Changeset 34511 in osm for applications
- Timestamp:
- 2018-08-18T17:20:46+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/FixAddresses
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/FixAddresses/build.xml
r33718 r34511 4 4 <property name="commit.message" value="[josm_fixadresses]: Fixes #josm8336"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 2840"/>6 <property name="plugin.main.version" value="14153"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressEditContainer.java
r34058 r34511 9 9 import java.util.List; 10 10 11 import org.openstreetmap.josm.Main;12 11 import org.openstreetmap.josm.data.osm.DataSet; 13 12 import org.openstreetmap.josm.data.osm.Node; … … 26 25 import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor; 27 26 import org.openstreetmap.josm.gui.MainApplication; 27 import org.openstreetmap.josm.gui.layer.MainLayerManager; 28 28 import org.openstreetmap.josm.tools.CheckParameterUtil; 29 29 … … 480 480 * Rebuilds the street and address lists using the data set given 481 481 * in {@link AddressEditContainer#attachToDataSet(Collection)} or the 482 * full data set of the current data layer {@link Main #getCurrentDataSet()}.482 * full data set of the current data layer {@link MainLayerManager#getEditDataSet()}. 483 483 */ 484 484 public void invalidate() { … … 579 579 */ 580 580 public void detachFromDataSet() { 581 // Main.main.getCurrentDataSet().removeDataSetListener(this);581 //getCurrentDataSet().removeDataSetListener(this); 582 582 if (workingSet != null) { 583 583 workingSet.clear(); -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesPreferences.java
r33718 r34511 7 7 import javax.swing.JCheckBox; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; 11 10 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 12 11 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; 13 12 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 13 import org.openstreetmap.josm.spi.preferences.Config; 14 14 15 15 public final class FixAddressesPreferences extends DefaultTabPreferenceSetting { … … 42 42 */ 43 43 private void loadFromPrefs() { 44 setSelectGuessedObjects( Main.pref.getBoolean(FIX_ADDRESSES_SELECT_GUESSED_OBJECTS_KEY, false));45 setIgnorePostCode( Main.pref.getBoolean(FIX_ADDRESSES_IGNORE_POST_CODE_KEY, false));44 setSelectGuessedObjects(Config.getPref().getBoolean(FIX_ADDRESSES_SELECT_GUESSED_OBJECTS_KEY, false)); 45 setIgnorePostCode(Config.getPref().getBoolean(FIX_ADDRESSES_IGNORE_POST_CODE_KEY, false)); 46 46 } 47 47 … … 50 50 */ 51 51 private void saveToPrefs() { 52 Main.pref.putBoolean(FIX_ADDRESSES_SELECT_GUESSED_OBJECTS_KEY, isSelectGuessedObjects());53 Main.pref.putBoolean(FIX_ADDRESSES_IGNORE_POST_CODE_KEY, isIgnorePostCode());52 Config.getPref().putBoolean(FIX_ADDRESSES_SELECT_GUESSED_OBJECTS_KEY, isSelectGuessedObjects()); 53 Config.getPref().putBoolean(FIX_ADDRESSES_IGNORE_POST_CODE_KEY, isIgnorePostCode()); 54 54 } 55 55 -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixUnresolvedStreetsAction.java
r34058 r34511 9 9 10 10 import org.openstreetmap.josm.actions.JosmAction; 11 import org.openstreetmap.josm.data.SelectionChangedListener; 12 import org.openstreetmap.josm.data.osm.DataSet; 11 import org.openstreetmap.josm.data.osm.DataSelectionListener; 13 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; 13 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 14 14 import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditDialog; 15 15 import org.openstreetmap.josm.tools.Shortcut; … … 21 21 * @author Oliver Wieland <oliver.wieland@online.de> 22 22 */ 23 @SuppressWarnings("serial") 24 public class FixUnresolvedStreetsAction extends JosmAction implements SelectionChangedListener { 23 public class FixUnresolvedStreetsAction extends JosmAction implements DataSelectionListener { 25 24 private AddressEditContainer addressEditContainer; 26 25 private Collection<? extends OsmPrimitive> newSelection; … … 34 33 setEnabled(false); 35 34 addressEditContainer = new AddressEditContainer(); 36 DataSet.addSelectionListener(this);35 SelectionEventManager.getInstance().addSelectionListener(this); 37 36 } 38 37 39 38 @Override 40 public void selectionChanged( Collection<? extends OsmPrimitive> newSelection) {39 public void selectionChanged(SelectionChangeEvent event) { 41 40 /* remember new selection for actionPerformed */ 42 this.newSelection = newSelection;41 this.newSelection = event.getSelection(); 43 42 } 44 43 -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java
r34058 r34511 34 34 import org.openstreetmap.gui.jmapviewer.JMapViewer; 35 35 import org.openstreetmap.gui.jmapviewer.MapMarkerDot; 36 import org.openstreetmap.josm.Main;37 36 import org.openstreetmap.josm.data.osm.Node; 38 37 import org.openstreetmap.josm.data.osm.Way; 38 import org.openstreetmap.josm.gui.MainApplication; 39 39 import org.openstreetmap.josm.gui.SideButton; 40 40 import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer; … … 48 48 import org.openstreetmap.josm.plugins.fixAddresses.gui.actions.ApplyAllGuessesAction; 49 49 import org.openstreetmap.josm.tools.ImageProvider; 50 import org.openstreetmap.josm.tools.Logging; 50 51 51 52 @SuppressWarnings("serial") … … 76 77 77 78 public AddressEditDialog(AddressEditContainer addressEditContainer) throws HeadlessException { 78 super(JOptionPane.getFrameForComponent(Main .parent), tr("Fix unresolved addresses"), false);79 super(JOptionPane.getFrameForComponent(MainApplication.getMainFrame()), tr("Fix unresolved addresses"), false); 79 80 80 81 this.editContainer = addressEditContainer; … … 155 156 unresolvedPanel.add(unresolvedButtons, BorderLayout.SOUTH); 156 157 } catch (Exception e) { 157 e.printStackTrace();158 Logging.error(e); 158 159 } 159 160 -
applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AbstractAddressEditAction.java
r34058 r34511 6 6 import java.util.List; 7 7 8 import org.openstreetmap.josm.Main;9 8 import org.openstreetmap.josm.actions.JosmAction; 10 9 import org.openstreetmap.josm.command.Command; 11 10 import org.openstreetmap.josm.command.SequenceCommand; 11 import org.openstreetmap.josm.data.UndoRedoHandler; 12 12 import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer; 13 13 import org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener; … … 172 172 // execute the commands 173 173 if (!commands.isEmpty()) { 174 Main.main.undoRedo.add(new SequenceCommand(txName, commands));174 UndoRedoHandler.getInstance().add(new SequenceCommand(txName, commands)); 175 175 commands.clear(); 176 176 if (container != null) {
Note:
See TracChangeset
for help on using the changeset viewer.