Changeset 14005 in josm for trunk/src


Ignore:
Timestamp:
2018-07-06T01:32:11+02:00 (6 years ago)
Author:
Don-vip
Message:

remove deprecated API

Location:
trunk/src/org/openstreetmap/josm
Files:
2 deleted
10 edited

Legend:

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

    r14003 r14005  
    13591359    }
    13601360
    1361     /**
    1362      * Gets a collection of primitives that should not be hidden by the filter.
    1363      * @return The primitives that the filter should not hide.
    1364      * @deprecated use {@link org.openstreetmap.josm.data.osm.DataSet#allPreservedPrimitives}
    1365      * @since 11993
    1366      */
    1367     @Override
    1368     @Deprecated
    1369     public Collection<? extends OsmPrimitive> getPreservedPrimitives() {
    1370         DataSet ds = getLayerManager().getEditDataSet();
    1371         return ds != null ? ds.allPreservedPrimitives() : Collections.emptySet();
    1372     }
    1373 
    13741361    @Override
    13751362    public boolean layerIsSupported(Layer l) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java

    r13847 r14005  
    88import java.awt.event.MouseListener;
    99import java.awt.event.MouseMotionListener;
    10 import java.util.Collection;
    11 import java.util.Collections;
    1210
    1311import javax.swing.Action;
    1412
    1513import org.openstreetmap.josm.actions.JosmAction;
    16 import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1714import org.openstreetmap.josm.gui.MainApplication;
    1815import org.openstreetmap.josm.gui.MapFrame;
     
    237234
    238235    /**
    239      * Gets a collection of primitives that should not be hidden by the filter.
    240      * @return The primitives that the filter should not hide.
    241      * @deprecated use {@link org.openstreetmap.josm.data.osm.DataSet#allPreservedPrimitives}
    242      * @since 11993
    243      */
    244     @Deprecated
    245     public Collection<? extends OsmPrimitive> getPreservedPrimitives() {
    246         return Collections.emptySet();
    247     }
    248 
    249     /**
    250236     * Determines if the given layer is a data layer that can be modified.
    251237     * Useful for {@link #layerIsSupported(Layer)} implementations.
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r13849 r14005  
    238238
    239239    /**
    240      * Returns the user defined preferences directory, containing the preferences.xml file
    241      * @return The user defined preferences directory, containing the preferences.xml file
    242      * @since 7834
    243      * @deprecated use {@link #getPreferencesDirectory(boolean)}
    244      */
    245     @Deprecated
    246     public File getPreferencesDirectory() {
    247         return getPreferencesDirectory(false);
    248     }
    249 
    250     /**
    251      * @param createIfMissing if true, automatically creates this directory,
    252      * in case it is missing
    253      * @return the preferences directory
    254      * @deprecated use {@link #getDirs()} or (more generally) {@link Config#getDirs()}
    255      */
    256     @Deprecated
    257     public File getPreferencesDirectory(boolean createIfMissing) {
    258         return dirs.getPreferencesDirectory(createIfMissing);
    259     }
    260 
    261     /**
    262      * Returns the user data directory, containing autosave, plugins, etc.
    263      * Depending on the OS it may be the same directory as preferences directory.
    264      * @return The user data directory, containing autosave, plugins, etc.
    265      * @since 7834
    266      * @deprecated use {@link #getUserDataDirectory(boolean)}
    267      */
    268     @Deprecated
    269     public File getUserDataDirectory() {
    270         return getUserDataDirectory(false);
    271     }
    272 
    273     /**
    274      * @param createIfMissing if true, automatically creates this directory,
    275      * in case it is missing
    276      * @return the user data directory
    277      * @deprecated use {@link #getDirs()} or (more generally) {@link Config#getDirs()}
    278      */
    279     @Deprecated
    280     public File getUserDataDirectory(boolean createIfMissing) {
    281         return dirs.getUserDataDirectory(createIfMissing);
    282     }
    283 
    284     /**
    285240     * Returns the user preferences file (preferences.xml).
    286241     * @return The user preferences file (preferences.xml)
     
    304259    public File getPluginsDirectory() {
    305260        return new File(dirs.getUserDataDirectory(false), "plugins");
    306     }
    307 
    308     /**
    309      * Get the directory where cached content of any kind should be stored.
    310      *
    311      * If the directory doesn't exist on the file system, it will be created by this method.
    312      *
    313      * @return the cache directory
    314      * @deprecated use {@link #getCacheDirectory(boolean)}
    315      */
    316     @Deprecated
    317     public File getCacheDirectory() {
    318         return getCacheDirectory(true);
    319     }
    320 
    321     /**
    322      * @param createIfMissing if true, automatically creates this directory,
    323      * in case it is missing
    324      * @return the cache directory
    325      * @deprecated use {@link #getDirs()} or (more generally) {@link Config#getDirs()}
    326      */
    327     @Deprecated
    328     public File getCacheDirectory(boolean createIfMissing) {
    329         return dirs.getCacheDirectory(createIfMissing);
    330261    }
    331262
  • trunk/src/org/openstreetmap/josm/data/osm/Tag.java

    r13625 r14005  
    1010
    1111import org.openstreetmap.josm.tools.CheckParameterUtil;
    12 import org.openstreetmap.josm.tools.Utils;
    1312
    1413/**
     
    141140
    142141    /**
    143      * Removes leading, trailing, and multiple inner whitespaces from the given string, to be used as a key or value.
    144      * @param s The string
    145      * @return The string without leading, trailing or multiple inner whitespaces
    146      * @since 6699
    147      * @deprecated since 13597. Use {@link Utils#removeWhiteSpaces(String)} instead
    148      */
    149     @Deprecated
    150     public static String removeWhiteSpaces(String s) {
    151         return Utils.removeWhiteSpaces(s);
    152     }
    153 
    154     /**
    155142     * Unsupported.
    156143     * @param keys ignored
  • trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java

    r13926 r14005  
    7474         * Gets the data layer that was previously used.
    7575         * @return The old data layer, <code>null</code> if there is none.
    76          * @deprecated use {@link #getPreviousDataLayer}
    77          */
    78         @Deprecated
    79         public OsmDataLayer getPreviousEditLayer() {
    80             return getPreviousDataLayer();
    81         }
    82 
    83         /**
    84          * Gets the data layer that was previously used.
    85          * @return The old data layer, <code>null</code> if there is none.
    8676         * @since 13434
    8777         */
     
    9686        public Layer getPreviousActiveLayer() {
    9787            return previousActiveLayer;
    98         }
    99 
    100         /**
    101          * Gets the data set that was previously used.
    102          * @return The data set of {@link #getPreviousDataLayer()}.
    103          * @deprecated use {@link #getPreviousDataSet}
    104          */
    105         @Deprecated
    106         public DataSet getPreviousEditDataSet() {
    107             return getPreviousDataSet();
    10888        }
    10989
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/AbstractProjectionChoice.java

    r13182 r14005  
    1717    protected String name;
    1818    protected String id;
    19 
    20     /**
    21      * Constructs a new {@code AbstractProjectionChoice}.
    22      *
    23      * @param name short name of the projection choice as shown in the GUI
    24      * @param id unique identifier for the projection choice
    25      * @param cacheDir unused
    26      * @deprecated use {@link #AbstractProjectionChoice(String, String)} instead
    27      */
    28     @Deprecated
    29     public AbstractProjectionChoice(String name, String id, String cacheDir) {
    30         this(name, id);
    31     }
    3219
    3320    /**
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java

    r13206 r14005  
    277277     * @param id short name of the projection choice as shown in the GUI
    278278     * @param epsg the unique numeric EPSG identifier for the projection
    279      * @param cacheDir unused
    280      * @return the registered {@link ProjectionChoice}
    281      * @deprecated use {@link #registerProjectionChoice(String, String, Integer)} instead
    282      */
    283     @Deprecated
    284     public static ProjectionChoice registerProjectionChoice(String name, String id, Integer epsg, String cacheDir) {
    285         return registerProjectionChoice(name, id, epsg);
    286     }
    287 
    288     /**
    289      * Registers a new projection choice.
    290      * @param name short name of the projection choice as shown in the GUI
    291      * @param id short name of the projection choice as shown in the GUI
    292      * @param epsg the unique numeric EPSG identifier for the projection
    293279     * @return the registered {@link ProjectionChoice}
    294280     */
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/SingleProjectionChoice.java

    r13182 r14005  
    1616
    1717    protected String code;
    18 
    19     /**
    20      * Constructs a new {@code SingleProjectionChoice}.
    21      *
    22      * @param name short name of the projection choice as shown in the GUI
    23      * @param id unique identifier for the projection choice, e.g. "core:thisproj"
    24      * @param code the unique identifier for the projection, e.g. "EPSG:1234"
    25      * @param cacheDir unused
    26      * @deprecated use {@link #SingleProjectionChoice(String, String, String)} instead
    27      */
    28     @Deprecated
    29     public SingleProjectionChoice(String name, String id, String code, String cacheDir) {
    30         this(name, id, code);
    31     }
    3218
    3319    /**
  • trunk/src/org/openstreetmap/josm/io/OsmServerReader.java

    r13901 r14005  
    285285
    286286    /**
    287      * Download BZip2-compressed OSM Change files from somewhere
    288      * @param progressMonitor The progress monitor
    289      * @return The corresponding dataset
    290      * @throws OsmTransferException if any error occurs
    291      * @deprecated use {@link #parseOsmChange(ProgressMonitor, Compression)} instead
    292      */
    293     @Deprecated
    294     public DataSet parseOsmChangeBzip2(ProgressMonitor progressMonitor) throws OsmTransferException {
    295         return parseOsmChange(progressMonitor, Compression.BZIP2);
    296     }
    297 
    298     /**
    299      * Download GZip-compressed OSM Change files from somewhere
    300      * @param progressMonitor The progress monitor
    301      * @return The corresponding dataset
    302      * @throws OsmTransferException if any error occurs
    303      * @deprecated use {@link #parseOsmChange(ProgressMonitor, Compression)} instead
    304      */
    305     @Deprecated
    306     public DataSet parseOsmChangeGzip(ProgressMonitor progressMonitor) throws OsmTransferException {
    307         return parseOsmChange(progressMonitor, Compression.GZIP);
    308     }
    309 
    310     /**
    311287     * Retrieve raw gps waypoints from the server API.
    312288     * @param progressMonitor The progress monitor
     
    328304    public GpxData parseRawGps(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException {
    329305        return null;
    330     }
    331 
    332     /**
    333      * Retrieve BZip2-compressed GPX files from somewhere.
    334      * @param progressMonitor The progress monitor
    335      * @return The corresponding GPX tracks
    336      * @throws OsmTransferException if any error occurs
    337      * @deprecated use {@link #parseRawGps(ProgressMonitor, Compression)} instead
    338      * @since 6244
    339      */
    340     @Deprecated
    341     public GpxData parseRawGpsBzip2(ProgressMonitor progressMonitor) throws OsmTransferException {
    342         return parseRawGps(progressMonitor, Compression.BZIP2);
    343     }
    344 
    345     /**
    346      * Download BZip2-compressed OSM files from somewhere
    347      * @param progressMonitor The progress monitor
    348      * @return The corresponding dataset
    349      * @throws OsmTransferException if any error occurs
    350      * @deprecated use {@link #parseOsm(ProgressMonitor, Compression)} instead
    351      */
    352     @Deprecated
    353     public DataSet parseOsmBzip2(ProgressMonitor progressMonitor) throws OsmTransferException {
    354         return parseOsm(progressMonitor, Compression.BZIP2);
    355     }
    356 
    357     /**
    358      * Download GZip-compressed OSM files from somewhere
    359      * @param progressMonitor The progress monitor
    360      * @return The corresponding dataset
    361      * @throws OsmTransferException if any error occurs
    362      * @deprecated use {@link #parseOsm(ProgressMonitor, Compression)} instead
    363      */
    364     @Deprecated
    365     public DataSet parseOsmGzip(ProgressMonitor progressMonitor) throws OsmTransferException {
    366         return parseOsm(progressMonitor, Compression.GZIP);
    367     }
    368 
    369     /**
    370      * Download Zip-compressed OSM files from somewhere
    371      * @param progressMonitor The progress monitor
    372      * @return The corresponding dataset
    373      * @throws OsmTransferException if any error occurs
    374      * @deprecated use {@link #parseOsm(ProgressMonitor, Compression)} instead
    375      * @since 6882
    376      */
    377     @Deprecated
    378     public DataSet parseOsmZip(final ProgressMonitor progressMonitor) throws OsmTransferException {
    379         return parseOsm(progressMonitor, Compression.ZIP);
    380306    }
    381307
     
    445371    public List<Note> parseRawNotes(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException {
    446372        return null;
    447     }
    448 
    449     /**
    450      * Download notes from a URL that contains a bzip2 compressed notes dump file
    451      * @param progressMonitor progress monitor
    452      * @return A list of notes parsed from the URL
    453      * @throws OsmTransferException if any error occurs during dialog with OSM API
    454      * @deprecated Use {@link #parseRawNotes(ProgressMonitor, Compression)} instead
    455      */
    456     @Deprecated
    457     public List<Note> parseRawNotesBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException {
    458         return parseRawNotes(progressMonitor, Compression.BZIP2);
    459373    }
    460374
  • trunk/src/org/openstreetmap/josm/plugins/Plugin.java

    r13193 r14005  
    55
    66import java.io.File;
    7 import java.io.FileNotFoundException;
    8 import java.io.IOException;
    9 import java.io.InputStream;
    107import java.net.URL;
    118import java.net.URLClassLoader;
    12 import java.nio.file.Files;
    13 import java.nio.file.StandardCopyOption;
    149import java.security.AccessController;
    1510import java.security.PrivilegedAction;
     
    138133    }
    139134
    140     /**
    141      * @return The directory for the plugin to store all kind of stuff.
    142      * @deprecated (since 13007) to get the same directory as this method, use {@code getPluginDirs().getUserDataDirectory(false)}.
    143      * However, for files that can be characterized as cache or preferences, you are encouraged to use the appropriate
    144      * {@link IBaseDirectories} method from {@link #getPluginDirs()}.
    145      */
    146     @Deprecated
    147     public String getPluginDir() {
    148         return new File(Main.pref.getPluginsDirectory(), info.name).getPath();
    149     }
    150 
    151135    @Override
    152136    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {}
     
    167151     */
    168152    public void addDownloadSelection(List<DownloadSelection> list) {}
    169 
    170     /**
    171      * Copies the resource 'from' to the file in the plugin directory named 'to'.
    172      * @param from source file
    173      * @param to target file
    174      * @throws FileNotFoundException if the file exists but is a directory rather than a regular file,
    175      * does not exist but cannot be created, or cannot be opened for any other reason
    176      * @throws IOException if any other I/O error occurs
    177      * @deprecated without replacement
    178      */
    179     @Deprecated
    180     public void copy(String from, String to) throws IOException {
    181         String pluginDirName = getPluginDir();
    182         File pluginDir = new File(pluginDirName);
    183         if (!pluginDir.exists()) {
    184             Utils.mkDirs(pluginDir);
    185         }
    186         try (InputStream in = getClass().getResourceAsStream(from)) {
    187             if (in == null) {
    188                 throw new IOException("Resource not found: "+from);
    189             }
    190             Files.copy(in, new File(pluginDirName, to).toPath(), StandardCopyOption.REPLACE_EXISTING);
    191         }
    192     }
    193153
    194154    /**
Note: See TracChangeset for help on using the changeset viewer.