GraphModel model = new ActorGraphModel(_toplevel);
pane = new GraphPane(controller, model);
}
JGraph modelViewer = new JGraph(pane);
// Get dimensions from the model, if they are present.
// Otherwise, use the same defaults used by vergil.
boolean boundsSet = false;
try {
SizeAttribute vergilBounds = (SizeAttribute) _toplevel
.getAttribute("_vergilSize", SizeAttribute.class);
boundsSet = vergilBounds.setSize(modelViewer);
} catch (Throwable throwable) {
// Ignore and set to default.
}
if (!boundsSet) {
// Set default size
Dimension size = new Dimension(400, 300);
modelViewer.setMinimumSize(size);
modelViewer.setPreferredSize(size);
}
// Inherit the background color from the applet parameter.
modelViewer.setBackground(getBackground());
// Do not include a scroll pane, since generally we size the
// applet to show the entire model.
// JScrollPane scrollPane = new JScrollPane(modelViewer);
// getContentPane().add(scrollPane, BorderLayout.NORTH);