Class InteractionEvent
java.lang.Object
java.util.EventObject
java.awt.AWTEvent
java.awt.event.ActionEvent
org.opensourcephysics.display3d.core.interaction.InteractionEvent
- All Implemented Interfaces:
Serializable
Title: InteractionEvent
Description: This class is used to describe the basic interaction with a 3d element. It extends ActionEvent in order to allow for the object generating the event to include an object with additional information and the mouse event which was used in the interaction.
It is up to the interacted element to decide which information (object) to pass along.
Copyright: Open Source Physics project
- Version:
- June 2005
- Author:
- Francisco Esquembre
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
ID for the action of dragging the mouse on the elementstatic final int
ID for the action of entering (lingering on) the elementstatic final int
ID for the action of exiting the elementstatic final int
ID for the action of moving the mouse on the elementstatic final int
ID for the action of pressing the mouse on the elementstatic final int
ID for the action of releasing the mouse on the elementFields inherited from class java.awt.event.ActionEvent
ACTION_FIRST, ACTION_LAST, ACTION_PERFORMED, ALT_MASK, CTRL_MASK, META_MASK, SHIFT_MASK
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
ConstructorsConstructorDescriptionInteractionEvent
(Object _source, int _id, String _command, Object _info, MouseEvent _mouseEvent) Constructor for the event -
Method Summary
Modifier and TypeMethodDescriptiongetInfo()
The object with additional information provided by the source.The mouse event which generated the interaction event.Methods inherited from class java.awt.event.ActionEvent
getActionCommand, getModifiers, getWhen, paramString
Methods inherited from class java.util.EventObject
getSource
-
Field Details
-
MOUSE_PRESSED
public static final int MOUSE_PRESSEDID for the action of pressing the mouse on the element- See Also:
-
MOUSE_DRAGGED
public static final int MOUSE_DRAGGEDID for the action of dragging the mouse on the element- See Also:
-
MOUSE_RELEASED
public static final int MOUSE_RELEASEDID for the action of releasing the mouse on the element- See Also:
-
MOUSE_ENTERED
public static final int MOUSE_ENTEREDID for the action of entering (lingering on) the element- See Also:
-
MOUSE_EXITED
public static final int MOUSE_EXITEDID for the action of exiting the element- See Also:
-
MOUSE_MOVED
public static final int MOUSE_MOVEDID for the action of moving the mouse on the element- See Also:
-
-
Constructor Details
-
InteractionEvent
public InteractionEvent(Object _source, int _id, String _command, Object _info, MouseEvent _mouseEvent) Constructor for the event- Parameters:
_source
- Object The object which generated the event._id
- int An integer which identifies the type of event._command
- String An action command associated to the event._info
- Object The object provided as additional information._mouseEvent
- MouseEvent The mouse event which generated the interaction event. It is useful to extract additional information such as the number of mouse clicks or the modifier keys and mouse buttons that were down during the event.
-
-
Method Details
-
getInfo
The object with additional information provided by the source.- Returns:
- Object
-
getMouseEvent
The mouse event which generated the interaction event. It is useful to extract additional information such as the number of mouse clicks or the modifier keys and mouse buttons that were down during the event.- Returns:
- MouseEvent
-