Package io.guise.framework.event
Class MouseClickEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.globalmentor.event.AbstractEvent
-
- All Implemented Interfaces:
com.globalmentor.event.Event
,com.globalmentor.event.TargetedEvent
,GestureInputEvent
,GuiseEvent
,InputEvent
,MouseEvent
,java.io.Serializable
public class MouseClickEvent extends AbstractMouseEvent
An event providing mouse information of a mouse clicking a target.- Author:
- Garret Wilson
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MouseClickEvent(java.lang.Object source, MouseClickEvent mouseClickEvent)
Copy constructor that specifies a different source.MouseClickEvent(java.lang.Object source, Rectangle targetBounds, Rectangle viewportBounds, Point mousePosition, MouseButton button, int count, Key... keys)
Source constructor.MouseClickEvent(java.lang.Object source, MouseClickInput mouseClickInput)
Mouse click input constructor with empty target bounds and viewport bounds and a mouse position at the origin.MouseClickEvent(java.lang.Object source, java.lang.Object target, Rectangle targetBounds, Rectangle viewportBounds, Point mousePosition, MouseButton button, int count, Key... keys)
Source and target constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MouseButton
getButton()
int
getCount()
MouseClickInput
getInput()
-
Methods inherited from class io.guise.framework.event.AbstractMouseEvent
getMousePosition, getTarget, getTargetBounds, getViewportBounds
-
Methods inherited from class io.guise.framework.event.AbstractGestureInputEvent
getKeys, hasAltKey, hasControlKey, hasShiftKey
-
Methods inherited from class io.guise.framework.event.AbstractInputEvent
consume, isConsumed
-
Methods inherited from class io.guise.framework.event.AbstractGuiseEvent
getSession
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.guise.framework.event.GestureInputEvent
getKeys, hasAltKey, hasControlKey, hasShiftKey
-
Methods inherited from interface io.guise.framework.event.GuiseEvent
getSession
-
Methods inherited from interface io.guise.framework.event.InputEvent
consume, isConsumed
-
-
-
-
Constructor Detail
-
MouseClickEvent
public MouseClickEvent(java.lang.Object source, Rectangle targetBounds, Rectangle viewportBounds, Point mousePosition, MouseButton button, int count, Key... keys)
Source constructor. The target will be set to be the same as the given source.- Parameters:
source
- The object on which the event initially occurred.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.button
- The button that was clicked.count
- The number of clicks that were input (e.g. 1 for a single click, 2 for a double click, etc.).keys
- The keys that were pressed when this event was generated.- Throws:
java.lang.NullPointerException
- if the given source, target bounds, viewport bounds, mouse position, button, and/or keys isnull
.java.lang.IllegalArgumentException
- if the given count is zero or less.
-
MouseClickEvent
public MouseClickEvent(java.lang.Object source, java.lang.Object target, Rectangle targetBounds, Rectangle viewportBounds, Point mousePosition, MouseButton button, int count, 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.button
- The button that was clicked.count
- The number of clicks that were input (e.g. 1 for a single click, 2 for a double click, etc.).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, button, and/or keys isnull
.java.lang.IllegalArgumentException
- if the given count is zero or less.
-
MouseClickEvent
public MouseClickEvent(java.lang.Object source, MouseClickInput mouseClickInput)
Mouse click input constructor with empty target bounds and viewport bounds and a mouse position at the origin.- Parameters:
source
- The object on which the event initially occurred.mouseClickInput
- The mouse click input the properties of which will be copied.- Throws:
java.lang.NullPointerException
- if the given source and/or input isnull
.
-
MouseClickEvent
public MouseClickEvent(java.lang.Object source, MouseClickEvent mouseClickEvent)
Copy constructor that specifies a different source.- Parameters:
source
- The object on which the event initially occurred.mouseClickEvent
- The event the properties of which will be copied.- Throws:
java.lang.NullPointerException
- if the given source and/or event isnull
.java.lang.IllegalArgumentException
- if the given count is zero or less.
-
-
Method Detail
-
getButton
public MouseButton getButton()
- Returns:
- The button that was clicked.
-
getCount
public int getCount()
- Returns:
- The number of clicks that were input (e.g. 1 for a single click, 2 for a double click, etc.).
-
getInput
public MouseClickInput getInput()
- Returns:
- The input associated with this event, or
null
if there is no input associated with this event.
-
-