Search in sources :

Example 36 with JSlider

use of javax.swing.JSlider in project jdk8u_jdk by JetBrains.

the class CAccessible method addNotificationListeners.

public void addNotificationListeners(Component c) {
    if (c instanceof Accessible) {
        AccessibleContext ac = ((Accessible) c).getAccessibleContext();
        ac.addPropertyChangeListener(new AXChangeNotifier());
    }
    if (c instanceof JProgressBar) {
        JProgressBar pb = (JProgressBar) c;
        pb.addChangeListener(new AXProgressChangeNotifier());
    } else if (c instanceof JSlider) {
        JSlider slider = (JSlider) c;
        slider.addChangeListener(new AXProgressChangeNotifier());
    }
}
Also used : AccessibleContext(javax.accessibility.AccessibleContext) JProgressBar(javax.swing.JProgressBar) JSlider(javax.swing.JSlider) Accessible(javax.accessibility.Accessible)

Example 37 with JSlider

use of javax.swing.JSlider in project vcell by virtualcell.

the class OverlayEditorPanelJAI method getZSlider.

/**
 * This method initializes zSlider
 *
 * @return javax.swing.JSlider
 */
private JSlider getZSlider() {
    if (zSlider == null) {
        zSlider = new JSlider(1, 1);
        zSlider.setMajorTickSpacing(100);
        zSlider.setPaintLabels(true);
        zSlider.addChangeListener(new javax.swing.event.ChangeListener() {

            public void stateChanged(javax.swing.event.ChangeEvent e) {
                saveUserChangesToROI();
                updateLabel(-1, -1);
                BufferedImage image = getImage();
                if (image != null) {
                    imagePane.setUnderlyingImage(image, /*false,*/
                    allPixelValuesRange);
                }
                refreshROI();
                imagePane.repaint();
            }
        });
    }
    return zSlider;
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) JSlider(javax.swing.JSlider) ChangeListener(javax.swing.event.ChangeListener) BufferedImage(java.awt.image.BufferedImage)

Example 38 with JSlider

use of javax.swing.JSlider in project vcell by virtualcell.

the class VFrap_OverlayEditorPanelJAI method getTimeSlider.

/**
 * This method initializes timeSlider
 *
 * @return javax.swing.JSlider
 */
private JSlider getTimeSlider() {
    if (timeSlider == null) {
        timeSlider = new JSlider(1, 1);
        timeSlider.setPaintLabels(true);
        timeSlider.setMajorTickSpacing(100);
        timeSlider.addChangeListener(new javax.swing.event.ChangeListener() {

            public void stateChanged(javax.swing.event.ChangeEvent e) {
                forceImage();
            }
        });
    }
    return timeSlider;
}
Also used : JSlider(javax.swing.JSlider)

Example 39 with JSlider

use of javax.swing.JSlider in project vcell by virtualcell.

the class VFrap_OverlayEditorPanelJAI method getZSlider.

/**
 * This method initializes zSlider
 *
 * @return javax.swing.JSlider
 */
private JSlider getZSlider() {
    if (zSlider == null) {
        zSlider = new JSlider(1, 1);
        zSlider.setMajorTickSpacing(100);
        zSlider.setPaintLabels(true);
        zSlider.addChangeListener(new javax.swing.event.ChangeListener() {

            public void stateChanged(javax.swing.event.ChangeEvent e) {
                saveUserChangesToROI();
                updateLabel(-1, -1);
                BufferedImage image = getImage();
                if (image != null) {
                    imagePane.setUnderlyingImage(image, false, minmaxPixelValues);
                }
                refreshROI();
                imagePane.repaint();
            }
        });
    }
    return zSlider;
}
Also used : JSlider(javax.swing.JSlider) BufferedImage(java.awt.image.BufferedImage)

Example 40 with JSlider

use of javax.swing.JSlider in project knime-core by knime.

the class DefaultAlphaColorPanel method buildChooser.

/**
 * {@inheritDoc}
 */
@Override
protected void buildChooser() {
    super.setLayout(new BorderLayout());
    m_slider = new JSlider(JSlider.HORIZONTAL, 0, 255, 255);
    m_slider.setMajorTickSpacing(85);
    m_slider.setMinorTickSpacing(17);
    m_slider.setPaintTicks(true);
    m_slider.setPaintLabels(true);
    m_spinner = new JSpinner(new SpinnerNumberModel(255, 0, 255, 5));
    JPanel spinnerPanel = new JPanel(new FlowLayout());
    spinnerPanel.add(m_spinner);
    super.add(new JLabel("Alpha "), BorderLayout.WEST);
    super.add(m_slider, BorderLayout.CENTER);
    super.add(spinnerPanel, BorderLayout.EAST);
    super.add(new JLabel("\n(Alpha composition is " + "expensive in cases when operations performed are not " + "hardware-accelerated.)"), BorderLayout.SOUTH);
    m_slider.addChangeListener(new ChangeListener() {

        public void stateChanged(final ChangeEvent e) {
            setAlpha(m_slider.getValue());
        }
    });
    m_spinner.addChangeListener(new ChangeListener() {

        public void stateChanged(final ChangeEvent e) {
            try {
                m_spinner.commitEdit();
                setAlpha((Integer) m_spinner.getValue());
            } catch (ParseException pe) {
                setAlpha(255);
            }
        }
    });
    m_slider.addFocusListener(new FocusAdapter() {

        @Override
        public void focusLost(final FocusEvent fe) {
            getAlpha();
        }
    });
    m_spinner.addFocusListener(new FocusAdapter() {

        @Override
        public void focusLost(final FocusEvent fe) {
            getAlpha();
        }
    });
}
Also used : JPanel(javax.swing.JPanel) FocusAdapter(java.awt.event.FocusAdapter) FlowLayout(java.awt.FlowLayout) JLabel(javax.swing.JLabel) FocusEvent(java.awt.event.FocusEvent) SpinnerNumberModel(javax.swing.SpinnerNumberModel) BorderLayout(java.awt.BorderLayout) ChangeEvent(javax.swing.event.ChangeEvent) JSlider(javax.swing.JSlider) JSpinner(javax.swing.JSpinner) ChangeListener(javax.swing.event.ChangeListener) ParseException(java.text.ParseException)

Aggregations

JSlider (javax.swing.JSlider)43 ChangeEvent (javax.swing.event.ChangeEvent)23 ChangeListener (javax.swing.event.ChangeListener)23 JLabel (javax.swing.JLabel)14 JPanel (javax.swing.JPanel)14 JButton (javax.swing.JButton)12 ActionEvent (java.awt.event.ActionEvent)11 ActionListener (java.awt.event.ActionListener)11 GridBagLayout (java.awt.GridBagLayout)8 Dimension (java.awt.Dimension)7 GridBagConstraints (java.awt.GridBagConstraints)7 BorderLayout (java.awt.BorderLayout)6 JCheckBox (javax.swing.JCheckBox)6 JComponent (javax.swing.JComponent)6 JToggleButton (javax.swing.JToggleButton)6 PropertyChangeEvent (java.beans.PropertyChangeEvent)5 JRadioButton (javax.swing.JRadioButton)5 JTextField (javax.swing.JTextField)5 Color (java.awt.Color)4 Point (java.awt.Point)4