/** 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));
   }
 }
 public void stateChanged(ChangeEvent e) {
   JSlider source = (JSlider) e.getSource();
   if (!source.getValueIsAdjusting()) {
     int delay = 1000 * (int) source.getValue();
     LifeSimulation.timer().setDelay(delay);
   }
 }
예제 #3
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");
      }
    }
  }
예제 #4
0
 /** 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);
 }
예제 #5
0
  /**
   * Listens for network changes and if we have a down interface and we have a tcp/tls provider
   * which is staying for 20 seconds in unregistering state, it cannot unregister cause its using
   * the old address which is currently down, and we must recreate its listening points so it can
   * further reconnect.
   *
   * @param event the change event.
   */
  public void configurationChanged(ChangeEvent event) {
    if (event.isInitial()) return;

    if (event.getType() == ChangeEvent.ADDRESS_DOWN) {
      for (final ProtocolProviderServiceSipImpl pp : listeners) {
        if (pp.getRegistrarConnection().getTransport() != null
            && (pp.getRegistrarConnection().getTransport().equals(ListeningPoint.TCP)
                || pp.getRegistrarConnection().getTransport().equals(ListeningPoint.TLS))) {
          ResetListeningPoint reseter;
          synchronized (resetListeningPointsTimers) {
            // we do this only once for transport
            if (resetListeningPointsTimers.containsKey(pp.getRegistrarConnection().getTransport()))
              continue;

            reseter = new ResetListeningPoint(pp);
            resetListeningPointsTimers.put(pp.getRegistrarConnection().getTransport(), reseter);
          }
          pp.addRegistrationStateChangeListener(reseter);
        }
      }
    }
  }