Beispiel #1
0
 /** Defines reactions on pressed keys for the arena. */
 public void keyPressed(KeyEvent e) {
   switch (e.getKeyCode()) {
     case KeyEvent.VK_A:
       // switch between antialiased and not antialiased painting.
       setAllArenaPartsAntialiased(!isAllArenaPartsAntialiased);
       break;
     case KeyEvent.VK_V:
       // toggles on and off the visibility of the status frames.
       for (Active active : actives) {
         active.setShowingStatusFrame(!active.isShowingStatusFrame());
       }
       break;
     case KeyEvent.VK_P:
       // Sets the status frames to be binded to their owner.
       for (Active active : actives) {
         active.setStatusFramePinedToPosition(!active.isStatusFramePinedToPosition());
       }
       break;
     case KeyEvent.VK_C:
       // captures an SVG output
       captureToSVG(svgOutputFileName);
       break;
     case KeyEvent.VK_N:
       // start caturing
       capture = true;
       break;
     case KeyEvent.VK_M:
       // stop capturing
       capture = false;
       break;
   }
 }