Search in sources :

Example 1 with PersistentLayout

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;
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) DefaultModalGraphMouse(edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse) JButton(javax.swing.JButton) ScalingControl(edu.uci.ics.jung.visualization.control.ScalingControl) CrossoverScalingControl(edu.uci.ics.jung.visualization.control.CrossoverScalingControl) GraphMouse(edu.uci.ics.jung.visualization.VisualizationViewer.GraphMouse) DefaultModalGraphMouse(edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse) PersistentLayout(edu.uci.ics.jung.visualization.PersistentLayout) CrossoverScalingControl(edu.uci.ics.jung.visualization.control.CrossoverScalingControl)

Example 2 with PersistentLayout

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;
}
Also used : SatelliteVisualizationViewer(edu.uci.ics.jung.visualization.control.SatelliteVisualizationViewer) JPanel(javax.swing.JPanel) DefaultVisualizationModel(edu.uci.ics.jung.visualization.DefaultVisualizationModel) Composite(org.eclipse.swt.widgets.Composite) VisualizationModel(edu.uci.ics.jung.visualization.VisualizationModel) DefaultVisualizationModel(edu.uci.ics.jung.visualization.DefaultVisualizationModel) PersistentLayoutImpl(edu.uci.ics.jung.visualization.PersistentLayoutImpl) SatelliteVisualizationViewer(edu.uci.ics.jung.visualization.control.SatelliteVisualizationViewer) VisualizationViewer(edu.uci.ics.jung.visualization.VisualizationViewer) GraphZoomScrollPane(edu.uci.ics.jung.visualization.GraphZoomScrollPane) PersistentLayout(edu.uci.ics.jung.visualization.PersistentLayout) Dimension(java.awt.Dimension) ISOMLayout(edu.uci.ics.jung.visualization.ISOMLayout)

Aggregations

PersistentLayout (edu.uci.ics.jung.visualization.PersistentLayout)2 JPanel (javax.swing.JPanel)2 DefaultVisualizationModel (edu.uci.ics.jung.visualization.DefaultVisualizationModel)1 GraphZoomScrollPane (edu.uci.ics.jung.visualization.GraphZoomScrollPane)1 ISOMLayout (edu.uci.ics.jung.visualization.ISOMLayout)1 PersistentLayoutImpl (edu.uci.ics.jung.visualization.PersistentLayoutImpl)1 VisualizationModel (edu.uci.ics.jung.visualization.VisualizationModel)1 VisualizationViewer (edu.uci.ics.jung.visualization.VisualizationViewer)1 GraphMouse (edu.uci.ics.jung.visualization.VisualizationViewer.GraphMouse)1 CrossoverScalingControl (edu.uci.ics.jung.visualization.control.CrossoverScalingControl)1 DefaultModalGraphMouse (edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse)1 SatelliteVisualizationViewer (edu.uci.ics.jung.visualization.control.SatelliteVisualizationViewer)1 ScalingControl (edu.uci.ics.jung.visualization.control.ScalingControl)1 Dimension (java.awt.Dimension)1 JButton (javax.swing.JButton)1 JCheckBox (javax.swing.JCheckBox)1 Composite (org.eclipse.swt.widgets.Composite)1