Changeset 35450 in osm for applications/editors/josm/plugins
- Timestamp:
- 2020-05-15T09:34:10+02:00 (6 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 // Potentially add my type of command only if last command wasn't my type55 // or, if it was, the rotated nodes were not the same as now56 if (!(c instanceof AlignWaysCmdKeepLength&& affectableNodes57 .equals(((AlignWaysCmdKeepLength) c).getPrevAffectedNodes()))) {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 AlignWaysCmdKeepLength cmdAW;60 if (AlignWaysPlugin.getAwDialog().getAwOpt() == AligningModeOption.ALGN_OPT_KEEP_ANGLE) {61 cmdAW = new AlignWaysCmdKeepAngles(ds);62 } else {63 cmdAW = new AlignWaysCmdKeepLength(ds);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 if (cmdAW.executable()) {67 // This will also trigger AlignWaysCmdKeepLength.executeCommand()68 UndoRedoHandler.getInstance().add(cmdAW);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.
