266 return (EventType<? extends MouseEvent>) super.getEventType(); 267 } 268 269 /** 270 * Copies this event for a different source and target. 271 * In most cases you don't need to use this method, it's called 272 * automatically when you fire the event. 273 * @param newSource New event source 274 * @param newTarget New event target 275 * @return copy of this event for a different source and target 276 */ 277 @Override 278 public MouseEvent copyFor(Object newSource, EventTarget newTarget) { 279 MouseEvent e = (MouseEvent) super.copyFor(newSource, newTarget); 280 e.recomputeCoordinatesToSource(this, newSource); 281 return e; 282 } 283 284 /** 285 * Creates a copy of the given event with the given fields substituted. 286 * @param source the new source of the copied event 287 * @param target the new target of the copied event 288 * @param eventType the new eventType 289 * @return the event copy with the fields substituted 290 * @since JavaFX 8.0 291 */ 292 public MouseEvent copyFor(Object newSource, EventTarget newTarget, EventType<? extends MouseEvent> eventType) { 293 MouseEvent e = copyFor(newSource, newTarget); 294 e.eventType = eventType; 295 return e; 296 } 297 298 /** 299 * Constructs new MouseEvent event with null source and target. 300 * @param eventType The type of the event. 301 * @param x The x with respect to the scene. 302 * @param y The y with respect to the scene. 303 * @param screenX The x coordinate relative to screen. 304 * @param screenY The y coordinate relative to screen. 305 * @param button the mouse button used 306 * @param clickCount number of click counts 307 * @param shiftDown true if shift modifier was pressed. | 266 return (EventType<? extends MouseEvent>) super.getEventType(); 267 } 268 269 /** 270 * Copies this event for a different source and target. 271 * In most cases you don't need to use this method, it's called 272 * automatically when you fire the event. 273 * @param newSource New event source 274 * @param newTarget New event target 275 * @return copy of this event for a different source and target 276 */ 277 @Override 278 public MouseEvent copyFor(Object newSource, EventTarget newTarget) { 279 MouseEvent e = (MouseEvent) super.copyFor(newSource, newTarget); 280 e.recomputeCoordinatesToSource(this, newSource); 281 return e; 282 } 283 284 /** 285 * Creates a copy of the given event with the given fields substituted. 286 * @param newSource the new source of the copied event 287 * @param newTarget the new target of the copied event 288 * @param eventType the new eventType 289 * @return the event copy with the fields substituted 290 * @since JavaFX 8.0 291 */ 292 public MouseEvent copyFor(Object newSource, EventTarget newTarget, EventType<? extends MouseEvent> eventType) { 293 MouseEvent e = copyFor(newSource, newTarget); 294 e.eventType = eventType; 295 return e; 296 } 297 298 /** 299 * Constructs new MouseEvent event with null source and target. 300 * @param eventType The type of the event. 301 * @param x The x with respect to the scene. 302 * @param y The y with respect to the scene. 303 * @param screenX The x coordinate relative to screen. 304 * @param screenY The y coordinate relative to screen. 305 * @param button the mouse button used 306 * @param clickCount number of click counts 307 * @param shiftDown true if shift modifier was pressed. |