Class AbstractMouseEvent

All Implemented Interfaces:
com.globalmentor.event.Event, com.globalmentor.event.TargetedEvent, GestureInputEvent, GuiseEvent, InputEvent, MouseEvent, Serializable
Direct Known Subclasses:
MouseClickEvent, MouseEnterEvent, MouseExitEvent

public abstract class AbstractMouseEvent extends AbstractGestureInputEvent implements MouseEvent
An abstract event providing mouse input information.
Author:
Garret Wilson
See Also:
  • Constructor Details

    • AbstractMouseEvent

      public AbstractMouseEvent(Object source, Object target, Rectangle targetBounds, Rectangle viewportBounds, Point mousePosition, Key... keys)
      Source and target constructor.
      Parameters:
      source - The object on which the event initially occurred.
      target - The target of the event.
      targetBounds - The absolute bounds of the event target.
      viewportBounds - The absolute bounds of the viewport.
      mousePosition - The position of the mouse relative to the viewport.
      keys - The keys that were pressed when this event was generated.
      Throws:
      NullPointerException - if the given source, target, target bounds, viewport bounds, mouse position, and/or keys is null.
  • Method Details

    • getTarget

      public Object getTarget()
      Specified by:
      getTarget in interface com.globalmentor.event.TargetedEvent
    • getTargetBounds

      public Rectangle getTargetBounds()
      Specified by:
      getTargetBounds in interface MouseEvent
      Returns:
      The absolute bounds of the event target.
    • getViewportBounds

      public Rectangle getViewportBounds()
      Specified by:
      getViewportBounds in interface MouseEvent
      Returns:
      The absolute bounds of the viewport.
    • getMousePosition

      public Point getMousePosition()
      Specified by:
      getMousePosition in interface MouseEvent
      Returns:
      The position of the mouse relative to the viewport.