Changeset 10220 in josm for trunk/src/org
- Timestamp:
- 2016-05-15T19:51:21+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
r10152 r10220 55 55 * 4. Visual cues could be better 56 56 * 57 * 5. Cursors (Half-done) 58 * 59 * 6. (long term) Parallelize and adjust offsets of existing ways 57 * 5. (long term) Parallelize and adjust offsets of existing ways 60 58 * 61 59 * == Code quality == … … 83 81 84 82 private enum Mode { 85 dragging, normal83 DRAGGING, NORMAL 86 84 } 87 85 … … 145 143 public void enterMode() { 146 144 // super.enterMode() updates the status line and cursor so we need our state to be set correctly 147 setMode(Mode. normal);145 setMode(Mode.NORMAL); 148 146 pWays = null; 149 147 updateAllPreferences(); // All default values should've been set now … … 190 188 // TODO: dynamic messages based on preferences. (Could be problematic translation wise) 191 189 switch (mode) { 192 case normal:190 case NORMAL: 193 191 // CHECKSTYLE.OFF: LineLength 194 192 return tr("Select ways as in Select mode. Drag selected ways or a single way to create a parallel copy (Alt toggles tag preservation)"); 195 193 // CHECKSTYLE.ON: LineLength 196 case dragging:194 case DRAGGING: 197 195 return tr("Hold Ctrl to toggle snapping"); 198 196 } … … 203 201 private void updateAllPreferences() { 204 202 updateModeLocalPreferences(); 205 // @formatter:off206 // @formatter:on207 203 } 208 204 … … 252 248 Cursor newCursor = null; 253 249 switch (mode) { 254 case normal:250 case NORMAL: 255 251 if (matchesCurrentModifiers(setSelectedModifierCombo)) { 256 252 newCursor = ImageProvider.getCursor("normal", "parallel"); 257 253 } else if (matchesCurrentModifiers(addToSelectionModifierCombo)) { 258 newCursor = ImageProvider.getCursor("normal", "parallel "); // FIXME254 newCursor = ImageProvider.getCursor("normal", "parallel_add"); 259 255 } else if (matchesCurrentModifiers(toggleSelectedModifierCombo)) { 260 newCursor = ImageProvider.getCursor("normal", "parallel"); // FIXME 261 } else if (Main.isDebugEnabled()) { 262 // TODO: set to a cursor indicating an error 263 Main.debug("TODO: set an error cursor"); 256 newCursor = ImageProvider.getCursor("normal", "parallel_remove"); 264 257 } 265 258 break; 266 case dragging: 267 if (snap) { 268 // TODO: snapping cursor? 269 newCursor = Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR); 270 } else { 271 newCursor = Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR); 272 } 259 case DRAGGING: 260 newCursor = Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR); 261 break; 262 default: throw new AssertionError(); 273 263 } 274 264 if (newCursor != null) { … … 352 342 addSourceWay(nearestWay); 353 343 } // else -> invalid modifier combination 354 } else if (mode == Mode. dragging) {344 } else if (mode == Mode.DRAGGING) { 355 345 clearSourceWays(); 356 346 } 357 347 358 setMode(Mode. normal);348 setMode(Mode.NORMAL); 359 349 resetMouseTrackingState(); 360 350 mv.repaint(); … … 392 382 mouseHasBeenDragged = true; 393 383 394 if (mode == Mode. normal) {384 if (mode == Mode.NORMAL) { 395 385 // Should we ensure that the copyTags modifiers are still valid? 396 386 … … 401 391 if (!initParallelWays(mousePressedPos, copyTags)) 402 392 return; 403 setMode(Mode. dragging);393 setMode(Mode.DRAGGING); 404 394 } 405 395 … … 465 455 @Override 466 456 public void paint(Graphics2D g, MapView mv, Bounds bbox) { 467 if (mode == Mode. dragging) {457 if (mode == Mode.DRAGGING) { 468 458 // sanity checks 469 459 if (mv == null) -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r10212 r10220 611 611 this.value = value; 612 612 613 } else if (caseSensitive) {614 this.key = key;615 this.value = value;616 this.keyPattern = null;617 this.valuePattern = null;618 613 } else { 619 614 this.key = key;
Note:
See TracChangeset
for help on using the changeset viewer.