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); }
/** 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(); } }
/** Deal with mouseReleased (mouse up) events on the HexPanel. */ public void mouseReleased(final MouseEvent e) { Controller.hexPanelMouseReleased(e); }
/** Defines the procedure for dragging a mouse button across the HexPanel */ public void mouseDragged(final MouseEvent e) { Controller.hexPanelMouseDragged(e); }