Class MoveObjectGlassPane

All Implemented Interfaces:
KeyListener, MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener

public class MoveObjectGlassPane extends JComponent implements MouseMotionListener, MouseListener, KeyListener
This glass implements a GlassPane over the map, so that a ghost of the dragged station's icon can be moved around with the cursor.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • MoveObjectGlassPane

      public MoveObjectGlassPane(com.bbn.openmap.MapBean mapBean, StationState ss, ObjectReport or)
      Create a glass pane for dragging an object around the map window.
      Parameters:
      mapBean - the MapBean that the glass pane will be overlaying
      ss - StationState of the object or station being moved
      or - an ObjectReport to be updated with the new location of the station or object
  • Method Details

    • isSuccessful

      public boolean isSuccessful()
      Report whether the move should be saved or discarded.
      Returns:
      boolean true if user indicated that change should be kept
    • getObjectReport

      public ObjectReport getObjectReport()
      Get the ObjectReport being processed by this move.
      Returns:
      ObjectReport of APRS Object being moved
    • paintComponent

      protected void paintComponent(Graphics g)
      Paint the cursor icon on the glass pane.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - the Graphics object to protect
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Invoked when the mouse button has been clicked (pressed and released) on a component.
      Specified by:
      mouseClicked in interface MouseListener
    • mousePressed

      public void mousePressed(MouseEvent e)
      Invoked when a mouse button has been pressed on a component.
      Specified by:
      mousePressed in interface MouseListener
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Invoked when a mouse button has been released on a component.
      Specified by:
      mouseReleased in interface MouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Invoked when the mouse enters a component.
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent e)
      Invoked when the mouse exits a component.
      Specified by:
      mouseExited in interface MouseListener
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Invoked when a mouse button is pressed on a component and then dragged. MOUSE_DRAGGED events will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).

      Due to platform-dependent Drag and Drop implementations, MOUSE_DRAGGED events may not be delivered during a native Drag and Drop operation.

      Specified by:
      mouseDragged in interface MouseMotionListener
    • mouseMoved

      public void mouseMoved(MouseEvent e)
      Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
      Specified by:
      mouseMoved in interface MouseMotionListener
    • keyPressed

      public void keyPressed(KeyEvent e)
      Invoked when a key has been pressed. See the class description for KeyEvent for a definition of a key pressed event.
      Specified by:
      keyPressed in interface KeyListener
    • keyTyped

      public void keyTyped(KeyEvent e)
      Invoked when a key has been typed. See the class description for KeyEvent for a definition of a key typed event.
      Specified by:
      keyTyped in interface KeyListener
    • keyReleased

      public void keyReleased(KeyEvent e)
      Invoked when a key has been released. See the class description for KeyEvent for a definition of a key released event.
      Specified by:
      keyReleased in interface KeyListener