/[gzz]/gzz/lava/gzz/loom/SimpleView.java
ViewVC logotype

Diff of /gzz/lava/gzz/loom/SimpleView.java

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

revision 1.21 by benja, Sun Feb 23 20:19:10 2003 UTC revision 1.22 by benja, Sun Feb 23 20:43:40 2003 UTC
# Line 54  public class SimpleView implements View Line 54  public class SimpleView implements View
54          this.nodeView = nodeView;          this.nodeView = nodeView;
55      }      }
56    
57        protected int sizex = 250, sizey = 20;
58        protected int gapx = 50, gapy = 30;
59    
60      public void render(VobScene sc, int into, Cursor c) {      public void render(VobScene sc, int into, Cursor c) {
61          int midx = sc.size.width/2, midy = sc.size.height/2;          int midx = sc.size.width/2, midy = sc.size.height/2;
62          int cs = sc.orthoBoxCS(into, c.focus, 0, midx-25, midy-10, 1, 1, 50, 20);          int cs = sc.orthoBoxCS(into, c.focus, 0, midx-sizex/2, midy-sizey/2,
63                                   1, 1, sizex, sizey);
64          nodeView.render(sc, cs, c.focus);          nodeView.render(sc, cs, c.focus);
65                    
66          SortedSet nodes = c.getConnections(1);          SortedSet nodes = c.getConnections(1);
# Line 67  public class SimpleView implements View Line 71  public class SimpleView implements View
71          else          else
72              before = 0;              before = 0;
73                    
74          int x = midx + 75, y = midy-10-before*50;          int x = midx + gapx + sizex/2,
75                y = midy - sizey/2 - before*(gapy+sizey);
76                    
77          for(Iterator j=nodes.iterator(); j.hasNext();) {          for(Iterator j=nodes.iterator(); j.hasNext();) {
78              RDFNode node = (RDFNode)j.next();              RDFNode node = (RDFNode)j.next();
79              int cs2 = sc.orthoBoxCS(into, node, 0, x, y, 1, 1, 50, 20);              int cs2 = sc.orthoBoxCS(into, node, 0, x, y, 1, 1, sizex, sizey);
80              nodeView.render(sc, cs2, node);              nodeView.render(sc, cs2, node);
81              sc.map.put(conn, cs, cs2);              sc.map.put(conn, cs, cs2);
82              y += 50;              y += sizey + gapy;
83          }          }
84    
85          nodes = c.getConnections(-1);          nodes = c.getConnections(-1);
86          x = midx - 75 - 50; y = midy-10-before*50;          x = midx - gapx - sizex - sizex/2;
87            y = midy - sizey/2 - before*(gapy+sizey);
88    
89          for(Iterator j=nodes.iterator(); j.hasNext();) {          for(Iterator j=nodes.iterator(); j.hasNext();) {
90              RDFNode node = (RDFNode)j.next();              RDFNode node = (RDFNode)j.next();
91              int cs2 = sc.orthoBoxCS(into, node, 0, x, y, 1, 1, 50, 20);              int cs2 = sc.orthoBoxCS(into, node, 0, x, y, 1, 1, sizex, sizey);
92              nodeView.render(sc, cs2, node);              nodeView.render(sc, cs2, node);
93              sc.map.put(conn, cs2, cs);              sc.map.put(conn, cs2, cs);
94              y += 50;              y += sizey + gapy;
95          }          }
96      }      }
97  }  }

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

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