コード例 #1
0
  //
  //  Implement the ChangeListener
  //
  public void stateChanged(ChangeEvent e) {
    //  Keep the scrolling of the row table in sync with main table

    JViewport viewport = (JViewport) e.getSource();
    JScrollPane scrollPane = (JScrollPane) viewport.getParent();
    scrollPane.getVerticalScrollBar().setValue(viewport.getViewPosition().y);
  }
コード例 #2
0
 /** Called when the speed slider was moved. */
 public void SpeedSlider_stateChanged(ChangeEvent e) {
   JSlider source = (JSlider) e.getSource();
   if (!source.getValueIsAdjusting()) {
     int speed = source.getValue();
     notifyControllerListeners(ControllerEvent.SPEED_CHANGE, new Integer(speed));
   }
 }
コード例 #3
0
ファイル: MyDateChooseBtn.java プロジェクト: singleD/se2
    public void stateChanged(ChangeEvent e) {
      JSpinner source = (JSpinner) e.getSource();
      if (source.getName().equals("Hour")) {
        calendar.set(Calendar.HOUR_OF_DAY, getSelectedHour());
        return;
      }
      if (source.getName().equals("Year")) {

        calendar.set(Calendar.YEAR, getSelectedYear());
        dayPanel.removeAll();
        this.flushWeekAndDayPanal(calendar);
        dayPanel.revalidate();
        dayPanel.updateUI();
        return;
      }
      if (source.getName().equals("Month")) {
        calendar.set(Calendar.MONTH, getSelectedMonth() - 1);

        dayPanel.removeAll();
        this.flushWeekAndDayPanal(calendar);
        dayPanel.revalidate();
        dayPanel.updateUI();
        return;
      }
    }
コード例 #4
0
ファイル: PanelEventFD.java プロジェクト: uuanang/aurorarnm
 /** Reaction to value changes in the form. */
 public void stateChanged(ChangeEvent e) {
   String nm = ((JComponent) e.getSource()).getName();
   double x;
   if (nm.equals(nmSpinMaxFlow)) {
     x = (Double) spinMaxFlow.getValue();
     mf = x;
   }
   if (nm.equals(nmSpinCapDrop)) {
     x = (Double) spinCapDrop.getValue();
     drp = x;
   }
   if (nm.equals(nmSpinCritDen)) {
     x = (Double) spinCritDen.getValue();
     if (x <= jd) cd = x;
   }
   if (nm.equals(nmSpinJamDen)) {
     x = (Double) spinJamDen.getValue();
     if (x >= cd) jd = x;
   }
   if (nm.equals(nmSpinVff)) {
     x = (Double) spinVff.getValue();
     if (x > 0.0) cd = mf / x;
     double xx = (Double) spinWc.getValue();
     if (xx > 0.0) jd = cd + (mf / xx);
   }
   if (nm.equals(nmSpinWc)) {
     x = (Double) spinWc.getValue();
     if (x > 0.0) jd = cd + (mf / x);
   }
   updateSpinners();
   updateFDSeries();
   return;
 }
コード例 #5
0
 public void stateChanged(ChangeEvent e) {
   JSlider source = (JSlider) e.getSource();
   if (!source.getValueIsAdjusting()) {
     int delay = 1000 * (int) source.getValue();
     LifeSimulation.timer().setDelay(delay);
   }
 }
コード例 #6
0
 public void stateChanged(ChangeEvent e) {
   texta.setText(
       lblName.getText()
           + text0.getText()
           + '\n'
           + lblAge.getText()
           + ((JSpinner) e.getSource()).getValue());
 }
コード例 #7
0
 /** @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent) */
 public void stateChanged(ChangeEvent e) {
   // set label according to slider which has been changed
   JSlider source = (JSlider) e.getSource();
   if (source == sliderNumberOfRetries)
     this.currentNumberOfRetries.setText(Integer.toString(source.getValue()));
   if (source == sliderIntervalBetweenRetries)
     this.currentIntervalBetweenRetries.setText(Integer.toString(source.getValue()));
 }
コード例 #8
0
 public void stateChanged(ChangeEvent e) {
   if (e.getSource() == whichRadius) {
     if (!whichRadius.getValueIsAdjusting()) {
       // System.out.println(acc.length);
       if (acc != null) buildAccumulator(whichRadius.getValue());
       accumulator.setSelected(true);
     }
   }
 }
コード例 #9
0
  public void stateChanged(ChangeEvent ce) {
    Object ob = ce.getSource();
    Class<?> cl = ob.getClass();

    if (Debug) {
      System.out.println("MyChangeListener: got stateChanged: Object: " + ob.toString() + "\n");
      System.out.println("MyChangeListener: got stateChanged: Class: " + cl.getName() + "\n");
    }

    if (cl.getName().equals("javax.swing.JTabbedPane")) {
      if (pane == ce.getSource()) {
        int index = pane.getSelectedIndex();
        mLook.stateChanged(index);
      } else {
        System.out.println("The source does NOT equal pane\n");
      }
    }
  }
コード例 #10
0
  public void stateChanged(ChangeEvent e) {
    if (e.getSource() instanceof JSlider && !isAdjusting) {

      int red = redSlider.getValue();
      int green = greenSlider.getValue();
      int blue = blueSlider.getValue();
      Color color = new Color(red, green, blue);

      getColorSelectionModel().setSelectedColor(color);
    } else if (e.getSource() instanceof JSpinner && !isAdjusting) {

      int red = ((Integer) redField.getValue()).intValue();
      int green = ((Integer) greenField.getValue()).intValue();
      int blue = ((Integer) blueField.getValue()).intValue();
      Color color = new Color(red, green, blue);

      getColorSelectionModel().setSelectedColor(color);
    }
  }
コード例 #11
0
  public void stateChanged(ChangeEvent e) {
    JSlider source = (JSlider) e.getSource();

    if (source == unitXSlider) {
      ux = source.getValue();
      graph.setUnityX(ux);
    } else {
      uy = source.getValue();
      graph.setUnityY(uy);
    }
  }
コード例 #12
0
ファイル: ThumbMaker.java プロジェクト: ctrueden/web-toys
 /** Called when color slider values change. */
 public void stateChanged(ChangeEvent e) {
   JSlider slider = (JSlider) e.getSource();
   int val = slider.getValue();
   String s = "" + val;
   if (val < 100) s = "0" + s;
   if (val < 10) s = "0" + s;
   if (slider == red) redValue.setText(s);
   else if (slider == green) greenValue.setText(s);
   else if (slider == blue) blueValue.setText(s);
   Color c = new Color(red.getValue(), green.getValue(), blue.getValue());
   colorBox.setBackground(c);
 }
コード例 #13
0
 @Override
 public void stateChanged(ChangeEvent event) {
   Object source = event.getSource();
   if (source.equals(gui.getSizeSpinner())) {
     gui.getTestText()
         .setFont(
             new Font(
                 gui.getFontName().getSelectedValue(),
                 Font.PLAIN,
                 (int) gui.getSizeSpinner().getValue()));
   }
 }
コード例 #14
0
 public void stateChanged(ChangeEvent e) {
   // when using these sliders use double buffering, which means
   // ignoring when DemoSurface.imageType = 'On Screen'
   if (getImageType() <= 1) {
     setImageType(2);
   }
   if (e.getSource().equals(slider1)) {
     if (opsIndex == 0) {
       thresholdOp(slider1.getValue(), high);
     } else {
       rescaleFactor = slider1.getValue();
       biop[1] = new RescaleOp((float) rescaleFactor / 128.0f, rescaleOffset, null);
     }
   } else {
     if (opsIndex == 0) {
       thresholdOp(low, slider2.getValue());
     } else {
       rescaleOffset = (float) slider2.getValue();
       biop[1] = new RescaleOp((float) rescaleFactor / 128.0f, rescaleOffset, null);
     }
   }
   repaint();
 }
コード例 #15
0
ファイル: FilterPanel.java プロジェクト: jseyster/seystertron
 public void stateChanged(ChangeEvent e) {
   JSlider sliderResonance = (JSlider) e.getSource();
   int ripple = (int) sliderResonance.getValue();
   filter.setRipple((double) ripple / 2.0d);
 }
コード例 #16
0
ファイル: FilterPanel.java プロジェクト: jseyster/seystertron
 public void stateChanged(ChangeEvent e) {
   JSlider sliderCutoff = (JSlider) e.getSource();
   int cutoff = (int) sliderCutoff.getValue();
   filter.setCutoff((double) cutoff / 4000.0d);
 }
コード例 #17
0
ファイル: deviceFrame.java プロジェクト: davsebamse/TapeV2
 public void stateChanged(ChangeEvent e) {
   if (((JSlider) e.getSource()).getValueIsAdjusting()) {
     devArray[id].lastSetVal = ((JSlider) e.getSource()).getValue();
   }
 }
コード例 #18
0
ファイル: NewsPanel.java プロジェクト: ThatGuyOverTher/Frost
 public void stateChanged(final ChangeEvent e) {
   if (e.getSource() == altEditCheckBox) {
     altEditChanged();
   }
 }
コード例 #19
0
 public void stateChanged(ChangeEvent event) {
   if (event.getSource() == slider1) ball1.setDelay(slider1.getValue());
   else ball2.setDelay(slider2.getValue());
 } // end of SliderListener
コード例 #20
0
  /*
   * Name: stateChanged
   * Purpose: Changes speed
   * Parameters: ChangeEvent evt
   * Return: void
   */
  public void stateChanged(ChangeEvent evt) {

    // get the JSlider value
    speed = ((JSlider) (evt.getSource())).getValue();
  }