Java Code Examples for java.awt.event.MouseEvent#isAltGraphDown()

The following examples show how to use java.awt.event.MouseEvent#isAltGraphDown() . 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: RComponent.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
protected void mousePressed(MouseEvent me) {
    if (me.getButton() == MouseEvent.BUTTON1 && me.getClickCount() == 1 && !me.isAltDown() && !me.isMetaDown()
            && !me.isAltGraphDown() && !me.isControlDown()) {
        mouseButton1Pressed(me);
    } else {
        recorder.recordClick2(this, me, true);
    }
}
 
Example 2
Source File: ProfilerTableContainer.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private static boolean onlyShift(MouseEvent e) {
    return e.isShiftDown() && !(e.isAltDown() || e.isAltGraphDown() ||
                                e.isControlDown() || e.isMetaDown());
}
 
Example 3
Source File: JTreeTablePanel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private static boolean onlyShift(MouseEvent e) {
    return e.isShiftDown() && !(e.isAltDown() || e.isAltGraphDown() ||
                                e.isControlDown() || e.isMetaDown());
}
 
Example 4
Source File: ProfilerTableContainer.java    From visualvm with GNU General Public License v2.0 4 votes vote down vote up
private static boolean onlyShift(MouseEvent e) {
    return e.isShiftDown() && !(e.isAltDown() || e.isAltGraphDown() ||
                                e.isControlDown() || e.isMetaDown());
}
 
Example 5
Source File: JTreeTablePanel.java    From visualvm with GNU General Public License v2.0 4 votes vote down vote up
private static boolean onlyShift(MouseEvent e) {
    return e.isShiftDown() && !(e.isAltDown() || e.isAltGraphDown() ||
                                e.isControlDown() || e.isMetaDown());
}
 
Example 6
Source File: MouseOrTabletOperation.java    From WorldPainter with GNU General Public License v3.0 4 votes vote down vote up
@Override
    public void mousePressed(MouseEvent me) {
        if ((me.getButton() != BUTTON1) && (me.getButton() != BUTTON3)) {
            // Only interested in left and right mouse buttons
            // TODO: the right mouse button is not button three on two-button
            //  mice, is it?
            return;
        }
        x = me.getX();
        y = me.getY();
        altDown = me.isAltDown() || me.isAltGraphDown();
        undo = (me.getButton() == BUTTON3) || altDown;
        ctrlDown = me.isControlDown() || me.isMetaDown();
        shiftDown = me.isShiftDown();
        first = true;
        if (! oneShot) {
            interrupt(); // Make sure any operation in progress (due to timing issues perhaps) is interrupted
            timer = new Timer(delay, e -> {
                Point worldCoords = view.viewToWorld((int) x, (int) y);
                tick(worldCoords.x, worldCoords.y, undo, first, 1.0f);
                view.updateStatusBar(worldCoords.x, worldCoords.y);
                first = false;
            });
            timer.setInitialDelay(0);
            timer.start();
            operationStartedWithButton = me.getButton();
            App.getInstance().pauseAutosave();
//            start = System.currentTimeMillis();
        } else {
            Point worldCoords = view.viewToWorld((int) x, (int) y);
            App.getInstance().pauseAutosave();
            try {
                tick(worldCoords.x, worldCoords.y, undo, true, 1.0f);
                view.updateStatusBar(worldCoords.x, worldCoords.y);
                Dimension dimension = getDimension();
                if (dimension != null) {
                    dimension.armSavePoint();
                }
                logOperation(undo ? statisticsKeyUndo : statisticsKey);
            } finally {
                App.getInstance().resumeAutosave();
            }
        }
        me.consume();
    }
 
Example 7
Source File: MouseOrTabletOperation.java    From WorldPainter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void mouseMoved(MouseEvent me) {
    altDown = me.isAltDown() || me.isAltGraphDown();
    ctrlDown = me.isControlDown() || me.isMetaDown();
    shiftDown = me.isShiftDown();
}