Changeset 34517 in osm for applications/editors/josm
- Timestamp:
- 2018-08-18T18:00:08+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/LaunchAction.java
r34069 r34517 5 5 import java.awt.event.KeyEvent; 6 6 import java.io.File; 7 import java.util. Collection;7 import java.util.Set; 8 8 9 9 import org.openstreetmap.josm.actions.JosmAction; 10 import org.openstreetmap.josm.data.SelectionChangedListener; 11 import org.openstreetmap.josm.data.osm.DataSet; 10 import org.openstreetmap.josm.data.osm.DataSelectionListener; 12 11 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 13 13 import org.openstreetmap.josm.tools.Shortcut; 14 14 15 public class LaunchAction extends JosmAction implements SelectionChangedListener {15 public class LaunchAction extends JosmAction implements DataSelectionListener { 16 16 17 17 private OsmPrimitive selection = null; … … 31 31 32 32 this.pluginDir = pluginDir; 33 DataSet.addSelectionListener(this);33 SelectionEventManager.getInstance().addSelectionListener(this); 34 34 setEnabled(false); 35 35 } … … 53 53 54 54 @Override 55 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 55 public void selectionChanged(SelectionChangeEvent event) { 56 Set<OsmPrimitive> newSelection = event.getSelection(); 56 57 if (newSelection != null && newSelection.size() == 1) { 57 58 setEnabled(true); -
applications/editors/josm/plugins/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/TagDialog.java
r34074 r34517 37 37 import javax.swing.SwingUtilities; 38 38 39 import org.openstreetmap.josm.Main;40 39 import org.openstreetmap.josm.command.ChangePropertyCommand; 41 40 import org.openstreetmap.josm.command.Command; 42 41 import org.openstreetmap.josm.command.SequenceCommand; 42 import org.openstreetmap.josm.data.UndoRedoHandler; 43 43 import org.openstreetmap.josm.data.osm.OsmPrimitive; 44 44 import org.openstreetmap.josm.data.tagging.ac.AutoCompletionItem; … … 106 106 */ 107 107 public TagDialog(File pluginDir, OsmPrimitive selection) { 108 super(Main .parent, tr("House Number Editor"), new String[] { tr("OK"), tr("Cancel") }, true);108 super(MainApplication.getMainFrame(), tr("House Number Editor"), new String[] { tr("OK"), tr("Cancel") }, true); 109 109 this.pluginDir = pluginDir; 110 110 this.selection = selection; … … 521 521 522 522 // executes the commands and adds them to the undo/redo chains 523 Main.main.undoRedo.add(sequenceCommand);523 UndoRedoHandler.getInstance().add(sequenceCommand); 524 524 } 525 525 }
Note:
See TracChangeset
for help on using the changeset viewer.