<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_191) on Wed Oct 31 14:02:13 UTC 2018 --> <title>MouseEvent (JavaFX 8)</title> <meta name="date" content="2018-10-31"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="MouseEvent (JavaFX 8)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":9,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/MouseEvent.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">JavaFX 8</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../javafx/scene/input/MouseDragEvent.html" title="class in javafx.scene.input"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javafx/scene/input/PickResult.html" title="class in javafx.scene.input"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/input/MouseEvent.html" target="_top">Frames</a></li> <li><a href="MouseEvent.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#field.summary">Field</a> | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field.detail">Field</a> | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">javafx.scene.input</div> <h2 title="Class MouseEvent" class="title">Class MouseEvent</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>java.util.EventObject</li> <li> <ul class="inheritance"> <li><a href="../../../javafx/event/Event.html" title="class in javafx.event">javafx.event.Event</a></li> <li> <ul class="inheritance"> <li><a href="../../../javafx/scene/input/InputEvent.html" title="class in javafx.scene.input">javafx.scene.input.InputEvent</a></li> <li> <ul class="inheritance"> <li>javafx.scene.input.MouseEvent</li> </ul> </li> </ul> </li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.io.Serializable, java.lang.Cloneable</dd> </dl> <dl> <dt>Direct Known Subclasses:</dt> <dd><a href="../../../javafx/scene/input/MouseDragEvent.html" title="class in javafx.scene.input">MouseDragEvent</a></dd> </dl> <hr> <br> <pre>public class <span class="typeNameLabel">MouseEvent</span> extends <a href="../../../javafx/scene/input/InputEvent.html" title="class in javafx.scene.input">InputEvent</a></pre> <div class="block">When mouse event occurs, the top-most node under cursor is picked and the event is delivered to it through capturing and bubbling phases described at <a href="../../../javafx/event/EventDispatcher.html" title="interface in javafx.event"><code>EventDispatcher</code></a>. <p> 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 <code>Scene</code> that contains the node, screenX,screenY - relative to origin of the screen that contains the mouse pointer. <h4>Dragging gestures</h4> <p> There are three types of dragging gestures. They are all initiated by a mouse press event and terminated as a result of a mouse released event, the source node decides which gesture will take place. <p> The simple press-drag-release gesture is default. It's best used to allow changing size of a shape, dragging it around and so on. Whole press-drag-release gesture is delivered to one node. When mouse button is pressed, the top-most node is picked and all subsequent mouse events are delivered to the same node until the button is released. If a mouse clicked event is generated from these events, it is still delivered to the same node. <p> During simple press-drag-release gesture, the other nodes are not involved and don't get any events. If these nodes need to be involved in the gesture, full press-drag-release gesture has to be activated. This gesture is best used for connecting nodes by "wires", dragging nodes to other nodes etc. This gesture type is more closely described at <a href="../../../javafx/scene/input/MouseDragEvent.html" title="class in javafx.scene.input"><code>MouseDragEvent</code></a> which contains the events delivered to the gesture targets. <p> The third gesture type is platform-supported drag-and-drop gesture. It serves best to transfer data and works also between (not necessarily FX) applications. This gesture type is more closely described at <a href="../../../javafx/scene/input/DragEvent.html" title="class in javafx.scene.input"><code>DragEvent</code></a>. <p> In a short summary, simple press-drag-release gesture is activated automatically when a mouse button is pressed and delivers all <code>MouseEvent</code>s to the gesture source. When you start dragging, eventually the <code>DRAG_DETECTED</code> event arrives. In its handler you can either start full press-drag-release gesture by calling <code>startFullDrag</code> method on a node or scene - the <code>MouseDragEvent</code>s start to be delivered to gesture targets, or you can start drag and drop gesture by calling <code>startDragAndDrop</code> method on a node or scene - the system switches into the drag and drop mode and <code>DragEvent</code>s start to be delivered instead of <code>MouseEvent</code>s. If you don't call any of those methods, the simple press-drag-release gesture continues. <p> Note that dragging a finger over touch screen produces mouse dragging events, but also scroll gesture events. If it means a conflict in an application (the physical dragging action is handled by two different handlers), the <code>isSynthesized()</code> method may be used to detect the problem and make the dragging handlers behave accordingly. <h4>Mouse enter/exit handling</h4> <p> When mouse enters a node, the node gets <code>MOUSE_ENTERED</code> event, when it leaves, it gets <code>MOUSE_EXITED</code> event. These events are delivered only to the entered/exited node and seemingly don't go through the capturing/bubbling phases. This is the most common use-case. <p> When the capturing or bubbling is desired, there are <code>MOUSE_ENTERED_TARGET</code>/<code>MOUSE_EXITED_TARGET</code> events. These events go through capturing/bubbling phases normally. This means that parent may receive the <code>MOUSE_ENTERED_TARGET</code> event when mouse entered either the parent itself or some of its children. To distinguish between these two cases event target can be tested on equality with the node. <p> These two types are closely connected: <code>MOUSE_ENTERED</code>/<code>MOUSE_EXITED</code> are subtypes of <code>MOUSE_ENTERED_TARGET</code>/<code>MOUSE_EXITED_TARGET</code>. During capturing phase, <code>MOUSE_ENTERED_TARGET</code> is delivered to the parents. When the event is delivered to the event target (the node that has actually been entered), its type is switched to <code>MOUSE_ENTERED</code>. Then the type is switched back to <code>MOUSE_ENTERED_TARGET</code> for the bubbling phase. It's still one event just switching types, so if it's filtered or consumed, it affects both event variants. Thanks to the subtype-relationship, a <code>MOUSE_ENTERED_TARGET</code> event handler will receive the <code>MOUSE_ENTERED</code> event on target. <h4>Notes</h4> <ul> <li>For triggering context menus see the <a href="../../../javafx/scene/input/ContextMenuEvent.html" title="class in javafx.scene.input"><code>ContextMenuEvent</code></a>.</li> </ul></div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 2.0</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../serialized-form.html#javafx.scene.input.MouseEvent">Serialized Form</a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#ANY">ANY</a></span></code> <div class="block">Common supertype for all mouse event types.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#DRAG_DETECTED">DRAG_DETECTED</a></span></code> <div class="block">This event is delivered to a node that is identified as a source of a dragging gesture.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#MOUSE_CLICKED">MOUSE_CLICKED</a></span></code> <div class="block">This event occurs when mouse button has been clicked (pressed and released on the same node).</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#MOUSE_DRAGGED">MOUSE_DRAGGED</a></span></code> <div class="block">This event occurs when mouse moves with a pressed button.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#MOUSE_ENTERED">MOUSE_ENTERED</a></span></code> <div class="block">This event occurs when mouse enters a node.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#MOUSE_ENTERED_TARGET">MOUSE_ENTERED_TARGET</a></span></code> <div class="block">This event occurs when mouse enters a node.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#MOUSE_EXITED">MOUSE_EXITED</a></span></code> <div class="block">This event occurs when mouse exits a node.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#MOUSE_EXITED_TARGET">MOUSE_EXITED_TARGET</a></span></code> <div class="block">This event occurs when mouse exits a node.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#MOUSE_MOVED">MOUSE_MOVED</a></span></code> <div class="block">This event occurs when mouse moves within a node and no buttons are pressed.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#MOUSE_PRESSED">MOUSE_PRESSED</a></span></code> <div class="block">This event occurs when mouse button is pressed.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#MOUSE_RELEASED">MOUSE_RELEASED</a></span></code> <div class="block">This event occurs when mouse button is released.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="fields.inherited.from.class.javafx.event.Event"> <!-- --> </a> <h3>Fields inherited from class javafx.event.<a href="../../../javafx/event/Event.html" title="class in javafx.event">Event</a></h3> <code><a href="../../../javafx/event/Event.html#consumed">consumed</a>, <a href="../../../javafx/event/Event.html#eventType">eventType</a>, <a href="../../../javafx/event/Event.html#NULL_SOURCE_TARGET">NULL_SOURCE_TARGET</a>, <a href="../../../javafx/event/Event.html#target">target</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="fields.inherited.from.class.java.util.EventObject"> <!-- --> </a> <h3>Fields inherited from class java.util.EventObject</h3> <code>source</code></li> </ul> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#MouseEvent-javafx.event.EventType-double-double-double-double-javafx.scene.input.MouseButton-int-boolean-boolean-boolean-boolean-boolean-boolean-boolean-boolean-boolean-boolean-javafx.scene.input.PickResult-">MouseEvent</a></span>(<a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><? extends <a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> eventType, double x, double y, double screenX, double screenY, <a href="../../../javafx/scene/input/MouseButton.html" title="enum in javafx.scene.input">MouseButton</a> button, int clickCount, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown, boolean synthesized, boolean popupTrigger, boolean stillSincePress, <a href="../../../javafx/scene/input/PickResult.html" title="class in javafx.scene.input">PickResult</a> pickResult)</code> <div class="block">Constructs new MouseEvent event with null source and target.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#MouseEvent-java.lang.Object-javafx.event.EventTarget-javafx.event.EventType-double-double-double-double-javafx.scene.input.MouseButton-int-boolean-boolean-boolean-boolean-boolean-boolean-boolean-boolean-boolean-boolean-javafx.scene.input.PickResult-">MouseEvent</a></span>(java.lang.Object source, <a href="../../../javafx/event/EventTarget.html" title="interface in javafx.event">EventTarget</a> target, <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><? extends <a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> eventType, double x, double y, double screenX, double screenY, <a href="../../../javafx/scene/input/MouseButton.html" title="enum in javafx.scene.input">MouseButton</a> button, int clickCount, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown, boolean synthesized, boolean popupTrigger, boolean stillSincePress, <a href="../../../javafx/scene/input/PickResult.html" title="class in javafx.scene.input">PickResult</a> pickResult)</code> <div class="block">Constructs new MouseEvent event.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#copyFor-java.lang.Object-javafx.event.EventTarget-">copyFor</a></span>(java.lang.Object newSource, <a href="../../../javafx/event/EventTarget.html" title="interface in javafx.event">EventTarget</a> newTarget)</code> <div class="block">Copies this event for a different source and target.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#copyFor-java.lang.Object-javafx.event.EventTarget-javafx.event.EventType-">copyFor</a></span>(java.lang.Object newSource, <a href="../../../javafx/event/EventTarget.html" title="interface in javafx.event">EventTarget</a> newTarget, <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><? extends <a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> eventType)</code> <div class="block">Creates a copy of the given event with the given fields substituted.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>static <a href="../../../javafx/scene/input/MouseDragEvent.html" title="class in javafx.scene.input">MouseDragEvent</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#copyForMouseDragEvent-javafx.scene.input.MouseEvent-java.lang.Object-javafx.event.EventTarget-javafx.event.EventType-java.lang.Object-javafx.scene.input.PickResult-">copyForMouseDragEvent</a></span>(<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a> e, java.lang.Object source, <a href="../../../javafx/event/EventTarget.html" title="interface in javafx.event">EventTarget</a> target, <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseDragEvent.html" title="class in javafx.scene.input">MouseDragEvent</a>> type, java.lang.Object gestureSource, <a href="../../../javafx/scene/input/PickResult.html" title="class in javafx.scene.input">PickResult</a> pickResult)</code> <div class="block">Creates a copy of this mouse event of MouseDragEvent type</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/scene/input/MouseButton.html" title="enum in javafx.scene.input">MouseButton</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#getButton--">getButton</a></span>()</code> <div class="block">Which, if any, of the mouse buttons is responsible for this event.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#getClickCount--">getClickCount</a></span>()</code> <div class="block">Returns number of mouse clicks associated with this event.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><? extends <a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#getEventType--">getEventType</a></span>()</code> <div class="block">Gets the event type of this event.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/scene/input/PickResult.html" title="class in javafx.scene.input">PickResult</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#getPickResult--">getPickResult</a></span>()</code> <div class="block">Returns information about the pick.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#getSceneX--">getSceneX</a></span>()</code> <div class="block">Returns horizontal position of the event relative to the origin of the <code>Scene</code> that contains the MouseEvent's source.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#getSceneY--">getSceneY</a></span>()</code> <div class="block">Returns vertical position of the event relative to the origin of the <code>Scene</code> that contains the MouseEvent's source.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#getScreenX--">getScreenX</a></span>()</code> <div class="block">Returns absolute horizontal position of the event.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#getScreenY--">getScreenY</a></span>()</code> <div class="block">Returns absolute vertical position of the event.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#getX--">getX</a></span>()</code> <div class="block">Horizontal position of the event relative to the origin of the MouseEvent's source.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#getY--">getY</a></span>()</code> <div class="block">Vertical position of the event relative to the origin of the MouseEvent's source.</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#getZ--">getZ</a></span>()</code> <div class="block">Depth position of the event relative to the origin of the MouseEvent's source.</div> </td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#isAltDown--">isAltDown</a></span>()</code> <div class="block">Whether or not the Alt modifier is down on this event.</div> </td> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#isControlDown--">isControlDown</a></span>()</code> <div class="block">Whether or not the Control modifier is down on this event.</div> </td> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#isDragDetect--">isDragDetect</a></span>()</code> <div class="block">Determines whether this event will be followed by <code>DRAG_DETECTED</code> event.</div> </td> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#isMetaDown--">isMetaDown</a></span>()</code> <div class="block">Whether or not the Meta modifier is down on this event.</div> </td> </tr> <tr id="i18" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#isMiddleButtonDown--">isMiddleButtonDown</a></span>()</code> <div class="block">Returns <code>true</code> if middle button (button 2) is currently pressed.</div> </td> </tr> <tr id="i19" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#isPopupTrigger--">isPopupTrigger</a></span>()</code> <div class="block">Returns <code>true</code> if this mouse event is the popup menu trigger event for the platform.</div> </td> </tr> <tr id="i20" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#isPrimaryButtonDown--">isPrimaryButtonDown</a></span>()</code> <div class="block">Returns <code>true</code> if primary button (button 1, usually the left) is currently pressed.</div> </td> </tr> <tr id="i21" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#isSecondaryButtonDown--">isSecondaryButtonDown</a></span>()</code> <div class="block">Returns <code>true</code> if secondary button (button 1, usually the right) is currently pressed.</div> </td> </tr> <tr id="i22" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#isShiftDown--">isShiftDown</a></span>()</code> <div class="block">Whether or not the Shift modifier is down on this event.</div> </td> </tr> <tr id="i23" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#isShortcutDown--">isShortcutDown</a></span>()</code> <div class="block">Returns whether or not the host platform common shortcut modifier is down on this event.</div> </td> </tr> <tr id="i24" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#isStillSincePress--">isStillSincePress</a></span>()</code> <div class="block">Indicates whether the mouse cursor stayed in the system-provided hysteresis area since last pressed event that occurred before this event.</div> </td> </tr> <tr id="i25" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#isSynthesized--">isSynthesized</a></span>()</code> <div class="block">Indicates whether this event is synthesized from using a touch screen instead of usual mouse event source devices like mouse or track pad.</div> </td> </tr> <tr id="i26" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#setDragDetect-boolean-">setDragDetect</a></span>(boolean dragDetect)</code> <div class="block">Augments drag detection behavior.</div> </td> </tr> <tr id="i27" class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/input/MouseEvent.html#toString--">toString</a></span>()</code> <div class="block">Returns a string representation of this <code>MouseEvent</code> object.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.javafx.event.Event"> <!-- --> </a> <h3>Methods inherited from class javafx.event.<a href="../../../javafx/event/Event.html" title="class in javafx.event">Event</a></h3> <code><a href="../../../javafx/event/Event.html#clone--">clone</a>, <a href="../../../javafx/event/Event.html#consume--">consume</a>, <a href="../../../javafx/event/Event.html#fireEvent-javafx.event.EventTarget-javafx.event.Event-">fireEvent</a>, <a href="../../../javafx/event/Event.html#getTarget--">getTarget</a>, <a href="../../../javafx/event/Event.html#isConsumed--">isConsumed</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.util.EventObject"> <!-- --> </a> <h3>Methods inherited from class java.util.EventObject</h3> <code>getSource</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.Object</h3> <code>equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field.detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="ANY"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ANY</h4> <pre>public static final <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> ANY</pre> <div class="block">Common supertype for all mouse event types.</div> </li> </ul> <a name="MOUSE_PRESSED"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MOUSE_PRESSED</h4> <pre>public static final <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> MOUSE_PRESSED</pre> <div class="block">This event occurs when mouse button is pressed. This activates a press-drag-release gesture, so all subsequent mouse events until the button is released are delivered to the same node.</div> </li> </ul> <a name="MOUSE_RELEASED"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MOUSE_RELEASED</h4> <pre>public static final <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> MOUSE_RELEASED</pre> <div class="block">This event occurs when mouse button is released. It is delivered to the same node where the button has been pressed which activated a press-drag-release gesture.</div> </li> </ul> <a name="MOUSE_CLICKED"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MOUSE_CLICKED</h4> <pre>public static final <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> MOUSE_CLICKED</pre> <div class="block">This event occurs when mouse button has been clicked (pressed and released on the same node). This event provides a button-like behavior to any node. Note that even long drags can generate click event (it is delivered to the top-most node on which the mouse was both pressed and released).</div> </li> </ul> <a name="MOUSE_ENTERED_TARGET"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MOUSE_ENTERED_TARGET</h4> <pre>public static final <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> MOUSE_ENTERED_TARGET</pre> <div class="block">This event occurs when mouse enters a node. It's the bubbling variant, which is delivered also to all parents of the entered node (unless it was consumed). When notifications about mouse entering some of node's children are not desired, <code>MOUSE_ENTERED</code> event handler should be used.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input"><code>MouseEvent for more information about mouse entered/exited handling</code></a></dd> </dl> </li> </ul> <a name="MOUSE_ENTERED"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MOUSE_ENTERED</h4> <pre>public static final <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> MOUSE_ENTERED</pre> <div class="block">This event occurs when mouse enters a node. This event type is delivered only to the entered node, if parents want to filter it or get the bubbling event, they need to use <code>MOUSE_ENTERED_TARGET</code>.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input"><code>MouseEvent for more information about mouse entered/exited handling</code></a></dd> </dl> </li> </ul> <a name="MOUSE_EXITED_TARGET"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MOUSE_EXITED_TARGET</h4> <pre>public static final <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> MOUSE_EXITED_TARGET</pre> <div class="block">This event occurs when mouse exits a node. It's the bubbling variant, which is delivered also to all parents of the exited node (unless it was consumed). When notifications about mouse exiting some of node's children are not desired, <code>MOUSE_EXITED</code> event handler should be used.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input"><code>MouseEvent for more information about mouse entered/exited handling</code></a></dd> </dl> </li> </ul> <a name="MOUSE_EXITED"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MOUSE_EXITED</h4> <pre>public static final <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> MOUSE_EXITED</pre> <div class="block">This event occurs when mouse exits a node. This event type is delivered only to the exited node, if parents want to filter it or get the bubbling event, they need to use <code>MOUSE_EXITED_TARGET</code>.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input"><code>MouseEvent for more information about mouse entered/exited handling</code></a></dd> </dl> </li> </ul> <a name="MOUSE_MOVED"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MOUSE_MOVED</h4> <pre>public static final <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> MOUSE_MOVED</pre> <div class="block">This event occurs when mouse moves within a node and no buttons are pressed. If any mouse button is pressed, MOUSE_DRAGGED event occurs instead.</div> </li> </ul> <a name="MOUSE_DRAGGED"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MOUSE_DRAGGED</h4> <pre>public static final <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> MOUSE_DRAGGED</pre> <div class="block">This event occurs when mouse moves with a pressed button. It is delivered to the same node where the button has been pressed which activated a press-drag-release gesture. It is delivered regardless of the mouse being within bounds of the node.</div> </li> </ul> <a name="DRAG_DETECTED"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>DRAG_DETECTED</h4> <pre>public static final <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> DRAG_DETECTED</pre> <div class="block">This event is delivered to a node that is identified as a source of a dragging gesture. Handler of this event is the only place where full press-drag-release gesture or a drag and drop gesture can be started (by calling <a href="../../../javafx/scene/Node.html#startFullDrag--"><code>startFullDrag()</code></a> of <a href="../../../javafx/scene/Node.html#startDragAndDrop-javafx.scene.input.TransferMode...-"><code>startDragAndDrop()</code></a> method). If none of them is called, simple press-drag-release gesture will continue. <p> Note that his event is generated based on dragging the mouse over a platform-specific distance threshold. You can modify this behavior by calling <code>setDragDetect</code> method on any MOUSE_PRESSED or MOUSE_DRAGGED event.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input"><code>MouseEvent for more details about simple press-drag-release gestures</code></a>, <a href="../../../javafx/scene/input/MouseDragEvent.html" title="class in javafx.scene.input"><code>MouseDragEvent for more details about full press-drag-release gestures</code></a>, <a href="../../../javafx/scene/input/DragEvent.html" title="class in javafx.scene.input"><code>DragEvent for more details about drag and drop gestures</code></a></dd> </dl> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="MouseEvent-javafx.event.EventType-double-double-double-double-javafx.scene.input.MouseButton-int-boolean-boolean-boolean-boolean-boolean-boolean-boolean-boolean-boolean-boolean-javafx.scene.input.PickResult-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MouseEvent</h4> <pre>public MouseEvent(<a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><? extends <a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> eventType, double x, double y, double screenX, double screenY, <a href="../../../javafx/scene/input/MouseButton.html" title="enum in javafx.scene.input">MouseButton</a> button, int clickCount, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown, boolean synthesized, boolean popupTrigger, boolean stillSincePress, <a href="../../../javafx/scene/input/PickResult.html" title="class in javafx.scene.input">PickResult</a> pickResult)</pre> <div class="block">Constructs new MouseEvent event with null source and target.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>eventType</code> - The type of the event.</dd> <dd><code>x</code> - The x with respect to the scene.</dd> <dd><code>y</code> - The y with respect to the scene.</dd> <dd><code>screenX</code> - The x coordinate relative to screen.</dd> <dd><code>screenY</code> - The y coordinate relative to screen.</dd> <dd><code>button</code> - the mouse button used</dd> <dd><code>clickCount</code> - number of click counts</dd> <dd><code>shiftDown</code> - true if shift modifier was pressed.</dd> <dd><code>controlDown</code> - true if control modifier was pressed.</dd> <dd><code>altDown</code> - true if alt modifier was pressed.</dd> <dd><code>metaDown</code> - true if meta modifier was pressed.</dd> <dd><code>primaryButtonDown</code> - true if primary button was pressed.</dd> <dd><code>middleButtonDown</code> - true if middle button was pressed.</dd> <dd><code>secondaryButtonDown</code> - true if secondary button was pressed.</dd> <dd><code>synthesized</code> - if this event was synthesized</dd> <dd><code>popupTrigger</code> - whether this event denotes a popup trigger for current platform</dd> <dd><code>stillSincePress</code> - see <a href="../../../javafx/scene/input/MouseEvent.html#isStillSincePress--"><code>isStillSincePress()</code></a></dd> <dd><code>pickResult</code> - pick result. Can be null, in this case a 2D pick result without any further values is constructed based on the scene coordinates</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 8.0</dd> </dl> </li> </ul> <a name="MouseEvent-java.lang.Object-javafx.event.EventTarget-javafx.event.EventType-double-double-double-double-javafx.scene.input.MouseButton-int-boolean-boolean-boolean-boolean-boolean-boolean-boolean-boolean-boolean-boolean-javafx.scene.input.PickResult-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>MouseEvent</h4> <pre>public MouseEvent(java.lang.Object source, <a href="../../../javafx/event/EventTarget.html" title="interface in javafx.event">EventTarget</a> target, <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><? extends <a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> eventType, double x, double y, double screenX, double screenY, <a href="../../../javafx/scene/input/MouseButton.html" title="enum in javafx.scene.input">MouseButton</a> button, int clickCount, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown, boolean synthesized, boolean popupTrigger, boolean stillSincePress, <a href="../../../javafx/scene/input/PickResult.html" title="class in javafx.scene.input">PickResult</a> pickResult)</pre> <div class="block">Constructs new MouseEvent event.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>source</code> - the source of the event. Can be null.</dd> <dd><code>target</code> - the target of the event. Can be null.</dd> <dd><code>eventType</code> - The type of the event.</dd> <dd><code>x</code> - The x with respect to the source. Should be in scene coordinates if source == null or source is not a Node.</dd> <dd><code>y</code> - The y with respect to the source. Should be in scene coordinates if source == null or source is not a Node.</dd> <dd><code>screenX</code> - The x coordinate relative to screen.</dd> <dd><code>screenY</code> - The y coordinate relative to screen.</dd> <dd><code>button</code> - the mouse button used</dd> <dd><code>clickCount</code> - number of click counts</dd> <dd><code>shiftDown</code> - true if shift modifier was pressed.</dd> <dd><code>controlDown</code> - true if control modifier was pressed.</dd> <dd><code>altDown</code> - true if alt modifier was pressed.</dd> <dd><code>metaDown</code> - true if meta modifier was pressed.</dd> <dd><code>primaryButtonDown</code> - true if primary button was pressed.</dd> <dd><code>middleButtonDown</code> - true if middle button was pressed.</dd> <dd><code>secondaryButtonDown</code> - true if secondary button was pressed.</dd> <dd><code>synthesized</code> - if this event was synthesized</dd> <dd><code>popupTrigger</code> - whether this event denotes a popup trigger for current platform</dd> <dd><code>stillSincePress</code> - see <a href="../../../javafx/scene/input/MouseEvent.html#isStillSincePress--"><code>isStillSincePress()</code></a></dd> <dd><code>pickResult</code> - pick result. Can be null, in this case a 2D pick result without any further values is constructed based on the scene coordinates and target</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 8.0</dd> </dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getEventType--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getEventType</h4> <pre>public <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><? extends <a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> getEventType()</pre> <div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../javafx/event/Event.html#getEventType--">Event</a></code></span></div> <div class="block">Gets the event type of this event. Objects of the same <code>Event</code> class can have different event types. These event types further specify what kind of event occurred.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code><a href="../../../javafx/scene/input/InputEvent.html#getEventType--">getEventType</a></code> in class <code><a href="../../../javafx/scene/input/InputEvent.html" title="class in javafx.scene.input">InputEvent</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the event type</dd> </dl> </li> </ul> <a name="copyFor-java.lang.Object-javafx.event.EventTarget-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>copyFor</h4> <pre>public <a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a> copyFor(java.lang.Object newSource, <a href="../../../javafx/event/EventTarget.html" title="interface in javafx.event">EventTarget</a> newTarget)</pre> <div class="block">Copies this event for a different source and target. In most cases you don't need to use this method, it's called automatically when you fire the event.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code><a href="../../../javafx/event/Event.html#copyFor-java.lang.Object-javafx.event.EventTarget-">copyFor</a></code> in class <code><a href="../../../javafx/event/Event.html" title="class in javafx.event">Event</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>newSource</code> - New event source</dd> <dd><code>newTarget</code> - New event target</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>copy of this event for a different source and target</dd> </dl> </li> </ul> <a name="copyFor-java.lang.Object-javafx.event.EventTarget-javafx.event.EventType-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>copyFor</h4> <pre>public <a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a> copyFor(java.lang.Object newSource, <a href="../../../javafx/event/EventTarget.html" title="interface in javafx.event">EventTarget</a> newTarget, <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><? extends <a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a>> eventType)</pre> <div class="block">Creates a copy of the given event with the given fields substituted.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>source</code> - the new source of the copied event</dd> <dd><code>target</code> - the new target of the copied event</dd> <dd><code>eventType</code> - the new eventType</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the event copy with the fields substituted</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 8.0</dd> </dl> </li> </ul> <a name="copyForMouseDragEvent-javafx.scene.input.MouseEvent-java.lang.Object-javafx.event.EventTarget-javafx.event.EventType-java.lang.Object-javafx.scene.input.PickResult-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>copyForMouseDragEvent</h4> <pre>public static <a href="../../../javafx/scene/input/MouseDragEvent.html" title="class in javafx.scene.input">MouseDragEvent</a> copyForMouseDragEvent(<a href="../../../javafx/scene/input/MouseEvent.html" title="class in javafx.scene.input">MouseEvent</a> e, java.lang.Object source, <a href="../../../javafx/event/EventTarget.html" title="interface in javafx.event">EventTarget</a> target, <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/input/MouseDragEvent.html" title="class in javafx.scene.input">MouseDragEvent</a>> type, java.lang.Object gestureSource, <a href="../../../javafx/scene/input/PickResult.html" title="class in javafx.scene.input">PickResult</a> pickResult)</pre> <div class="block">Creates a copy of this mouse event of MouseDragEvent type</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>e</code> - the mouse event to copy</dd> <dd><code>source</code> - the new source of the copied event</dd> <dd><code>target</code> - the new target of the copied event</dd> <dd><code>type</code> - the new MouseDragEvent type</dd> <dd><code>gestureSource</code> - the new source of the gesture</dd> <dd><code>pickResult</code> - pick result. Can be null, in this case a 2D pick result without any further values is constructed based on the scene coordinates</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>new MouseDragEvent that was created from MouseEvent</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 8.0</dd> </dl> </li> </ul> <a name="isDragDetect--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isDragDetect</h4> <pre>public boolean isDragDetect()</pre> <div class="block">Determines whether this event will be followed by <code>DRAG_DETECTED</code> event. It has effect only with <code>MOUSE_PRESSED</code> and <code>MOUSE_DRAGGED</code> events.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if the <code>DRAG_DETECTED</code> event will follow</dd> </dl> </li> </ul> <a name="setDragDetect-boolean-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setDragDetect</h4> <pre>public void setDragDetect(boolean dragDetect)</pre> <div class="block">Augments drag detection behavior. The value says whether this event will be followed by <code>DRAG_DETECTED</code> event. It has effect only with <code>MOUSE_PRESSED</code> and <code>MOUSE_DRAGGED</code> events.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>dragDetect</code> - Whether <code>DRAG_DETECTED</code> event will follow</dd> </dl> </li> </ul> <a name="getX--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getX</h4> <pre>public final double getX()</pre> <div class="block">Horizontal position of the event relative to the origin of the MouseEvent's source.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>horizontal position of the event relative to the origin of the MouseEvent's source.</dd> </dl> </li> </ul> <a name="getY--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getY</h4> <pre>public final double getY()</pre> <div class="block">Vertical position of the event relative to the origin of the MouseEvent's source.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>vertical position of the event relative to the origin of the MouseEvent's source.</dd> </dl> </li> </ul> <a name="getZ--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getZ</h4> <pre>public final double getZ()</pre> <div class="block">Depth position of the event relative to the origin of the MouseEvent's source.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>depth position of the event relative to the origin of the MouseEvent's source.</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 8.0</dd> </dl> </li> </ul> <a name="getScreenX--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getScreenX</h4> <pre>public final double getScreenX()</pre> <div class="block">Returns absolute horizontal position of the event.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>absolute horizontal position of the event</dd> </dl> </li> </ul> <a name="getScreenY--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getScreenY</h4> <pre>public final double getScreenY()</pre> <div class="block">Returns absolute vertical position of the event.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>absolute vertical position of the event</dd> </dl> </li> </ul> <a name="getSceneX--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getSceneX</h4> <pre>public final double getSceneX()</pre> <div class="block">Returns horizontal position of the event relative to the origin of the <code>Scene</code> that contains the MouseEvent's source. If the node is not in a <code>Scene</code>, then the value is relative to the boundsInParent of the root-most parent of the MouseEvent's node. Note that in 3D scene, this represents the flat coordinates after applying the projection transformations.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>horizontal position of the event relative to the origin of the <code>Scene</code> that contains the MouseEvent's source</dd> </dl> </li> </ul> <a name="getSceneY--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getSceneY</h4> <pre>public final double getSceneY()</pre> <div class="block">Returns vertical position of the event relative to the origin of the <code>Scene</code> that contains the MouseEvent's source. If the node is not in a <code>Scene</code>, then the value is relative to the boundsInParent of the root-most parent of the MouseEvent's node. Note that in 3D scene, this represents the flat coordinates after applying the projection transformations.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>vertical position of the event relative to the origin of the <code>Scene</code> that contains the MouseEvent's source</dd> </dl> </li> </ul> <a name="getButton--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getButton</h4> <pre>public final <a href="../../../javafx/scene/input/MouseButton.html" title="enum in javafx.scene.input">MouseButton</a> getButton()</pre> <div class="block">Which, if any, of the mouse buttons is responsible for this event.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>mouse button whose state change caused this event</dd> </dl> </li> </ul> <a name="getClickCount--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getClickCount</h4> <pre>public final int getClickCount()</pre> <div class="block">Returns number of mouse clicks associated with this event. All MOUSE_MOVED events have the clickCount value equal to 0. The value is increased with MOUSE_PRESSED event and stays like that for all subsequent events till MOUSE_RELEASED, including the afterwards generated MOUSE_CLICKED event. The value is increased to numbers higher than one if all the events between two subsequent presses happen on a small region and in a small time (according to native operating system configuration).</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>number of mouse clicks associated with this event</dd> </dl> </li> </ul> <a name="isStillSincePress--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isStillSincePress</h4> <pre>public final boolean isStillSincePress()</pre> <div class="block">Indicates whether the mouse cursor stayed in the system-provided hysteresis area since last pressed event that occurred before this event. <p> Click event is generated for a node if mouse was both pressed and released over the node, regardless of mouse movements between the press and release. If a node wants to react differently on a simple click and on a mouse drag, it should use a system-supplied short distance threshold to decide between click and drag (users often perform inadvertent tiny movements during a click). It can be easily achieved by ignoring all drags with this method returning <code>true</code> and ignoring all clicks with this method returning <code>false</code>.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if there were no significant mouse movements (out of system hysteresis area) since the last pressed event that occurred before this event.</dd> </dl> </li> </ul> <a name="isShiftDown--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isShiftDown</h4> <pre>public final boolean isShiftDown()</pre> <div class="block">Whether or not the Shift modifier is down on this event.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if the Shift modifier is down on this event</dd> </dl> </li> </ul> <a name="isControlDown--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isControlDown</h4> <pre>public final boolean isControlDown()</pre> <div class="block">Whether or not the Control modifier is down on this event.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if the Control modifier is down on this event</dd> </dl> </li> </ul> <a name="isAltDown--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isAltDown</h4> <pre>public final boolean isAltDown()</pre> <div class="block">Whether or not the Alt modifier is down on this event.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if the Alt modifier is down on this event</dd> </dl> </li> </ul> <a name="isMetaDown--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isMetaDown</h4> <pre>public final boolean isMetaDown()</pre> <div class="block">Whether or not the Meta modifier is down on this event.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if the Meta modifier is down on this event</dd> </dl> </li> </ul> <a name="isSynthesized--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isSynthesized</h4> <pre>public boolean isSynthesized()</pre> <div class="block">Indicates whether this event is synthesized from using a touch screen instead of usual mouse event source devices like mouse or track pad. When a finger is dragged over a touch screen, both scrolling gesture and mouse dragging are produced. If it causes a conflict in an application, this flag can be used to tell apart the usual mouse dragging from the touch screen dragging already handled as scroll events.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if this event is synthesized from using a touch screen</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 2.2</dd> </dl> </li> </ul> <a name="isShortcutDown--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isShortcutDown</h4> <pre>public final boolean isShortcutDown()</pre> <div class="block">Returns whether or not the host platform common shortcut modifier is down on this event. This common shortcut modifier is a modifier key which is used commonly in shortcuts on the host platform. It is for example <code>control</code> on Windows and <code>meta</code> (command key) on Mac.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd><code>true</code> if the shortcut modifier is down, <code>false</code> otherwise</dd> </dl> </li> </ul> <a name="isPopupTrigger--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isPopupTrigger</h4> <pre>public final boolean isPopupTrigger()</pre> <div class="block">Returns <code>true</code> if this mouse event is the popup menu trigger event for the platform. <p><b>Note</b>: Popup menus are triggered differently on different systems. Therefore, <code>popupTrigger</code> should be checked in both <code>onMousePressed</code> and <code>mouseReleased</code> for proper cross-platform functionality.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd><code>true</code> if this mouse event is the popup menu trigger event for the platform</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 8.0</dd> </dl> </li> </ul> <a name="isPrimaryButtonDown--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isPrimaryButtonDown</h4> <pre>public final boolean isPrimaryButtonDown()</pre> <div class="block">Returns <code>true</code> if primary button (button 1, usually the left) is currently pressed. Note that this is different from the <code>getButton()</code> method that indicates which button press was responsible for this event while this method indicates whether the primary button is depressed.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd><code>true</code> if primary button (button 1, usually the left) is currently pressed</dd> </dl> </li> </ul> <a name="isSecondaryButtonDown--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isSecondaryButtonDown</h4> <pre>public final boolean isSecondaryButtonDown()</pre> <div class="block">Returns <code>true</code> if secondary button (button 1, usually the right) is currently pressed. Note that this is different from the <code>getButton()</code> method that indicates which button press was responsible for this event while this method indicates whether the secondary button is depressed.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd><code>true</code> if secondary button (button 3, usually the right) is currently pressed</dd> </dl> </li> </ul> <a name="isMiddleButtonDown--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isMiddleButtonDown</h4> <pre>public final boolean isMiddleButtonDown()</pre> <div class="block">Returns <code>true</code> if middle button (button 2) is currently pressed. Note that this is different from the <code>getButton()</code> method that indicates which button press was responsible for this event while this method indicates whether the middle button is depressed.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd><code>true</code> if middle button (button 2) is currently pressed</dd> </dl> </li> </ul> <a name="toString--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>toString</h4> <pre>public java.lang.String toString()</pre> <div class="block">Returns a string representation of this <code>MouseEvent</code> object.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code>toString</code> in class <code>java.util.EventObject</code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a string representation of this <code>MouseEvent</code> object.</dd> </dl> </li> </ul> <a name="getPickResult--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getPickResult</h4> <pre>public final <a href="../../../javafx/scene/input/PickResult.html" title="class in javafx.scene.input">PickResult</a> getPickResult()</pre> <div class="block">Returns information about the pick.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>new PickResult object that contains information about the pick</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 8.0</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/MouseEvent.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">JavaFX 8</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../javafx/scene/input/MouseDragEvent.html" title="class in javafx.scene.input"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javafx/scene/input/PickResult.html" title="class in javafx.scene.input"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/input/MouseEvent.html" target="_top">Frames</a></li> <li><a href="MouseEvent.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#field.summary">Field</a> | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field.detail">Field</a> | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><font size="-1"><a href="http://bugreport.java.com/bugreport/" target="_blank">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="https://docs.oracle.com/javase/8/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> <a href="https://docs.oracle.com/javase/8/docs/legal/cpyr.html" target="_blank">Copyright</a> © 2008, 2018, Oracle and/or its affiliates. All rights reserved. Use is subject to <a href="http://download.oracle.com/otndocs/jcp/java_se-8-mrel-spec/license.html" target="_blank">license terms</a>. Also see the <a target="_blank" href="http://www.oracle.com/technetwork/java/redist-137594.html" target="_blank">documentation redistribution policy</a>.</font></small></p> </body> </html>