< prev index next >

modules/javafx.graphics/src/main/java/javafx/scene/input/DragEvent.java

Print this page




 410             return;
 411         }
 412 
 413         final Point3D newCoordinates = InputEventUtils.recomputeCoordinates(
 414                 pickResult, newSource);
 415 
 416         newEvent.x = newCoordinates.getX();
 417         newEvent.y = newCoordinates.getY();
 418         newEvent.z = newCoordinates.getZ();
 419     }
 420 
 421     @Override
 422     public DragEvent copyFor(Object newSource, EventTarget newTarget) {
 423         DragEvent e = (DragEvent) super.copyFor(newSource, newTarget);
 424         recomputeCoordinatesToSource(e, newSource);
 425         return e;
 426     }
 427 
 428     /**
 429      * Creates a copy of the given drag event with the given fields substituted.
 430      * @param source the new source of the copied event
 431      * @param target the new target of the copied event
 432      * @param eventType the new eventType
 433      * @return the event copy with the fields
 434      * @since JavaFX 8.0
 435      */
 436     public DragEvent copyFor(Object source, EventTarget target, EventType<DragEvent> type) {
 437         DragEvent e = (DragEvent) copyFor(source, target);
 438         e.eventType = type;
 439         return e;
 440     }
 441 
 442     @Override
 443     public EventType<DragEvent> getEventType() {
 444         return (EventType<DragEvent>) super.getEventType();
 445     }
 446 
 447     /**
 448      * Horizontal x position of the event relative to the
 449      * origin of the MouseEvent's node.
 450      */
 451     private transient double x;
 452 




 410             return;
 411         }
 412 
 413         final Point3D newCoordinates = InputEventUtils.recomputeCoordinates(
 414                 pickResult, newSource);
 415 
 416         newEvent.x = newCoordinates.getX();
 417         newEvent.y = newCoordinates.getY();
 418         newEvent.z = newCoordinates.getZ();
 419     }
 420 
 421     @Override
 422     public DragEvent copyFor(Object newSource, EventTarget newTarget) {
 423         DragEvent e = (DragEvent) super.copyFor(newSource, newTarget);
 424         recomputeCoordinatesToSource(e, newSource);
 425         return e;
 426     }
 427 
 428     /**
 429      * Creates a copy of the given drag event with the given fields substituted.
 430      * @param source source of the copied event
 431      * @param target target of the copied event
 432      * @param type type of event
 433      * @return the event copy with the fields
 434      * @since JavaFX 8.0
 435      */
 436     public DragEvent copyFor(Object source, EventTarget target, EventType<DragEvent> type) {
 437         DragEvent e = (DragEvent) copyFor(source, target);
 438         e.eventType = type;
 439         return e;
 440     }
 441 
 442     @Override
 443     public EventType<DragEvent> getEventType() {
 444         return (EventType<DragEvent>) super.getEventType();
 445     }
 446 
 447     /**
 448      * Horizontal x position of the event relative to the
 449      * origin of the MouseEvent's node.
 450      */
 451     private transient double x;
 452 


< prev index next >