Search in sources :

Example 6 with ChangeListener

use of javax.swing.event.ChangeListener in project ACS by ACS-Community.

the class BeanGrouper method getSaveButton.

private JToggleButton getSaveButton() {
    if (saveButton == null) {
        saveButton = new JToggleButton();
        saveButton.setIcon(new ImageIcon(getClass().getClassLoader().getResource("cl/utfsm/samplingSystemUI/img/filesave.png")));
        saveButton.setSelected(false);
        saveButton.setToolTipText("Press to start saving sampled data to file");
        saveButton.addChangeListener(new ChangeListener() {

            @Override
            public void stateChanged(ChangeEvent e) {
                if (saveButton.isSelected() == true) {
                    saveButton.setToolTipText("Press to stop saving sampled data to file");
                    for (DataPrinter dp : samplers) {
                        ((PlotPrinter) dp).setDumpToFile(true);
                    }
                } else {
                    saveButton.setToolTipText("Press to start saving sampled data to file");
                    for (DataPrinter dp : samplers) {
                        ((PlotPrinter) dp).setDumpToFile(false);
                    }
                }
            }
        });
    }
    return saveButton;
}
Also used : ImageIcon(javax.swing.ImageIcon) JToggleButton(javax.swing.JToggleButton) ChangeEvent(javax.swing.event.ChangeEvent) ChangeListener(javax.swing.event.ChangeListener)

Example 7 with ChangeListener

use of javax.swing.event.ChangeListener in project ACS by ACS-Community.

the class RemoteResponseWindow method getResultPanel.

/**
 * Return the ResultPanel property value.
 * @return javax.swing.JTabbedPane
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JTabbedPane getResultPanel() {
    if (ivjResultPanel == null) {
        try {
            ivjResultPanel = new javax.swing.JTabbedPane();
            ivjResultPanel.setName("ResultPanel");
            ivjResultPanel.insertTab("Text output", null, getTextPanel(), null, 0);
            ivjResultPanel.insertTab("Trend", null, getTrendPanel(), null, 1);
            ivjResultPanel.insertTab("Operations", null, getOperations(), null, 2);
            // set trend as default
            ivjResultPanel.setSelectedIndex(1);
            // text output switch
            ivjResultPanel.addChangeListener(new ChangeListener() {

                // This method is called whenever the selected tab changes
                public void stateChanged(ChangeEvent evt) {
                    JTabbedPane pane = (JTabbedPane) evt.getSource();
                    // Get current tab
                    textOutputTabSelected = (pane.getSelectedIndex() == 0);
                }
            });
        // user code begin {1}
        // user code end
        } catch (java.lang.Throwable ivjExc) {
            // user code begin {2}
            // user code end
            handleException(ivjExc);
        }
    }
    return ivjResultPanel;
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) JTabbedPane(javax.swing.JTabbedPane) JTabbedPane(javax.swing.JTabbedPane) ChangeListener(javax.swing.event.ChangeListener)

Example 8 with ChangeListener

use of javax.swing.event.ChangeListener in project EnrichmentMapApp by BaderLab.

the class SliderBarPanel method fireChangeEvent.

protected void fireChangeEvent() {
    Iterator<Object> iter = listeners.iterator();
    ChangeEvent evt = new ChangeEvent(this);
    while (iter.hasNext()) {
        ChangeListener cl = (ChangeListener) iter.next();
        cl.stateChanged(evt);
    }
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) ChangeListener(javax.swing.event.ChangeListener)

Example 9 with ChangeListener

use of javax.swing.event.ChangeListener in project intellij-community by JetBrains.

the class RepositoryLibraryPropertiesEditor method initVersionsPanel.

private void initVersionsPanel() {
    final int selection = getSelection(model.getVersion(), versions);
    CollectionComboBoxModel<String> versionSelectorModel = new CollectionComboBoxModel<>(versions);
    //noinspection unchecked
    versionSelector.setModel(versionSelectorModel);
    versionSelector.setSelectedIndex(selection);
    setState(State.Loaded);
    initVersionKindSelector();
    versionSelector.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            model.setVersion(getSelectedVersion());
            onChangeListener.onChange(RepositoryLibraryPropertiesEditor.this);
        }
    });
    downloadSourcesCheckBox.setSelected(model.isDownloadSources());
    downloadSourcesCheckBox.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            model.setDownloadSources(downloadSourcesCheckBox.isSelected());
            onChangeListener.onChange(RepositoryLibraryPropertiesEditor.this);
        }
    });
    downloadJavaDocsCheckBox.setSelected(model.isDownloadJavaDocs());
    downloadJavaDocsCheckBox.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            model.setDownloadJavaDocs(downloadJavaDocsCheckBox.isSelected());
            onChangeListener.onChange(RepositoryLibraryPropertiesEditor.this);
        }
    });
}
Also used : ItemEvent(java.awt.event.ItemEvent) ChangeEvent(javax.swing.event.ChangeEvent) CollectionComboBoxModel(com.intellij.ui.CollectionComboBoxModel) ItemListener(java.awt.event.ItemListener) ChangeListener(javax.swing.event.ChangeListener)

Example 10 with ChangeListener

use of javax.swing.event.ChangeListener in project intellij-community by JetBrains.

the class GroovyMapParameterDialog method setUpDialog.

private void setUpDialog(final String[] possibleNames, boolean createNew) {
    setTitle(GroovyIntentionsBundle.message("convert.param.to.map.entry"));
    if (GroovyApplicationSettings.getInstance().CONVERT_PARAM_CREATE_NEW_PARAM != null) {
        myCreateNew.setSelected(createNew = GroovyApplicationSettings.getInstance().CONVERT_PARAM_CREATE_NEW_PARAM.booleanValue());
    } else {
        myCreateNew.setSelected(createNew);
    }
    myNameLabel.setLabelFor(myNameComboBox);
    myCbTypeSpec.setMnemonic(KeyEvent.VK_T);
    myCbTypeSpec.setFocusable(false);
    setUpNameComboBox(possibleNames);
    setModal(true);
    if (GroovyApplicationSettings.getInstance().CONVERT_PARAM_SPECIFY_MAP_TYPE != null) {
        myCbTypeSpec.setSelected(GroovyApplicationSettings.getInstance().CONVERT_PARAM_SPECIFY_MAP_TYPE.booleanValue());
    } else {
        myCbTypeSpec.setSelected(true);
    }
    myCbTypeSpec.setEnabled(createNew);
    myNameComboBox.setEnabled(createNew);
    myNameLabel.setEnabled(createNew);
    myCreateNew.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(final ChangeEvent e) {
            final boolean flag = myCreateNew.isSelected();
            myCbTypeSpec.setEnabled(flag);
            myNameComboBox.setEnabled(flag);
            myNameLabel.setEnabled(flag);
        }
    });
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) ChangeListener(javax.swing.event.ChangeListener)

Aggregations

ChangeListener (javax.swing.event.ChangeListener)472 ChangeEvent (javax.swing.event.ChangeEvent)449 ActionEvent (java.awt.event.ActionEvent)170 ActionListener (java.awt.event.ActionListener)164 Dimension (java.awt.Dimension)160 JPanel (javax.swing.JPanel)136 Point (java.awt.Point)108 JLabel (javax.swing.JLabel)98 JSlider (javax.swing.JSlider)69 JButton (javax.swing.JButton)66 JCheckBox (javax.swing.JCheckBox)55 MouseEvent (java.awt.event.MouseEvent)47 BorderLayout (java.awt.BorderLayout)46 GridBagConstraints (java.awt.GridBagConstraints)42 GridBagLayout (java.awt.GridBagLayout)39 MouseAdapter (java.awt.event.MouseAdapter)39 Insets (java.awt.Insets)37 PropertyChangeListener (java.beans.PropertyChangeListener)35 PropertyChangeEvent (java.beans.PropertyChangeEvent)34 ItemEvent (java.awt.event.ItemEvent)33