Changeset 1842 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2009-07-25T18:17:36+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r1643 r1842 14 14 15 15 /** 16 17 16 * see PlatformHook.java 17 */ 18 18 public class PlatformHookOsx extends PlatformHookUnixoid implements PlatformHook, InvocationHandler { 19 19 private static PlatformHookOsx ivhandler = new PlatformHookOsx(); 20 @Override 20 21 public void preStartupHook(){ 21 22 // This will merge our MenuBar into the system menu. … … 25 26 System.setProperty("apple.laf.useScreenMenuBar", "true"); 26 27 } 28 @Override 27 29 public void startupHook() { 28 30 // Here we register callbacks for the menu entries in the system menu … … 42 44 System.out.println("Failed to register with OSX: " + ex); 43 45 } 44 45 // Ctrl + mouse 1 is suppressing mouseDragged events46 SelectAction.needMouseMove = true;47 46 } 48 47 public Object invoke (Object proxy, Method method, Object[] args) throws Throwable { … … 55 54 } else if (method.getName().equals("handlePreferences")) { 56 55 Main.main.menu.preferences.actionPerformed(null); 57 } else {56 } else 58 57 return null; 59 }60 58 if (args[0] != null) { 61 59 try { … … 67 65 return null; 68 66 } 67 @Override 69 68 public void openUrl(String url) throws IOException { 70 69 // Ain't that KISS? 71 70 Runtime.getRuntime().exec("open " + url); 72 71 } 72 @Override 73 73 public void initShortcutGroups() { 74 74 // Everything but Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_MENU is guesswork. … … 97 97 Main.pref.put("shortcut.groups."+(Shortcut.GROUPS_ALT2+Shortcut.GROUP_MNEMONIC), Integer.toString(KeyEvent.ALT_DOWN_MASK)); 98 98 } 99 @Override 99 100 public void initSystemShortcuts() { 100 101 // Yeah, it's a long, long list. And people always complain that OSX has no shortcuts. … … 235 236 236 237 } 238 @Override 237 239 public String makeTooltip(String name, Shortcut sc) { 238 240 String lafid = UIManager.getLookAndFeel().getID(); … … 243 245 } 244 246 String result = ""; 245 if (canHtml) result += "<html>"; 247 if (canHtml) { 248 result += "<html>"; 249 } 246 250 result += name; 247 251 if (sc != null && sc.getKeyText().length() != 0) { 248 252 result += " "; 249 if (canHtml) result += "<font size='-2'>"; 253 if (canHtml) { 254 result += "<font size='-2'>"; 255 } 250 256 result += "("+sc.getKeyText()+")"; 251 if (canHtml) result += "</font>"; 252 } 253 if (canHtml) result += " </html>"; 257 if (canHtml) { 258 result += "</font>"; 259 } 260 } 261 if (canHtml) { 262 result += " </html>"; 263 } 254 264 return result; 255 265 }
Note:
See TracChangeset
for help on using the changeset viewer.