Changeset 6957 in josm for trunk/src/org/openstreetmap/josm/gui/MapMover.java
- Timestamp:
- 2014-04-05T15:27:26+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 new MapMover78 * 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
Note:
See TracChangeset
for help on using the changeset viewer.