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());
}
}
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;
}
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;
}
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;
}
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();
}
});
}
Aggregations