コード例 #1
0
  public void start() {
    timer =
        new javax.swing.Timer(
            delay.getValue(),
            new ActionListener() {
              public void actionPerformed(ActionEvent evt) {
                processX();
              }
            });

    started = false;

    counter = from.getValue();
    outValue.setValue(counter);
    outValue.setChanged(true);
    element.notifyPin(0);

    timer.start();
  }
コード例 #2
0
  public void process() {
    if (start.getValue() == true) {
      if (counter >= to.getValue()) {
        counter = from.getValue();
      }
      started = true;
    }

    if (stop.getValue()) {
      started = false;
    }

    if (delay.getValue() != oldImpuse) {
      oldImpuse = delay.getValue();
      if (timer != null) timer.setDelay(delay.getValue());
    }

    if (reset.getValue() == true) {
      counter = from.getValue();
      outValue.setValue(counter);
      outValue.setChanged(true);
      element.notifyPin(0);
    }
  }
コード例 #3
0
 public void stop() {
   if (timer != null) timer.stop();
 }