use of edu.uci.ics.jung.visualization.PersistentLayout in project tdq-studio-se by Talend.
the class JungGraphGenerator method createToolControllers.
/**
* DOC bZhou Comment method "createToolControllers".
*
* @param vv
* @return
*/
private JPanel createToolControllers(final VisualizationViewer vv) {
final GraphMouse graphMouse = new DefaultModalGraphMouse();
vv.setGraphMouse(graphMouse);
JPanel pSlider = createSlider();
JCheckBox inverse = createInverseCheck(vv);
ScalingControl scaler = new CrossoverScalingControl();
JButton plus = createPlusScaler(vv, scaler);
JButton minus = createMinusScaler(vv, scaler);
JButton reset = createResetBTN(vv);
// set mode seleciton box
JCheckBox checkBox = createModeSwitcher(graphMouse);
final PersistentLayout pl = (PersistentLayout) vv.getGraphLayout();
JButton persist = createPersistBTN(pl, PERSIST_LAYOUT_FILE_NAME);
JButton restore = createRestoreBTN(vv, pl, PERSIST_LAYOUT_FILE_NAME);
JPanel jp2 = new JPanel();
jp2.setLayout(new java.awt.GridLayout(2, 1));
jp2.add(inverse);
jp2.add(checkBox);
JPanel jp3 = new JPanel();
jp3.setLayout(new java.awt.GridLayout(2, 1));
jp3.add(persist);
jp3.add(restore);
JPanel controls = new JPanel();
controls.add(pSlider);
controls.add(plus);
controls.add(minus);
controls.add(reset);
controls.add(jp2);
controls.add(jp3);
return controls;
}
use of edu.uci.ics.jung.visualization.PersistentLayout in project tdq-studio-se by Talend.
the class JungGraphGenerator method generate.
public Composite generate(Composite parent, boolean isWithHelp) {
Composite frameComp = createAWTSWTComposite(parent);
frame = SWT_AWT.new_Frame(frameComp);
// $NON-NLS-1$
frame.setTitle(DefaultMessagesImpl.getString("JungGraphGenerator.NominalAnalysis"));
pr = new LineRender(graphbuilder);
sr = new LineRender(graphbuilder);
PersistentLayout layout = new PersistentLayoutImpl(new ISOMLayout(graph));
VisualizationModel vm = new DefaultVisualizationModel(layout);
vv = new VisualizationViewer(vm, pr);
sv = new SatelliteVisualizationViewer(vv, vm, sr, new Dimension(200, 200));
configureVViewer(vv);
// create contollers
JPanel controllers = createToolControllers(vv);
// MOD yyi 2009-09-09 feature 8834
if (this.isPreview)
controllers.setVisible(false);
JPanel panel = new GraphZoomScrollPane(vv);
if (isWithHelp) {
helpDialog = createSatelliteDialog(vv, sv);
controllers.add(createShowSatelliteCheck(helpDialog));
}
frame.add(panel);
frame.add(controllers, BorderLayout.SOUTH);
frame.validate();
addListeners();
return frameComp;
}
Aggregations