/[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.12 by benja, Sat Feb 22 16:48:59 2003 UTC revision 1.13 by benja, Sat Feb 22 19:38:23 2003 UTC
# Line 51  public class SimpleView implements View Line 51  public class SimpleView implements View
51      final RectBgVob bg = new RectBgVob();      final RectBgVob bg = new RectBgVob();
52            
53      /** The comparator used to order the nodes in the graph.      /** The comparator used to order the nodes in the graph.
54         *  The vertical order of nodes is determined by this Comparator.
55       */       */
56      protected Comparator cmp;      protected Comparator cmp;
57    
# Line 83  public class SimpleView implements View Line 84  public class SimpleView implements View
84              throw new Error("RDFException: "+e);              throw new Error("RDFException: "+e);
85          }          }
86      }      }
   
   
     public static Model load(String filename) throws RDFException,  
                                                      IOException {  
         Model model = new ModelMem();  
         model.read(new java.io.FileReader(filename), "");  
         return model;  
     }  
   
     public static void main(String[] args) throws RDFException, IOException {  
         final Model model = load(args[0]);  
         final Statement stmt = model.listStatements().next();  
   
         final Comparator cmp = new Comparator() {  
                 public int compare(Object o1, Object o2) {  
                     return o1.hashCode() - o2.hashCode();  
                 }  
             };  
         final Shower s = new Shower() {  
                 Screen screen;  
                 public void setScreen(Screen s) {  
                     this.screen = s;  
                 }  
                 public VobScene generate() {  
                     VobScene sc = this.screen.window.createVobScene();  
                     SimpleView sv = new SimpleView(cmp);  
                     sv.render(sc, 0, stmt.getSubject(), stmt.getObject());  
                     return sc;  
                 }  
                 public void chg() {}  
             };  
         final Binder b = new Binder() {  
                 public void keystroke(String s) {}  
                 public void mouse(MouseEvent m) {}  
                 public void setScreen(Screen s) {}  
                 public void timeout(Object id) {}  
                 public void windowClosed() {}  
             };  
   
         final GraphicsAPI api = GraphicsAPI.getInstance();  
         api.startUpdateManager(new Runnable() {  
                 public void run() {  
                     Screen scr = new Screen(api.createWindow(), b, s);  
                     AbstractUpdateManager.addWindow(scr);  
                     scr.window.setLocation(0, 0, 300, 300);  
                     AbstractUpdateManager.chg();  
                 }  
             });  
     }  
87  }  }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

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