List of usage examples for javafx.scene.input MouseEvent isStillSincePress
public final boolean isStillSincePress()
From source file:org.samcrow.frameviewer.trajectory.ui.FrameController.java
/** * Called when a mouse event is received. Subclasses should override * this method. The default implementation does nothing. * <p>/*from www . j ava 2s . c o m*/ * @param event The mouse event * @param framePosition The position of the event in frame coordinates */ public void handleMouseEvent(MouseEvent event, Point2D framePosition) { final EventType<? extends Event> type = event.getEventType(); if (type == MouseEvent.MOUSE_PRESSED) { handleMousePressed(event, framePosition); } else if (type == MouseEvent.MOUSE_RELEASED) { handleMouseReleased(event, framePosition); } else if (type == MouseEvent.MOUSE_CLICKED && event.isStillSincePress()) { handleMouseClicked(event, framePosition); } else if (type == MouseEvent.MOUSE_MOVED) { handleMouseMoved(event, framePosition); } else if (type == MouseEvent.MOUSE_DRAGGED) { handleMouseDragged(event, framePosition); } }
From source file:org.sleuthkit.autopsy.timeline.ui.AbstractVisualization.java
protected void setChartClickHandler() { chart.addEventHandler(MouseEvent.MOUSE_CLICKED, (MouseEvent event) -> { if (event.getButton() == MouseButton.PRIMARY && event.isStillSincePress()) { selectedNodes.clear();/* www. ja v a 2 s . c o m*/ } }); }