public void keyPressed(KeyEvent e){
  if (e.isAltDown() || e.isControlDown() || e.isMetaDown()|| e.isShiftDown()) {
    return;
  }
  if ((e.getKeyCode() == accelerateKey) || (e.getKeyCode() == accelerateKey1)) {
    accelerate1();
  }
 else   if (e.getKeyCode() == accelerateKey2) {
    accelerate10();
  }
 else   if ((e.getKeyCode() == decelerateKey) || (e.getKeyCode() == decelerateKey1)) {
    decelerate1();
  }
 else   if (e.getKeyCode() == decelerateKey2) {
    decelerate10();
  }
 else   if (e.getKeyCode() == forwardKey) {
    if (forwardButton.isEnabled()) {
      forwardButton.doClick();
    }
  }
 else   if (e.getKeyCode() == reverseKey) {
    if (reverseButton.isEnabled()) {
      reverseButton.doClick();
    }
  }
 else   if (e.getKeyCode() == stopKey) {
    if (speedSlider.isEnabled() || (speedSpinner != null && speedSpinner.isEnabled())) {
      stop();
    }
  }
 else   if (e.getKeyCode() == idleKey) {
    if (speedSlider.isEnabled() || (speedSpinner != null && speedSpinner.isEnabled())) {
      speedSlider.setValue(0);
    }
  }
}

public void keyPressed ( KeyEvent e ) { if ( e . isAltDown ( ) || e . isControlDown ( ) || e . isMetaDown ( ) || e . isShiftDown ( ) ) { return ; } if ( ( e . getKeyCode ( ) == accelerateKey ) || ( e . getKeyCode ( ) == accelerateKey1 ) ) { accelerate1 ( ) ; } else if ( e . getKeyCode ( ) == accelerateKey2 ) { accelerate10 ( ) ; } else if ( ( e . getKeyCode ( ) == decelerateKey ) || ( e . getKeyCode ( ) == decelerateKey1 ) ) { decelerate1 ( ) ; } else if ( e . getKeyCode ( ) == decelerateKey2 ) { decelerate10 ( ) ; } else if ( e . getKeyCode ( ) == forwardKey ) { if ( forwardButton . isEnabled ( ) ) { forwardButton . doClick ( ) ; } } else if ( e . getKeyCode ( ) == reverseKey ) { if ( reverseButton . isEnabled ( ) ) { reverseButton . doClick ( ) ; } } else if ( e . getKeyCode ( ) == stopKey ) { if ( speedSlider . isEnabled ( ) || ( speedSpinner != null && speedSpinner . isEnabled ( ) ) ) { stop ( ) ; } } else if ( e . getKeyCode ( ) == idleKey ) { if ( speedSlider . isEnabled ( ) || ( speedSpinner != null && speedSpinner . isEnabled ( ) ) ) { speedSlider . setValue ( 0 ) ; } } }
description of the method
