Ignore:
Timestamp:
2017-11-28T00:56:29+01:00 (2 years ago)
Author:
Don-vip
Message:

see #15310 - remove most of deprecated APIs

Location:
trunk/src/org/openstreetmap/josm/data
Files:
4 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Bounds.java

    r12818 r13173  
    88import java.text.MessageFormat;
    99import java.util.Objects;
    10 import java.util.function.Consumer;
    1110
    1211import org.openstreetmap.josm.data.coor.ILatLon;
    1312import org.openstreetmap.josm.data.coor.LatLon;
    1413import org.openstreetmap.josm.data.osm.BBox;
    15 import org.openstreetmap.josm.data.projection.Projection;
    1614import org.openstreetmap.josm.tools.CheckParameterUtil;
    1715
     
    565563    }
    566564
    567     /**
    568      * Visit points along the edge of this bounds instance.
    569      * @param projection The projection that should be used to determine how often the edge should be split along a given corner.
    570      * @param visitor A function to call for the points on the edge.
    571      * @since 10806
    572      * @deprecated use {@link Projection#visitOutline(Bounds, Consumer)}
    573      */
    574     @Deprecated
    575     public void visitEdge(Projection projection, Consumer<LatLon> visitor) {
    576         double width = getWidth();
    577         double height = maxLat - minLat;
    578         //TODO: Use projection to see if there is any need for doing this along each axis.
    579         int splitX = Math.max((int) width / 10, 10);
    580         int splitY = Math.max((int) height / 10, 10);
    581 
    582         for (int step = 0; step < splitX; step++) {
    583             visitor.accept(new LatLon(minLat, minLon + width * step / splitX));
    584         }
    585         for (int step = 0; step < splitY; step++) {
    586             visitor.accept(new LatLon(minLat + height * step / splitY, maxLon));
    587         }
    588         for (int step = 0; step < splitX; step++) {
    589             visitor.accept(new LatLon(maxLat, maxLon - width * step / splitX));
    590         }
    591         for (int step = 0; step < splitY; step++) {
    592             visitor.accept(new LatLon(maxLat - height * step / splitY, minLon));
    593         }
    594     }
    595 
    596565    @Override
    597566    public int hashCode() {
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r13076 r13173  
    1111import java.io.Reader;
    1212import java.io.StringWriter;
    13 import java.lang.annotation.Retention;
    14 import java.lang.annotation.RetentionPolicy;
    1513import java.nio.charset.StandardCharsets;
    1614import java.util.ArrayList;
     
    3836
    3937import org.openstreetmap.josm.Main;
    40 import org.openstreetmap.josm.data.preferences.BooleanProperty;
    4138import org.openstreetmap.josm.data.preferences.ColorInfo;
    42 import org.openstreetmap.josm.data.preferences.DoubleProperty;
    43 import org.openstreetmap.josm.data.preferences.IntegerProperty;
    44 import org.openstreetmap.josm.data.preferences.LongProperty;
    4539import org.openstreetmap.josm.data.preferences.NamedColorProperty;
    4640import org.openstreetmap.josm.data.preferences.PreferencesReader;
     
    5145import org.openstreetmap.josm.spi.preferences.Config;
    5246import org.openstreetmap.josm.spi.preferences.IBaseDirectories;
    53 import org.openstreetmap.josm.spi.preferences.IPreferences;
    54 import org.openstreetmap.josm.spi.preferences.ListListSetting;
    5547import org.openstreetmap.josm.spi.preferences.ListSetting;
    56 import org.openstreetmap.josm.spi.preferences.MapListSetting;
    5748import org.openstreetmap.josm.spi.preferences.Setting;
    5849import org.openstreetmap.josm.spi.preferences.StringSetting;
     
    137128    protected boolean initSuccessful;
    138129
    139     /**
    140      * Event triggered when a preference entry value changes.
    141      * @deprecated use {@link org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent}
    142      */
    143     @Deprecated
    144     public interface PreferenceChangeEvent {
    145         /**
    146          * Returns the preference key.
    147          * @return the preference key
    148          */
    149         String getKey();
    150 
    151         /**
    152          * Returns the old preference value.
    153          * @return the old preference value
    154          */
    155         Setting<?> getOldValue();
    156 
    157         /**
    158          * Returns the new preference value.
    159          * @return the new preference value
    160          */
    161         Setting<?> getNewValue();
    162     }
    163 
    164     /**
    165      * Listener to preference change events.
    166      * @since 10600 (functional interface)
    167      * @deprecated use {@link org.openstreetmap.josm.spi.preferences.PreferenceChangedListener}
    168      */
    169     @FunctionalInterface
    170     @Deprecated
    171     public interface PreferenceChangedListener {
    172         /**
    173          * Trigerred when a preference entry value changes.
    174          * @param e the preference change event
    175          */
    176         void preferenceChanged(PreferenceChangeEvent e);
    177     }
    178 
    179     /**
    180      * @deprecated private class is deprecated
    181      */
    182     @Deprecated
    183     private static class DefaultPreferenceChangeEvent implements PreferenceChangeEvent {
    184         private final String key;
    185         private final Setting<?> oldValue;
    186         private final Setting<?> newValue;
    187 
    188         DefaultPreferenceChangeEvent(String key, Setting<?> oldValue, Setting<?> newValue) {
    189             this.key = key;
    190             this.oldValue = oldValue;
    191             this.newValue = newValue;
    192         }
    193 
    194         @Override
    195         public String getKey() {
    196             return key;
    197         }
    198 
    199         @Override
    200         public Setting<?> getOldValue() {
    201             return oldValue;
    202         }
    203 
    204         @Override
    205         public Setting<?> getNewValue() {
    206             return newValue;
    207         }
    208     }
    209 
    210130    private final ListenerList<org.openstreetmap.josm.spi.preferences.PreferenceChangedListener> listeners = ListenerList.create();
    211131
    212132    private final HashMap<String, ListenerList<org.openstreetmap.josm.spi.preferences.PreferenceChangedListener>> keyListeners = new HashMap<>();
    213 
    214     /**
    215      * @deprecated deprecated private field
    216      */
    217     @Deprecated
    218     private final ListenerList<Preferences.PreferenceChangedListener> listenersDeprecated = ListenerList.create();
    219 
    220     /**
    221      * @deprecated deprecated private field
    222      */
    223     @Deprecated
    224     private final HashMap<String, ListenerList<Preferences.PreferenceChangedListener>> keyListenersDeprecated = new HashMap<>();
    225133
    226134    /**
     
    266174
    267175    /**
    268      * Adds a new preferences listener.
    269      * @param listener The listener to add
    270      * @deprecated use {@link #addPreferenceChangeListener(org.openstreetmap.josm.spi.preferences.PreferenceChangedListener)}
    271      */
    272     @Deprecated
    273     public void addPreferenceChangeListener(Preferences.PreferenceChangedListener listener) {
    274         if (listener != null) {
    275             listenersDeprecated.addListener(listener);
    276         }
    277     }
    278 
    279     /**
    280176     * Removes a preferences listener.
    281177     * @param listener The listener to remove
     
    285181    public void removePreferenceChangeListener(org.openstreetmap.josm.spi.preferences.PreferenceChangedListener listener) {
    286182        listeners.removeListener(listener);
    287     }
    288 
    289     /**
    290      * Removes a preferences listener.
    291      * @param listener The listener to remove
    292      * @deprecated use {@link #removePreferenceChangeListener(org.openstreetmap.josm.spi.preferences.PreferenceChangedListener)}
    293      */
    294     @Deprecated
    295     public void removePreferenceChangeListener(Preferences.PreferenceChangedListener listener) {
    296         listenersDeprecated.removeListener(listener);
    297183    }
    298184
     
    309195
    310196    /**
    311      * Adds a listener that only listens to changes in one preference
    312      * @param key The preference key to listen to
    313      * @param listener The listener to add.
    314      * @since 10824
    315      * @deprecated use
    316      * {@link #addKeyPreferenceChangeListener(java.lang.String, org.openstreetmap.josm.spi.preferences.PreferenceChangedListener)}
    317      */
    318     @Deprecated
    319     public void addKeyPreferenceChangeListener(String key, Preferences.PreferenceChangedListener listener) {
    320         listenersForKeyDeprecated(key).addListener(listener);
    321     }
    322 
    323     /**
    324197     * Adds a weak listener that only listens to changes in one preference
    325198     * @param key The preference key to listen to
     
    333206    private ListenerList<org.openstreetmap.josm.spi.preferences.PreferenceChangedListener> listenersForKey(String key) {
    334207        return keyListeners.computeIfAbsent(key, k -> ListenerList.create());
    335     }
    336 
    337     /**
    338      * @param key preference key
    339      * @return listener list for this key
    340      * @deprecated deprecated private method
    341      */
    342     @Deprecated
    343     private ListenerList<Preferences.PreferenceChangedListener> listenersForKeyDeprecated(String key) {
    344         return keyListenersDeprecated.computeIfAbsent(key, k -> ListenerList.create());
    345208    }
    346209
     
    358221    }
    359222
    360     /**
    361      * Removes a listener that only listens to changes in one preference
    362      * @param key The preference key to listen to
    363      * @param listener The listener to add.
    364      * @deprecated use
    365      * {@link #removeKeyPreferenceChangeListener(java.lang.String, org.openstreetmap.josm.spi.preferences.PreferenceChangedListener)}
    366      */
    367     @Deprecated
    368     public void removeKeyPreferenceChangeListener(String key, Preferences.PreferenceChangedListener listener) {
    369         Optional.ofNullable(keyListenersDeprecated.get(key)).orElseThrow(
    370                 () -> new IllegalArgumentException("There are no listeners registered for " + key))
    371         .removeListener(listener);
    372     }
    373 
    374223    protected void firePreferenceChanged(String key, Setting<?> oldValue, Setting<?> newValue) {
    375224        final org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent evt =
     
    381230            forKey.fireEvent(listener -> listener.preferenceChanged(evt));
    382231        }
    383         firePreferenceChangedDeprecated(key, oldValue, newValue);
    384     }
    385 
    386     /**
    387      * @param key preference key
    388      * @param oldValue old value
    389      * @param newValue new value
    390      * @deprecated deprecated private method
    391      */
    392     @Deprecated
    393     private void firePreferenceChangedDeprecated(String key, Setting<?> oldValue, Setting<?> newValue) {
    394         final Preferences.PreferenceChangeEvent evtDeprecated = new Preferences.DefaultPreferenceChangeEvent(key, oldValue, newValue);
    395         listenersDeprecated.fireEvent(listener -> listener.preferenceChanged(evtDeprecated));
    396 
    397         ListenerList<Preferences.PreferenceChangedListener> forKeyDeprecated = keyListenersDeprecated.get(key);
    398         if (forKeyDeprecated != null) {
    399             forKeyDeprecated.fireEvent(listener -> listener.preferenceChanged(evtDeprecated));
    400         }
    401     }
    402 
    403     /**
    404      * Get the base name of the JOSM directories for preferences, cache and
    405      * user data.
     232    }
     233
     234    /**
     235     * Get the base name of the JOSM directories for preferences, cache and user data.
    406236     * Default value is "JOSM", unless overridden by system property "josm.dir.name".
    407      * @return the base name of the JOSM directories for preferences, cache and
    408      * user data
     237     * @return the base name of the JOSM directories for preferences, cache and user data
    409238     */
    410239    public String getJOSMDirectoryBaseName() {
     
    639468        }
    640469        return all;
    641     }
    642 
    643     /**
    644      * Gets an boolean that may be specialized
    645      * @param key The basic key
    646      * @param specName The sub-key to append to the key
    647      * @param def The default value
    648      * @return The boolean value or the default value if it could not be parsed
    649      * @deprecated use {@link PreferencesUtils#getBoolean(IPreferences, String, String, boolean)}
    650      */
    651     @Deprecated
    652     public synchronized boolean getBoolean(final String key, final String specName, final boolean def) {
    653         boolean generic = getBoolean(key, def);
    654         String skey = key+'.'+specName;
    655         Setting<?> prop = settingsMap.get(skey);
    656         if (prop instanceof StringSetting)
    657             return Boolean.parseBoolean(((StringSetting) prop).getValue());
    658         else
    659             return generic;
    660     }
    661 
    662     /**
    663      * Set a boolean value for a certain setting.
    664      * @param key the unique identifier for the setting
    665      * @param value The new value
    666      * @return {@code true}, if something has changed (i.e. value is different than before)
    667      * @see BooleanProperty
    668      * @deprecated use {@link IPreferences#putBoolean(String, boolean)}
    669      */
    670     @Deprecated
    671     public boolean put(final String key, final boolean value) {
    672         return put(key, Boolean.toString(value));
    673     }
    674 
    675     /**
    676      * Set a boolean value for a certain setting.
    677      * @param key the unique identifier for the setting
    678      * @param value The new value
    679      * @return {@code true}, if something has changed (i.e. value is different than before)
    680      * @see IntegerProperty#put(Integer)
    681      * @deprecated use {@link IPreferences#putInt(String, int)}
    682      */
    683     @Deprecated
    684     public boolean putInteger(final String key, final Integer value) {
    685         return put(key, Integer.toString(value));
    686     }
    687 
    688     /**
    689      * Set a boolean value for a certain setting.
    690      * @param key the unique identifier for the setting
    691      * @param value The new value
    692      * @return {@code true}, if something has changed (i.e. value is different than before)
    693      * @see DoubleProperty#put(Double)
    694      * @deprecated use {@link IPreferences#putDouble(java.lang.String, double)}
    695      */
    696     @Deprecated
    697     public boolean putDouble(final String key, final Double value) {
    698         return put(key, Double.toString(value));
    699     }
    700 
    701     /**
    702      * Set a boolean value for a certain setting.
    703      * @param key the unique identifier for the setting
    704      * @param value The new value
    705      * @return {@code true}, if something has changed (i.e. value is different than before)
    706      * @see LongProperty#put(Long)
    707      * @deprecated use {@link IPreferences#putLong(java.lang.String, long)}
    708      */
    709     @Deprecated
    710     public boolean putLong(final String key, final Long value) {
    711         return put(key, Long.toString(value));
    712470    }
    713471
     
    1050808
    1051809    /**
    1052      * Gets an integer preference
    1053      * @param key The preference key
    1054      * @param def The default value to use
    1055      * @return The integer
    1056      * @see IntegerProperty#get()
    1057      * @deprecated use {@link IPreferences#getInt(String, int)}
    1058      */
    1059     @Deprecated
    1060     public synchronized int getInteger(String key, int def) {
    1061         String v = get(key, Integer.toString(def));
    1062         if (v.isEmpty())
    1063             return def;
    1064 
    1065         try {
    1066             return Integer.parseInt(v);
    1067         } catch (NumberFormatException e) {
    1068             // fall out
    1069             Logging.trace(e);
    1070         }
    1071         return def;
    1072     }
    1073 
    1074     /**
    1075      * Gets an integer that may be specialized
    1076      * @param key The basic key
    1077      * @param specName The sub-key to append to the key
    1078      * @param def The default value
    1079      * @return The integer value or the default value if it could not be parsed
    1080      * @deprecated use {@link PreferencesUtils#getInteger(IPreferences, String, String, int)}
    1081      */
    1082     @Deprecated
    1083     public synchronized int getInteger(String key, String specName, int def) {
    1084         String v = get(key+'.'+specName);
    1085         if (v.isEmpty())
    1086             v = get(key, Integer.toString(def));
    1087         if (v.isEmpty())
    1088             return def;
    1089 
    1090         try {
    1091             return Integer.parseInt(v);
    1092         } catch (NumberFormatException e) {
    1093             // fall out
    1094             Logging.trace(e);
    1095         }
    1096         return def;
    1097     }
    1098 
    1099     /**
    1100      * Get a list of values for a certain key
    1101      * @param key the identifier for the setting
    1102      * @param def the default value.
    1103      * @return the corresponding value if the property has been set before, {@code def} otherwise
    1104      * @deprecated use {@link IPreferences#getList(java.lang.String, java.util.List)}
    1105      */
    1106     @Deprecated
    1107     public Collection<String> getCollection(String key, Collection<String> def) {
    1108         return getSetting(key, ListSetting.create(def), ListSetting.class).getValue();
    1109     }
    1110 
    1111     /**
    1112      * Get a list of values for a certain key
    1113      * @param key the identifier for the setting
    1114      * @return the corresponding value if the property has been set before, an empty collection otherwise.
    1115      * @deprecated use {@link IPreferences#getList(java.lang.String)}
    1116      */
    1117     @Deprecated
    1118     public Collection<String> getCollection(String key) {
    1119         Collection<String> val = getList(key, null);
    1120         return val == null ? Collections.<String>emptyList() : val;
    1121     }
    1122 
    1123     /**
    1124      * Removes a value from a given String collection
    1125      * @param key The preference key the collection is stored with
    1126      * @param value The value that should be removed in the collection
    1127      * @see #getList(String)
    1128      * @deprecated use {@link PreferencesUtils#removeFromList(IPreferences, String, String)}
    1129      */
    1130     @Deprecated
    1131     public synchronized void removeFromCollection(String key, String value) {
    1132         List<String> a = new ArrayList<>(getList(key, Collections.<String>emptyList()));
    1133         a.remove(value);
    1134         putList(key, a);
    1135     }
    1136 
    1137     /**
    1138810     * Set a value for a certain setting. The changed setting is saved to the preference file immediately.
    1139811     * Due to caching mechanisms on modern operating systems and hardware, this shouldn't be a performance problem.
     
    1218890    }
    1219891
    1220     /**
    1221      * Put a collection.
    1222      * @param key key
    1223      * @param value value
    1224      * @return {@code true}, if something has changed (i.e. value is different than before)
    1225      * @deprecated use {@link IPreferences#putList(java.lang.String, java.util.List)}
    1226      */
    1227     @Deprecated
    1228     public boolean putCollection(String key, Collection<String> value) {
    1229         return putSetting(key, value == null ? null : ListSetting.create(value));
    1230     }
    1231 
    1232     /**
    1233      * Saves at most {@code maxsize} items of collection {@code val}.
    1234      * @param key key
    1235      * @param maxsize max number of items to save
    1236      * @param val value
    1237      * @return {@code true}, if something has changed (i.e. value is different than before)
    1238      * @deprecated use {@link PreferencesUtils#putListBounded(IPreferences, String, int, List)}
    1239      */
    1240     @Deprecated
    1241     public boolean putCollectionBounded(String key, int maxsize, Collection<String> val) {
    1242         List<String> newCollection = new ArrayList<>(Math.min(maxsize, val.size()));
    1243         for (String i : val) {
    1244             if (newCollection.size() >= maxsize) {
    1245                 break;
    1246             }
    1247             newCollection.add(i);
    1248         }
    1249         return putList(key, newCollection);
    1250     }
    1251 
    1252     /**
    1253      * Used to read a 2-dimensional array of strings from the preference file.
    1254      * If not a single entry could be found, <code>def</code> is returned.
    1255      * @param key preference key
    1256      * @param def default array value
    1257      * @return array value
    1258      * @deprecated use {@link #getListOfLists(java.lang.String, java.util.List)}
    1259      */
    1260     @Deprecated
    1261     @SuppressWarnings({ "unchecked", "rawtypes" })
    1262     public synchronized Collection<Collection<String>> getArray(String key, Collection<Collection<String>> def) {
    1263         ListListSetting val = getSetting(key, ListListSetting.create(def), ListListSetting.class);
    1264         return (Collection) val.getValue();
    1265     }
    1266 
    1267     /**
    1268      * Gets a collection of string collections for the given key
    1269      * @param key The key
    1270      * @return The collection of string collections or an empty collection as default
    1271      * @deprecated use {@link IPreferences#getListOfLists(java.lang.String)}
    1272      */
    1273     @Deprecated
    1274     public Collection<Collection<String>> getArray(String key) {
    1275         Collection<Collection<String>> res = getArray(key, null);
    1276         return res == null ? Collections.<Collection<String>>emptyList() : res;
    1277     }
    1278 
    1279     /**
    1280      * Put an array.
    1281      * @param key key
    1282      * @param value value
    1283      * @return {@code true}, if something has changed (i.e. value is different than before)
    1284      * @deprecated use {@link IPreferences#putListOfLists(java.lang.String, java.util.List)}
    1285      */
    1286     @Deprecated
    1287     public boolean putArray(String key, Collection<Collection<String>> value) {
    1288         return putSetting(key, value == null ? null : ListListSetting.create(value));
    1289     }
    1290 
    1291     /**
    1292      * Gets a collection of key/value maps.
    1293      * @param key The key to search at
    1294      * @param def The default value to use
    1295      * @return The stored value or the default one if it could not be parsed
    1296      * @deprecated use {@link IPreferences#getListOfMaps(java.lang.String, java.util.List)}
    1297      */
    1298     @Deprecated
    1299     public Collection<Map<String, String>> getListOfStructs(String key, Collection<Map<String, String>> def) {
    1300         return getSetting(key, new MapListSetting(def == null ? null : new ArrayList<>(def)), MapListSetting.class).getValue();
    1301     }
    1302 
    1303     /**
    1304      * Stores a list of structs
    1305      * @param key The key to store the list in
    1306      * @param value A list of key/value maps
    1307      * @return <code>true</code> if the value was changed
    1308      * @see #getListOfMaps(java.lang.String, java.util.List)
    1309      * @deprecated use {@link IPreferences#putListOfMaps(java.lang.String, java.util.List)}
    1310      */
    1311     @Deprecated
    1312     public boolean putListOfStructs(String key, Collection<Map<String, String>> value) {
    1313         return putSetting(key, value == null ? null : new MapListSetting(new ArrayList<>(value)));
    1314     }
    1315 
    1316     /**
    1317      * Annotation used for converting objects to String Maps and vice versa.
    1318      * Indicates that a certain field should be considered in the conversion process. Otherwise it is ignored.
    1319      *
    1320      * @see #serializeStruct(java.lang.Object, java.lang.Class)
    1321      * @see #deserializeStruct(java.util.Map, java.lang.Class)
    1322      * @deprecated use {@link StructUtils.StructEntry}
    1323      */
    1324     @Deprecated
    1325     @Retention(RetentionPolicy.RUNTIME) // keep annotation at runtime
    1326     public @interface pref { }
    1327 
    1328     /**
    1329      * Annotation used for converting objects to String Maps.
    1330      * Indicates that a certain field should be written to the map, even if the value is the same as the default value.
    1331      *
    1332      * @see #serializeStruct(java.lang.Object, java.lang.Class)
    1333      * @deprecated use {@link StructUtils.WriteExplicitly}
    1334      */
    1335     @Deprecated
    1336     @Retention(RetentionPolicy.RUNTIME) // keep annotation at runtime
    1337     public @interface writeExplicitly { }
    1338 
    1339     /**
    1340      * Get a list of hashes which are represented by a struct-like class.
    1341      * Possible properties are given by fields of the class klass that have the @pref annotation.
    1342      * Default constructor is used to initialize the struct objects, properties then override some of these default values.
    1343      * @param <T> klass type
    1344      * @param key main preference key
    1345      * @param klass The struct class
    1346      * @return a list of objects of type T or an empty list if nothing was found
    1347      * @deprecated use {@link StructUtils#getListOfStructs(IPreferences, String, Class)}
    1348      */
    1349     @Deprecated
    1350     public <T> List<T> getListOfStructs(String key, Class<T> klass) {
    1351         return StructUtils.getListOfStructs(this, key, klass);
    1352     }
    1353 
    1354     /**
    1355      * same as above, but returns def if nothing was found
    1356      * @param <T> klass type
    1357      * @param key main preference key
    1358      * @param def default value
    1359      * @param klass The struct class
    1360      * @return a list of objects of type T or {@code def} if nothing was found
    1361      * @deprecated use {@link StructUtils#getListOfStructs(IPreferences, String, Collection, Class)}
    1362      */
    1363     @Deprecated
    1364     public <T> List<T> getListOfStructs(String key, Collection<T> def, Class<T> klass) {
    1365         return StructUtils.getListOfStructs(this, key, def, klass);
    1366     }
    1367 
    1368     /**
    1369      * Convenience method that saves a MapListSetting which is provided as a collection of objects.
    1370      *
    1371      * Each object is converted to a <code>Map&lt;String, String&gt;</code> using the fields with {@link pref} annotation.
    1372      * The field name is the key and the value will be converted to a string.
    1373      *
    1374      * Considers only fields that have the @pref annotation.
    1375      * In addition it does not write fields with null values. (Thus they are cleared)
    1376      * Default values are given by the field values after default constructor has been called.
    1377      * Fields equal to the default value are not written unless the field has the @writeExplicitly annotation.
    1378      * @param <T> the class,
    1379      * @param key main preference key
    1380      * @param val the list that is supposed to be saved
    1381      * @param klass The struct class
    1382      * @return true if something has changed
    1383      * @deprecated use {@link StructUtils#putListOfStructs(IPreferences, String, Collection, Class)}
    1384      */
    1385     @Deprecated
    1386     public <T> boolean putListOfStructs(String key, Collection<T> val, Class<T> klass) {
    1387         return StructUtils.putListOfStructs(this, key, val, klass);
    1388     }
    1389 
    1390     /**
    1391      * Convert an object to a String Map, by using field names and values as map key and value.
    1392      *
    1393      * The field value is converted to a String.
    1394      *
    1395      * Only fields with annotation {@link pref} are taken into account.
    1396      *
    1397      * Fields will not be written to the map if the value is null or unchanged
    1398      * (compared to an object created with the no-arg-constructor).
    1399      * The {@link writeExplicitly} annotation overrides this behavior, i.e. the default value will also be written.
    1400      *
    1401      * @param <T> the class of the object <code>struct</code>
    1402      * @param struct the object to be converted
    1403      * @param klass the class T
    1404      * @return the resulting map (same data content as <code>struct</code>)
    1405      * @deprecated use {@link StructUtils#serializeStruct(java.lang.Object, java.lang.Class)}
    1406      */
    1407     @Deprecated
    1408     public static <T> Map<String, String> serializeStruct(T struct, Class<T> klass) {
    1409         return StructUtils.serializeStruct(struct, klass);
    1410     }
    1411 
    1412     /**
    1413      * Converts a String-Map to an object of a certain class, by comparing map keys to field names of the class and assigning
    1414      * map values to the corresponding fields.
    1415      *
    1416      * The map value (a String) is converted to the field type. Supported types are: boolean, Boolean, int, Integer, double,
    1417      * Double, String, Map&lt;String, String&gt; and Map&lt;String, List&lt;String&gt;&gt;.
    1418      *
    1419      * Only fields with annotation {@link pref} are taken into account.
    1420      * @param <T> the class
    1421      * @param hash the string map with initial values
    1422      * @param klass the class T
    1423      * @return an object of class T, initialized as described above
    1424      * @deprecated use {@link StructUtils#deserializeStruct(java.util.Map, java.lang.Class)}
    1425      */
    1426     @Deprecated
    1427     public static <T> T deserializeStruct(Map<String, String> hash, Class<T> klass) {
    1428         return StructUtils.deserializeStruct(hash, klass);
    1429     }
    1430 
    1431892    @Override
    1432893    public Set<String> getKeySet() {
  • trunk/src/org/openstreetmap/josm/data/StructUtils.java

    r12851 r13173  
    148148     * @return the resulting map (same data content as <code>struct</code>)
    149149     */
    150     @SuppressWarnings("deprecation")
    151150    public static <T> Map<String, String> serializeStruct(T struct, Class<T> klass) {
    152151        T structPrototype;
     
    159158        Map<String, String> hash = new LinkedHashMap<>();
    160159        for (Field f : klass.getDeclaredFields()) {
    161             if (f.getAnnotation(Preferences.pref.class) == null && f.getAnnotation(StructEntry.class) == null) {
     160            if (f.getAnnotation(StructEntry.class) == null) {
    162161                continue;
    163162            }
     
    167166                Object defaultFieldValue = f.get(structPrototype);
    168167                if (fieldValue != null && (
    169                         f.getAnnotation(Preferences.writeExplicitly.class) != null ||
    170168                        f.getAnnotation(WriteExplicitly.class) != null ||
    171169                        !Objects.equals(fieldValue, defaultFieldValue))) {
     
    216214                continue;
    217215            }
    218             if (f.getAnnotation(Preferences.pref.class) == null && f.getAnnotation(StructEntry.class) == null) {
     216            if (f.getAnnotation(StructEntry.class) == null) {
    219217                continue;
    220218            }
  • trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java

    r13140 r13173  
    44import java.io.Serializable;
    55import java.util.Objects;
    6 
    7 import org.openstreetmap.josm.data.osm.BBox;
    86
    97/**
     
    9290    }
    9391
    94     /**
    95      * Creates bbox around this coordinate. Coordinate defines
    96      * center of bbox, its edge will be 2*r.
    97      *
    98      * @param r size
    99      * @return BBox around this coordinate
    100      * @since 6203
    101      * @deprecated use {@link BBox#BBox(double, double, double)} instead
    102      */
    103     @Deprecated
    104     public BBox toBBox(final double r) {
    105         return new BBox(x, y, r);
    106     }
    107 
    10892    @Override
    10993    public int hashCode() {
  • trunk/src/org/openstreetmap/josm/data/coor/ILatLon.java

    r12729 r13173  
    22package org.openstreetmap.josm.data.coor;
    33
    4 import org.openstreetmap.josm.Main;
    54import org.openstreetmap.josm.data.projection.Projecting;
    65
     
    3938
    4039    /**
    41      * <p>Replies the projected east/north coordinates.</p>
    42      *
    43      * <p>Uses the {@link Main#getProjection() global projection} to project the lat/lon-coordinates.</p>
    44      *
    45      * @return the east north coordinates or {@code null} if #is
    46      * @deprecated use {@link #getEastNorth(org.openstreetmap.josm.data.projection.Projecting)}
    47      */
    48     @Deprecated
    49     default EastNorth getEastNorth() {
    50         return getEastNorth(Main.getProjection());
    51     }
    52 
    53     /**
    5440     * Replies the projected east/north coordinates.
    5541     * <p>
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r12873 r13173  
    99import static java.lang.Math.sqrt;
    1010import static org.openstreetmap.josm.data.projection.Ellipsoid.WGS84;
    11 import static org.openstreetmap.josm.tools.I18n.trc;
    1211import static org.openstreetmap.josm.tools.Utils.toRadians;
    1312
     
    1514import java.text.DecimalFormat;
    1615import java.text.NumberFormat;
    17 import java.util.Arrays;
    1816import java.util.Locale;
    1917import java.util.Objects;
     
    2119import org.openstreetmap.josm.Main;
    2220import org.openstreetmap.josm.data.Bounds;
    23 import org.openstreetmap.josm.data.coor.conversion.DMSCoordinateFormat;
    24 import org.openstreetmap.josm.data.coor.conversion.DecimalDegreesCoordinateFormat;
    25 import org.openstreetmap.josm.data.coor.conversion.LatLonParser;
    26 import org.openstreetmap.josm.data.coor.conversion.NauticalCoordinateFormat;
    2721import org.openstreetmap.josm.tools.Logging;
    2822import org.openstreetmap.josm.tools.Utils;
     
    8781
    8882    /**
    89      * Character denoting South, as string.
    90      * @deprecated use {@link LatLonParser#SOUTH}
    91      */
    92     @Deprecated
    93     public static final String SOUTH = trc("compass", "S");
    94     /**
    95      * Character denoting North, as string.
    96      * @deprecated use {@link LatLonParser#NORTH}
    97      */
    98     @Deprecated
    99     public static final String NORTH = trc("compass", "N");
    100     /**
    101      * Character denoting West, as string.
    102      * @deprecated use {@link LatLonParser#WEST}
    103      */
    104     @Deprecated
    105     public static final String WEST = trc("compass", "W");
    106     /**
    107      * Character denoting East, as string.
    108      * @deprecated use {@link LatLonParser#EAST}
    109      */
    110     @Deprecated
    111     public static final String EAST = trc("compass", "E");
    112 
    113     /**
    11483     * Replies true if lat is in the range [-90,90]
    11584     *
     
    185154
    186155    /**
    187      * Replies the coordinate in degrees/minutes/seconds format
    188      * @param pCoordinate The coordinate to convert
    189      * @return The coordinate in degrees/minutes/seconds format
    190      * @deprecated use {@link #degreesMinutesSeconds} instead
    191      */
    192     @Deprecated
    193     public static String dms(double pCoordinate) {
    194         return degreesMinutesSeconds(pCoordinate);
    195     }
    196 
    197     /**
    198      * Replies the coordinate in degrees/minutes/seconds format
    199      * @param pCoordinate The coordinate to convert
    200      * @return The coordinate in degrees/minutes/seconds format
    201      * @since 12561
    202      * @deprecated use {@link DMSCoordinateFormat#degreesMinutesSeconds(double)}
    203      */
    204     @Deprecated
    205     public static String degreesMinutesSeconds(double pCoordinate) {
    206         return DMSCoordinateFormat.degreesMinutesSeconds(pCoordinate);
    207     }
    208 
    209     /**
    210      * Replies the coordinate in degrees/minutes format
    211      * @param pCoordinate The coordinate to convert
    212      * @return The coordinate in degrees/minutes format
    213      * @since 12537
    214      * @deprecated use {@link NauticalCoordinateFormat#degreesMinutes(double)}
    215      */
    216     @Deprecated
    217     public static String degreesMinutes(double pCoordinate) {
    218         return NauticalCoordinateFormat.degreesMinutes(pCoordinate);
    219     }
    220 
    221     /**
    222      * Replies the coordinate in degrees/minutes format
    223      * @param pCoordinate The coordinate to convert
    224      * @return The coordinate in degrees/minutes format
    225      * @deprecated use {@link #degreesMinutes(double)} instead
    226      */
    227     @Deprecated
    228     public static String dm(double pCoordinate) {
    229         return degreesMinutes(pCoordinate);
    230     }
    231 
    232     /**
    233156     * Constructs a new object representing the given latitude/longitude.
    234157     * @param lat the latitude, i.e., the north-south position in degrees
     
    252175    }
    253176
    254     /**
    255      * Formats the latitude part according to the given format
    256      * @param d the coordinate format to use
    257      * @return the formatted latitude
    258      * @deprecated use {@link org.openstreetmap.josm.data.coor.conversion.ICoordinateFormat#latToString(ILatLon)}
    259      */
    260     @Deprecated
    261     public String latToString(CoordinateFormat d) {
    262         return d.getICoordinateFormat().latToString(this);
    263     }
    264 
    265177    @Override
    266178    public double lon() {
    267179        return x;
    268     }
    269 
    270     /**
    271      * Formats the longitude part according to the given format
    272      * @param d the coordinate format to use
    273      * @return the formatted longitude
    274      * @deprecated use {@link org.openstreetmap.josm.data.coor.conversion.ICoordinateFormat#lonToString(ILatLon)}
    275      */
    276     @Deprecated
    277     public String lonToString(CoordinateFormat d) {
    278         return d.getICoordinateFormat().lonToString(this);
    279180    }
    280181
     
    409310
    410311    /**
    411      * Returns this lat/lon pair in human-readable format separated by {@code separator}.
    412      * @param separator values separator
    413      * @return String in the format {@code "1.23456[separator]2.34567"}
    414      * @deprecated method removed without replacement
    415      */
    416     @Deprecated
    417     public String toStringCSV(String separator) {
    418         return Utils.join(separator, Arrays.asList(
    419                 DecimalDegreesCoordinateFormat.INSTANCE.latToString(this),
    420                 DecimalDegreesCoordinateFormat.INSTANCE.lonToString(this)
    421         ));
    422     }
    423 
    424     /**
    425312     * Interpolate between this and a other latlon
    426313     * @param ll2 The other lat/lon object
     
    506393               Double.compare(that.y, y) == 0;
    507394    }
    508 
    509     /**
    510      * Parses the given string as lat/lon.
    511      * @param coord String to parse
    512      * @return parsed lat/lon
    513      * @since 11045
    514      * @deprecated use {@link LatLonParser#parse(java.lang.String)}
    515      */
    516     @Deprecated
    517     public static LatLon parse(String coord) {
    518         return LatLonParser.parse(coord);
    519     }
    520395}
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuthAccessTokenHolder.java

    r12928 r13173  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import org.openstreetmap.josm.data.Preferences;
    76import org.openstreetmap.josm.io.auth.CredentialsAgent;
    87import org.openstreetmap.josm.io.auth.CredentialsAgentException;
     
    165164
    166165    /**
    167      * Initializes the content of this holder from the Access Token managed by the
    168      * credential manager.
    169      *
    170      * @param pref the preferences. Must not be null.
    171      * @param cm the credential manager. Must not be null.
    172      * @throws IllegalArgumentException if cm is null
    173      * @deprecated (since 12928) replaced by {@link #init(org.openstreetmap.josm.io.auth.CredentialsAgent)}
    174      */
    175     @Deprecated
    176     public void init(Preferences pref, CredentialsAgent cm) {
    177         CheckParameterUtil.ensureParameterNotNull(pref, "pref");
    178         CheckParameterUtil.ensureParameterNotNull(cm, "cm");
    179         OAuthToken token = null;
    180         try {
    181             token = cm.lookupOAuthAccessToken();
    182         } catch (CredentialsAgentException e) {
    183             Logging.error(e);
    184             Logging.warn(tr("Failed to retrieve OAuth Access Token from credential manager"));
    185             Logging.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
    186         }
    187         saveToPreferences = pref.getBoolean("oauth.access-token.save-to-preferences", true);
    188         if (token != null) {
    189             accessTokenKey = token.getKey();
    190             accessTokenSecret = token.getSecret();
    191         }
    192     }
    193 
    194     /**
    195166     * Saves the content of this holder to the preferences and a credential store managed
    196167     * by a credential manager.
     
    216187
    217188    /**
    218      * Saves the content of this holder to the preferences and a credential store managed
    219      * by a credential manager.
    220      *
    221      * @param preferences the preferences. Must not be null.
    222      * @param cm the credentials manager. Must not be null.
    223      * @throws IllegalArgumentException if preferences is null
    224      * @throws IllegalArgumentException if cm is null
    225      * @deprecated (since 12928) replaced by {@link #save(org.openstreetmap.josm.io.auth.CredentialsAgent)}
    226      */
    227     @Deprecated
    228     public void save(Preferences preferences, CredentialsAgent cm) {
    229         CheckParameterUtil.ensureParameterNotNull(preferences, "preferences");
    230         CheckParameterUtil.ensureParameterNotNull(cm, "cm");
    231         preferences.putBoolean("oauth.access-token.save-to-preferences", saveToPreferences);
    232         try {
    233             if (!saveToPreferences) {
    234                 cm.storeOAuthAccessToken(null);
    235             } else {
    236                 cm.storeOAuthAccessToken(new OAuthToken(accessTokenKey, accessTokenSecret));
    237             }
    238         } catch (CredentialsAgentException e) {
    239             Logging.error(e);
    240             Logging.warn(tr("Failed to store OAuth Access Token to credentials manager"));
    241             Logging.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
    242         }
    243     }
    244 
    245     /**
    246189     * Clears the content of this holder
    247190     */
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java

    r12928 r13173  
    55
    66import org.openstreetmap.josm.Main;
    7 import org.openstreetmap.josm.data.Preferences;
    87import org.openstreetmap.josm.io.OsmApi;
    98import org.openstreetmap.josm.spi.preferences.Config;
     
    9695
    9796    /**
    98      * Replies a set of parameters as defined in the preferences.
    99      *
    100      * @param pref the preferences
    101      * @return the parameters
    102      * @deprecated (since 12928) replaced by {@link #createFromApiUrl(java.lang.String)}
    103      */
    104     @Deprecated
    105     public static OAuthParameters createFromPreferences(Preferences pref) {
    106         OAuthParameters parameters = createDefault(pref.get("osm-server.url"));
    107         return new OAuthParameters(
    108                 pref.get("oauth.settings.consumer-key", parameters.getConsumerKey()),
    109                 pref.get("oauth.settings.consumer-secret", parameters.getConsumerSecret()),
    110                 pref.get("oauth.settings.request-token-url", parameters.getRequestTokenUrl()),
    111                 pref.get("oauth.settings.access-token-url", parameters.getAccessTokenUrl()),
    112                 pref.get("oauth.settings.authorise-url", parameters.getAuthoriseUrl()),
    113                 pref.get("oauth.settings.osm-login-url", parameters.getOsmLoginUrl()),
    114                 pref.get("oauth.settings.osm-logout-url", parameters.getOsmLogoutUrl()));
    115     }
    116 
    117     /**
    11897     * Remembers the current values in the preferences.
    11998     */
     
    126105        Config.getPref().put("oauth.settings.osm-login-url", getOsmLoginUrl());
    127106        Config.getPref().put("oauth.settings.osm-logout-url", getOsmLogoutUrl());
    128     }
    129 
    130     /**
    131      * Remembers the current values in the preferences <code>pref</code>.
    132      *
    133      * @param pref the preferences. Must not be null.
    134      * @throws IllegalArgumentException if pref is null.
    135      * @deprecated (since 12928) replaced by {@link #rememberPreferences()}
    136      */
    137     @Deprecated
    138     public void rememberPreferences(Preferences pref) {
    139         CheckParameterUtil.ensureParameterNotNull(pref, "pref");
    140         pref.put("oauth.settings.consumer-key", getConsumerKey());
    141         pref.put("oauth.settings.consumer-secret", getConsumerSecret());
    142         pref.put("oauth.settings.request-token-url", getRequestTokenUrl());
    143         pref.put("oauth.settings.access-token-url", getAccessTokenUrl());
    144         pref.put("oauth.settings.authorise-url", getAuthoriseUrl());
    145         pref.put("oauth.settings.osm-login-url", getOsmLoginUrl());
    146         pref.put("oauth.settings.osm-logout-url", getOsmLogoutUrl());
    147107    }
    148108
  • trunk/src/org/openstreetmap/josm/data/osm/Changeset.java

    r12809 r13173  
    105105
    106106    /**
    107      * Visitor pattern.
    108      * @param v visitor
    109      * @deprecated no longer supported
    110      */
    111     @Deprecated
    112     public void visit(org.openstreetmap.josm.data.osm.visitor.Visitor v) {
    113         v.visit(this);
    114     }
    115 
    116     /**
    117107     * Compares this changeset to another, based on their identifier.
    118108     * @param other other changeset
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r13161 r13173  
    5555import org.openstreetmap.josm.data.projection.ProjectionChangeListener;
    5656import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    57 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
    5857import org.openstreetmap.josm.tools.ListenerList;
    5958import org.openstreetmap.josm.tools.Logging;
     
    208207        // the listener, projection change listeners are managed as WeakReferences.
    209208        Main.addProjectionChangeListener(this);
    210         addSelectionListener((DataSelectionListener) e -> fireDeprecatedSelectionChange(e.getSelection()));
     209        addSelectionListener((DataSelectionListener) e -> fireSelectionChange(e.getSelection()));
    211210    }
    212211
     
    335334
    336335    /**
    337      * Returns the autocompletion manager, which maintains a list of used tags for autocompletion.
    338      * @return the autocompletion manager
    339      * @deprecated to be removed end of 2017. Use {@link AutoCompletionManager#of(DataSet)} instead.
    340      */
    341     @Deprecated
    342     public AutoCompletionManager getAutoCompletionManager() {
    343         return AutoCompletionManager.of(this);
    344     }
    345 
    346     /**
    347336     * The API version that created this data set, if any.
    348337     */
     
    365354    public void setVersion(String version) {
    366355        this.version = version;
    367     }
    368 
    369     /**
    370      * Determines if upload is being discouraged.
    371      * (i.e. this dataset contains private data which should not be uploaded)
    372      * @return {@code true} if upload is being discouraged, {@code false} otherwise
    373      * @see #setUploadDiscouraged
    374      * @deprecated use {@link #getUploadPolicy()}
    375      */
    376     @Deprecated
    377     public boolean isUploadDiscouraged() {
    378         return uploadPolicy == UploadPolicy.DISCOURAGED || uploadPolicy == UploadPolicy.BLOCKED;
    379     }
    380 
    381     /**
    382      * Sets the "upload discouraged" flag.
    383      * @param uploadDiscouraged {@code true} if this dataset contains private data which should not be uploaded
    384      * @see #isUploadDiscouraged
    385      * @deprecated use {@link #setUploadPolicy(UploadPolicy)}
    386      */
    387     @Deprecated
    388     public void setUploadDiscouraged(boolean uploadDiscouraged) {
    389         if (uploadPolicy != UploadPolicy.BLOCKED) {
    390             this.uploadPolicy = uploadDiscouraged ? UploadPolicy.DISCOURAGED : UploadPolicy.NORMAL;
    391         }
    392356    }
    393357
     
    676640    }
    677641
    678     /**
    679      * Notifies all registered {@link SelectionChangedListener} about the current selection in
    680      * this dataset.
    681      * @deprecated You should never need to do this from the outside.
    682      */
    683     @Deprecated
    684     public void fireSelectionChanged() {
    685         fireDeprecatedSelectionChange(getAllSelected());
    686     }
    687 
    688     private static void fireDeprecatedSelectionChange(Collection<? extends OsmPrimitive> currentSelection) {
     642    private static void fireSelectionChange(Collection<? extends OsmPrimitive> currentSelection) {
    689643        for (SelectionChangedListener l : selListeners) {
    690644            l.selectionChanged(currentSelection);
     
    827781        highlightedWaySegments = waySegments;
    828782        fireHighlightingChanged();
    829     }
    830 
    831     /**
    832      * Sets the current selection to the primitives in <code>selection</code>.
    833      * Notifies all {@link SelectionChangedListener} if <code>fireSelectionChangeEvent</code> is true.
    834      *
    835      * @param selection the selection
    836      * @param fireSelectionChangeEvent true, if the selection change listeners are to be notified; false, otherwise
    837      * @deprecated Use {@link #setSelected(Collection)} instead. To be removed end of 2017. Does not seem to be used by plugins.
    838      */
    839     @Deprecated
    840     public void setSelected(Collection<? extends PrimitiveId> selection, boolean fireSelectionChangeEvent) {
    841         setSelected(selection);
    842783    }
    843784
  • trunk/src/org/openstreetmap/josm/data/osm/Node.java

    r13012 r13173  
    9393     * Uses the {@link Main#getProjection() global projection} to project the lat/lon-coordinates.
    9494     * <p>
    95      * Method {@link org.openstreetmap.josm.data.coor.ILatLon#getEastNorth()} of
    96      * implemented interface <code>ILatLon</code> is deprecated, but this method is not.
    9795     * @return the east north coordinates or {@code null} if {@link #isLatLonKnown()}
    9896     * is false.
    9997     */
    100     @SuppressWarnings("deprecation")
    101     @Override
    10298    public EastNorth getEastNorth() {
    10399        return getEastNorth(Main.getProjection());
     
    223219    }
    224220
    225     /**
    226      * @deprecated no longer supported
    227      */
    228     @Override
    229     @Deprecated
    230     public void accept(org.openstreetmap.josm.data.osm.visitor.Visitor visitor) {
    231         visitor.visit(this);
    232     }
    233 
    234221    @Override
    235222    public void accept(OsmPrimitiveVisitor visitor) {
  • trunk/src/org/openstreetmap/josm/data/osm/NodeData.java

    r12778 r13173  
    7575    }
    7676
    77     /**
    78      * @deprecated use {@link #getEastNorth(org.openstreetmap.josm.data.projection.Projecting)}
    79      */
    80     @Override
    81     @Deprecated
    82     public EastNorth getEastNorth() {
    83         // No internal caching of projected coordinates needed. In contrast to getEastNorth()
    84         // on Node, this method is rarely used. Caching would be overkill.
    85         return Main.getProjection().latlon2eastNorth(getCoor());
    86     }
    87 
    8877    @Override
    8978    public void setEastNorth(EastNorth eastNorth) {
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r13070 r13173  
    10241024
    10251025    /**
    1026      * <p>Visits {@code org.openstreetmap.josm.data.osm.visitor.Visitor} for all referrers.</p>
    1027      *
    1028      * @param visitor the visitor. Ignored, if null.
    1029      * @deprecated use {@link #visitReferrers(OsmPrimitiveVisitor)}
    1030      */
    1031     @Deprecated
    1032     public void visitReferrers(org.openstreetmap.josm.data.osm.visitor.Visitor visitor) {
    1033         visitReferrers((OsmPrimitiveVisitor) visitor);
    1034     }
    1035 
    1036     /**
    10371026     * <p>Visits {@code visitor} for all referrers.</p>
    10381027     *
     
    10901079     * visitor function.
    10911080     * @param visitor The visitor from which the visit() function must be called.
    1092      * @deprecated will be removed along with {@link org.openstreetmap.josm.data.osm.visitor.Visitor}
    1093      */
    1094     @Deprecated
    1095     public abstract void accept(org.openstreetmap.josm.data.osm.visitor.Visitor visitor);
    1096 
    1097     /**
    1098      * Implementation of the visitor scheme. Subclasses have to call the correct
    1099      * visitor function.
    1100      * @param visitor The visitor from which the visit() function must be called.
    11011081     * @since 12809
    11021082     */
  • trunk/src/org/openstreetmap/josm/data/osm/Relation.java

    r12846 r13173  
    174174    public OsmPrimitiveType getMemberType(int idx) {
    175175        return members[idx].getType();
    176     }
    177 
    178     /**
    179      * @deprecated no longer supported
    180      */
    181     @Override
    182     @Deprecated
    183     public void accept(org.openstreetmap.josm.data.osm.visitor.Visitor visitor) {
    184         visitor.visit(this);
    185176    }
    186177
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r13033 r13173  
    205205        }
    206206        return chunkSet;
    207     }
    208 
    209     /**
    210      * @deprecated no longer supported
    211      */
    212     @Deprecated
    213     @Override public void accept(org.openstreetmap.josm.data.osm.visitor.Visitor visitor) {
    214         visitor.visit(this);
    215207    }
    216208
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r13150 r13173  
    472472     * be replaced by plain fill, when it covers a certain fraction of the total area
    473473     * @param disabled If this should be drawn with a special disabled style.
    474      * @param text Ignored. Use {@link #drawText} instead.
    475      * @deprecated use {@link #drawArea(Relation r, Color color, MapImage fillImage, Float extent, Float extentThreshold, boolean disabled)}
    476      */
    477     @Deprecated
    478     public void drawArea(Relation r, Color color, MapImage fillImage, Float extent, Float extentThreshold, boolean disabled, TextLabel text) {
    479         drawArea(r, color, fillImage, extent, extentThreshold, disabled);
    480     }
    481 
    482     /**
    483      * Draws a multipolygon area.
    484      * @param r The multipolygon relation
    485      * @param color The color to fill the area with.
    486      * @param fillImage The image to fill the area with. Overrides color.
    487      * @param extent if not null, area will be filled partially; specifies, how
    488      * far to fill from the boundary towards the center of the area;
    489      * if null, area will be filled completely
    490      * @param extentThreshold if not null, determines if the partial filled should
    491      * be replaced by plain fill, when it covers a certain fraction of the total area
    492      * @param disabled If this should be drawn with a special disabled style.
    493474     * @since 12285
    494475     */
     
    516497            }
    517498        }
    518     }
    519 
    520     /**
    521      * Draws an area defined by a way. They way does not need to be closed, but it should.
    522      * @param w The way.
    523      * @param color The color to fill the area with.
    524      * @param fillImage The image to fill the area with. Overrides color.
    525      * @param extent if not null, area will be filled partially; specifies, how
    526      * far to fill from the boundary towards the center of the area;
    527      * if null, area will be filled completely
    528      * @param extentThreshold if not null, determines if the partial filled should
    529      * be replaced by plain fill, when it covers a certain fraction of the total area
    530      * @param disabled If this should be drawn with a special disabled style.
    531      * @param text Ignored. Use {@link #drawText} instead.
    532      * @deprecated use {@link #drawArea(Way w, Color color, MapImage fillImage, Float extent, Float extentThreshold, boolean disabled)}
    533      */
    534     @Deprecated
    535     public void drawArea(Way w, Color color, MapImage fillImage, Float extent, Float extentThreshold, boolean disabled, TextLabel text) {
    536         drawArea(w, color, fillImage, extent, extentThreshold, disabled);
    537499    }
    538500
  • trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java

    r12868 r13173  
    210210     * @param code unique code for this projection - may be null
    211211     * @param pref the string that defines the custom projection
    212      * @param cacheDir cache directory name
    213      * @deprecated unused - remove in 2017-09
    214      */
    215     @Deprecated
    216     public CustomProjection(String name, String code, String pref, String cacheDir) {
    217         this(name, code, pref);
    218     }
    219 
    220     /**
    221      * Constructs a new {@code CustomProjection} with given name, code and parameters.
    222      *
    223      * @param name describe projection in one or two words
    224      * @param code unique code for this projection - may be null
    225      * @param pref the string that defines the custom projection
    226212     */
    227213    public CustomProjection(String name, String code, String pref) {
     
    693679    }
    694680
    695     /**
    696      * {@inheritDoc}
    697      * @deprecated unused - remove in 2017-09
    698      */
    699     @Override
    700     @Deprecated
    701     public String getCacheDirectoryName() {
    702         if (cacheDir != null) {
    703             return cacheDir;
    704         } else {
    705             return "proj-" + Utils.md5Hex(pref == null ? "" : pref).substring(0, 4);
    706         }
    707     }
    708 
    709681    @Override
    710682    public Bounds getWorldBoundsLatLon() {
  • trunk/src/org/openstreetmap/josm/data/projection/Projection.java

    r12818 r13173  
    5252     */
    5353    String toCode();
    54 
    55     /**
    56      * Get a filename compatible string (for the cache directory).
    57      * @return the cache directory name (base name)
    58      * @deprecated unused - remove in 2017-07
    59      */
    60     @Deprecated
    61     String getCacheDirectoryName();
    6254
    6355    /**
  • trunk/src/org/openstreetmap/josm/data/projection/Projections.java

    r12786 r13173  
    1818import java.util.regex.Pattern;
    1919
    20 import org.openstreetmap.josm.Main;
    21 import org.openstreetmap.josm.data.coor.EastNorth;
    22 import org.openstreetmap.josm.data.coor.ILatLon;
    23 import org.openstreetmap.josm.data.coor.LatLon;
    2420import org.openstreetmap.josm.data.projection.datum.Datum;
    2521import org.openstreetmap.josm.data.projection.datum.GRS80Datum;
     
    181177
    182178    /**
    183      * Convert from lat/lon to easting/northing using the current projection.
    184      *
    185      * @param ll the geographical point to convert (in WGS84 lat/lon)
    186      * @return the corresponding east/north coordinates
    187      * @since 12725
    188      * @deprecated use <code>Main.getProjection().latlon2eastNorth(ll)</code>
    189      */
    190     @Deprecated
    191     public static EastNorth project(ILatLon ll) {
    192         if (ll == null) return null;
    193         return Main.getProjection().latlon2eastNorth(ll);
    194     }
    195 
    196     /**
    197      * Convert from lat/lon to easting/northing using the current projection.
    198      *
    199      * @param ll the geographical point to convert (in WGS84 lat/lon)
    200      * @return the corresponding east/north coordinates
    201      * @deprecated use <code>Main.getProjection().latlon2eastNorth(ll)</code>
    202      */
    203     @Deprecated
    204     public static EastNorth project(LatLon ll) {
    205         return project((ILatLon) ll);
    206     }
    207 
    208     /**
    209      * Convert from easting/norting to lat/lon using the current projection.
    210      *
    211      * @param en the geographical point to convert (in projected coordinates)
    212      * @return the corresponding lat/lon (WGS84)
    213      * @deprecated use <code>Main.getProjection().eastNorth2latlon(en)</code>
    214      */
    215     @Deprecated
    216     public static LatLon inverseProject(EastNorth en) {
    217         if (en == null) return null;
    218         return Main.getProjection().eastNorth2latlon(en);
    219     }
    220 
    221     /**
    222179     * Plugins can register additional base projections.
    223180     *
  • trunk/src/org/openstreetmap/josm/data/tagging/ac/AutoCompletionItem.java

    r13121 r13173  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.tagging.ac;
    3 
    4 import org.openstreetmap.josm.tools.CheckParameterUtil;
    53
    64/**
     
    7573    }
    7674
    77     /**
    78      * sets the value
    79      * @param value the value; must not be null
    80      * @throws IllegalArgumentException if value if null
    81      * @deprecated value is now final, set it when constructing the object
    82      */
    83     @Deprecated
    84     public void setValue(String value) {
    85         CheckParameterUtil.ensureParameterNotNull(value, "value");
    86         throw new UnsupportedOperationException("setValue() is no longer supported");
    87     }
    88 
    8975    @Override
    9076    public String toString() {
Note: See TracChangeset for help on using the changeset viewer.