Changeset 32395 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/DuplicateChosenRelationAction.java
- Timestamp:
- 2016-06-24T09:10:57+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/DuplicateChosenRelationAction.java
r26290 r32395 1 // License: GPL. For details, see LICENSE file. 1 2 package relcontext.actions; 2 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 4 6 import java.awt.event.ActionEvent; 7 5 8 import javax.swing.AbstractAction; 9 6 10 import org.openstreetmap.josm.Main; 7 11 import org.openstreetmap.josm.command.AddCommand; 8 12 import org.openstreetmap.josm.data.osm.Relation; 9 13 import org.openstreetmap.josm.tools.ImageProvider; 14 10 15 import relcontext.ChosenRelation; 11 16 import relcontext.ChosenRelationListener; … … 14 19 private ChosenRelation rel; 15 20 16 public DuplicateChosenRelationAction( ChosenRelation rel) {21 public DuplicateChosenRelationAction(ChosenRelation rel) { 17 22 super(tr("Duplicate relation")); 18 23 putValue(SMALL_ICON, ImageProvider.get("duplicate")); … … 23 28 } 24 29 25 public void actionPerformed( ActionEvent e ) { 30 @Override 31 public void actionPerformed(ActionEvent e) { 26 32 Relation r = rel.get(); 27 33 Relation copy = new Relation(r, true); 28 34 Main.main.undoRedo.add(new AddCommand(copy)); 29 35 rel.set(copy); 30 if (Main.main.getCurrentDataSet() != null )36 if (Main.main.getCurrentDataSet() != null ) { 31 37 Main.main.getCurrentDataSet().setSelected(copy); 38 } 32 39 } 33 40 34 public void chosenRelationChanged( Relation oldRelation, Relation newRelation ) { 41 @Override 42 public void chosenRelationChanged(Relation oldRelation, Relation newRelation) { 35 43 setEnabled(newRelation != null); 36 44 }
Note:
See TracChangeset
for help on using the changeset viewer.
