java.awt.event.InputEvent#ALT_MASK源码实例Demo

下面列出了java.awt.event.InputEvent#ALT_MASK 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: jdk1.8-source-analysis   文件: AWTKeyStroke.java
private static int mapNewModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_MASK;
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
        modifiers |= InputEvent.ALT_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_MASK;
    }
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        modifiers |= InputEvent.CTRL_MASK;
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
        modifiers |= InputEvent.META_MASK;
    }

    return modifiers;
}
 
源代码2 项目: Bytecoder   文件: AWTKeyStroke.java
@SuppressWarnings("deprecation")
private static int mapNewModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_MASK;
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
        modifiers |= InputEvent.ALT_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_MASK;
    }
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        modifiers |= InputEvent.CTRL_MASK;
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
        modifiers |= InputEvent.META_MASK;
    }

    return modifiers;
}
 
源代码3 项目: openjdk-jdk9   文件: AWTKeyStroke.java
@SuppressWarnings("deprecation")
private static int mapNewModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_MASK;
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
        modifiers |= InputEvent.ALT_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_MASK;
    }
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        modifiers |= InputEvent.CTRL_MASK;
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
        modifiers |= InputEvent.META_MASK;
    }

    return modifiers;
}
 
源代码4 项目: Java8CN   文件: AWTKeyStroke.java
private static int mapNewModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_MASK;
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
        modifiers |= InputEvent.ALT_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_MASK;
    }
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        modifiers |= InputEvent.CTRL_MASK;
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
        modifiers |= InputEvent.META_MASK;
    }

    return modifiers;
}
 
源代码5 项目: jdk8u-jdk   文件: AWTKeyStroke.java
private static int mapOldModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_MASK) != 0) {
        modifiers |= InputEvent.ALT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
    if ((modifiers & InputEvent.CTRL_MASK) != 0) {
        modifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((modifiers & InputEvent.META_MASK) != 0) {
        modifiers |= InputEvent.META_DOWN_MASK;
    }

    modifiers &= InputEvent.SHIFT_DOWN_MASK
        | InputEvent.ALT_DOWN_MASK
        | InputEvent.ALT_GRAPH_DOWN_MASK
        | InputEvent.CTRL_DOWN_MASK
        | InputEvent.META_DOWN_MASK
        | InputEvent.BUTTON1_DOWN_MASK
        | InputEvent.BUTTON2_DOWN_MASK
        | InputEvent.BUTTON3_DOWN_MASK;

    return modifiers;
}
 
源代码6 项目: dragonwell8_jdk   文件: AWTKeyStroke.java
private static int mapOldModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_MASK) != 0) {
        modifiers |= InputEvent.ALT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
    if ((modifiers & InputEvent.CTRL_MASK) != 0) {
        modifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((modifiers & InputEvent.META_MASK) != 0) {
        modifiers |= InputEvent.META_DOWN_MASK;
    }

    modifiers &= InputEvent.SHIFT_DOWN_MASK
        | InputEvent.ALT_DOWN_MASK
        | InputEvent.ALT_GRAPH_DOWN_MASK
        | InputEvent.CTRL_DOWN_MASK
        | InputEvent.META_DOWN_MASK
        | InputEvent.BUTTON1_DOWN_MASK
        | InputEvent.BUTTON2_DOWN_MASK
        | InputEvent.BUTTON3_DOWN_MASK;

    return modifiers;
}
 
源代码7 项目: megamek   文件: TargetingPhaseDisplay.java
@Override
public void hexMoused(BoardViewEvent b) {

    // Are we ignoring events?
    if (isIgnoringEvents()) {
        return;
    }

    // ignore buttons other than 1
    if (!clientgui.getClient().isMyTurn()
        || ((b.getModifiers() & InputEvent.BUTTON1_MASK) == 0)) {
        return;
    }
    // control pressed means a line of sight check.
    // added ALT_MASK by kenn
    if (((b.getModifiers() & InputEvent.CTRL_MASK) != 0)
        || ((b.getModifiers() & InputEvent.ALT_MASK) != 0)) {
        return;
    }
    // check for shifty goodness
    if (shiftheld != ((b.getModifiers() & InputEvent.SHIFT_MASK) != 0)) {
        shiftheld = (b.getModifiers() & InputEvent.SHIFT_MASK) != 0;
    }

    if (b.getType() == BoardViewEvent.BOARD_HEX_DRAGGED) {
        if (shiftheld || twisting) {
            updateFlipArms(false);
            torsoTwist(b.getCoords());
        }
        clientgui.getBoardView().cursor(b.getCoords());
    } else if (b.getType() == BoardViewEvent.BOARD_HEX_CLICKED) {
        twisting = false;
        clientgui.getBoardView().select(b.getCoords());
    }
}
 
源代码8 项目: jdk8u-jdk   文件: AWTKeyStroke.java
private static int mapOldModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_MASK) != 0) {
        modifiers |= InputEvent.ALT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
    if ((modifiers & InputEvent.CTRL_MASK) != 0) {
        modifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((modifiers & InputEvent.META_MASK) != 0) {
        modifiers |= InputEvent.META_DOWN_MASK;
    }

    modifiers &= InputEvent.SHIFT_DOWN_MASK
        | InputEvent.ALT_DOWN_MASK
        | InputEvent.ALT_GRAPH_DOWN_MASK
        | InputEvent.CTRL_DOWN_MASK
        | InputEvent.META_DOWN_MASK
        | InputEvent.BUTTON1_DOWN_MASK
        | InputEvent.BUTTON2_DOWN_MASK
        | InputEvent.BUTTON3_DOWN_MASK;

    return modifiers;
}
 
源代码9 项目: hottub   文件: AWTKeyStroke.java
private static int mapOldModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_MASK) != 0) {
        modifiers |= InputEvent.ALT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
    if ((modifiers & InputEvent.CTRL_MASK) != 0) {
        modifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((modifiers & InputEvent.META_MASK) != 0) {
        modifiers |= InputEvent.META_DOWN_MASK;
    }

    modifiers &= InputEvent.SHIFT_DOWN_MASK
        | InputEvent.ALT_DOWN_MASK
        | InputEvent.ALT_GRAPH_DOWN_MASK
        | InputEvent.CTRL_DOWN_MASK
        | InputEvent.META_DOWN_MASK
        | InputEvent.BUTTON1_DOWN_MASK
        | InputEvent.BUTTON2_DOWN_MASK
        | InputEvent.BUTTON3_DOWN_MASK;

    return modifiers;
}
 
源代码10 项目: pumpernickel   文件: ModifierTracker.java
public static int getModifiers() {
	return (alt ? InputEvent.ALT_MASK : 0)
			+ (altGraph ? InputEvent.ALT_GRAPH_MASK : 0)
			+ (shift ? InputEvent.SHIFT_MASK : 0)
			+ (ctrl ? InputEvent.CTRL_MASK : 0)
			+ (meta ? InputEvent.META_MASK : 0);

}
 
源代码11 项目: openjdk-8-source   文件: LWCToolkit.java
/**
 * Returns key modifiers used by Swing to set up a focus accelerator key stroke.
 */
@Override
public int getFocusAcceleratorKeyMask() {
    return InputEvent.CTRL_MASK | InputEvent.ALT_MASK;
}
 
源代码12 项目: hottub   文件: SunToolkit.java
/**
 * Returns key modifiers used by Swing to set up a focus accelerator key stroke.
 */
public int getFocusAcceleratorKeyMask() {
    return InputEvent.ALT_MASK;
}
 
源代码13 项目: openjdk-jdk8u-backup   文件: SunToolkit.java
/**
 * Returns key modifiers used by Swing to set up a focus accelerator key stroke.
 */
public int getFocusAcceleratorKeyMask() {
    return InputEvent.ALT_MASK;
}
 
源代码14 项目: openjdk-jdk9   文件: SunToolkit.java
/**
 * Returns key modifiers used by Swing to set up a focus accelerator key stroke.
 */
@SuppressWarnings("deprecation")
public int getFocusAcceleratorKeyMask() {
    return InputEvent.ALT_MASK;
}
 
源代码15 项目: astor   文件: ChartPanel.java
/**
 * Constructs a JFreeChart panel.
 *
 * @param chart  the chart.
 * @param width  the preferred width of the panel.
 * @param height  the preferred height of the panel.
 * @param minimumDrawWidth  the minimum drawing width.
 * @param minimumDrawHeight  the minimum drawing height.
 * @param maximumDrawWidth  the maximum drawing width.
 * @param maximumDrawHeight  the maximum drawing height.
 * @param useBuffer  a flag that indicates whether to use the off-screen
 *                   buffer to improve performance (at the expense of
 *                   memory).
 * @param properties  a flag indicating whether or not the chart property
 *                    editor should be available via the popup menu.
 * @param copy  a flag indicating whether or not a copy option should be
 *              available via the popup menu.
 * @param save  a flag indicating whether or not save options should be
 *              available via the popup menu.
 * @param print  a flag indicating whether or not the print option
 *               should be available via the popup menu.
 * @param zoom  a flag indicating whether or not zoom options should be
 *              added to the popup menu.
 * @param tooltips  a flag indicating whether or not tooltips should be
 *                  enabled for the chart.
 *
 * @since 1.0.13
 */
public ChartPanel(JFreeChart chart, int width, int height,
       int minimumDrawWidth, int minimumDrawHeight, int maximumDrawWidth,
       int maximumDrawHeight, boolean useBuffer, boolean properties,
       boolean copy, boolean save, boolean print, boolean zoom,
       boolean tooltips) {

    setChart(chart);
    this.chartMouseListeners = new EventListenerList();
    this.info = new ChartRenderingInfo();
    this.info.setRenderingSource(this);
    setPreferredSize(new Dimension(width, height));
    this.useBuffer = useBuffer;
    this.refreshBuffer = false;
    this.minimumDrawWidth = minimumDrawWidth;
    this.minimumDrawHeight = minimumDrawHeight;
    this.maximumDrawWidth = maximumDrawWidth;
    this.maximumDrawHeight = maximumDrawHeight;
    this.zoomTriggerDistance = DEFAULT_ZOOM_TRIGGER_DISTANCE;

    // set up popup menu...
    this.popup = null;
    if (properties || copy || save || print || zoom) {
        this.popup = createPopupMenu(properties, copy, save, print, zoom);
    }

    enableEvents(AWTEvent.MOUSE_EVENT_MASK);
    enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
    setDisplayToolTips(tooltips);
    addMouseListener(this);
    addMouseMotionListener(this);

    this.defaultDirectoryForSaveAs = null;
    this.enforceFileExtensions = true;

    // initialize ChartPanel-specific tool tip delays with
    // values the from ToolTipManager.sharedInstance()
    ToolTipManager ttm = ToolTipManager.sharedInstance();
    this.ownToolTipInitialDelay = ttm.getInitialDelay();
    this.ownToolTipDismissDelay = ttm.getDismissDelay();
    this.ownToolTipReshowDelay = ttm.getReshowDelay();

    this.zoomAroundAnchor = false;
    this.zoomOutlinePaint = Color.blue;
    this.zoomFillPaint = new Color(0, 0, 255, 63);

    this.overlays = new java.util.ArrayList();

    this.availableMouseHandlers = new java.util.ArrayList();

    this.zoomHandler = new ZoomHandler();
    this.availableMouseHandlers.add(zoomHandler);

    PanHandler panHandler = new PanHandler();
    int panMask = InputEvent.CTRL_MASK;
    // for MacOSX we can't use the CTRL key for mouse drags, see:
    // http://developer.apple.com/qa/qa2004/qa1362.html
    String osName = System.getProperty("os.name").toLowerCase();
    if (osName.startsWith("mac os x")) {
        panMask = InputEvent.ALT_MASK;
    }
    panHandler.setModifier(panMask);
    this.availableMouseHandlers.add(panHandler);
    this.auxiliaryMouseHandlers = new java.util.ArrayList();
}
 
源代码16 项目: jdk8u60   文件: SunToolkit.java
/**
 * Returns key modifiers used by Swing to set up a focus accelerator key stroke.
 */
public int getFocusAcceleratorKeyMask() {
    return InputEvent.ALT_MASK;
}
 
源代码17 项目: ccu-historian   文件: ChartPanel.java
/**
 * Constructs a JFreeChart panel.
 *
 * @param chart  the chart.
 * @param width  the preferred width of the panel.
 * @param height  the preferred height of the panel.
 * @param minimumDrawWidth  the minimum drawing width.
 * @param minimumDrawHeight  the minimum drawing height.
 * @param maximumDrawWidth  the maximum drawing width.
 * @param maximumDrawHeight  the maximum drawing height.
 * @param useBuffer  a flag that indicates whether to use the off-screen
 *                   buffer to improve performance (at the expense of
 *                   memory).
 * @param properties  a flag indicating whether or not the chart property
 *                    editor should be available via the popup menu.
 * @param copy  a flag indicating whether or not a copy option should be
 *              available via the popup menu.
 * @param save  a flag indicating whether or not save options should be
 *              available via the popup menu.
 * @param print  a flag indicating whether or not the print option
 *               should be available via the popup menu.
 * @param zoom  a flag indicating whether or not zoom options should be
 *              added to the popup menu.
 * @param tooltips  a flag indicating whether or not tooltips should be
 *                  enabled for the chart.
 *
 * @since 1.0.13
 */
public ChartPanel(JFreeChart chart, int width, int height,
       int minimumDrawWidth, int minimumDrawHeight, int maximumDrawWidth,
       int maximumDrawHeight, boolean useBuffer, boolean properties,
       boolean copy, boolean save, boolean print, boolean zoom,
       boolean tooltips) {

    setChart(chart);
    this.chartMouseListeners = new EventListenerList();
    this.info = new ChartRenderingInfo();
    setPreferredSize(new Dimension(width, height));
    this.useBuffer = useBuffer;
    this.refreshBuffer = false;
    this.minimumDrawWidth = minimumDrawWidth;
    this.minimumDrawHeight = minimumDrawHeight;
    this.maximumDrawWidth = maximumDrawWidth;
    this.maximumDrawHeight = maximumDrawHeight;
    this.zoomTriggerDistance = DEFAULT_ZOOM_TRIGGER_DISTANCE;

    // set up popup menu...
    this.popup = null;
    if (properties || copy || save || print || zoom) {
        this.popup = createPopupMenu(properties, copy, save, print, zoom);
    }

    enableEvents(AWTEvent.MOUSE_EVENT_MASK);
    enableEvents(AWTEvent.MOUSE_MOTION_EVENT_MASK);
    setDisplayToolTips(tooltips);
    addMouseListener(this);
    addMouseMotionListener(this);

    this.defaultDirectoryForSaveAs = null;
    this.enforceFileExtensions = true;

    // initialize ChartPanel-specific tool tip delays with
    // values the from ToolTipManager.sharedInstance()
    ToolTipManager ttm = ToolTipManager.sharedInstance();
    this.ownToolTipInitialDelay = ttm.getInitialDelay();
    this.ownToolTipDismissDelay = ttm.getDismissDelay();
    this.ownToolTipReshowDelay = ttm.getReshowDelay();

    this.zoomAroundAnchor = false;
    this.zoomOutlinePaint = Color.blue;
    this.zoomFillPaint = new Color(0, 0, 255, 63);

    this.panMask = InputEvent.CTRL_MASK;
    // for MacOSX we can't use the CTRL key for mouse drags, see:
    // http://developer.apple.com/qa/qa2004/qa1362.html
    String osName = System.getProperty("os.name").toLowerCase();
    if (osName.startsWith("mac os x")) {
        this.panMask = InputEvent.ALT_MASK;
    }

    this.overlays = new java.util.ArrayList();
}
 
源代码18 项目: jdk8u_jdk   文件: SunToolkit.java
/**
 * Returns key modifiers used by Swing to set up a focus accelerator key stroke.
 */
public int getFocusAcceleratorKeyMask() {
    return InputEvent.ALT_MASK;
}
 
源代码19 项目: jdk8u-jdk   文件: SunToolkit.java
/**
 * Tests whether specified key modifiers mask can be used to enter a printable
 * character. This is a default implementation of this method, which reflects
 * the way things work on Windows: here, pressing ctrl + alt allows user to enter
 * characters from the extended character set (like euro sign or math symbols)
 */
public boolean isPrintableCharacterModifiersMask(int mods) {
    return ((mods & InputEvent.ALT_MASK) == (mods & InputEvent.CTRL_MASK));
}
 
源代码20 项目: openjdk-8-source   文件: SunToolkit.java
/**
 * Tests whether specified key modifiers mask can be used to enter a printable
 * character. This is a default implementation of this method, which reflects
 * the way things work on Windows: here, pressing ctrl + alt allows user to enter
 * characters from the extended character set (like euro sign or math symbols)
 */
public boolean isPrintableCharacterModifiersMask(int mods) {
    return ((mods & InputEvent.ALT_MASK) == (mods & InputEvent.CTRL_MASK));
}