Class SoEventBuilder
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.viewercomponents.SoEventBuilder
Utility class that generates Open Inventor events.
This class is used to generate an Open Inventor event object from a system independent event description.
Note: The same SoEvent
object is returned each time. This object is owned by the SoEventBuilder
instance and must not be modified or destroyed by the application.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetKeyPressEvent
(SoKeyboardEvent.Keys key, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoKeyboardEvent
corresponding to given parameters.getKeyReleaseEvent
(SoKeyboardEvent.Keys key, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoKeyboardEvent
corresponding to given parameters.getMouseDoubleClickEvent
(int x, int y, SoMouseButtonEvent.Buttons buttonId, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoMouseButtonEvent
corresponding to given parameters.getMouseEnterEvent
(int x, int y, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoLocation2Event
corresponding to given parameters.getMouseLeaveEvent
(int x, int y, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoLocation2Event
corresponding to given parameters.getMouseMoveEvent
(int x, int y, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoLocation2Event
corresponding to given parameters.getMousePressEvent
(int x, int y, SoMouseButtonEvent.Buttons buttonId, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoMouseButtonEvent
corresponding to given parameters.getMouseReleaseEvent
(int x, int y, SoMouseButtonEvent.Buttons buttonId, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoMouseButtonEvent
corresponding to given parameters.getMouseWheelEvent
(int delta, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoMouseWheelEvent
corresponding to given parameters.getTouchDownEvent
(int x, int y, long fingerId) Return a list ofSoEvent
corresponding to given parameters.Get the touch manager instance used by this event builder to build touch events.getTouchMoveEvent
(int x, int y, long fingerId) Return a list ofSoEvent
corresponding to given parameters.getTouchUpEvent
(int x, int y, long fingerId) Return a list ofSoEvent
corresponding to given parameters.void
setValue
(SoEventBuilder copyFrom) static SoEventBuilder[]
toArray
(long nativeArray, long length) Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
Constructor Details
-
SoEventBuilder
-
SoEventBuilder
public SoEventBuilder()Constructor.
-
-
Method Details
-
getTouchMoveEvent
Return a list ofSoEvent
corresponding to given parameters. This list may contain some recognizedSoGestureEvent
. The returned events should not be destroyed.- Parameters:
x
- X coordinate in pixel of the finger position.y
- Y coordinate in pixel of the finger position.fingerId
- id of the finger used.
-
getTouchManager
Get the touch manager instance used by this event builder to build touch events. -
getMouseLeaveEvent
public SoLocation2Event getMouseLeaveEvent(int x, int y, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoLocation2Event
corresponding to given parameters. A MouseLeave event correspond to a mouse leaving some GUI area like a panel or a window. The returned object should not be destroyed.- Parameters:
x
- X coordinate in pixel.y
- Y coordinate in pixel.isAltDown
- Specify if Alt key was down when mouse has leaved area.isCtrlDown
- Specify if Ctrl key was down when mouse has leaved area.isShiftDown
- Specify if Shift key was down when mouse has leaved area.
-
toArray
-
setValue
-
getMouseDoubleClickEvent
public SoMouseButtonEvent getMouseDoubleClickEvent(int x, int y, SoMouseButtonEvent.Buttons buttonId, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoMouseButtonEvent
corresponding to given parameters. The returned object should not be destroyed.- Parameters:
x
- X coordinate in pixel.y
- Y coordinate in pixel.buttonId
- Which mouse button has been double clicked.isAltDown
- Specify if Alt key was down when mouse has been double clicked.isCtrlDown
- Specify if Ctrl key was down when mouse has been double clicked.isShiftDown
- Specify if Shift key was down when mouse has been double clicked.
-
getKeyPressEvent
public SoKeyboardEvent getKeyPressEvent(SoKeyboardEvent.Keys key, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoKeyboardEvent
corresponding to given parameters. The returned object should not be destroyed.- Parameters:
key
- key that have been pressed.isAltDown
- Specify if Alt key was down when key has been pressed.isCtrlDown
- Specify if Ctrl key was down when key has been pressed.isShiftDown
- Specify if Shift key was down when key has been pressed.
-
getKeyReleaseEvent
public SoKeyboardEvent getKeyReleaseEvent(SoKeyboardEvent.Keys key, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoKeyboardEvent
corresponding to given parameters. The returned object should not be destroyed.- Parameters:
key
- key that have been released.isAltDown
- Specify if Alt key was down when key has been released.isCtrlDown
- Specify if Ctrl key was down when key has been released.isShiftDown
- Specify if Shift key was down when key has been released.
-
getMouseMoveEvent
public SoLocation2Event getMouseMoveEvent(int x, int y, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoLocation2Event
corresponding to given parameters. The returned object should not be destroyed.- Parameters:
x
- X coordinate in pixel.y
- Y coordinate in pixel.isAltDown
- Specify if Alt key was down when mouse has been moved.isCtrlDown
- Specify if Ctrl key was down when mouse has been moved.isShiftDown
- Specify if Shift key was down when mouse has been moved.
-
getMouseWheelEvent
public SoMouseWheelEvent getMouseWheelEvent(int delta, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoMouseWheelEvent
corresponding to given parameters. The returned object should not be destroyed.- Parameters:
delta
- Number of tick mouse wheel has done. For most of mice, one tick correspond to 15 degree on the wheel but it may change depending on hardware.isAltDown
- Specify if Alt key was down when wheel has been activated.isCtrlDown
- Specify if Ctrl key was down when when wheel has been activated.isShiftDown
- Specify if Shift key was down when when wheel has been activated.
-
getTouchUpEvent
Return a list ofSoEvent
corresponding to given parameters. This list may contain some recognizedSoGestureEvent
. The returned events should not be destroyed.- Parameters:
x
- X coordinate in pixel of the finger position.y
- Y coordinate in pixel of the finger position.fingerId
- id of the finger used.
-
getMouseEnterEvent
public SoLocation2Event getMouseEnterEvent(int x, int y, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoLocation2Event
corresponding to given parameters. A MouseEnter event correspond to a mouse entering some GUI area like a panel or a window. The returned object should not be destroyed.- Parameters:
x
- X coordinate in pixel.y
- Y coordinate in pixel.isAltDown
- Specify if Alt key was down when mouse has entered area.isCtrlDown
- Specify if Ctrl key was down when mouse has entered area.isShiftDown
- Specify if Shift key was down when mouse has entered area.
-
getMouseReleaseEvent
public SoMouseButtonEvent getMouseReleaseEvent(int x, int y, SoMouseButtonEvent.Buttons buttonId, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoMouseButtonEvent
corresponding to given parameters. The returned object should not be destroyed.- Parameters:
x
- X coordinate in pixel.y
- Y coordinate in pixel.buttonId
- Which mouse button has been released.isAltDown
- Specify if Alt key was down when mouse has been released.isCtrlDown
- Specify if Ctrl key was down when mouse has been released.isShiftDown
- Specify if Shift key was down when mouse has been released.
-
getMousePressEvent
public SoMouseButtonEvent getMousePressEvent(int x, int y, SoMouseButtonEvent.Buttons buttonId, boolean isAltDown, boolean isCtrlDown, boolean isShiftDown) Return anSoMouseButtonEvent
corresponding to given parameters. The returned object should not be destroyed.- Parameters:
x
- X coordinate in pixel.y
- Y coordinate in pixel.buttonId
- Which mouse button has been pressed.isAltDown
- Specify if Alt key was down when mouse has been pressed.isCtrlDown
- Specify if Ctrl key was down when mouse has been pressed.isShiftDown
- Specify if Shift key was down when mouse has been pressed.
-
getTouchDownEvent
Return a list ofSoEvent
corresponding to given parameters. This list may contain some recognizedSoGestureEvent
. The returned events should not be destroyed.- Parameters:
x
- X coordinate in pixel of the finger position.y
- Y coordinate in pixel of the finger position.fingerId
- id of the finger used.
-