Changeset 301 in josm for src/org/openstreetmap/josm/actions/mapmode
- Timestamp:
- 2007-08-08T14:56:38+02:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm/actions/mapmode
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/actions/mapmode/AddNodeAction.java
r298 r301 170 170 } 171 171 172 Main.main. editLayer().add(c);172 Main.main.undoRedo.add(c); 173 173 Main.ds.setSelected(n); 174 174 Main.map.mapView.repaint(); -
src/org/openstreetmap/josm/actions/mapmode/AddSegmentAction.java
r298 r301 146 146 147 147 Segment ls = new Segment(start, end); 148 Main.main. editLayer().add(new AddCommand(ls));148 Main.main.undoRedo.add(new AddCommand(ls)); 149 149 Collection<OsmPrimitive> sel = Main.ds.getSelected(); 150 150 sel.add(ls); -
src/org/openstreetmap/josm/actions/mapmode/AddWayAction.java
r298 r301 107 107 copy.segments.remove(s); 108 108 if (copy.segments.isEmpty()) { 109 Main.main. editLayer().add(new DeleteCommand(Arrays.asList(new OsmPrimitive[]{way})));109 Main.main.undoRedo.add(new DeleteCommand(Arrays.asList(new OsmPrimitive[]{way}))); 110 110 way = null; 111 111 } else 112 Main.main. editLayer().add(new ChangeCommand(way, copy));112 Main.main.undoRedo.add(new ChangeCommand(way, copy)); 113 113 } else { 114 114 if (way == null) { 115 115 way = new Way(); 116 116 way.segments.add(s); 117 Main.main. editLayer().add(new AddCommand(way));117 Main.main.undoRedo.add(new AddCommand(way)); 118 118 } else { 119 119 Way copy = new Way(way); … … 123 123 break; 124 124 copy.segments.add(i, s); 125 Main.main. editLayer().add(new ChangeCommand(way, copy));125 Main.main.undoRedo.add(new ChangeCommand(way, copy)); 126 126 } 127 127 } … … 198 198 w.segments.clear(); 199 199 w.segments.addAll(sortedSegments); 200 Main.main. editLayer().add(new ChangeCommand(wayToAdd, w));200 Main.main.undoRedo.add(new ChangeCommand(wayToAdd, w)); 201 201 return wayToAdd; 202 202 } … … 207 207 Way w = new Way(); 208 208 w.segments.addAll(sortedSegments); 209 Main.main. editLayer().add(new AddCommand(w));209 Main.main.undoRedo.add(new AddCommand(w)); 210 210 return w; 211 211 } -
src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r298 r301 126 126 v.data.addAll(selection); 127 127 if (!v.data.isEmpty()) 128 Main.main. editLayer().add(new DeleteCommand(v.data));128 Main.main.undoRedo.add(new DeleteCommand(v.data)); 129 129 } 130 130 … … 164 164 } 165 165 if (!del.isEmpty()) 166 Main.main. editLayer().add(new DeleteCommand(del));166 Main.main.undoRedo.add(new DeleteCommand(del)); 167 167 } 168 168 … … 213 213 cmds.add(new ChangeCommand(seg1, s)); 214 214 cmds.add(new DeleteCommand(Arrays.asList(new OsmPrimitive[]{n, seg2}))); 215 Main.main. editLayer().add(new SequenceCommand(tr("Delete Node"), cmds));215 Main.main.undoRedo.add(new SequenceCommand(tr("Delete Node"), cmds)); 216 216 return null; 217 217 } -
src/org/openstreetmap/josm/actions/mapmode/MoveAction.java
r298 r301 106 106 } 107 107 108 Command c = !Main.main. editLayer().commands.isEmpty() ? Main.main.editLayer().commands.getLast() : null;108 Command c = !Main.main.undoRedo.commands.isEmpty() ? Main.main.undoRedo.commands.getLast() : null; 109 109 if (c instanceof MoveCommand && affectedNodes.equals(((MoveCommand)c).objects)) 110 110 ((MoveCommand)c).moveAgain(dx,dy); 111 111 else 112 Main.main. editLayer().add(new MoveCommand(selection, dx, dy));112 Main.main.undoRedo.add(new MoveCommand(selection, dx, dy)); 113 113 114 114 Main.map.mapView.repaint();
Note:
See TracChangeset
for help on using the changeset viewer.