From 6a59764e0bf36ca7301904669aef9464fbd56496 Mon Sep 17 00:00:00 2001 From: Shigeru KANEMOTO Date: Tue, 12 Feb 2013 21:38:15 +0900 Subject: [PATCH] newJMenuItem() should use SHORTCUT_KEY_MASK newJMenuItem() should use SHORTCUT_KEY_MASK variable defined at the top of this class. --- app/src/processing/app/Editor.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 682a1dfa2..da16f87f6 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -1301,8 +1301,7 @@ public class Editor extends JFrame implements RunnerListener { */ static public JMenuItem newJMenuItem(String title, int what) { JMenuItem menuItem = new JMenuItem(title); - int modifiers = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); - menuItem.setAccelerator(KeyStroke.getKeyStroke(what, modifiers)); + menuItem.setAccelerator(KeyStroke.getKeyStroke(what, SHORTCUT_KEY_MASK)); return menuItem; } @@ -1312,9 +1311,7 @@ public class Editor extends JFrame implements RunnerListener { */ static public JMenuItem newJMenuItemShift(String title, int what) { JMenuItem menuItem = new JMenuItem(title); - int modifiers = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); - modifiers |= ActionEvent.SHIFT_MASK; - menuItem.setAccelerator(KeyStroke.getKeyStroke(what, modifiers)); + menuItem.setAccelerator(KeyStroke.getKeyStroke(what, SHORTCUT_KEY_MASK | ActionEvent.SHIFT_MASK)); return menuItem; } @@ -1325,8 +1322,6 @@ public class Editor extends JFrame implements RunnerListener { */ static public JMenuItem newJMenuItemAlt(String title, int what) { JMenuItem menuItem = new JMenuItem(title); - //int modifiers = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); - //menuItem.setAccelerator(KeyStroke.getKeyStroke(what, modifiers)); menuItem.setAccelerator(KeyStroke.getKeyStroke(what, SHORTCUT_ALT_KEY_MASK)); return menuItem; }