diva.graph.tutorial
Class NestedTutorial
java.lang.Object
diva.graph.tutorial.NestedTutorial
public class NestedTutorial
- extends java.lang.Object
This example shows three alternatives to display a prepopulated
graph model in a window. Prepopulated means that there are
already nodes in the model before the model was placed in a
GraphPane. There was a problem in the initial release which made
this break. That problem has been fixed and it will just work now,
except for one little gotcha, which is if you set the model while
the window is closed, the GraphPane thinks its size is 0x0, so the
nodes all get layed out in the upper-left corner of the canvas. The
way to fix this is to either set the model once the window is open,
or explicitly call a global layout once the window has been opened.
More comments below in the individual methods.
- Version:
- $Id: NestedTutorial.java 38798 2005-07-08 20:00:01Z cxh $
- Author:
- Michael Shilman
- Accepted Rating:
Method Summary |
void |
layoutPostDisplay(MutableGraphModel model,
AppContext context)
In this version you construct the graph widget with the model,
and apply a layout to the graph once the window is showing. |
static void |
main(java.lang.String[] argv)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NestedTutorial
private NestedTutorial(AppContext context)
main
public static void main(java.lang.String[] argv)
layoutPostDisplay
public void layoutPostDisplay(MutableGraphModel model,
AppContext context)
- In this version you construct the graph widget with the model,
and apply a layout to the graph once the window is showing. I
think the "set model post display" version is preferable, but
this might be useful in some cases.