Changeset 6957 in josm
- Timestamp:
- 2014-04-05T15:27:26+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r6920 r6957 1516 1516 return OSM_WEBSITE; 1517 1517 } 1518 1519 /** 1520 * Determines if we are currently running on OSX. 1521 * @return {@code true} if we are currently running on OSX 1522 * @since 6957 1523 */ 1524 public static boolean isPlatformOsx() { 1525 return Main.platform instanceof PlatformHookOsx; 1526 } 1518 1527 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r6889 r6957 56 56 import org.openstreetmap.josm.tools.ImageProvider; 57 57 import org.openstreetmap.josm.tools.Pair; 58 import org.openstreetmap.josm.tools.PlatformHookOsx;59 58 import org.openstreetmap.josm.tools.Shortcut; 60 59 … … 473 472 public void mouseMoved(MouseEvent e) { 474 473 // Mac OSX simulates with ctrl + mouse 1 the second mouse button hence no dragging events get fired. 475 if ( (Main.platform instanceofPlatformHookOsx) && (mode == Mode.rotate || mode == Mode.scale)) {474 if (Main.isPlatformOsx() && (mode == Mode.rotate || mode == Mode.scale)) { 476 475 mouseDragged(e); 477 476 return; -
trunk/src/org/openstreetmap/josm/gui/MapMover.java
r6380 r6957 24 24 import org.openstreetmap.josm.data.coor.EastNorth; 25 25 import org.openstreetmap.josm.tools.Destroyable; 26 import org.openstreetmap.josm.tools.PlatformHookOsx;27 26 import org.openstreetmap.josm.tools.Shortcut; 28 27 … … 77 76 78 77 /** 79 * C reate a newMapMover78 * COnstructs a new {@code MapMover}. 80 79 */ 81 80 public MapMover(NavigatableComponent navComp, JPanel contentPane) { … … 133 132 mousePosMove.east() + center.east() - mouseCenter.east(), 134 133 mousePosMove.north() + center.north() - mouseCenter.north())); 135 } else 134 } else { 136 135 endMovement(); 136 } 137 137 } 138 138 … … 140 140 * Start the movement, if it was the 3rd button (right button). 141 141 */ 142 @Override public void mousePressed(MouseEvent e) { 142 @Override 143 public void mousePressed(MouseEvent e) { 143 144 int offMask = MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK; 144 145 int macMouseMask = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK; 145 146 if (e.getButton() == MouseEvent.BUTTON3 && (e.getModifiersEx() & offMask) == 0) { 146 147 startMovement(e); 147 } else if (isPlatformOsx() && e.getModifiersEx() == macMouseMask) { 148 } else if (Main.isPlatformOsx() && e.getModifiersEx() == macMouseMask) { 148 149 startMovement(e); 149 150 } … … 153 154 * Change the cursor back to it's pre-move cursor. 154 155 */ 155 @Override public void mouseReleased(MouseEvent e) { 156 @Override 157 public void mouseReleased(MouseEvent e) { 156 158 if (e.getButton() == MouseEvent.BUTTON3) { 157 159 endMovement(); 158 } else if (isPlatformOsx() && e.getButton() == MouseEvent.BUTTON1) { 160 } else if (Main.isPlatformOsx() && e.getButton() == MouseEvent.BUTTON1) { 159 161 endMovement(); 160 162 } … … 195 197 196 198 /** 197 * Emulates dragging on Mac OSX 199 * Emulates dragging on Mac OSX. 198 200 */ 199 201 @Override … … 203 205 // Mac OSX simulates with ctrl + mouse 1 the second mouse button hence no dragging events get fired. 204 206 // Is only the selected mouse button pressed? 205 if (isPlatformOsx()) { 207 if (Main.isPlatformOsx()) { 206 208 if (e.getModifiersEx() == MouseEvent.CTRL_DOWN_MASK) { 207 209 if (mousePosMove == null) { … … 216 218 } 217 219 } 218 }219 220 /**221 * Replies true if we are currently running on OSX222 *223 * @return true if we are currently running on OSX224 */225 public static boolean isPlatformOsx() {226 return Main.platform instanceof PlatformHookOsx;227 220 } 228 221 -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
r6857 r6957 30 30 import org.openstreetmap.josm.gui.widgets.JosmComboBox; 31 31 import org.openstreetmap.josm.tools.GBC; 32 import org.openstreetmap.josm.tools.PlatformHookOsx;33 32 34 33 /** … … 63 62 64 63 // let's try to load additional LookAndFeels and put them into the list 65 if (Main. platform instanceofPlatformHookOsx) {64 if (Main.isPlatformOsx()) { 66 65 try { 67 66 Class<?> Cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel");
Note:
See TracChangeset
for help on using the changeset viewer.