public class GraphicsNodeMouseEvent extends GraphicsNodeInputEvent
Modifier and Type | Field and Description |
---|---|
(package private) int |
button
The mouse button that changed state.
|
(package private) int |
clickCount
Indicates the number of quick consecutive clicks of a mouse button.
|
(package private) int |
clientX |
(package private) int |
clientY |
static int |
MOUSE_CLICKED
The id for the "mouseClicked" event.
|
static int |
MOUSE_DRAGGED
The id for the "mouseDragged" event.
|
static int |
MOUSE_ENTERED
The id for the "mouseEntered" event.
|
static int |
MOUSE_EXITED
The id for the "mouseExited" event.
|
(package private) static int |
MOUSE_FIRST
The first number in the range of ids used for mouse events.
|
static int |
MOUSE_MOVED
The id for the "mouseMoved" event.
|
static int |
MOUSE_PRESSED
The id for the "mousePressed" event.
|
static int |
MOUSE_RELEASED
The id for the "mouseReleased" event.
|
(package private) GraphicsNode |
relatedNode
Additional information.
|
(package private) int |
screenX |
(package private) int |
screenY |
(package private) float |
x
The graphics node mouse events x coordinate.
|
(package private) float |
y
The graphics node mouse events y coordinate.
|
ALT_GRAPH_MASK, ALT_MASK, BUTTON1_MASK, BUTTON2_MASK, BUTTON3_MASK, CAPS_LOCK_MASK, CTRL_MASK, KANA_LOCK_MASK, lockState, META_MASK, modifiers, NUM_LOCK_MASK, SCROLL_LOCK_MASK, SHIFT_MASK, when
id
Constructor and Description |
---|
GraphicsNodeMouseEvent(GraphicsNode source,
int id,
long when,
int modifiers,
int lockState,
int button,
float x,
float y,
int clientX,
int clientY,
int screenX,
int screenY,
int clickCount,
GraphicsNode relatedNode)
Constructs a new graphics node mouse event.
|
GraphicsNodeMouseEvent(GraphicsNode source,
java.awt.event.MouseEvent evt,
int button,
int lockState)
Constructs a new graphics node mouse event from an AWT MouseEvent.
|
Modifier and Type | Method and Description |
---|---|
int |
getButton()
Returns the mouse button that changed state.
|
int |
getClickCount()
Returns the number of mouse clicks associated with this event.
|
java.awt.Point |
getClientPoint()
Returns the (x, y) position of the event relative to the screen.
|
float |
getClientX()
Returns the horizontal x position of the event relative to the
source graphics node.
|
float |
getClientY()
Returns the vertical y position of the event relative to the source node.
|
java.awt.geom.Point2D |
getPoint2D()
Returns the (x, y) position of the event relative to the source node.
|
GraphicsNode |
getRelatedNode()
Returns the related node for this
GraphicsNodeMouseEvent . |
java.awt.Point |
getScreenPoint()
Returns the (x, y) position of the event relative to the screen.
|
int |
getScreenX()
Returns the horizontal x position of the event relative to the
screen.
|
int |
getScreenY()
Returns the vertical y position of the event relative to the screen.
|
float |
getX()
Returns the horizontal x position of the event relative to the
source graphics node.
|
float |
getY()
Returns the vertical y position of the event relative to the source node.
|
getLockState, getModifiers, getWhen, isAltDown, isAltGraphDown, isControlDown, isMetaDown, isShiftDown
consume, getGraphicsNode, getID, isConsumed
static final int MOUSE_FIRST
public static final int MOUSE_CLICKED
public static final int MOUSE_PRESSED
public static final int MOUSE_RELEASED
public static final int MOUSE_MOVED
public static final int MOUSE_ENTERED
public static final int MOUSE_EXITED
public static final int MOUSE_DRAGGED
float x
float y
int clientX
int clientY
int screenX
int screenY
int clickCount
int button
GraphicsNode relatedNode
public GraphicsNodeMouseEvent(GraphicsNode source, int id, long when, int modifiers, int lockState, int button, float x, float y, int clientX, int clientY, int screenX, int screenY, int clickCount, GraphicsNode relatedNode)
source
- the graphics node where the event originatedid
- the id of this eventwhen
- the time the event occurredmodifiers
- the modifier keys down when event occurredlockState
- the lock keys active when the event occurredbutton
- the mouse button that changed statex
- the mouse x coordinatey
- the mouse y coordinatescreenX
- the mouse x coordinate relative to the screenscreenY
- the mouse y coordinate relative to the screenclickCount
- the number of clicksrelatedNode
- the related nodegetRelatedNode()
public GraphicsNodeMouseEvent(GraphicsNode source, java.awt.event.MouseEvent evt, int button, int lockState)
source
- the source where the event originatedevt
- the AWT mouse event which is the source of this
GraphicsNodeEventpublic int getButton()
public float getX()
public float getY()
public float getClientX()
public float getClientY()
public int getScreenX()
public int getScreenY()
public java.awt.Point getScreenPoint()
public java.awt.Point getClientPoint()
public java.awt.geom.Point2D getPoint2D()
public int getClickCount()
public GraphicsNode getRelatedNode()
GraphicsNodeMouseEvent
.
For a MOUSE_ENTERED
event it is the previous node target,
for a MOUSE_EXITED
event it is the next node target and
for a MOUSE_DRAGGED
event it is the node under the mouse
pointer. Otherwise the value is null
.