Changeset 34511 in osm for applications


Ignore:
Timestamp:
2018-08-18T17:20:46+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153

Location:
applications/editors/josm/plugins/FixAddresses
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/FixAddresses/build.xml

    r33718 r34511  
    44    <property name="commit.message" value="[josm_fixadresses]: Fixes #josm8336"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="12840"/>
     6    <property name="plugin.main.version" value="14153"/>
    77       
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/AddressEditContainer.java

    r34058 r34511  
    99import java.util.List;
    1010
    11 import org.openstreetmap.josm.Main;
    1211import org.openstreetmap.josm.data.osm.DataSet;
    1312import org.openstreetmap.josm.data.osm.Node;
     
    2625import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor;
    2726import org.openstreetmap.josm.gui.MainApplication;
     27import org.openstreetmap.josm.gui.layer.MainLayerManager;
    2828import org.openstreetmap.josm.tools.CheckParameterUtil;
    2929
     
    480480     * Rebuilds the street and address lists using the data set given
    481481     * 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()}.
    483483     */
    484484    public void invalidate() {
     
    579579     */
    580580    public void detachFromDataSet() {
    581         //Main.main.getCurrentDataSet().removeDataSetListener(this);
     581        //getCurrentDataSet().removeDataSetListener(this);
    582582        if (workingSet != null) {
    583583            workingSet.clear();
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixAddressesPreferences.java

    r33718 r34511  
    77import javax.swing.JCheckBox;
    88
    9 import org.openstreetmap.josm.Main;
    109import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
    1110import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
    1211import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
    1312import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     13import org.openstreetmap.josm.spi.preferences.Config;
    1414
    1515public final class FixAddressesPreferences extends DefaultTabPreferenceSetting {
     
    4242     */
    4343    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));
    4646    }
    4747
     
    5050     */
    5151    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());
    5454    }
    5555
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/FixUnresolvedStreetsAction.java

    r34058 r34511  
    99
    1010import org.openstreetmap.josm.actions.JosmAction;
    11 import org.openstreetmap.josm.data.SelectionChangedListener;
    12 import org.openstreetmap.josm.data.osm.DataSet;
     11import org.openstreetmap.josm.data.osm.DataSelectionListener;
    1312import org.openstreetmap.josm.data.osm.OsmPrimitive;
     13import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
    1414import org.openstreetmap.josm.plugins.fixAddresses.gui.AddressEditDialog;
    1515import org.openstreetmap.josm.tools.Shortcut;
     
    2121 * @author Oliver Wieland &lt;oliver.wieland@online.de>
    2222 */
    23 @SuppressWarnings("serial")
    24 public class FixUnresolvedStreetsAction extends JosmAction implements SelectionChangedListener {
     23public class FixUnresolvedStreetsAction extends JosmAction implements DataSelectionListener {
    2524    private AddressEditContainer addressEditContainer;
    2625    private Collection<? extends OsmPrimitive> newSelection;
     
    3433        setEnabled(false);
    3534        addressEditContainer = new AddressEditContainer();
    36         DataSet.addSelectionListener(this);
     35        SelectionEventManager.getInstance().addSelectionListener(this);
    3736    }
    3837
    3938    @Override
    40     public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
     39    public void selectionChanged(SelectionChangeEvent event) {
    4140        /* remember new selection for actionPerformed */
    42         this.newSelection = newSelection;
     41        this.newSelection = event.getSelection();
    4342    }
    4443
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/AddressEditDialog.java

    r34058 r34511  
    3434import org.openstreetmap.gui.jmapviewer.JMapViewer;
    3535import org.openstreetmap.gui.jmapviewer.MapMarkerDot;
    36 import org.openstreetmap.josm.Main;
    3736import org.openstreetmap.josm.data.osm.Node;
    3837import org.openstreetmap.josm.data.osm.Way;
     38import org.openstreetmap.josm.gui.MainApplication;
    3939import org.openstreetmap.josm.gui.SideButton;
    4040import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
     
    4848import org.openstreetmap.josm.plugins.fixAddresses.gui.actions.ApplyAllGuessesAction;
    4949import org.openstreetmap.josm.tools.ImageProvider;
     50import org.openstreetmap.josm.tools.Logging;
    5051
    5152@SuppressWarnings("serial")
     
    7677
    7778    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);
    7980
    8081        this.editContainer = addressEditContainer;
     
    155156                unresolvedPanel.add(unresolvedButtons, BorderLayout.SOUTH);
    156157            } catch (Exception e) {
    157                 e.printStackTrace();
     158                Logging.error(e);
    158159            }
    159160
  • applications/editors/josm/plugins/FixAddresses/src/org/openstreetmap/josm/plugins/fixAddresses/gui/actions/AbstractAddressEditAction.java

    r34058 r34511  
    66import java.util.List;
    77
    8 import org.openstreetmap.josm.Main;
    98import org.openstreetmap.josm.actions.JosmAction;
    109import org.openstreetmap.josm.command.Command;
    1110import org.openstreetmap.josm.command.SequenceCommand;
     11import org.openstreetmap.josm.data.UndoRedoHandler;
    1212import org.openstreetmap.josm.plugins.fixAddresses.AddressEditContainer;
    1313import org.openstreetmap.josm.plugins.fixAddresses.IAddressEditContainerListener;
     
    172172        // execute the commands
    173173        if (!commands.isEmpty()) {
    174             Main.main.undoRedo.add(new SequenceCommand(txName, commands));
     174            UndoRedoHandler.getInstance().add(new SequenceCommand(txName, commands));
    175175            commands.clear();
    176176            if (container != null) {
Note: See TracChangeset for help on using the changeset viewer.