Example #1
0
 /**
  * Sets the value of the Victor using a value between -1.0 and +1.0.
  *
  * @param speed The speed value of the Victor between -1.0 and +1.0.
  */
 public void set(double speed) {
   if (System.currentTimeMillis() - startTime > 35 && isGraphRunning) {
     graph.appendSpeed(speed);
     startTime = System.currentTimeMillis();
   }
   this.speed = speed;
   victorSpeed.setText((int) ((speed * 100) * 10) / 10.0 + "%");
 }
Example #2
0
 public void componentResized(ComponentEvent e) {
   graph.setGraphSize(frame.getWidth(), frame.getHeight());
   graph.repaint();
 }