コード例 #1
0
 public HexPanelListener() {
   /*
    * Set this object as the listener
    * for the hex panel for
    * *both* types of Mouse Listener
    */
   Controller.getHexPanel().addMouseMotionListener(this);
   Controller.getHexPanel().addMouseListener(this);
 }
コード例 #2
0
 /** Sets the direction of the vehicle */
 public void stateChanged(ChangeEvent event) {
   JSlider source = (JSlider) event.getSource();
   if (!source.getValueIsAdjusting()) {
     SensorInfo.getInstance().setSliderDirection(source.getValue());
     Controller.getInstance().setMotors();
   }
 }
コード例 #3
0
 /** Deal with mouseReleased (mouse up) events on the HexPanel. */
 public void mouseReleased(final MouseEvent e) {
   Controller.hexPanelMouseReleased(e);
 }
コード例 #4
0
 /** Defines the procedure for dragging a mouse button across the HexPanel */
 public void mouseDragged(final MouseEvent e) {
   Controller.hexPanelMouseDragged(e);
 }