- Timestamp:
- 2018-07-06T01:32:11+02:00 (6 years ago)
- 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 1359 1359 } 1360 1360 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 119931366 */1367 @Override1368 @Deprecated1369 public Collection<? extends OsmPrimitive> getPreservedPrimitives() {1370 DataSet ds = getLayerManager().getEditDataSet();1371 return ds != null ? ds.allPreservedPrimitives() : Collections.emptySet();1372 }1373 1374 1361 @Override 1375 1362 public boolean layerIsSupported(Layer l) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java
r13847 r14005 8 8 import java.awt.event.MouseListener; 9 9 import java.awt.event.MouseMotionListener; 10 import java.util.Collection;11 import java.util.Collections;12 10 13 11 import javax.swing.Action; 14 12 15 13 import org.openstreetmap.josm.actions.JosmAction; 16 import org.openstreetmap.josm.data.osm.OsmPrimitive;17 14 import org.openstreetmap.josm.gui.MainApplication; 18 15 import org.openstreetmap.josm.gui.MapFrame; … … 237 234 238 235 /** 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 11993243 */244 @Deprecated245 public Collection<? extends OsmPrimitive> getPreservedPrimitives() {246 return Collections.emptySet();247 }248 249 /**250 236 * Determines if the given layer is a data layer that can be modified. 251 237 * Useful for {@link #layerIsSupported(Layer)} implementations. -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r13849 r14005 238 238 239 239 /** 240 * Returns the user defined preferences directory, containing the preferences.xml file241 * @return The user defined preferences directory, containing the preferences.xml file242 * @since 7834243 * @deprecated use {@link #getPreferencesDirectory(boolean)}244 */245 @Deprecated246 public File getPreferencesDirectory() {247 return getPreferencesDirectory(false);248 }249 250 /**251 * @param createIfMissing if true, automatically creates this directory,252 * in case it is missing253 * @return the preferences directory254 * @deprecated use {@link #getDirs()} or (more generally) {@link Config#getDirs()}255 */256 @Deprecated257 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 7834266 * @deprecated use {@link #getUserDataDirectory(boolean)}267 */268 @Deprecated269 public File getUserDataDirectory() {270 return getUserDataDirectory(false);271 }272 273 /**274 * @param createIfMissing if true, automatically creates this directory,275 * in case it is missing276 * @return the user data directory277 * @deprecated use {@link #getDirs()} or (more generally) {@link Config#getDirs()}278 */279 @Deprecated280 public File getUserDataDirectory(boolean createIfMissing) {281 return dirs.getUserDataDirectory(createIfMissing);282 }283 284 /**285 240 * Returns the user preferences file (preferences.xml). 286 241 * @return The user preferences file (preferences.xml) … … 304 259 public File getPluginsDirectory() { 305 260 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 directory314 * @deprecated use {@link #getCacheDirectory(boolean)}315 */316 @Deprecated317 public File getCacheDirectory() {318 return getCacheDirectory(true);319 }320 321 /**322 * @param createIfMissing if true, automatically creates this directory,323 * in case it is missing324 * @return the cache directory325 * @deprecated use {@link #getDirs()} or (more generally) {@link Config#getDirs()}326 */327 @Deprecated328 public File getCacheDirectory(boolean createIfMissing) {329 return dirs.getCacheDirectory(createIfMissing);330 261 } 331 262 -
trunk/src/org/openstreetmap/josm/data/osm/Tag.java
r13625 r14005 10 10 11 11 import org.openstreetmap.josm.tools.CheckParameterUtil; 12 import org.openstreetmap.josm.tools.Utils;13 12 14 13 /** … … 141 140 142 141 /** 143 * Removes leading, trailing, and multiple inner whitespaces from the given string, to be used as a key or value.144 * @param s The string145 * @return The string without leading, trailing or multiple inner whitespaces146 * @since 6699147 * @deprecated since 13597. Use {@link Utils#removeWhiteSpaces(String)} instead148 */149 @Deprecated150 public static String removeWhiteSpaces(String s) {151 return Utils.removeWhiteSpaces(s);152 }153 154 /**155 142 * Unsupported. 156 143 * @param keys ignored -
trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java
r13926 r14005 74 74 * Gets the data layer that was previously used. 75 75 * @return The old data layer, <code>null</code> if there is none. 76 * @deprecated use {@link #getPreviousDataLayer}77 */78 @Deprecated79 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.86 76 * @since 13434 87 77 */ … … 96 86 public Layer getPreviousActiveLayer() { 97 87 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 @Deprecated106 public DataSet getPreviousEditDataSet() {107 return getPreviousDataSet();108 88 } 109 89 -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/AbstractProjectionChoice.java
r13182 r14005 17 17 protected String name; 18 18 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 GUI24 * @param id unique identifier for the projection choice25 * @param cacheDir unused26 * @deprecated use {@link #AbstractProjectionChoice(String, String)} instead27 */28 @Deprecated29 public AbstractProjectionChoice(String name, String id, String cacheDir) {30 this(name, id);31 }32 19 33 20 /** -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r13206 r14005 277 277 * @param id short name of the projection choice as shown in the GUI 278 278 * @param epsg the unique numeric EPSG identifier for the projection 279 * @param cacheDir unused280 * @return the registered {@link ProjectionChoice}281 * @deprecated use {@link #registerProjectionChoice(String, String, Integer)} instead282 */283 @Deprecated284 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 GUI291 * @param id short name of the projection choice as shown in the GUI292 * @param epsg the unique numeric EPSG identifier for the projection293 279 * @return the registered {@link ProjectionChoice} 294 280 */ -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/SingleProjectionChoice.java
r13182 r14005 16 16 17 17 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 GUI23 * @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 unused26 * @deprecated use {@link #SingleProjectionChoice(String, String, String)} instead27 */28 @Deprecated29 public SingleProjectionChoice(String name, String id, String code, String cacheDir) {30 this(name, id, code);31 }32 18 33 19 /** -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r13901 r14005 285 285 286 286 /** 287 * Download BZip2-compressed OSM Change files from somewhere288 * @param progressMonitor The progress monitor289 * @return The corresponding dataset290 * @throws OsmTransferException if any error occurs291 * @deprecated use {@link #parseOsmChange(ProgressMonitor, Compression)} instead292 */293 @Deprecated294 public DataSet parseOsmChangeBzip2(ProgressMonitor progressMonitor) throws OsmTransferException {295 return parseOsmChange(progressMonitor, Compression.BZIP2);296 }297 298 /**299 * Download GZip-compressed OSM Change files from somewhere300 * @param progressMonitor The progress monitor301 * @return The corresponding dataset302 * @throws OsmTransferException if any error occurs303 * @deprecated use {@link #parseOsmChange(ProgressMonitor, Compression)} instead304 */305 @Deprecated306 public DataSet parseOsmChangeGzip(ProgressMonitor progressMonitor) throws OsmTransferException {307 return parseOsmChange(progressMonitor, Compression.GZIP);308 }309 310 /**311 287 * Retrieve raw gps waypoints from the server API. 312 288 * @param progressMonitor The progress monitor … … 328 304 public GpxData parseRawGps(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException { 329 305 return null; 330 }331 332 /**333 * Retrieve BZip2-compressed GPX files from somewhere.334 * @param progressMonitor The progress monitor335 * @return The corresponding GPX tracks336 * @throws OsmTransferException if any error occurs337 * @deprecated use {@link #parseRawGps(ProgressMonitor, Compression)} instead338 * @since 6244339 */340 @Deprecated341 public GpxData parseRawGpsBzip2(ProgressMonitor progressMonitor) throws OsmTransferException {342 return parseRawGps(progressMonitor, Compression.BZIP2);343 }344 345 /**346 * Download BZip2-compressed OSM files from somewhere347 * @param progressMonitor The progress monitor348 * @return The corresponding dataset349 * @throws OsmTransferException if any error occurs350 * @deprecated use {@link #parseOsm(ProgressMonitor, Compression)} instead351 */352 @Deprecated353 public DataSet parseOsmBzip2(ProgressMonitor progressMonitor) throws OsmTransferException {354 return parseOsm(progressMonitor, Compression.BZIP2);355 }356 357 /**358 * Download GZip-compressed OSM files from somewhere359 * @param progressMonitor The progress monitor360 * @return The corresponding dataset361 * @throws OsmTransferException if any error occurs362 * @deprecated use {@link #parseOsm(ProgressMonitor, Compression)} instead363 */364 @Deprecated365 public DataSet parseOsmGzip(ProgressMonitor progressMonitor) throws OsmTransferException {366 return parseOsm(progressMonitor, Compression.GZIP);367 }368 369 /**370 * Download Zip-compressed OSM files from somewhere371 * @param progressMonitor The progress monitor372 * @return The corresponding dataset373 * @throws OsmTransferException if any error occurs374 * @deprecated use {@link #parseOsm(ProgressMonitor, Compression)} instead375 * @since 6882376 */377 @Deprecated378 public DataSet parseOsmZip(final ProgressMonitor progressMonitor) throws OsmTransferException {379 return parseOsm(progressMonitor, Compression.ZIP);380 306 } 381 307 … … 445 371 public List<Note> parseRawNotes(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException { 446 372 return null; 447 }448 449 /**450 * Download notes from a URL that contains a bzip2 compressed notes dump file451 * @param progressMonitor progress monitor452 * @return A list of notes parsed from the URL453 * @throws OsmTransferException if any error occurs during dialog with OSM API454 * @deprecated Use {@link #parseRawNotes(ProgressMonitor, Compression)} instead455 */456 @Deprecated457 public List<Note> parseRawNotesBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException {458 return parseRawNotes(progressMonitor, Compression.BZIP2);459 373 } 460 374 -
trunk/src/org/openstreetmap/josm/plugins/Plugin.java
r13193 r14005 5 5 6 6 import java.io.File; 7 import java.io.FileNotFoundException;8 import java.io.IOException;9 import java.io.InputStream;10 7 import java.net.URL; 11 8 import java.net.URLClassLoader; 12 import java.nio.file.Files;13 import java.nio.file.StandardCopyOption;14 9 import java.security.AccessController; 15 10 import java.security.PrivilegedAction; … … 138 133 } 139 134 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 appropriate144 * {@link IBaseDirectories} method from {@link #getPluginDirs()}.145 */146 @Deprecated147 public String getPluginDir() {148 return new File(Main.pref.getPluginsDirectory(), info.name).getPath();149 }150 151 135 @Override 152 136 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {} … … 167 151 */ 168 152 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 file173 * @param to target file174 * @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 reason176 * @throws IOException if any other I/O error occurs177 * @deprecated without replacement178 */179 @Deprecated180 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 }193 153 194 154 /**
Note:
See TracChangeset
for help on using the changeset viewer.