Changeset 35450 in osm for applications/editors/josm/plugins/alignways/src
- Timestamp:
- 2020-05-15T09:34:10+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysAction.java
r34489 r35450 45 45 return; 46 46 47 Collection<Node> affectableNodes = AlignWaysSegmentMgr.getInstance( 48 MainApplication.getMap().mapView).getSelectedNodes();47 Collection<Node> affectableNodes = AlignWaysSegmentMgr.getInstance(MainApplication.getMap().mapView) 48 .getSelectedNodes(); 49 49 50 50 // c is the last command launched, if any 51 Command c = !UndoRedoHandler.getInstance().commands.isEmpty() ? UndoRedoHandler.getInstance().commands 52 .getLast() : null; 51 Command c = UndoRedoHandler.getInstance().getLastCommand(); 53 52 54 55 56 if (!(c instanceof AlignWaysCmdKeepLength && affectableNodes57 53 // Potentially add my type of command only if last command wasn't my type 54 // or, if it was, the rotated nodes were not the same as now 55 if (!(c instanceof AlignWaysCmdKeepLength 56 && affectableNodes.equals(((AlignWaysCmdKeepLength) c).getPrevAffectedNodes()))) { 58 57 59 60 61 62 63 64 58 AlignWaysCmdKeepLength cmdAW; 59 if (AlignWaysPlugin.getAwDialog().getAwOpt() == AligningModeOption.ALGN_OPT_KEEP_ANGLE) { 60 cmdAW = new AlignWaysCmdKeepAngles(ds); 61 } else { 62 cmdAW = new AlignWaysCmdKeepLength(ds); 63 } 65 64 66 67 68 69 70 65 if (cmdAW.executable()) { 66 // This will also trigger AlignWaysCmdKeepLength.executeCommand() 67 UndoRedoHandler.getInstance().add(cmdAW); 68 } 69 } 71 70 72 MainApplication.getMap().mapView.repaint(); 73 74 return; 71 MainApplication.getMap().mapView.repaint(); 75 72 } 76 73 }
Note:
See TracChangeset
for help on using the changeset viewer.