Esempio n. 1
0
 private void _legendDefaultColoringActionPerformed(ActionEvent e) {
   if (_oldColorLegendUI != null) {
     _ctl.getView().removeComponent(_oldColorLegendUI);
   }
   _oldColorLegendUI = null;
   _renderbox.useDefaultColoring();
 }
Esempio n. 2
0
 /**
  * Use the <code>_oldColorLegendUI</code> to make sure that only one legend panel is open at any
  * given time.
  */
 private void _viewLegendMenuActionPerformed(ActionEvent e, ColorLegendUI clu) {
   if (_oldColorLegendUI != null) {
     _ctl.getView().removeComponentNoUpdate(_oldColorLegendUI);
   }
   _ctl.getView().addComponentNoUpdate(clu, "Legend", ViewInterface.SIDE_PANEL);
   _ctl.getView().setComponentVisible(clu);
   _oldColorLegendUI = clu;
   _renderbox.useLegendColoring();
 }
Esempio n. 3
0
 private void _viewLengthItemStateChanged(ItemEvent e) {
   _renderbox.getRenderSettings().setBoolean(RenderSettings.SHOW_LENGTH, _viewLength.getState());
 }
Esempio n. 4
0
 private void _settingsAntialiasItemStateChanged(ItemEvent e) {
   _renderbox
       .getRenderSettings()
       .setBoolean(RenderSettings.ANTIALIAS, _settingsAntialias.getState());
   _renderbox.setHighQuality(_settingsAntialias.getState());
 }
Esempio n. 5
0
 private void _viewVLabelItemStateChanged(ItemEvent e) {
   _renderbox.getRenderSettings().setBoolean(RenderSettings.SHOW_LABELS, _viewVLabel.getState());
 }
Esempio n. 6
0
 private void _viewSaveImageActionPerformed(ActionEvent e) {
   _renderbox.handleSaveImage();
 }
Esempio n. 7
0
 private void _optimizeResetActionPerformed(ActionEvent e) {
   _renderbox.stopLayout();
   _renderbox.doRandomLayout();
 }
Esempio n. 8
0
 private void _optimizeCenterActionPerformed(ActionEvent e) {
   _renderbox.stopLayout();
   _renderbox.doCenterLayout();
 }
Esempio n. 9
0
 private void _optimizeStopActionPerformed(ActionEvent e) {
   _renderbox.stopLayout();
 }
Esempio n. 10
0
 private void _modsClearActionPerformed(ActionEvent e) {
   _renderbox.clear();
 }
Esempio n. 11
0
  private void initComponents() {
    _legend = new JMenu("Legend");
    _legendDefaultColoring = new JMenuItem("Normal Color Scheme");
    _legendDefaultColoring.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _legendDefaultColoringActionPerformed(e);
          }
        });
    _legend.add(_legendDefaultColoring);
    _legend.add(new JSeparator());

    // initialize the modules menu
    _mods = new JMenu("Import");
    _modsClear = new JMenuItem("Clear Graph");

    // NOTE: done in resetImporterMenu() now -bs
    // _mods.add(_modsClear);
    // _mods.add(_separatorImporter);
    _modsClear.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _modsClearActionPerformed(e);
          }
        });

    // initialize the plugins menu
    _plugin = new JMenu("Plugins");
    _pluginLoad = new JMenuItem("Plugin Manager");

    // NOTE: done in resetPluginMenu() now -bs
    // _plugin.add(_pluginLoad);
    // _plugin.add(_separatorPlugin);
    _pluginLoad.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _pluginLoadActionPerformed(e);
          }
        });

    // initialize the optimization menu
    _optimize = new JMenu("Optimization");
    _optimizeStart = new JMenuItem("Start");
    _optimizeStop = new JMenuItem("Stop");
    _optimizeCenter = new JMenuItem("Center");
    _optimizeReset = new JMenuItem("Reset");

    _optimize.add(_optimizeStart);
    _optimize.add(_optimizeStop);
    _optimize.add(_optimizeCenter);
    _optimize.add(_optimizeReset);

    _optimizeStart.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _optimizeStartActionPerformed(e);
          }
        });
    _optimizeStop.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _optimizeStopActionPerformed(e);
          }
        });
    _optimizeCenter.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _optimizeCenterActionPerformed(e);
          }
        });
    _optimizeReset.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _optimizeResetActionPerformed(e);
          }
        });

    _view = new JMenu("View");
    _viewVLabel =
        new JCheckBoxMenuItem(
            "Labels", _renderbox.getRenderSettings().getBoolean(RenderSettings.SHOW_LABELS));
    _viewStress =
        new JCheckBoxMenuItem(
            "Stress", _renderbox.getRenderSettings().getBoolean(RenderSettings.SHOW_STRESS));
    _viewLength =
        new JCheckBoxMenuItem(
            "Length", _renderbox.getRenderSettings().getBoolean(RenderSettings.SHOW_LENGTH));
    _viewVis = new JMenu("Visualization");
    _viewFilter = new JMenu("Graph Filters");
    _viewFilterDegree = new JMenuItem("Degree Filter");
    _viewSidePanel = new JMenuItem("Side Panel");
    _viewSouthPanel = new JMenuItem("Bottom Panel");
    _viewErrTxt = new JMenuItem("Error Messages");
    _viewOutTxt = new JMenuItem("Program Output");
    _viewRenderBox = new JMenuItem("Graph Visualization");
    _viewSaveImage = new JMenuItem("Save Image...");

    _view.add(_viewSouthPanel);
    _view.add(_viewSidePanel);
    _view.add(_viewRenderBox);
    _view.add(_viewOutTxt);
    _view.add(_viewErrTxt);
    _view.add(new JSeparator());
    _view.add(_viewVis);
    _view.add(_viewFilter);
    // visualization submenu
    _viewVis.add(_viewVLabel);
    // _viewVis.add(_viewStress); // TODO: not added b/c it doesn't do anything now
    _viewVis.add(_viewLength);
    // filter submenu
    _viewFilter.add(_viewFilterDegree);
    // save image option
    _view.add(new JSeparator());
    _view.add(_viewSaveImage);
    _viewFilterDegree.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _viewFilterDegreeActionPerformed(e);
          }
        });
    _viewSouthPanel.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _viewBottomPanelActionPerformed(e);
          }
        });
    _viewSidePanel.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _viewSidePanelActionPerformed(e);
          }
        });
    _viewVLabel.addItemListener(
        new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            _viewVLabelItemStateChanged(e);
          }
        });
    _viewStress.addItemListener(
        new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            _viewStressItemStateChanged(e);
          }
        });
    _viewLength.addItemListener(
        new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            _viewLengthItemStateChanged(e);
          }
        });
    _viewErrTxt.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _viewErrTxtActionPerformed(e);
          }
        });
    _viewOutTxt.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _viewOutTxtActionPerformed(e);
          }
        });
    _viewRenderBox.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _viewRenderBoxActionPerformed(e);
          }
        });
    _viewSaveImage.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            _viewSaveImageActionPerformed(e);
          }
        });

    // initialize settings menu
    _settings = new JMenu("Settings");
    _settingsAntialias =
        new JCheckBoxMenuItem(
            "Antialias", _renderbox.getRenderSettings().getBoolean(RenderSettings.ANTIALIAS));

    _settings.add(_settingsAntialias);
    _settingsAntialias.addItemListener(
        new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            _settingsAntialiasItemStateChanged(e);
          }
        });
  }