class GlassViewEventHandler extends View.EventHandler
Modifier and Type | Class and Description |
---|---|
private class |
GlassViewEventHandler.KeyEventNotification |
private class |
GlassViewEventHandler.MouseEventNotification |
private class |
GlassViewEventHandler.ViewEventNotification |
Modifier and Type | Field and Description |
---|---|
private PaintCollector |
collector |
private GlassSceneDnDEventHandler |
dndHandler |
private ClipboardAssistance |
dropSourceAssistant |
private GestureRecognizers |
gestures |
private GlassViewEventHandler.KeyEventNotification |
keyNotification |
private int |
mouseButtonPressedMask |
private GlassViewEventHandler.MouseEventNotification |
mouseNotification |
(package private) static boolean |
rotateGestureEnabled |
private ViewScene |
scene |
(package private) static boolean |
scrollGestureEnabled |
private GlassViewEventHandler.ViewEventNotification |
viewNotification |
(package private) static boolean |
zoomGestureEnabled |
Constructor and Description |
---|
GlassViewEventHandler(ViewScene scene) |
Modifier and Type | Method and Description |
---|---|
private static TransferMode |
actionToTransferMode(int dropActions) |
private static boolean |
allowableFullScreenKeys(int key) |
private boolean |
checkFullScreenKeyEvent(int type,
int key,
char[] chars,
int modifiers) |
double[] |
getInputMethodCandidatePos(int offset) |
Accessible |
getSceneAccessible() |
void |
handleBeginTouchEvent(View view,
long time,
int modifiers,
boolean isDirect,
int touchEventCount)
Touch event handler.
|
int |
handleDragDrop(View view,
int x,
int y,
int xAbs,
int yAbs,
int recommendedDropAction,
ClipboardAssistance dropTargetAssistant) |
void |
handleDragEnd(View view,
int performedAction) |
int |
handleDragEnter(View view,
int x,
int y,
int xAbs,
int yAbs,
int recommendedDropAction,
ClipboardAssistance dropTargetAssistant) |
void |
handleDragLeave(View view,
ClipboardAssistance dropTargetAssistant) |
int |
handleDragOver(View view,
int x,
int y,
int xAbs,
int yAbs,
int recommendedDropAction,
ClipboardAssistance dropTargetAssistant) |
void |
handleDragStart(View view,
int button,
int x,
int y,
int xAbs,
int yAbs,
ClipboardAssistance assistant) |
void |
handleEndTouchEvent(View view,
long time)
Touch event handler.
|
void |
handleInputMethodEvent(long time,
java.lang.String text,
int[] clauseBoundary,
int[] attrBoundary,
byte[] attrValue,
int commitCount,
int cursorPos) |
void |
handleKeyEvent(View view,
long time,
int type,
int key,
char[] chars,
int modifiers) |
void |
handleMenuEvent(View view,
int x,
int y,
int xAbs,
int yAbs,
boolean isKeyboardTrigger) |
void |
handleMouseEvent(View view,
long time,
int type,
int button,
int x,
int y,
int xAbs,
int yAbs,
int modifiers,
boolean isPopupTrigger,
boolean isSynthesized) |
void |
handleNextTouchEvent(View view,
long time,
int type,
long touchId,
int x,
int y,
int xAbs,
int yAbs)
Touch event handler.
|
void |
handleRotateGestureEvent(View view,
long time,
int type,
int modifiers,
boolean isDirect,
boolean isInertia,
int originx,
int originy,
int originxAbs,
int originyAbs,
double dangle,
double totalangle)
Rotation gesture handler.
|
void |
handleScrollEvent(View view,
long time,
int x,
int y,
int xAbs,
int yAbs,
double deltaX,
double deltaY,
int modifiers,
int lines,
int chars,
int defaultLines,
int defaultChars,
double xMultiplier,
double yMultiplier)
A Scroll event handler.
|
void |
handleScrollGestureEvent(View view,
long time,
int type,
int modifiers,
boolean isDirect,
boolean isInertia,
int touchCount,
int x,
int y,
int xAbs,
int yAbs,
double dx,
double dy,
double totaldx,
double totaldy,
double multiplierX,
double multiplierY)
Scroll gesture handler.
|
void |
handleSwipeGestureEvent(View view,
long time,
int type,
int modifiers,
boolean isDirect,
boolean isInertia,
int touchCount,
int dir,
int x,
int y,
int xAbs,
int yAbs)
Swipe gesture handler.
|
void |
handleViewEvent(View view,
long time,
int type) |
void |
handleZoomGestureEvent(View view,
long time,
int type,
int modifiers,
boolean isDirect,
boolean isInertia,
int originx,
int originy,
int originxAbs,
int originyAbs,
double scale,
double expansion,
double totalscale,
double totalexpansion)
Zoom gesture handler.
|
private static byte |
inputMethodEventAttrValue(int pos,
int[] attrBoundary,
byte[] attrValue) |
private static ObservableList<InputMethodTextRun> |
inputMethodEventComposed(java.lang.String text,
int commitCount,
int[] clauseBoundary,
int[] attrBoundary,
byte[] attrValue) |
private static EventType<KeyEvent> |
keyEventType(int glassType) |
private static MouseButton |
mouseEventButton(int glassButton) |
private static EventType<MouseEvent> |
mouseEventType(int glassType) |
private static int |
transferModeToAction(TransferMode tm) |
static boolean zoomGestureEnabled
static boolean rotateGestureEnabled
static boolean scrollGestureEnabled
private ViewScene scene
private final GlassSceneDnDEventHandler dndHandler
private final GestureRecognizers gestures
private final PaintCollector collector
private final GlassViewEventHandler.KeyEventNotification keyNotification
private int mouseButtonPressedMask
private final GlassViewEventHandler.MouseEventNotification mouseNotification
private ClipboardAssistance dropSourceAssistant
private final GlassViewEventHandler.ViewEventNotification viewNotification
public GlassViewEventHandler(ViewScene scene)
private static boolean allowableFullScreenKeys(int key)
private boolean checkFullScreenKeyEvent(int type, int key, char[] chars, int modifiers)
public void handleKeyEvent(View view, long time, int type, int key, char[] chars, int modifiers)
handleKeyEvent
in class View.EventHandler
private static EventType<MouseEvent> mouseEventType(int glassType)
private static MouseButton mouseEventButton(int glassButton)
public void handleMouseEvent(View view, long time, int type, int button, int x, int y, int xAbs, int yAbs, int modifiers, boolean isPopupTrigger, boolean isSynthesized)
handleMouseEvent
in class View.EventHandler
public void handleMenuEvent(View view, int x, int y, int xAbs, int yAbs, boolean isKeyboardTrigger)
handleMenuEvent
in class View.EventHandler
public void handleScrollEvent(View view, long time, int x, int y, int xAbs, int yAbs, double deltaX, double deltaY, int modifiers, int lines, int chars, int defaultLines, int defaultChars, double xMultiplier, double yMultiplier)
View.EventHandler
handleScrollEvent
in class View.EventHandler
private static byte inputMethodEventAttrValue(int pos, int[] attrBoundary, byte[] attrValue)
private static ObservableList<InputMethodTextRun> inputMethodEventComposed(java.lang.String text, int commitCount, int[] clauseBoundary, int[] attrBoundary, byte[] attrValue)
public void handleInputMethodEvent(long time, java.lang.String text, int[] clauseBoundary, int[] attrBoundary, byte[] attrValue, int commitCount, int cursorPos)
handleInputMethodEvent
in class View.EventHandler
public double[] getInputMethodCandidatePos(int offset)
getInputMethodCandidatePos
in class View.EventHandler
private static TransferMode actionToTransferMode(int dropActions)
private static int transferModeToAction(TransferMode tm)
public int handleDragEnter(View view, int x, int y, int xAbs, int yAbs, int recommendedDropAction, ClipboardAssistance dropTargetAssistant)
handleDragEnter
in class View.EventHandler
public void handleDragLeave(View view, ClipboardAssistance dropTargetAssistant)
handleDragLeave
in class View.EventHandler
public int handleDragDrop(View view, int x, int y, int xAbs, int yAbs, int recommendedDropAction, ClipboardAssistance dropTargetAssistant)
handleDragDrop
in class View.EventHandler
public int handleDragOver(View view, int x, int y, int xAbs, int yAbs, int recommendedDropAction, ClipboardAssistance dropTargetAssistant)
handleDragOver
in class View.EventHandler
public void handleDragStart(View view, int button, int x, int y, int xAbs, int yAbs, ClipboardAssistance assistant)
handleDragStart
in class View.EventHandler
public void handleDragEnd(View view, int performedAction)
handleDragEnd
in class View.EventHandler
public void handleViewEvent(View view, long time, int type)
handleViewEvent
in class View.EventHandler
public void handleScrollGestureEvent(View view, long time, int type, int modifiers, boolean isDirect, boolean isInertia, int touchCount, int x, int y, int xAbs, int yAbs, double dx, double dy, double totaldx, double totaldy, double multiplierX, double multiplierY)
View.EventHandler
handleScrollGestureEvent
in class View.EventHandler
type
- gesture state. One of constants declared in
#com.sun.glass.events.GestureEvent class.isInertia
- if gesture is caused by inertia.touchCount
- number of touch points at
the moment of gesture execution; it is always set to
View.GESTURE_NO_VALUE constant if value of type argument is
set to com.sun.glass.events.GestureEvent.GESTURE_FINISHED
constantx
- the X coordinate of the gesture;y
- the Y coordinate of the gesture;xAbs
- absolute X coordinate of the gesture;yAbs
- absolute Y coordinate of the gesture;dx
- horizontal scroll delta. Positive if scrolling from
left to right, non-positive otherwisedy
- vertical scroll delta. Positive if scrolling from
up to down, non-positive otherwisetotaldx
- total horizontal scroll calculated from all
sequential scroll gestures, i.e. sum of all 'dx' values from
previous sequential calls to this methodtotaldy
- total vertical scroll calculated from all
sequential scroll gestures, i.e. sum of all 'dy' values from
previous sequential calls to this methodmultiplierX
- the X multipliermultiplierY
- the Y multiplier
Multiplers are used when an app receives a non-zero unit values (i.e.
either the lines or chars are not zeroes), but wants instead get delta
values in pixels. In this case the app needs to multiply the deltas
on the provided multiplier parameter.public void handleZoomGestureEvent(View view, long time, int type, int modifiers, boolean isDirect, boolean isInertia, int originx, int originy, int originxAbs, int originyAbs, double scale, double expansion, double totalscale, double totalexpansion)
View.EventHandler
handleZoomGestureEvent
in class View.EventHandler
scale
- current zoom delta; the value is multiplicative
and not additive.expansion
- current expansion delta. Measured in pixels on
direct touch input devices and normalized values on indirect
touch input devices. See #handleBeginTouchEvent for
description of units of indirect touch input devices.totalscale
- total zoom calculated from all
sequential zoom gestures, i.e. sum of all 'scale' values from
previous sequential calls to this methodtotalexpansion
- total expansion calculated from all
sequential zoom gestures, i.e. sum of all 'expansion' values
from previous sequential calls of this methodpublic void handleRotateGestureEvent(View view, long time, int type, int modifiers, boolean isDirect, boolean isInertia, int originx, int originy, int originxAbs, int originyAbs, double dangle, double totalangle)
View.EventHandler
handleRotateGestureEvent
in class View.EventHandler
dangle
- current angle delta in degrees. Positive for clockwise
rotationtotalangle
- total angle calculated from all
sequential rotation gestures, i.e. sum of all 'dangle' values
from previous sequential calls of this methodpublic void handleSwipeGestureEvent(View view, long time, int type, int modifiers, boolean isDirect, boolean isInertia, int touchCount, int dir, int x, int y, int xAbs, int yAbs)
View.EventHandler
handleSwipeGestureEvent
in class View.EventHandler
dir
- gesture direction.
One of constants defined in com.sun.glass.events.SwipeGesture
class.public void handleBeginTouchEvent(View view, long time, int modifiers, boolean isDirect, int touchEventCount)
View.EventHandler
handleBeginTouchEvent
in class View.EventHandler
isDirect
- if event reported by direct or indirect touch device;
touch screen is an example of direct touch device and
touch pad is an example of indirect onetouchEventCount
- indicates number of #handleNextTouchEvent() calls
that will follow this method call.public void handleNextTouchEvent(View view, long time, int type, long touchId, int x, int y, int xAbs, int yAbs)
View.EventHandler
handleNextTouchEvent
in class View.EventHandler
type
- touch event type. One of constants declared in
#com.sun.glass.events.TouchEvent class.touchId
- touch point identifier;
every touch point has its own unique identifier;
the identifier remains the same across multiple calls of
#handleNextTouchEvent method for the same touch point until
it is not released.x
- the X coordinate of the touch point;y
- the Y coordinate of the touch point;xAbs
- absolute X coordinate of the touch point;yAbs
- absolute Y coordinate of the touch point;View.EventHandler.handleBeginTouchEvent(com.sun.glass.ui.View, long, int, boolean, int)
public void handleEndTouchEvent(View view, long time)
View.EventHandler
handleEndTouchEvent
in class View.EventHandler
View.EventHandler.handleBeginTouchEvent(com.sun.glass.ui.View, long, int, boolean, int)
public Accessible getSceneAccessible()
getSceneAccessible
in class View.EventHandler