Class RMShapeMouseEvent

All Implemented Interfaces:
Serializable

public class RMShapeMouseEvent extends 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:
  • Constructor Details

    • RMShapeMouseEvent

      public RMShapeMouseEvent(RMShape aShape, MouseEvent anEvent)
      Creates a new shape mouse event.
  • Method Details

    • getShape

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

      public RMViewer getViewer()
      Returns the viewer.
    • getMouseEvent

      public 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 MouseEvent
    • getY

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

      public Point getPoint()
      Overrides MouseEvent version to return point in shape coords.
      Overrides:
      getPoint in class 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 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 InputEvent
    • getCurrentEvent

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