Changeset 1842 in josm for trunk/src/org
- Timestamp:
- 2009-07-25T18:17:36+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r1838 r1842 50 50 import org.openstreetmap.josm.gui.MapFrame; 51 51 import org.openstreetmap.josm.gui.MapView; 52 import org.openstreetmap.josm.gui.OptionPaneUtil; 52 53 import org.openstreetmap.josm.gui.layer.Layer; 53 54 import org.openstreetmap.josm.gui.layer.MapViewPaintable; … … 338 339 n = new Node(Main.map.mapView.getLatLon(e.getX(), e.getY())); 339 340 if (n.getCoor().isOutSideWorld()) { 340 JOptionPane.showMessageDialog(Main.parent, 341 tr("Cannot add a node outside of the world.")); 341 OptionPaneUtil.showMessageDialog( 342 Main.parent, 343 tr("Cannot add a node outside of the world."), 344 tr("Warning"), 345 JOptionPane.WARNING_MESSAGE 346 ); 342 347 return; 343 348 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r1814 r1842 45 45 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 46 46 import org.openstreetmap.josm.tools.ImageProvider; 47 import org.openstreetmap.josm.tools.PlatformHookOsx; 47 48 import org.openstreetmap.josm.tools.Shortcut; 48 49 … … 58 59 */ 59 60 public class SelectAction extends MapMode implements SelectionEnded { 60 public static boolean needMouseMove = false; 61 62 /** 63 * Replies true if we are currently running on OSX 64 * 65 * @return true if we are currently running on OSX 66 */ 67 public static boolean isPlatformOsx() { 68 return Main.platform != null 69 && Main.platform instanceof PlatformHookOsx; 70 } 71 61 72 enum Mode { move, rotate, select } 62 73 private Mode mode = null; … … 254 265 } 255 266 256 /** 257 * Mac OSX simulates with ctrl + mouse 1 the second mouse button hence no dragging events get fired. 258 * 259 */ 267 260 268 @Override public void mouseMoved(MouseEvent e) { 261 if (needMouseMove && mode == Mode.rotate) { 269 // Mac OSX simulates with ctrl + mouse 1 the second mouse button hence no dragging events get fired. 270 // 271 if (isPlatformOsx() && mode == Mode.rotate) { 262 272 mouseDragged(e); 263 273 } -
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.