/** 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));
   }
 }
 /** Sets the direction of the vehicle */
 public void stateChanged(ChangeEvent event) {
   JSlider source = (JSlider) event.getSource();
   if (!source.getValueIsAdjusting()) {
     SensorInfo.getInstance().setSliderDirection(source.getValue());
     Controller.getInstance().setMotors();
   }
 }
 public void stateChanged(ChangeEvent e) {
   JSlider source = (JSlider) e.getSource();
   if (!source.getValueIsAdjusting()) {
     int delay = 1000 * (int) source.getValue();
     LifeSimulation.timer().setDelay(delay);
   }
 }
Ejemplo n.º 4
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);
     }
   }
 }