Example usage for javafx.scene.input MouseEvent isStillSincePress

List of usage examples for javafx.scene.input MouseEvent isStillSincePress

Introduction

In this page you can find the example usage for javafx.scene.input MouseEvent isStillSincePress.

Prototype

public final boolean isStillSincePress() 

Source Link

Document

Indicates whether the mouse cursor stayed in the system-provided hysteresis area since last pressed event that occurred before this event.

Usage

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*/
        }
    });
}