com.guiseframework.event
Class AbstractMouseEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.globalmentor.event.AbstractEvent
          extended by com.guiseframework.event.AbstractGuiseEvent
              extended by com.guiseframework.event.AbstractInputEvent
                  extended by com.guiseframework.event.AbstractGestureInputEvent
                      extended by com.guiseframework.event.AbstractMouseEvent
All Implemented Interfaces:
com.globalmentor.event.Event, com.globalmentor.event.TargetedEvent, GestureInputEvent, GuiseEvent, InputEvent, MouseEvent, java.io.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:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
AbstractMouseEvent(java.lang.Object source, java.lang.Object target, Rectangle targetBounds, Rectangle viewportBounds, Point mousePosition, Key... keys)
          Source and target constructor.
 
Method Summary
 Point getMousePosition()
           
 java.lang.Object getTarget()
          Returns the object to which the event applies.
 Rectangle getTargetBounds()
           
 Rectangle getViewportBounds()
           
 
Methods inherited from class com.guiseframework.event.AbstractGestureInputEvent
getKeys, hasAltKey, hasControlKey, hasShiftKey
 
Methods inherited from class com.guiseframework.event.AbstractInputEvent
consume, isConsumed
 
Methods inherited from class com.guiseframework.event.AbstractGuiseEvent
getSession
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.guiseframework.event.GestureInputEvent
getInput, getKeys, hasAltKey, hasControlKey, hasShiftKey
 
Methods inherited from interface com.guiseframework.event.InputEvent
consume, isConsumed
 
Methods inherited from interface com.guiseframework.event.GuiseEvent
getSession
 
Methods inherited from interface com.globalmentor.event.Event
getSource
 

Constructor Detail

AbstractMouseEvent

public AbstractMouseEvent(java.lang.Object source,
                          java.lang.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:
java.lang.NullPointerException - if the given source, target, target bounds, viewport bounds, mouse position, and/or keys is null.
Method Detail

getTarget

public java.lang.Object getTarget()
Returns the object to which the event applies. This may be a different than source, which is the object that generated this event instance.

Specified by:
getTarget in interface com.globalmentor.event.TargetedEvent
Returns:
The target of the event.

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.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.