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 |
|
|
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 |
} |
} |