Changeset 12881 in josm


Ignore:
Timestamp:
2017-09-21T12:41:32+02:00 (12 months ago)
Author:
bastiK
Message:

see #15229 - move remaining classes to spi.preferences package, to make it self-contained

  • extract event listener classes from Preferences (duplicated, for smooth transition)
  • move *Setting classes
Location:
trunk/src/org/openstreetmap/josm
Files:
3 added
37 edited
7 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/PreferenceToggleAction.java

    r12846 r12881  
    77
    88import org.openstreetmap.josm.Main;
     9import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
    910import org.openstreetmap.josm.data.Preferences;
    10 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     11import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    1112import org.openstreetmap.josm.data.preferences.BooleanProperty;
    1213
     
    5253
    5354    @Override
    54     public void preferenceChanged(Preferences.PreferenceChangeEvent e) {
     55    public void preferenceChanged(PreferenceChangeEvent e) {
    5556        checkbox.setSelected(pref.get());
    5657    }
  • trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    r12856 r12881  
    2727import org.openstreetmap.josm.data.osm.DataSet;
    2828import org.openstreetmap.josm.data.osm.DatasetConsistencyTest;
    29 import org.openstreetmap.josm.data.preferences.Setting;
     29import org.openstreetmap.josm.spi.preferences.Setting;
    3030import org.openstreetmap.josm.data.preferences.sources.MapPaintPrefHelper;
    3131import org.openstreetmap.josm.data.preferences.sources.PresetPrefHelper;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java

    r12873 r12881  
    1212
    1313import org.openstreetmap.josm.actions.JosmAction;
    14 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    15 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     14import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     15import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    1616import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1717import org.openstreetmap.josm.gui.MainApplication;
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r12865 r12881  
    4848import org.openstreetmap.josm.data.preferences.DoubleProperty;
    4949import org.openstreetmap.josm.data.preferences.IntegerProperty;
    50 import org.openstreetmap.josm.data.preferences.ListListSetting;
    51 import org.openstreetmap.josm.data.preferences.ListSetting;
     50import org.openstreetmap.josm.spi.preferences.ListListSetting;
     51import org.openstreetmap.josm.spi.preferences.ListSetting;
    5252import org.openstreetmap.josm.data.preferences.LongProperty;
    53 import org.openstreetmap.josm.data.preferences.MapListSetting;
     53import org.openstreetmap.josm.spi.preferences.MapListSetting;
    5454import org.openstreetmap.josm.data.preferences.PreferencesReader;
    5555import org.openstreetmap.josm.data.preferences.PreferencesWriter;
    56 import org.openstreetmap.josm.data.preferences.Setting;
    57 import org.openstreetmap.josm.data.preferences.StringSetting;
     56import org.openstreetmap.josm.spi.preferences.Setting;
     57import org.openstreetmap.josm.spi.preferences.StringSetting;
    5858import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry;
    5959import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper;
     
    157157    /**
    158158     * Event triggered when a preference entry value changes.
    159      */
     159     * @deprecated use {@link org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent}
     160     */
     161    @Deprecated
    160162    public interface PreferenceChangeEvent {
    161163        /**
     
    181183     * Listener to preference change events.
    182184     * @since 10600 (functional interface)
     185     * @deprecated use {@link org.openstreetmap.josm.spi.preferences.PreferenceChangedListener}
    183186     */
    184187    @FunctionalInterface
     188    @Deprecated
    185189    public interface PreferenceChangedListener {
    186190        /**
     
    191195    }
    192196
     197    @Deprecated
    193198    private static class DefaultPreferenceChangeEvent implements PreferenceChangeEvent {
    194199        private final String key;
     
    218223    }
    219224
    220     private final ListenerList<PreferenceChangedListener> listeners = ListenerList.create();
    221 
    222     private final HashMap<String, ListenerList<PreferenceChangedListener>> keyListeners = new HashMap<>();
     225    private final ListenerList<org.openstreetmap.josm.spi.preferences.PreferenceChangedListener> listeners = ListenerList.create();
     226
     227    private final HashMap<String, ListenerList<org.openstreetmap.josm.spi.preferences.PreferenceChangedListener>> keyListeners = new HashMap<>();
     228
     229    @Deprecated
     230    private final ListenerList<Preferences.PreferenceChangedListener> listenersDeprecated = ListenerList.create();
     231
     232    @Deprecated
     233    private final HashMap<String, ListenerList<Preferences.PreferenceChangedListener>> keyListenersDeprecated = new HashMap<>();
    223234
    224235    /**
     
    243254     * Adds a new preferences listener.
    244255     * @param listener The listener to add
     256     * @since xxx
    245257     */
    246258    @Override
    247     public void addPreferenceChangeListener(PreferenceChangedListener listener) {
     259    public void addPreferenceChangeListener(org.openstreetmap.josm.spi.preferences.PreferenceChangedListener listener) {
    248260        if (listener != null) {
    249261            listeners.addListener(listener);
     
    252264
    253265    /**
     266     * Adds a new preferences listener.
     267     * @param listener The listener to add
     268     * @deprecated use {@link #addPreferenceChangeListener(org.openstreetmap.josm.spi.preferences.PreferenceChangedListener)}
     269     */
     270    @Deprecated
     271    public void addPreferenceChangeListener(Preferences.PreferenceChangedListener listener) {
     272        if (listener != null) {
     273            listenersDeprecated.addListener(listener);
     274        }
     275    }
     276
     277    /**
    254278     * Removes a preferences listener.
    255279     * @param listener The listener to remove
     280     * @since xxx
    256281     */
    257282    @Override
    258     public void removePreferenceChangeListener(PreferenceChangedListener listener) {
     283    public void removePreferenceChangeListener(org.openstreetmap.josm.spi.preferences.PreferenceChangedListener listener) {
    259284        listeners.removeListener(listener);
     285    }
     286
     287    /**
     288     * Removes a preferences listener.
     289     * @param listener The listener to remove
     290     * @deprecated use {@link #removePreferenceChangeListener(org.openstreetmap.josm.spi.preferences.PreferenceChangedListener)}
     291     */
     292    @Deprecated
     293    public void removePreferenceChangeListener(Preferences.PreferenceChangedListener listener) {
     294        listenersDeprecated.removeListener(listener);
     295    }
     296
     297    /**
     298     * Adds a listener that only listens to changes in one preference
     299     * @param key The preference key to listen to
     300     * @param listener The listener to add.
     301     * @since xxx
     302     */
     303    @Override
     304    public void addKeyPreferenceChangeListener(String key, org.openstreetmap.josm.spi.preferences.PreferenceChangedListener listener) {
     305        listenersForKey(key).addListener(listener);
    260306    }
    261307
     
    265311     * @param listener The listener to add.
    266312     * @since 10824
    267      */
    268     @Override
    269     public void addKeyPreferenceChangeListener(String key, PreferenceChangedListener listener) {
    270         listenersForKey(key).addListener(listener);
     313     * @deprecated use {@link #addKeyPreferenceChangeListener(java.lang.String, org.openstreetmap.josm.spi.preferences.PreferenceChangedListener)}
     314     */
     315    @Deprecated
     316    public void addKeyPreferenceChangeListener(String key, Preferences.PreferenceChangedListener listener) {
     317        listenersForKeyDeprecated(key).addListener(listener);
    271318    }
    272319
     
    277324     * @since 10824
    278325     */
    279     public void addWeakKeyPreferenceChangeListener(String key, PreferenceChangedListener listener) {
     326    public void addWeakKeyPreferenceChangeListener(String key, org.openstreetmap.josm.spi.preferences.PreferenceChangedListener listener) {
    280327        listenersForKey(key).addWeakListener(listener);
    281328    }
    282329
    283     private ListenerList<PreferenceChangedListener> listenersForKey(String key) {
     330    private ListenerList<org.openstreetmap.josm.spi.preferences.PreferenceChangedListener> listenersForKey(String key) {
    284331        return keyListeners.computeIfAbsent(key, k -> ListenerList.create());
     332    }
     333
     334    @Deprecated
     335    private ListenerList<Preferences.PreferenceChangedListener> listenersForKeyDeprecated(String key) {
     336        return keyListenersDeprecated.computeIfAbsent(key, k -> ListenerList.create());
    285337    }
    286338
     
    289341     * @param key The preference key to listen to
    290342     * @param listener The listener to add.
     343     * @since xxx
    291344     */
    292345    @Override
    293     public void removeKeyPreferenceChangeListener(String key, PreferenceChangedListener listener) {
     346    public void removeKeyPreferenceChangeListener(String key, org.openstreetmap.josm.spi.preferences.PreferenceChangedListener listener) {
    294347        Optional.ofNullable(keyListeners.get(key)).orElseThrow(
    295348                () -> new IllegalArgumentException("There are no listeners registered for " + key))
     
    297350    }
    298351
     352    /**
     353     * Removes a listener that only listens to changes in one preference
     354     * @param key The preference key to listen to
     355     * @param listener The listener to add.
     356     * @deprecated use {@link #removeKeyPreferenceChangeListener(java.lang.String, org.openstreetmap.josm.spi.preferences.PreferenceChangedListener)}
     357     */
     358    @Deprecated
     359    public void removeKeyPreferenceChangeListener(String key, Preferences.PreferenceChangedListener listener) {
     360        Optional.ofNullable(keyListenersDeprecated.get(key)).orElseThrow(
     361                () -> new IllegalArgumentException("There are no listeners registered for " + key))
     362        .removeListener(listener);
     363    }
     364
    299365    protected void firePreferenceChanged(String key, Setting<?> oldValue, Setting<?> newValue) {
    300         final PreferenceChangeEvent evt = new DefaultPreferenceChangeEvent(key, oldValue, newValue);
     366        final org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent evt = new org.openstreetmap.josm.spi.preferences.DefaultPreferenceChangeEvent(key, oldValue, newValue);
    301367        listeners.fireEvent(listener -> listener.preferenceChanged(evt));
    302368
    303         ListenerList<PreferenceChangedListener> forKey = keyListeners.get(key);
     369        ListenerList<org.openstreetmap.josm.spi.preferences.PreferenceChangedListener> forKey = keyListeners.get(key);
    304370        if (forKey != null) {
    305371            forKey.fireEvent(listener -> listener.preferenceChanged(evt));
     372        }
     373        firePreferenceChangedDeprecated(key, oldValue, newValue);
     374    }
     375
     376    @Deprecated
     377    private void firePreferenceChangedDeprecated(String key, Setting<?> oldValue, Setting<?> newValue) {
     378        final Preferences.PreferenceChangeEvent evtDeprecated = new Preferences.DefaultPreferenceChangeEvent(key, oldValue, newValue);
     379        listenersDeprecated.fireEvent(listener -> listener.preferenceChanged(evtDeprecated));
     380
     381        ListenerList<Preferences.PreferenceChangedListener> forKeyDeprecated = keyListenersDeprecated.get(key);
     382        if (forKeyDeprecated != null) {
     383            forKeyDeprecated.fireEvent(listener -> listener.preferenceChanged(evtDeprecated));
    306384        }
    307385    }
  • trunk/src/org/openstreetmap/josm/data/PreferencesUtils.java

    r12869 r12881  
    1818
    1919import org.openstreetmap.josm.Main;
    20 import org.openstreetmap.josm.data.preferences.ListListSetting;
    21 import org.openstreetmap.josm.data.preferences.ListSetting;
    22 import org.openstreetmap.josm.data.preferences.MapListSetting;
    23 import org.openstreetmap.josm.data.preferences.Setting;
    24 import org.openstreetmap.josm.data.preferences.StringSetting;
     20import org.openstreetmap.josm.spi.preferences.ListListSetting;
     21import org.openstreetmap.josm.spi.preferences.ListSetting;
     22import org.openstreetmap.josm.spi.preferences.MapListSetting;
     23import org.openstreetmap.josm.spi.preferences.Setting;
     24import org.openstreetmap.josm.spi.preferences.StringSetting;
    2525import org.openstreetmap.josm.tools.Logging;
    2626import org.openstreetmap.josm.tools.Utils;
  • trunk/src/org/openstreetmap/josm/data/UserIdentityManager.java

    r12846 r12881  
    77
    88import org.openstreetmap.josm.Main;
    9 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    10 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     9import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     10import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    1111import org.openstreetmap.josm.data.oauth.OAuthAccessTokenHolder;
    1212import org.openstreetmap.josm.data.osm.User;
    1313import org.openstreetmap.josm.data.osm.UserInfo;
    14 import org.openstreetmap.josm.data.preferences.StringSetting;
     14import org.openstreetmap.josm.spi.preferences.StringSetting;
    1515import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    1616import org.openstreetmap.josm.io.OnlineResource;
  • trunk/src/org/openstreetmap/josm/data/osm/ChangesetCache.java

    r12846 r12881  
    1212import java.util.stream.Collectors;
    1313
    14 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    15 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     14import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     15import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    1616import org.openstreetmap.josm.data.UserIdentityManager;
    1717import org.openstreetmap.josm.spi.preferences.Config;
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java

    r12846 r12881  
    44import java.awt.Color;
    55
    6 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    7 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     6import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     7import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    88import org.openstreetmap.josm.spi.preferences.Config;
    99
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java

    r12846 r12881  
    1515
    1616import org.openstreetmap.josm.Main;
    17 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    18 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     17import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     18import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    1919import org.openstreetmap.josm.data.coor.EastNorth;
    2020import org.openstreetmap.josm.data.osm.DataSet;
  • trunk/src/org/openstreetmap/josm/data/preferences/AbstractProperty.java

    r12207 r12881  
    44import org.openstreetmap.josm.Main;
    55import org.openstreetmap.josm.data.Preferences;
    6 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    7 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     6import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     7import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    88import org.openstreetmap.josm.tools.ListenableWeakReference;
    99import org.openstreetmap.josm.tools.bugreport.BugReport;
  • trunk/src/org/openstreetmap/josm/data/preferences/AbstractToStringProperty.java

    r12620 r12881  
    22package org.openstreetmap.josm.data.preferences;
    33
    4 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     4import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    55import org.openstreetmap.josm.tools.CheckParameterUtil;
    66import org.openstreetmap.josm.tools.Logging;
  • trunk/src/org/openstreetmap/josm/data/preferences/CachedProperty.java

    r12867 r12881  
    22package org.openstreetmap.josm.data.preferences;
    33
    4 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    5 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     4import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     5import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    66import org.openstreetmap.josm.spi.preferences.Config;
    77
  • trunk/src/org/openstreetmap/josm/data/preferences/PreferencesReader.java

    r12620 r12881  
    3232import org.openstreetmap.josm.io.CachedFile;
    3333import org.openstreetmap.josm.io.XmlStreamParsingException;
     34import org.openstreetmap.josm.spi.preferences.Setting;
     35import org.openstreetmap.josm.spi.preferences.ListListSetting;
     36import org.openstreetmap.josm.spi.preferences.ListSetting;
     37import org.openstreetmap.josm.spi.preferences.MapListSetting;
     38import org.openstreetmap.josm.spi.preferences.StringSetting;
    3439import org.openstreetmap.josm.tools.Logging;
    3540import org.xml.sax.SAXException;
  • trunk/src/org/openstreetmap/josm/data/preferences/PreferencesWriter.java

    r11746 r12881  
    1212import org.openstreetmap.josm.data.Version;
    1313import org.openstreetmap.josm.io.XmlWriter;
     14import org.openstreetmap.josm.spi.preferences.Setting;
     15import org.openstreetmap.josm.spi.preferences.ListListSetting;
     16import org.openstreetmap.josm.spi.preferences.SettingVisitor;
     17import org.openstreetmap.josm.spi.preferences.ListSetting;
     18import org.openstreetmap.josm.spi.preferences.MapListSetting;
     19import org.openstreetmap.josm.spi.preferences.StringSetting;
    1420
    1521/**
  • trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java

    r12743 r12881  
    22package org.openstreetmap.josm.gui;
    33
    4 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
     4import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
    55import org.openstreetmap.josm.data.UserIdentityManager;
    66import org.openstreetmap.josm.data.osm.User;
  • trunk/src/org/openstreetmap/josm/gui/MapFrame.java

    r12846 r12881  
    5151import org.openstreetmap.josm.actions.mapmode.SelectAction;
    5252import org.openstreetmap.josm.actions.mapmode.ZoomAction;
    53 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     53import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    5454import org.openstreetmap.josm.data.ViewportData;
    5555import org.openstreetmap.josm.data.preferences.BooleanProperty;
  • trunk/src/org/openstreetmap/josm/gui/MapMover.java

    r12846 r12881  
    1919import org.openstreetmap.josm.Main;
    2020import org.openstreetmap.josm.actions.mapmode.SelectAction;
    21 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    22 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     21import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     22import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    2323import org.openstreetmap.josm.data.coor.EastNorth;
    2424import org.openstreetmap.josm.data.preferences.BooleanProperty;
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r12866 r12881  
    5656
    5757import org.openstreetmap.josm.Main;
    58 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    59 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     58import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     59import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    6060import org.openstreetmap.josm.data.SystemOfMeasurement;
    6161import org.openstreetmap.josm.data.SystemOfMeasurement.SoMChangeListener;
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r12846 r12881  
    4141import org.openstreetmap.josm.actions.mapmode.MapMode;
    4242import org.openstreetmap.josm.data.Bounds;
    43 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    44 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     43import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     44import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    4545import org.openstreetmap.josm.data.ProjectionBounds;
    4646import org.openstreetmap.josm.data.ViewportData;
  • trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilterManager.java

    r12846 r12881  
    2222
    2323import org.openstreetmap.josm.actions.mapmode.MapMode;
    24 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    25 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     24import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     25import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    2626import org.openstreetmap.josm.data.osm.BBox;
    2727import org.openstreetmap.josm.data.osm.DataSet;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r12846 r12881  
    5050import org.openstreetmap.josm.Main;
    5151import org.openstreetmap.josm.actions.JosmAction;
    52 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    53 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     52import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     53import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    5454import org.openstreetmap.josm.data.preferences.BooleanProperty;
    5555import org.openstreetmap.josm.data.preferences.ParametrizedEnumProperty;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r12846 r12881  
    6363import org.openstreetmap.josm.command.ChangePropertyCommand;
    6464import org.openstreetmap.josm.command.Command;
    65 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     65import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    6666import org.openstreetmap.josm.data.SelectionChangedListener;
    6767import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
  • trunk/src/org/openstreetmap/josm/gui/io/CustomConfigurator.java

    r12856 r12881  
    4545import org.openstreetmap.josm.data.PreferencesUtils;
    4646import org.openstreetmap.josm.data.Version;
    47 import org.openstreetmap.josm.data.preferences.Setting;
     47import org.openstreetmap.josm.spi.preferences.Setting;
    4848import org.openstreetmap.josm.gui.MainApplication;
    4949import org.openstreetmap.josm.plugins.PluginDownloadTask;
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r12853 r12881  
    4343import org.openstreetmap.josm.Main;
    4444import org.openstreetmap.josm.data.APIDataSet;
    45 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    46 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     45import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     46import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    4747import org.openstreetmap.josm.data.Version;
    4848import org.openstreetmap.josm.data.osm.Changeset;
    4949import org.openstreetmap.josm.data.osm.DataSet;
    5050import org.openstreetmap.josm.data.osm.OsmPrimitive;
    51 import org.openstreetmap.josm.data.preferences.Setting;
     51import org.openstreetmap.josm.spi.preferences.Setting;
    5252import org.openstreetmap.josm.gui.ExtendedDialog;
    5353import org.openstreetmap.josm.gui.HelpAwareOptionPane;
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java

    r12725 r12881  
    2424
    2525import org.openstreetmap.josm.Main;
    26 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
     26import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
    2727import org.openstreetmap.josm.data.coor.CachedLatLon;
    2828import org.openstreetmap.josm.data.coor.EastNorth;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java

    r12846 r12881  
    1111import java.util.Map.Entry;
    1212
    13 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    14 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     13import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     14import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    1515import org.openstreetmap.josm.data.osm.Node;
    1616import org.openstreetmap.josm.data.osm.OsmPrimitive;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LabelCompositionStrategy.java

    r12854 r12881  
    88import java.util.Objects;
    99
    10 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    11 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
     10import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent;
     11import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
    1212import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1313import org.openstreetmap.josm.spi.preferences.Config;
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java

    r12856 r12881  
    4040import org.openstreetmap.josm.data.Preferences;
    4141import org.openstreetmap.josm.data.PreferencesUtils;
    42 import org.openstreetmap.josm.data.preferences.Setting;
    43 import org.openstreetmap.josm.data.preferences.StringSetting;
     42import org.openstreetmap.josm.spi.preferences.Setting;
     43import org.openstreetmap.josm.spi.preferences.StringSetting;
    4444import org.openstreetmap.josm.gui.dialogs.LogShowDialog;
    4545import org.openstreetmap.josm.gui.io.CustomConfigurator;
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileAction.java

    r12634 r12881  
    2020import org.openstreetmap.josm.actions.DiskAccessAction;
    2121import org.openstreetmap.josm.data.Preferences;
    22 import org.openstreetmap.josm.data.preferences.Setting;
     22import org.openstreetmap.josm.spi.preferences.Setting;
    2323import org.openstreetmap.josm.gui.io.CustomConfigurator;
    2424import org.openstreetmap.josm.gui.widgets.AbstractFileChooser;
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java

    r10657 r12881  
    1616import javax.swing.table.AbstractTableModel;
    1717
    18 import org.openstreetmap.josm.data.preferences.ListSetting;
     18import org.openstreetmap.josm.spi.preferences.ListSetting;
    1919import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2020import org.openstreetmap.josm.tools.GBC;
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListListEditor.java

    r9759 r12881  
    1212import javax.swing.table.AbstractTableModel;
    1313
    14 import org.openstreetmap.josm.data.preferences.ListListSetting;
     14import org.openstreetmap.josm.spi.preferences.ListListSetting;
    1515
    1616/**
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java

    r9759 r12881  
    1616import javax.swing.table.AbstractTableModel;
    1717
    18 import org.openstreetmap.josm.data.preferences.MapListSetting;
     18import org.openstreetmap.josm.spi.preferences.MapListSetting;
    1919
    2020/**
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PrefEntry.java

    r11553 r12881  
    22package org.openstreetmap.josm.gui.preferences.advanced;
    33
    4 import org.openstreetmap.josm.data.preferences.Setting;
     4import org.openstreetmap.josm.spi.preferences.Setting;
    55import org.openstreetmap.josm.tools.CheckParameterUtil;
    66
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PreferencesTable.java

    r12280 r12881  
    3030
    3131import org.openstreetmap.josm.data.preferences.ColorProperty;
    32 import org.openstreetmap.josm.data.preferences.ListListSetting;
    33 import org.openstreetmap.josm.data.preferences.ListSetting;
    34 import org.openstreetmap.josm.data.preferences.MapListSetting;
    35 import org.openstreetmap.josm.data.preferences.Setting;
    36 import org.openstreetmap.josm.data.preferences.StringSetting;
     32import org.openstreetmap.josm.spi.preferences.ListListSetting;
     33import org.openstreetmap.josm.spi.preferences.ListSetting;
     34import org.openstreetmap.josm.spi.preferences.MapListSetting;
     35import org.openstreetmap.josm.spi.preferences.Setting;
     36import org.openstreetmap.josm.spi.preferences.StringSetting;
    3737import org.openstreetmap.josm.gui.ExtendedDialog;
    3838import org.openstreetmap.josm.gui.util.GuiHelper;
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/StringEditor.java

    r12279 r12881  
    1010import javax.swing.JPanel;
    1111
    12 import org.openstreetmap.josm.data.preferences.StringSetting;
     12import org.openstreetmap.josm.spi.preferences.StringSetting;
    1313import org.openstreetmap.josm.gui.ExtendedDialog;
    1414import org.openstreetmap.josm.gui.widgets.JosmTextField;
  • trunk/src/org/openstreetmap/josm/spi/preferences/AbstractPreferences.java

    r12853 r12881  
    55import java.util.Map;
    66
    7 import org.openstreetmap.josm.data.preferences.ListListSetting;
    8 import org.openstreetmap.josm.data.preferences.ListSetting;
    9 import org.openstreetmap.josm.data.preferences.MapListSetting;
    10 import org.openstreetmap.josm.data.preferences.Setting;
    11 import org.openstreetmap.josm.data.preferences.StringSetting;
    127import org.openstreetmap.josm.tools.Logging;
    138
  • trunk/src/org/openstreetmap/josm/spi/preferences/AbstractSetting.java

    r12879 r12881  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.data.preferences;
     2package org.openstreetmap.josm.spi.preferences;
    33
    44import java.util.Objects;
     
    88 *
    99 * @param <T> The setting type
    10  * @since 9759
     10 * @since xxx (moved from package {@code org.openstreetmap.josm.data.preferences})
    1111 */
    1212public abstract class AbstractSetting<T> implements Setting<T> {
  • trunk/src/org/openstreetmap/josm/spi/preferences/IPreferences.java

    r12853 r12881  
    55import java.util.List;
    66import java.util.Map;
    7 
    8 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
    97
    108/**
  • trunk/src/org/openstreetmap/josm/spi/preferences/ListListSetting.java

    r12879 r12881  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.data.preferences;
     2package org.openstreetmap.josm.spi.preferences;
    33
    44import java.util.ArrayList;
     
    99/**
    1010 * Setting containing a {@link List} of {@code List}s of {@link String} values.
    11  * @since 9759
     11 * @since xxx (moved from package {@code org.openstreetmap.josm.data.preferences})
    1212 */
    1313public class ListListSetting extends AbstractSetting<List<List<String>>> {
  • trunk/src/org/openstreetmap/josm/spi/preferences/ListSetting.java

    r12879 r12881  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.data.preferences;
     2package org.openstreetmap.josm.spi.preferences;
    33
    44import java.util.ArrayList;
     
    99/**
    1010 * Setting containing a {@link List} of {@link String} values.
    11  * @since 9759
     11 * @since xxx (moved from package {@code org.openstreetmap.josm.data.preferences})
    1212 */
    1313public class ListSetting extends AbstractSetting<List<String>> {
  • trunk/src/org/openstreetmap/josm/spi/preferences/MapListSetting.java

    r12879 r12881  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.data.preferences;
     2package org.openstreetmap.josm.spi.preferences;
    33
    44import java.util.ArrayList;
     
    1010/**
    1111 * Setting containing a {@link List} of {@link Map}s of {@link String} values.
    12  * @since 9759
     12 * @since xxx (moved from package {@code org.openstreetmap.josm.data.preferences})
    1313 */
    1414public class MapListSetting extends AbstractSetting<List<Map<String, String>>> {
  • trunk/src/org/openstreetmap/josm/spi/preferences/Setting.java

    r12879 r12881  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.data.preferences;
    3 
    4 import org.openstreetmap.josm.data.Preferences;
     2package org.openstreetmap.josm.spi.preferences;
    53
    64/**
     
    108 *
    119 * @param <T> the data type for the value
    12  * @since 9759
     10 * @since xxx (moved from package {@code org.openstreetmap.josm.data.preferences})
    1311 */
    1412public interface Setting<T> {
     
    7270     * For default preferences. A setting is marked as new, if it has been seen
    7371     * in the current session.
    74      * Methods like {@link Preferences#get(java.lang.String, java.lang.String)},
     72     * Methods like {@link IPreferences#get(java.lang.String, java.lang.String)},
    7573     * can be called from different parts of the code with the same key. In this case,
    7674     * the supplied default value must match. However, this is only an error if the mismatching
  • trunk/src/org/openstreetmap/josm/spi/preferences/SettingVisitor.java

    r12879 r12881  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.data.preferences;
     2package org.openstreetmap.josm.spi.preferences;
    33
    44/**
    55 * Visitor interface for {@link Setting} implementations.
    6  * @since 9759
     6 * @since xxx (moved from package {@code org.openstreetmap.josm.data.preferences})
    77 */
    88public interface SettingVisitor {
  • trunk/src/org/openstreetmap/josm/spi/preferences/StringSetting.java

    r12879 r12881  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.data.preferences;
     2package org.openstreetmap.josm.spi.preferences;
    33
    44/**
    55 * Setting containing a {@link String} value.
    6  * @since 9759
     6 * @since xxx (moved from package {@code org.openstreetmap.josm.data.preferences})
    77 */
    88public class StringSetting extends AbstractSetting<String> {
Note: See TracChangeset for help on using the changeset viewer.