1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
public class Test extends JApplet implements Printable
{
/**
* the graph
*/
Graph<Number,Number> graph;
AbstractLayout<Number,Number> layout;
/**
* the visual component and renderer for the graph
*/
VisualizationViewer<Number,Number> vv;
public Test()
{
// create a simple graph for the demo
graph = new SparseMultigraph<Number,Number>();
this.layout = new StaticLayout<Number,Number>(graph,
new Dimension(600,600));
vv = new VisualizationViewer<Number,Number>(layout);
vv.setBackground(Color.white);
Container content = getContentPane();
final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv);
content.add(panel);
}
} |
Partager