protected static class BridgeEventSupport.Listener extends java.lang.Object implements GraphicsNodeMouseListener, GraphicsNodeKeyListener
Modifier and Type | Field and Description |
---|---|
protected BridgeContext |
context |
protected boolean |
isDown |
protected Element |
lastTargetElement |
protected UserAgent |
ua |
Constructor and Description |
---|
Listener(BridgeContext ctx,
UserAgent u) |
Modifier and Type | Method and Description |
---|---|
protected void |
dispatchKeyEvent(java.lang.String eventType,
GraphicsNodeKeyEvent evt)
Dispatch a DOM 2 Draft Key event.
|
protected void |
dispatchMouseEvent(java.lang.String eventType,
Element targetElement,
Element relatedElement,
java.awt.Point clientXY,
GraphicsNodeMouseEvent evt,
boolean cancelable)
Dispatches a DOM MouseEvent according to the specified
parameters.
|
protected void |
dispatchMouseEvent(java.lang.String eventType,
GraphicsNodeMouseEvent evt,
boolean cancelable)
Dispatches a DOM MouseEvent according to the specified
parameters.
|
protected Element |
getEventTarget(GraphicsNode node,
java.awt.geom.Point2D pt)
Returns the element that is the target of the specified
event or null if any.
|
protected Element |
getRelatedElement(GraphicsNodeMouseEvent evt)
Returns the related element according to the specified event.
|
void |
keyPressed(GraphicsNodeKeyEvent evt)
Invoked when a key has been pressed.
|
void |
keyReleased(GraphicsNodeKeyEvent evt)
Invoked when a key has been released.
|
void |
keyTyped(GraphicsNodeKeyEvent evt)
Invoked when a key has been typed.
|
protected int |
mapKeyCode(int keyCode)
The java KeyEvent keyCodes and the DOMKeyEvent keyCodes
map except for the VK_ENTER code (which has a different value
in DOM and the VK_KANA_LOCK and VK_INPUT_METHOD_ON_OFF which
have no DOM equivalent.
|
void |
mouseClicked(GraphicsNodeMouseEvent evt)
Invoked when the mouse has been clicked on a graphics node.
|
void |
mouseDragged(GraphicsNodeMouseEvent evt)
Invoked when a mouse button is pressed on a graphics node and then
dragged.
|
void |
mouseEntered(GraphicsNodeMouseEvent evt)
Invoked when the mouse enters a graphics node.
|
void |
mouseExited(GraphicsNodeMouseEvent evt)
Invoked when the mouse exits a graphics node.
|
void |
mouseMoved(GraphicsNodeMouseEvent evt)
Invoked when the mouse button has been moved on a node.
|
void |
mousePressed(GraphicsNodeMouseEvent evt)
Invoked when a mouse button has been pressed on a graphics node.
|
void |
mouseReleased(GraphicsNodeMouseEvent evt)
Invoked when a mouse button has been released on a graphics node.
|
protected BridgeContext context
protected UserAgent ua
protected Element lastTargetElement
protected boolean isDown
public Listener(BridgeContext ctx, UserAgent u)
public void keyPressed(GraphicsNodeKeyEvent evt)
keyPressed
in interface GraphicsNodeKeyListener
evt
- the graphics node key eventpublic void keyReleased(GraphicsNodeKeyEvent evt)
keyReleased
in interface GraphicsNodeKeyListener
evt
- the graphics node key eventpublic void keyTyped(GraphicsNodeKeyEvent evt)
keyTyped
in interface GraphicsNodeKeyListener
evt
- the graphics node key eventprotected void dispatchKeyEvent(java.lang.String eventType, GraphicsNodeKeyEvent evt)
protected final int mapKeyCode(int keyCode)
public void mouseClicked(GraphicsNodeMouseEvent evt)
GraphicsNodeMouseListener
mouseClicked
in interface GraphicsNodeMouseListener
evt
- the graphics node mouse eventpublic void mousePressed(GraphicsNodeMouseEvent evt)
GraphicsNodeMouseListener
mousePressed
in interface GraphicsNodeMouseListener
evt
- the graphics node mouse eventpublic void mouseReleased(GraphicsNodeMouseEvent evt)
GraphicsNodeMouseListener
mouseReleased
in interface GraphicsNodeMouseListener
evt
- the graphics node mouse eventpublic void mouseEntered(GraphicsNodeMouseEvent evt)
GraphicsNodeMouseListener
mouseEntered
in interface GraphicsNodeMouseListener
evt
- the graphics node mouse eventpublic void mouseExited(GraphicsNodeMouseEvent evt)
GraphicsNodeMouseListener
mouseExited
in interface GraphicsNodeMouseListener
evt
- the graphics node mouse eventpublic void mouseDragged(GraphicsNodeMouseEvent evt)
GraphicsNodeMouseListener
mouseDragged
in interface GraphicsNodeMouseListener
evt
- the graphics node mouse eventpublic void mouseMoved(GraphicsNodeMouseEvent evt)
GraphicsNodeMouseListener
mouseMoved
in interface GraphicsNodeMouseListener
evt
- the graphics node mouse eventprotected void dispatchMouseEvent(java.lang.String eventType, GraphicsNodeMouseEvent evt, boolean cancelable)
eventType
- the event typeevt
- the GVT GraphicsNodeMouseEventcancelable
- true means the event is cancelableprotected void dispatchMouseEvent(java.lang.String eventType, Element targetElement, Element relatedElement, java.awt.Point clientXY, GraphicsNodeMouseEvent evt, boolean cancelable)
eventType
- the event typetargetElement
- the target of the eventrelatedElement
- the related target if anyclientXY
- the mouse coordinates in the client spaceevt
- the GVT GraphicsNodeMouseEventcancelable
- true means the event is cancelableprotected Element getRelatedElement(GraphicsNodeMouseEvent evt)
evt
- the GVT GraphicsNodeMouseEventprotected Element getEventTarget(GraphicsNode node, java.awt.geom.Point2D pt)
node
- the graphics node that received the eventpt
- the mouse coordinates in the GVT tree spaceCopyright © 2022 Apache Software Foundation. All Rights Reserved.