/[fenfire]/fenfire/org/fenfire/loom/NodeView.java
ViewVC logotype

Diff of /fenfire/org/fenfire/loom/NodeView.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by benja, Tue Mar 4 11:17:19 2003 UTC revision 1.4 by benja, Tue Mar 4 16:49:25 2003 UTC
# Line 38  public interface NodeView { Line 38  public interface NodeView {
38       *  @param vs The VobScene to render the node into.       *  @param vs The VobScene to render the node into.
39       *  @param into The coordinate system inside <code>vs</code>       *  @param into The coordinate system inside <code>vs</code>
40       *         to render the node into.       *         to render the node into.
41       *  @param node The node to render.       *  @param spec Information about the node to render.
      *  @param prop The property through which the node  
      *              is related to the focus (<code>null</code>  
      *              for the focus itself).  
      *  @param dir Larger than zero if the node is posward  
      *         from the focus; smaller than zero if the node  
      *         is negward from the focus; zero if the node  
      *         <em>is</em> the focus.  
42       */       */
43      void render(VobScene vs, int into, RDFNode node,      void render(VobScene vs, int into, Nodespec spec);
                 Property prop, int dir);  
44    
45      /** Get the default size of a node.      /** Get the default size of a node.
46       * @param node The node to get size for, or null for a default size.       * @param node The node to get size for, or null for a default size.
# Line 57  public interface NodeView { Line 49  public interface NodeView {
49       */       */
50      //void getSize(RDFNode node, float[] out);      //void getSize(RDFNode node, float[] out);
51    
52    
53    
54        /** Information about a node to be rendered.
55         *  Also used as the key for the coordsys containing
56         *  the node.
57         *  XXX better name for this class?
58         */
59        class Nodespec {
60            /** Create a nodespec for the focused node.
61             */
62            public Nodespec(RDFNode focus) {
63                node = focus;
64                prop = null;
65                dir = 0;
66            }
67    
68            /** Create a nodespec for a node in the context.
69             */
70            public Nodespec(RDFNode node, Property prop, int dir) {
71                this.node = node;
72                this.prop = prop;
73                this.dir = dir;
74            }
75    
76            public boolean equals(Object o) {
77                if(!(o instanceof Nodespec)) return false;
78                Nodespec s = (Nodespec)o;
79    
80                boolean propeq;
81                if(prop == null || s.prop == null)
82                    propeq = (prop == s.prop);
83                else
84                    propeq = prop.equals(s.prop);
85    
86                return propeq && dir == s.dir && node.equals(s.node);
87            }
88            
89            public int hashCode() {
90                if(prop != null)
91                    return dir * (node.hashCode() ^ ~prop.hashCode());
92                else
93                    return node.hashCode();
94            }
95    
96            /** The node rendered in this cs.
97             */
98            public RDFNode node;
99    
100            /** The property through which the node
101             *  is related to the focus (<code>null</code>
102             *  for the focus itself).
103             */
104            public Property prop;
105    
106            /** Larger than zero if the node is posward
107             *  from the focus; smaller than zero if the node
108             *  is negward from the focus; zero if the node
109             *  <em>is</em> the focus.
110             */
111            public int dir;
112        }
113  }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26