Spec-Zone .ru
спецификации, руководства, описания, API

JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

Profile: desktop, common

Overview

The mouse (pointer's) location is available relative to several coordinate systems: x,y - relative to the origin of the MouseEvent's node, sceneX,sceneY - relative to to the origin of the Scene that contains the node, screenX,screenY - relative to origin of the screen that contains the mouse pointer, dragX, dragY - if the MouseEvent is part of a press-drag-release gesture, then relative to the location of the press event, otherwise 0.

Profile: common conditional mouse

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
public-readaltDownBoolean

Whether or not the Alt modifier is down on this event.

public-readbuttonMouseButton

Which, if any, of the mouse buttons has changed state.

public-readclickCountInteger

Number of mouse clicks associated with this event.

public-readcontrolDownBoolean

Whether or not the Control modifier is down on this event.

public-readdragAnchorXNumber

x position of the event that initiated the most recent press event if the MouseEvent is part of a press-drag-release gesture, otherwise the value is 0.

public-readdragAnchorYNumber

y position of the event that initiated the most recent press event only if the MouseEvent is part of a press-drag-release gesture, otherwise the value is 0.

public-readdragXNumber

x offset of the event relative to the most recent press event if the MouseEvent is part of a press-drag-release gesture, otherwise the value is 0.

public-readdragYNumber

y offset of the event relative to the most recent press event only if the MouseEvent is part of a press-drag-release gesture, otherwise the value is 0.

public-readmetaDownBoolean

Whether or not the Meta modifier is down on this event.

public-readmiddleButtonDownBoolean

true if middle button (button 2) is currently pressed.

true if middle button (button 2) is currently pressed. Note that this is different from the button variable in that the button variable indicates which button press was responsible for this event while this variable indicates whether the primary button is depressed.

Profile: common conditional mouse

 
public-initnodeNode

The Node on which this event has occurred.

public-readpopupTriggerBoolean

Whether or not this mouse event is the popup menu trigger event for the platform.

Whether or not this mouse event is the popup menu trigger event for the platform.

Note: Popup menus are triggered differently on different systems. Therefore, popupTrigger should be checked in both onMousePressed and mouseReleased for proper cross-platform functionality.

Profile: common conditional mouse

 
public-readprimaryButtonDownBoolean

true if primary button (button 1, usually the left) is currently pressed.

true if primary button (button 1, usually the left) is currently pressed. Note that this is different from the button variable in that the button variable indicates which button press was responsible for this event while this variable indicates whether the primary button is depressed.

Profile: common conditional mouse

 
public-readsceneXNumber

Horizontal x position of the event relative to the origin of the Scene that contains the MouseEvent's node.

Horizontal x position of the event relative to the origin of the Scene that contains the MouseEvent's node. If the node is not in a Scene, then the value is relative to the boundsInParent of the root-most parent of the MouseEvent's node.

Profile: common conditional mouse

 
public-readsceneYNumber

Vertical y position of the event relative to the origin of the Scene that contains the MouseEvent's node.

Vertical y position of the event relative to the origin of the Scene that contains the MouseEvent's node. If the node is not in a Scene, then the value is relative to the boundsInParent of the root-most parent of the MouseEvent's node.

Profile: common conditional mouse

 
public-readscreenXNumber

Absolute horizontal x position of the event.

public-readscreenYNumber

Absolute vertical y position of the event.

public-readsecondaryButtonDownBoolean

true if secondary button (button 3, usually the right) is currently pressed.

true if secondary button (button 3, usually the right) is currently pressed. Note that this is different from the button variable in that the button variable indicates which button press was responsible for this event while this variable indicates whether the primary button is depressed.

Profile: common conditional mouse

 
public-readshiftDownBoolean

Whether or not the Shift modifier is down on this event.

public-readsourceNode

Visually top-most Node in the node subtree under the mouse.

Visually top-most Node in the node subtree under the mouse. In case the node is a leaf node source is the same as the node. In case node is an instance of Parent source is the visually top-most Node in the (@node} subtree under the mouse.

 
public-readwheelRotationNumber

Number of clicks the mouse wheel was rotated.

public-readxNumber

Horizontal x position of the event relative to the origin of the MouseEvent's node.

public-readyNumber

Vertical y position of the event relative to the origin of the MouseEvent's node.

Inherited Variables

Script Function Summary

public impl_copy(node: Node, source: Node, evt: MouseEvent) : MouseEvent

Creates a copy of the given mouse event, substituting the given node for the one in the original event.

Creates a copy of the given mouse event, substituting the given node for the one in the original event. This function will also adjust the location properties (x, y, screenX, screenY, etc) such that the event is in values relative to the new node.

Parameters
node
source
evt
Returns
MouseEvent
 
public impl_copy(node: Node, source: Node, evt: MouseEvent, impl_EventID: MouseEventID) : MouseEvent
Parameters
node
source
evt
impl_EventID
Returns
MouseEvent
 
public impl_mouseEvent(_x: Number, _y: Number, _screenX: Number, _screenY: Number, _wheelRotation: Number, _button: MouseButton, _clickCount: Integer, _shiftDown: Boolean, _controlDown: Boolean, _altDown: Boolean, _metaDown: Boolean, _popupTrigger: Boolean, _primaryButtonDown: Boolean, _middleButtonDown: Boolean, _secondaryButtonDown: Boolean, _impl_EventID: MouseEventID) : MouseEvent
Parameters
_x
_y
_screenX
_screenY
_wheelRotation
_button
_clickCount
_shiftDown
_controlDown
_altDown
_metaDown
_popupTrigger
_primaryButtonDown
_middleButtonDown
_secondaryButtonDown
_impl_EventID
Returns
MouseEvent
 

Function Summary

public toString() : java.lang.String
Returns
String
 

Inherited Functions