Changeset 33694 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/DuplicateChosenRelationAction.java
- Timestamp:
- 2017-10-03T22:34:26+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/DuplicateChosenRelationAction.java
r33530 r33694 9 9 10 10 import org.openstreetmap.josm.command.AddCommand; 11 import org.openstreetmap.josm.data.osm.DataSet; 11 12 import org.openstreetmap.josm.data.osm.Relation; 12 13 import org.openstreetmap.josm.gui.MainApplication; … … 17 18 18 19 public class DuplicateChosenRelationAction extends AbstractAction implements ChosenRelationListener { 19 private ChosenRelation rel; 20 private final ChosenRelation rel; 20 21 21 22 public DuplicateChosenRelationAction(ChosenRelation rel) { … … 30 31 @Override 31 32 public void actionPerformed(ActionEvent e) { 32 Relation r = rel.get(); 33 Relation copy = new Relation(r, true); 34 MainApplication.undoRedo.add(new AddCommand(copy)); 35 rel.set(copy); 36 if (MainApplication.getLayerManager().getEditDataSet() != null) { 37 MainApplication.getLayerManager().getEditDataSet().setSelected(copy); 33 DataSet ds = MainApplication.getLayerManager().getEditDataSet(); 34 if (ds != null) { 35 Relation r = rel.get(); 36 Relation copy = new Relation(r, true); 37 MainApplication.undoRedo.add(new AddCommand(ds, copy)); 38 rel.set(copy); 39 ds.setSelected(copy); 38 40 } 39 41 }
Note:
See TracChangeset
for help on using the changeset viewer.
