Java Code Examples for org.netbeans.api.visual.action.WidgetAction.WidgetMouseEvent#getButton()

The following examples show how to use org.netbeans.api.visual.action.WidgetAction.WidgetMouseEvent#getButton() . 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: ExtendedSelectAction.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public State mousePressed(Widget widget, WidgetMouseEvent event) {
    // TODO: Solve this differently?
    if (event.getButton() != MouseEvent.BUTTON2) {
        return innerAction.mousePressed(widget, new WidgetMouseEvent(event.getEventID(), new MouseEvent(panel, (int) event.getEventID(), event.getWhen(), event.getModifiersEx(), event.getPoint().x, event.getPoint().y, event.getClickCount(), event.isPopupTrigger(), MouseEvent.BUTTON1)));
    } else {
        return super.mousePressed(widget, event);
    }
}
 
Example 2
Source File: ExtendedSelectAction.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public State mousePressed(Widget widget, WidgetMouseEvent event) {
    // TODO: Solve this differently?
    if (event.getButton() != MouseEvent.BUTTON2) {
        return innerAction.mousePressed(widget, new WidgetMouseEvent(event.getEventID(), new MouseEvent(panel, (int) event.getEventID(), event.getWhen(), event.getModifiersEx(), event.getPoint().x, event.getPoint().y, event.getClickCount(), event.isPopupTrigger(), MouseEvent.BUTTON1)));
    } else {
        return super.mousePressed(widget, event);
    }
}
 
Example 3
Source File: ExtendedSelectAction.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public State mousePressed(Widget widget, WidgetMouseEvent event) {
    // TODO: Solve this differently?
    if (event.getButton() != MouseEvent.BUTTON2) {
        return innerAction.mousePressed(widget, new WidgetMouseEvent(event.getEventID(), new MouseEvent(panel, (int) event.getEventID(), event.getWhen(), event.getModifiersEx(), event.getPoint().x, event.getPoint().y, event.getClickCount(), event.isPopupTrigger(), MouseEvent.BUTTON1)));
    } else {
        return super.mousePressed(widget, event);
    }
}
 
Example 4
Source File: Utils.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public State mousePressed(Widget widget, WidgetMouseEvent event) {
    if (event.getClickCount() == 1) {
        if (event.getButton() == MouseEvent.BUTTON1 || event.getButton() == MouseEvent.BUTTON2) {
            addNode("node" + nodeCounter++).setPreferredLocation(widget.convertLocalToScene(event.getPoint()));
            return State.CONSUMED;
        }
    }
    return State.REJECTED;
}
 
Example 5
Source File: Utils.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public State mouseClicked(Widget widget, WidgetMouseEvent event) {
    if (event.getButton() == MouseEvent.BUTTON1) {
        JDialog dialog = new JDialog((Frame) null, "Mouse Clicked " + event.getClickCount());
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        dialog.setBounds((screenSize.width - WIDTH) / 2, (screenSize.height - HEIGHT) / 2, WIDTH, HEIGHT);
        dialog.setVisible(true);
        return State.CONSUMED;
    }
    return State.REJECTED;
}
 
Example 6
Source File: ExtendedSelectAction.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public State mousePressed(Widget widget, WidgetMouseEvent event) {
    // TODO: Solve this differently?
    if (event.getButton() != MouseEvent.BUTTON2) {
        return innerAction.mousePressed(widget, new WidgetMouseEvent(event.getEventID(), new MouseEvent(panel, (int) event.getEventID(), event.getWhen(), event.getModifiersEx(), event.getPoint().x, event.getPoint().y, event.getClickCount(), event.isPopupTrigger(), MouseEvent.BUTTON1)));
    } else {
        return super.mousePressed(widget, event);
    }
}
 
Example 7
Source File: ExtendedSelectAction.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) {
    // TODO: Solve this differently?
    if (event.getButton() != MouseEvent.BUTTON2) {
        return innerAction.mousePressed(widget, new WidgetMouseEvent(event.getEventID(), new MouseEvent(panel, (int) event.getEventID(), event.getWhen(), event.getModifiersEx(), event.getPoint().x, event.getPoint().y, event.getClickCount(), event.isPopupTrigger(), MouseEvent.BUTTON1)));
    } else {
        return super.mousePressed(widget, event);
    }
}
 
Example 8
Source File: ExtendedSelectAction.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public State mousePressed(Widget widget, WidgetMouseEvent event) {
    // TODO: Solve this differently?
    if (event.getButton() != MouseEvent.BUTTON2) {
        return innerAction.mousePressed(widget, new WidgetMouseEvent(event.getEventID(), new MouseEvent(panel, (int) event.getEventID(), event.getWhen(), event.getModifiersEx(), event.getPoint().x, event.getPoint().y, event.getClickCount(), event.isPopupTrigger(), MouseEvent.BUTTON1)));
    } else {
        return super.mousePressed(widget, event);
    }
}
 
Example 9
Source File: ExtendedSelectAction.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public State mousePressed(Widget widget, WidgetMouseEvent event) {
    // TODO: Solve this differently?
    if (event.getButton() != MouseEvent.BUTTON2) {
        return innerAction.mousePressed(widget, new WidgetMouseEvent(event.getEventID(), new MouseEvent(panel, (int) event.getEventID(), event.getWhen(), event.getModifiersEx(), event.getPoint().x, event.getPoint().y, event.getClickCount(), event.isPopupTrigger(), MouseEvent.BUTTON1)));
    } else {
        return super.mousePressed(widget, event);
    }
}
 
Example 10
Source File: ExtendedSelectAction.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public State mousePressed(Widget widget, WidgetMouseEvent event) {
    // TODO: Solve this differently?
    if (event.getButton() != MouseEvent.BUTTON2) {
        return innerAction.mousePressed(widget, new WidgetMouseEvent(event.getEventID(), new MouseEvent(panel, (int) event.getEventID(), event.getWhen(), event.getModifiersEx(), event.getPoint().x, event.getPoint().y, event.getClickCount(), event.isPopupTrigger(), MouseEvent.BUTTON1)));
    } else {
        return super.mousePressed(widget, event);
    }
}