示例#1
0
 public synchronized void adjustmentValueChanged(AdjustmentEvent e) {
   Object source = e.getSource();
   for (int i = 0; i < slider.size(); i++) {
     if (source == slider.elementAt(i)) {
       Scrollbar sb = (Scrollbar) source;
       TextField tf = (TextField) numberField.elementAt(sliderIndexes[i]);
       int digits = sliderScales[i] == 1.0 ? 0 : 2;
       tf.setText("" + IJ.d2s(sb.getValue() / sliderScales[i], digits));
     }
   }
 }
示例#2
0
    public synchronized void adjustmentValueChanged(AdjustmentEvent e) {

      if (!checkImage()) {
        IJ.beep();
        IJ.showStatus("No Image");
        return;
      }

      if (e.getSource() == minSlider) {
        adjustMinHue((int) minSlider.getValue());
      } else if (e.getSource() == maxSlider) {
        adjustMaxHue((int) maxSlider.getValue());
      } else if (e.getSource() == minSlider2) {
        adjustMinSat((int) minSlider2.getValue());
      } else if (e.getSource() == maxSlider2) {
        adjustMaxSat((int) maxSlider2.getValue());
      } else if (e.getSource() == minSlider3) {
        adjustMinBri((int) minSlider3.getValue());
      } else if (e.getSource() == maxSlider3) {
        adjustMaxBri((int) maxSlider3.getValue());
      }
      originalB.setEnabled(true);
      updateLabels();
      updatePlot();
      notify();
    }