Search in sources :

Example 66 with ChangeListener

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

the class JstdServerSettingsTab method listenForChanges.

private void listenForChanges() {
    myPortField.addPropertyChangeListener(new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            update();
        }
    });
    myBrowserTimeoutSpinner.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            update();
        }
    });
    myRunnerModeComboBox.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            update();
        }
    });
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) ChangeEvent(javax.swing.event.ChangeEvent) PropertyChangeEvent(java.beans.PropertyChangeEvent) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) PropertyChangeListener(java.beans.PropertyChangeListener) ChangeListener(javax.swing.event.ChangeListener)

Example 67 with ChangeListener

use of javax.swing.event.ChangeListener in project JMRI by JMRI.

the class VSDManagerFrame method initGUI.

/**
     * Build the GUI components
     */
public void initGUI() {
    log.debug("initGUI");
    this.setTitle(Bundle.getMessage("VSDManagerFrameTitle"));
    this.buildMenu();
    this.setLayout(new BoxLayout(this.getContentPane(), BoxLayout.PAGE_AXIS));
    decoderPane = new JPanel();
    decoderPane.setLayout(new BoxLayout(decoderPane, BoxLayout.PAGE_AXIS));
    decoderBlank = VSDControl.generateBlank();
    decoderPane.add(decoderBlank);
    volumePane = new JPanel();
    volumePane.setLayout(new BoxLayout(volumePane, BoxLayout.LINE_AXIS));
    JToggleButton muteButton = new JToggleButton(Bundle.getMessage("MuteButtonLabel"));
    JButton addButton = new JButton(Bundle.getMessage("AddButtonLabel"));
    JButton closeButton = new JButton(Bundle.getMessage("ButtonClose"));
    JSlider volume = new JSlider(0, 100);
    volume.setMinorTickSpacing(10);
    volume.setPaintTicks(true);
    volume.setValue(80);
    volume.setPreferredSize(new Dimension(200, 20));
    volume.setToolTipText(Bundle.getMessage("MgrVolumeToolTip"));
    volume.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            volumeChange(e);
        }
    });
    volumePane.add(new JLabel(Bundle.getMessage("VolumePaneLabel")));
    volumePane.add(volume);
    volumePane.add(muteButton);
    muteButton.setToolTipText(Bundle.getMessage("MgrMuteToolTip"));
    muteButton.setMnemonic(Mnemonics.get("MuteButton"));
    muteButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            muteButtonPressed(e);
        }
    });
    volumePane.add(addButton);
    addButton.setToolTipText(Bundle.getMessage("MgrAddButtonToolTip"));
    addButton.setMnemonic(Mnemonics.get("AddButton"));
    addButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            addButtonPressed(e);
        }
    });
    volumePane.add(closeButton);
    closeButton.setToolTipText(Bundle.getMessage("MgrCloseButtonToolTip"));
    closeButton.setMnemonic(Mnemonics.get("CloseButton"));
    closeButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            closeButtonPressed(e);
        }
    });
    this.add(decoderPane);
    this.add(volumePane);
    log.debug("pane size + " + decoderPane.getPreferredSize());
    this.pack();
    this.setVisible(true);
    log.debug("done...");
}
Also used : JPanel(javax.swing.JPanel) JToggleButton(javax.swing.JToggleButton) PropertyChangeEvent(java.beans.PropertyChangeEvent) ChangeEvent(javax.swing.event.ChangeEvent) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) BoxLayout(javax.swing.BoxLayout) JButton(javax.swing.JButton) JSlider(javax.swing.JSlider) JLabel(javax.swing.JLabel) ChangeListener(javax.swing.event.ChangeListener) PropertyChangeListener(java.beans.PropertyChangeListener) Dimension(java.awt.Dimension)

Example 68 with ChangeListener

use of javax.swing.event.ChangeListener in project JMRI by JMRI.

the class EcosLocoTableTabAction method createModel.

@Override
protected void createModel() {
    dataPanel = new JPanel();
    dataTabs = new JTabbedPane();
    dataPanel.setLayout(new BorderLayout());
    java.util.List<EcosSystemConnectionMemo> list = jmri.InstanceManager.getList(EcosSystemConnectionMemo.class);
    if (list != null) {
        for (EcosSystemConnectionMemo eMemo : list) {
            //We only want to add connections that have an active loco address manager
            if (eMemo.getLocoAddressManager() != null) {
                TabbedTableItem itemModel = new TabbedTableItem(eMemo.getUserName(), true, eMemo.getLocoAddressManager(), getNewTableAction(eMemo.getUserName(), eMemo));
                tabbedTableArray.add(itemModel);
            }
        }
    }
    if (tabbedTableArray.size() == 1) {
        EcosLocoTableAction table = (EcosLocoTableAction) tabbedTableArray.get(0).getAAClass();
        table.addToPanel(this);
        dataPanel.add(tabbedTableArray.get(0).getPanel(), BorderLayout.CENTER);
    } else {
        for (int x = 0; x < tabbedTableArray.size(); x++) {
            EcosLocoTableAction table = (EcosLocoTableAction) tabbedTableArray.get(x).getAAClass();
            table.addToPanel(this);
            dataTabs.addTab(tabbedTableArray.get(x).getItemString(), null, tabbedTableArray.get(x).getPanel(), null);
        }
        dataTabs.addChangeListener(new ChangeListener() {

            @Override
            public void stateChanged(ChangeEvent evt) {
                setMenuBar(f);
            }
        });
        dataPanel.add(dataTabs, BorderLayout.CENTER);
    }
    init = true;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) ChangeEvent(javax.swing.event.ChangeEvent) EcosSystemConnectionMemo(jmri.jmrix.ecos.EcosSystemConnectionMemo) JTabbedPane(javax.swing.JTabbedPane) ChangeListener(javax.swing.event.ChangeListener)

Example 69 with ChangeListener

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

the class JSCreateMethodDialog method createVisibilityPanel.

@Override
protected JPanel createVisibilityPanel() {
    JPanel visibilityPanel = super.createVisibilityPanel();
    if (myMethod.isConstructor()) {
        return visibilityPanel;
    }
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(visibilityPanel, BorderLayout.NORTH);
    myStaticCb = new JCheckBox(JSBundle.message("declare.static"));
    myStaticCb.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(final ChangeEvent e) {
            updateSignature();
        }
    });
    panel.add(myStaticCb, BorderLayout.SOUTH);
    return panel;
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) ChangeListener(javax.swing.event.ChangeListener)

Example 70 with ChangeListener

use of javax.swing.event.ChangeListener in project processdash by dtuma.

the class TeamTimePanel method applySubteamFilter.

public void applySubteamFilter(Set<Integer> subteamFilter, String subteamName) {
    this.teamMemberFilter = null;
    this.subteamFilter = subteamFilter;
    this.subteamName = subteamName;
    this.teamList.setSubteamFilter(subteamFilter);
    rebuildPanelContents();
    ChangeEvent evt = new ChangeEvent(this);
    for (ChangeListener l : listenerList.getListeners(ChangeListener.class)) l.stateChanged(evt);
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) ChangeListener(javax.swing.event.ChangeListener)

Aggregations

ChangeListener (javax.swing.event.ChangeListener)218 ChangeEvent (javax.swing.event.ChangeEvent)205 JPanel (javax.swing.JPanel)54 ActionEvent (java.awt.event.ActionEvent)47 ActionListener (java.awt.event.ActionListener)46 JLabel (javax.swing.JLabel)34 Dimension (java.awt.Dimension)29 GridBagConstraints (java.awt.GridBagConstraints)27 GridBagLayout (java.awt.GridBagLayout)24 JCheckBox (javax.swing.JCheckBox)24 Insets (java.awt.Insets)21 JSlider (javax.swing.JSlider)20 PropertyChangeListener (java.beans.PropertyChangeListener)19 JButton (javax.swing.JButton)19 BorderLayout (java.awt.BorderLayout)17 PropertyChangeEvent (java.beans.PropertyChangeEvent)17 IOException (java.io.IOException)14 BoxLayout (javax.swing.BoxLayout)14 ButtonGroup (javax.swing.ButtonGroup)14 JSpinner (javax.swing.JSpinner)13