Changeset 4474 in josm
- Timestamp:
- 2011-09-28T23:13:06+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java
r4195 r4474 56 56 private SizeButton iSizeButton = null; 57 57 private SourceButton iSourceButton = null; 58 59 private boolean isSelecting; 58 60 59 61 /** … … 77 79 iSizeButton = sizeButton; 78 80 iSourceButton = sourceButton; 81 82 isSelecting = false; 79 83 80 84 InputMap inputMap = navComp.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); … … 132 136 iEndSelectionPoint = e.getPoint(); 133 137 iSlippyMapChooser.setSelection(iStartSelectionPoint, iEndSelectionPoint); 138 isSelecting = true; 134 139 } 135 140 } … … 144 149 if (e.getButton() == MouseEvent.BUTTON1) { 145 150 146 int sourceButton = iSourceButton.hit(e.getPoint()); 147 148 if (iSizeButton.hit(e.getPoint())) { 149 iSizeButton.toggle(); 150 iSlippyMapChooser.resizeSlippyMap(); 151 } else if (iSlippyMapChooser.handleAttribution(e.getPoint(), true)) { 152 /* do nothing, handleAttribution() already did the work */ 153 } else if (sourceButton == SourceButton.HIDE_OR_SHOW) { 154 iSourceButton.toggle(); 155 iSlippyMapChooser.repaint(); 156 } else if (sourceButton != 0) { 157 iSlippyMapChooser.toggleMapSource(iSourceButton.hitToTileSource(sourceButton)); 158 } else { 159 if (e.getClickCount() == 1) { 160 iSlippyMapChooser.setSelection(iStartSelectionPoint, e.getPoint()); 161 162 // reset the selections start and end 163 iEndSelectionPoint = null; 164 iStartSelectionPoint = null; 165 } 166 } 167 151 if (isSelecting && e.getClickCount() == 1) { 152 iSlippyMapChooser.setSelection(iStartSelectionPoint, e.getPoint()); 153 154 // reset the selections start and end 155 iEndSelectionPoint = null; 156 iStartSelectionPoint = null; 157 isSelecting = false; 158 159 } else { 160 int sourceButton = iSourceButton.hit(e.getPoint()); 161 162 if (iSizeButton.hit(e.getPoint())) { 163 iSizeButton.toggle(); 164 iSlippyMapChooser.resizeSlippyMap(); 165 } else if (iSlippyMapChooser.handleAttribution(e.getPoint(), true)) { 166 /* do nothing, handleAttribution() already did the work */ 167 } else if (sourceButton == SourceButton.HIDE_OR_SHOW) { 168 iSourceButton.toggle(); 169 iSlippyMapChooser.repaint(); 170 } else if (sourceButton != 0) { 171 iSlippyMapChooser.toggleMapSource(iSourceButton.hitToTileSource(sourceButton)); 172 } 173 } 168 174 } 169 175 }
Note:
See TracChangeset
for help on using the changeset viewer.