Changeset 19050 in josm for trunk/src/org/openstreetmap/josm/gui/MapMover.java
- Timestamp:
- 2024-04-22T20:59:26+02:00 (4 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapMover.java
r17333 r19050 7 7 import java.awt.Point; 8 8 import java.awt.event.ActionEvent; 9 import java.awt.event.InputEvent; 9 10 import java.awt.event.KeyEvent; 10 11 import java.awt.event.MouseAdapter; … … 88 89 EastNorth center = nc.getCenter(); 89 90 EastNorth newcenter = nc.getEastNorth(nc.getWidth()/2+nc.getWidth()/5, nc.getHeight()/2+nc.getHeight()/5); 90 switch (action) {91 switch (action) { 91 92 case "left": 92 93 nc.zoomTo(new EastNorth(2*center.east()-newcenter.east(), center.north())); … … 173 174 @Override 174 175 public void mouseDragged(MouseEvent e) { 175 int offMask = MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK;176 boolean allowMovement = (e.getModifiersEx() & ( MouseEvent.BUTTON3_DOWN_MASK | offMask)) == MouseEvent.BUTTON3_DOWN_MASK;176 int offMask = InputEvent.BUTTON1_DOWN_MASK | InputEvent.BUTTON2_DOWN_MASK; 177 boolean allowMovement = (e.getModifiersEx() & (InputEvent.BUTTON3_DOWN_MASK | offMask)) == InputEvent.BUTTON3_DOWN_MASK; 177 178 if (PlatformManager.isPlatformOsx()) { 178 179 MapFrame map = MainApplication.getMap(); 179 int macMouseMask = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK;180 int macMouseMask = InputEvent.CTRL_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK; 180 181 boolean macMovement = e.getModifiersEx() == macMouseMask; 181 182 boolean allowedMode = !map.mapModeSelect.equals(map.mapMode) … … 204 205 @Override 205 206 public void mousePressed(MouseEvent e) { 206 int offMask = MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK;207 int macMouseMask = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK;207 int offMask = InputEvent.BUTTON1_DOWN_MASK | InputEvent.BUTTON2_DOWN_MASK; 208 int macMouseMask = InputEvent.CTRL_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK; 208 209 if ((e.getButton() == MouseEvent.BUTTON3 && (e.getModifiersEx() & offMask) == 0) || 209 210 (PlatformManager.isPlatformOsx() && e.getModifiersEx() == macMouseMask)) { … … 253 254 @Override 254 255 public void mouseWheelMoved(MouseWheelEvent e) { 255 int rotation = PROP_ZOOM_REVERSE_WHEEL.get() ? -e.getWheelRotation() : e.getWheelRotation();256 int rotation = Boolean.TRUE.equals(PROP_ZOOM_REVERSE_WHEEL.get()) ? -e.getWheelRotation() : e.getWheelRotation(); 256 257 nc.zoomManyTimes(e.getX(), e.getY(), rotation); 257 258 } … … 268 269 // Is only the selected mouse button pressed? 269 270 if (PlatformManager.isPlatformOsx()) { 270 if (e.getModifiersEx() == MouseEvent.CTRL_DOWN_MASK) {271 if (e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK) { 271 272 doMoveForDrag(e); 272 273 } else {
Note:
See TracChangeset
for help on using the changeset viewer.