Class RMShapeMouseEvent

  • All Implemented Interfaces:
    java.io.Serializable

    public class RMShapeMouseEvent
    extends java.awt.event.MouseEvent
    The RMShapeMouseEvent is a subclass of MouseEvent which is sent to an RMShape's mouse listeners. It is the same as a regular mouse event except for two differences: The shape the action was performed on can be retrieved with getShape(), and event point in the shape's coordinate system can be retrieved with getShapePoint().
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.awt.event.MouseEvent

        BUTTON1, BUTTON2, BUTTON3, MOUSE_CLICKED, MOUSE_DRAGGED, MOUSE_ENTERED, MOUSE_EXITED, MOUSE_FIRST, MOUSE_LAST, MOUSE_MOVED, MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_WHEEL, NOBUTTON
      • Fields inherited from class java.awt.event.InputEvent

        ALT_DOWN_MASK, ALT_GRAPH_DOWN_MASK, ALT_GRAPH_MASK, ALT_MASK, BUTTON1_DOWN_MASK, BUTTON1_MASK, BUTTON2_DOWN_MASK, BUTTON2_MASK, BUTTON3_DOWN_MASK, BUTTON3_MASK, CTRL_DOWN_MASK, CTRL_MASK, META_DOWN_MASK, META_MASK, SHIFT_DOWN_MASK, SHIFT_MASK
      • Fields inherited from class java.awt.event.ComponentEvent

        COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN
      • Fields inherited from class java.awt.AWTEvent

        ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK
      • Fields inherited from class java.util.EventObject

        source
    • Constructor Summary

      Constructors 
      Constructor Description
      RMShapeMouseEvent​(RMShape aShape, java.awt.event.MouseEvent anEvent)
      Creates a new shape mouse event.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void consume()
      Overrides MouseEvent version to forward on to encapsulated event.
      static RMShapeMouseEvent getCurrentEvent()
      Returns the most recently delivered event.
      RMShapeMouseEvent getMouseDownEvent()
      Returns the mouse down event.
      java.awt.event.MouseEvent getMouseEvent()
      Returns the original mouse event.
      RMPoint getParentPoint()
      Returns the event location in shape's parent's coords.
      double getParentX()
      Returns the event location in shape's parent's coords.
      double getParentY()
      Returns the event location in shape's parent's coords.
      java.awt.Point getPoint()
      Overrides MouseEvent version to return point in shape coords.
      RMPoint getPoint2D()
      Returns the event point in shape coords.
      RMShape getShape()
      Returns the event shape.
      RMViewer getViewer()
      Returns the viewer.
      java.awt.Point getViewerPoint()
      Returns the event location in viewer coords.
      int getViewerX()
      Returns the event location in viewer coords.
      int getViewerY()
      Returns the event location in viewer coords.
      int getX()
      Overrides MouseEvent version to return point in shape coords.
      double getX2D()
      Returns the event point x.
      int getY()
      Overrides MouseEvent version to return point in shape coords.
      double getY2D()
      Returns the event point y.
      • Methods inherited from class java.awt.event.MouseEvent

        getButton, getClickCount, getLocationOnScreen, getModifiersEx, getMouseModifiersText, getXOnScreen, getYOnScreen, isPopupTrigger, paramString, translatePoint
      • Methods inherited from class java.awt.event.InputEvent

        getMaskForButton, getModifiers, getModifiersExText, getWhen, isAltDown, isAltGraphDown, isConsumed, isControlDown, isMetaDown, isShiftDown
      • Methods inherited from class java.awt.event.ComponentEvent

        getComponent
      • Methods inherited from class java.awt.AWTEvent

        getID, setSource, toString
      • Methods inherited from class java.util.EventObject

        getSource
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RMShapeMouseEvent

        public RMShapeMouseEvent​(RMShape aShape,
                                 java.awt.event.MouseEvent anEvent)
        Creates a new shape mouse event.
    • Method Detail

      • getShape

        public RMShape getShape()
        Returns the event shape.
      • getViewer

        public RMViewer getViewer()
        Returns the viewer.
      • getMouseEvent

        public java.awt.event.MouseEvent getMouseEvent()
        Returns the original mouse event.
      • getX2D

        public double getX2D()
        Returns the event point x.
      • getY2D

        public double getY2D()
        Returns the event point y.
      • getPoint2D

        public RMPoint getPoint2D()
        Returns the event point in shape coords.
      • getX

        public int getX()
        Overrides MouseEvent version to return point in shape coords.
        Overrides:
        getX in class java.awt.event.MouseEvent
      • getY

        public int getY()
        Overrides MouseEvent version to return point in shape coords.
        Overrides:
        getY in class java.awt.event.MouseEvent
      • getPoint

        public java.awt.Point getPoint()
        Overrides MouseEvent version to return point in shape coords.
        Overrides:
        getPoint in class java.awt.event.MouseEvent
      • getParentX

        public double getParentX()
        Returns the event location in shape's parent's coords.
      • getParentY

        public double getParentY()
        Returns the event location in shape's parent's coords.
      • getParentPoint

        public RMPoint getParentPoint()
        Returns the event location in shape's parent's coords.
      • getViewerX

        public int getViewerX()
        Returns the event location in viewer coords.
      • getViewerY

        public int getViewerY()
        Returns the event location in viewer coords.
      • getViewerPoint

        public java.awt.Point getViewerPoint()
        Returns the event location in viewer coords.
      • getMouseDownEvent

        public RMShapeMouseEvent getMouseDownEvent()
        Returns the mouse down event.
      • consume

        public void consume()
        Overrides MouseEvent version to forward on to encapsulated event.
        Overrides:
        consume in class java.awt.event.InputEvent
      • getCurrentEvent

        public static RMShapeMouseEvent getCurrentEvent()
        Returns the most recently delivered event.