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

public class InteractionEvent extends ActionEvent

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 Details

    • MOUSE_PRESSED

      public static final int MOUSE_PRESSED
      ID for the action of pressing the mouse on the element
      See Also:
    • MOUSE_DRAGGED

      public static final int MOUSE_DRAGGED
      ID for the action of dragging the mouse on the element
      See Also:
    • MOUSE_RELEASED

      public static final int MOUSE_RELEASED
      ID for the action of releasing the mouse on the element
      See Also:
    • MOUSE_ENTERED

      public static final int MOUSE_ENTERED
      ID for the action of entering (lingering on) the element
      See Also:
    • MOUSE_EXITED

      public static final int MOUSE_EXITED
      ID for the action of exiting the element
      See Also:
    • MOUSE_MOVED

      public static final int MOUSE_MOVED
      ID 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

      public Object getInfo()
      The object with additional information provided by the source.
      Returns:
      Object
    • getMouseEvent

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