Java Code Examples for org.netbeans.api.visual.action.WidgetAction.State#createLocked()

The following examples show how to use org.netbeans.api.visual.action.WidgetAction.State#createLocked() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomizablePanAction.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public State mousePressed (Widget widget, WidgetMouseEvent event) {
    if (isLocked ())
        return State.createLocked (widget, this);
    if (enabled && (event.getModifiersEx() & modifiersExMask) == modifiersEx) {
        scene = widget.getScene ();
        scrollPane = findScrollPane (scene.getView ());
        if (scrollPane != null) {
            lastLocation = scene.convertSceneToView (widget.convertLocalToScene (event.getPoint ()));
            SwingUtilities.convertPointToScreen (lastLocation, scene.getView ());
            return State.createLocked (widget, this);
        }
    }
    return State.REJECTED;
}
 
Example 2
Source File: CustomizablePanAction.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public State mouseReleased (Widget widget, WidgetMouseEvent event) {
    boolean state = pan (widget, event.getPoint ());
    if (state)
        scrollPane = null;
    return state ? State.createLocked (widget, this) : State.REJECTED;
}
 
Example 3
Source File: CustomizablePanAction.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public State mouseDragged (Widget widget, WidgetMouseEvent event) {
    return pan (widget, event.getPoint ()) ? State.createLocked (widget, this) : State.REJECTED;
}