Changeset 32724 in osm for applications/viewer/jmapviewer/src
- Timestamp:
- 2016-07-26T22:39:12+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/DefaultMapController.java
r32602 r32724 37 37 private boolean doubleClickZoomEnabled = true; 38 38 39 /** 40 * Constructs a new {@code DefaultMapController}. 41 * @param map map panel 42 */ 39 43 public DefaultMapController(JMapViewer map) { 40 44 super(map); … … 47 51 // Is only the selected mouse button pressed? 48 52 if ((e.getModifiersEx() & MOUSE_BUTTONS_MASK) == movementMouseButtonMask 49 || isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK) {53 || (isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK)) { 50 54 Point p = e.getPoint(); 51 55 if (lastDragPoint != null) { … … 67 71 @Override 68 72 public void mousePressed(MouseEvent e) { 69 if (e.getButton() == movementMouseButton || isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK) {73 if (e.getButton() == movementMouseButton || (isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK)) { 70 74 lastDragPoint = null; 71 75 isMoving = true; … … 75 79 @Override 76 80 public void mouseReleased(MouseEvent e) { 77 if (e.getButton() == movementMouseButton || isPlatformOsx() && e.getButton() == MouseEvent.BUTTON1) {81 if (e.getButton() == movementMouseButton || (isPlatformOsx() && e.getButton() == MouseEvent.BUTTON1)) { 78 82 lastDragPoint = null; 79 83 isMoving = false; … … 89 93 } 90 94 95 /** 96 * Determines if the map pane is allowed to be moved using the mouse 97 * @return {@code true} to allow the map pane to be moved using the mouse 98 */ 91 99 public boolean isMovementEnabled() { 92 100 return movementEnabled; … … 151 159 @Override 152 160 public void mouseEntered(MouseEvent e) { 161 // do nothing 153 162 } 154 163 155 164 @Override 156 165 public void mouseExited(MouseEvent e) { 166 // do nothing 157 167 } 158 168 … … 174 184 lastDragPoint = p; 175 185 } 176 177 186 } 178 179 187 } 180 188
Note:
See TracChangeset
for help on using the changeset viewer.