public void actionPerformed(ActionEvent actionevent) {
   if (actionevent.getActionCommand().equals("ADD_DATA")) {
     double d = 0.90000000000000002D + 0.20000000000000001D * Math.random();
     lastValue = lastValue * d;
     Millisecond millisecond = new Millisecond();
     System.out.println("Now = " + millisecond.toString());
     series.add(new Millisecond(), lastValue);
   }
 }
Beispiel #2
0
    public void actionPerformed(ActionEvent actionevent) {
      for (int i = 0; i < 3; i++)
        if (actionevent.getActionCommand().endsWith(String.valueOf(i))) {
          Millisecond millisecond1 = new Millisecond();
          System.out.println("Now = " + millisecond1.toString());
          lastValue[i] =
              lastValue[i] * (0.90000000000000002D + 0.20000000000000001D * Math.random());
          datasets[i].getSeries(0).add(new Millisecond(), lastValue[i]);
        }

      if (actionevent.getActionCommand().equals("ADD_ALL")) {
        Millisecond millisecond = new Millisecond();
        System.out.println("Now = " + millisecond.toString());
        for (int j = 0; j < 3; j++) {
          lastValue[j] =
              lastValue[j] * (0.90000000000000002D + 0.20000000000000001D * Math.random());
          datasets[j].getSeries(0).add(new Millisecond(), lastValue[j]);
        }
      }
    }