/[fenfire]/fenfire/org/fenfire/view/buoy/PPConnector.java
ViewVC logotype

Diff of /fenfire/org/fenfire/view/buoy/PPConnector.java

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

revision 1.8 by mudyc, Sat May 3 00:57:00 2003 UTC revision 1.9 by benja, Sat May 3 10:15:02 2003 UTC
# Line 10  import org.fenfire.vocab.*; Line 10  import org.fenfire.vocab.*;
10  import org.nongnu.libvob.*;  import org.nongnu.libvob.*;
11  import org.nongnu.libvob.buoy.*;  import org.nongnu.libvob.buoy.*;
12  import org.nongnu.libvob.impl.DefaultVobMatcher;  import org.nongnu.libvob.impl.DefaultVobMatcher;
13    import org.nongnu.libvob.lava.placeable.Placeable;
14    
15  import java.util.Iterator;  import java.util.Iterator;
16    
# Line 25  public static final String rcsid = "$Id$ Line 26  public static final String rcsid = "$Id$
26      private Fen fen;      private Fen fen;
27      private View2D view2d;      private View2D view2d;
28      private BuoyViewNodeType nodeType;      private BuoyViewNodeType nodeType;
29    
30        /** A node view used to determine the size of items
31         *  on the canvas, so that the appropriate rectangle to show
32         *  can be determined.
33         */
34        private NodeFunction nodeView;
35    
36      public PPConnector(Fen fen, View2D view2d,      public PPConnector(Fen fen, View2D view2d,
37                  AbstractMainNode2D.Factory factory) {                         AbstractMainNode2D.Factory factory,
38                           NodeFunction nodeView) {
39          this.fen = fen;          this.fen = fen;
40          this.view2d = view2d;          this.view2d = view2d;
41          this.nodeType = new NodeType2D(view2d, factory);          this.nodeType = new NodeType2D(view2d, factory);
42            this.nodeView = nodeView;
43      }      }
44    
45      public void addBuoys(VobScene vs, int parentCs,      public void addBuoys(VobScene vs, int parentCs,
# Line 75  public static final String rcsid = "$Id$ Line 85  public static final String rcsid = "$Id$
85          }          }
86      }      }
87    
88      public int dx = -100, dy = -200, w = 400, h = 400;      public int dx = 30, dy = 30;
89      protected java.awt.Rectangle getRect(Object node) {      protected java.awt.Rectangle getRect(Object node) {
90          if (node == null) throw new Error("Impossible!");          if (node == null) throw new Error("Impossible!");
91          int x = RDFUtil.getInt(fen, node, SPATIAL.coordX);          int x = RDFUtil.getInt(fen, node, SPATIAL.coordX);
92          int y = RDFUtil.getInt(fen, node, SPATIAL.coordY);          int y = RDFUtil.getInt(fen, node, SPATIAL.coordY);
93          return new java.awt.Rectangle(x+dx, y+dy, w, h);          Placeable p = (Placeable)nodeView.f(fen.constgraph, node);
94            return new java.awt.Rectangle(x-dx, y-dy,
95                                          (int)p.getWidth()+dx+dx,
96                                          (int)p.getHeight()+dy+dy);
97      }      }
98  }  }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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