- Timestamp:
- 2017-09-10T13:58:18+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r12813 r12816 21 21 22 22 import org.openstreetmap.josm.Main; 23 import org.openstreetmap.josm.data.osm.search.SearchParseError;24 23 import org.openstreetmap.josm.data.osm.search.SearchCompiler; 25 24 import org.openstreetmap.josm.data.osm.search.SearchCompiler.Match; 25 import org.openstreetmap.josm.data.osm.search.SearchParseError; 26 26 import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor; 27 27 import org.openstreetmap.josm.gui.mappaint.StyleCache; … … 1090 1090 * visitor function. 1091 1091 * @param visitor The visitor from which the visit() function must be called. 1092 * @deprecated will be removed along with {@link Visitor}1092 * @deprecated will be removed along with {@link org.openstreetmap.josm.data.osm.visitor.Visitor} 1093 1093 */ 1094 1094 @Deprecated -
trunk/src/org/openstreetmap/josm/gui/download/OverpassDownloadSource.java
r12733 r12816 35 35 import org.openstreetmap.josm.gui.MainApplication; 36 36 import org.openstreetmap.josm.gui.download.DownloadSourceSizingPolicy.AdjustableDownloadSizePolicy; 37 import org.openstreetmap.josm.gui.preferences.server.OverpassServerPreference;38 37 import org.openstreetmap.josm.gui.util.GuiHelper; 39 38 import org.openstreetmap.josm.gui.widgets.JosmTextArea; … … 63 62 task.setZoomAfterDownload(settings.zoomToData()); 64 63 Future<?> future = task.download( 65 new OverpassDownloadReader(area, Overpass ServerPreference.getOverpassServer(), data.getQuery()),64 new OverpassDownloadReader(area, OverpassDownloadReader.OVERPASS_SERVER.get(), data.getQuery()), 66 65 settings.asNewLayer(), area, null); 67 66 MainApplication.worker.submit(new PostDownloadHandler(task, future, data.getErrorReporter())); -
trunk/src/org/openstreetmap/josm/gui/preferences/server/OverpassServerPreference.java
r10306 r12816 5 5 6 6 import java.awt.GridBagLayout; 7 import java.util.Arrays;8 7 9 8 import javax.swing.BorderFactory; … … 13 12 import javax.swing.JPanel; 14 13 15 import org.openstreetmap.josm.data.preferences.BooleanProperty;16 import org.openstreetmap.josm.data.preferences.CollectionProperty;17 import org.openstreetmap.josm.data.preferences.StringProperty;18 14 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 19 15 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory; … … 22 18 import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting; 23 19 import org.openstreetmap.josm.gui.widgets.HistoryComboBox; 20 import org.openstreetmap.josm.io.OverpassDownloadReader; 24 21 import org.openstreetmap.josm.tools.GBC; 25 22 … … 30 27 */ 31 28 public class OverpassServerPreference implements SubPreferenceSetting { 32 33 private static final StringProperty OVERPASS_SERVER = new StringProperty("download.overpass.server",34 "https://overpass-api.de/api/");35 private static final CollectionProperty OVERPASS_SERVER_HISTORY = new CollectionProperty("download.overpass.servers",36 Arrays.asList("https://overpass-api.de/api/", "http://overpass.osm.rambler.ru/cgi/"));37 private static final BooleanProperty FOR_MULTI_FETCH = new BooleanProperty("download.overpass.for-multi-fetch", false);38 29 39 30 private final HistoryComboBox overpassServer = new HistoryComboBox(); … … 62 53 panel.add(new JLabel(tr("Overpass server: ")), GBC.std().insets(5, 5, 5, 5)); 63 54 panel.add(overpassServer, GBC.eop().fill(GBC.HORIZONTAL)); 64 overpassServer.setPossibleItems(O VERPASS_SERVER_HISTORY.get());65 overpassServer.setText(O VERPASS_SERVER.get());55 overpassServer.setPossibleItems(OverpassDownloadReader.OVERPASS_SERVER_HISTORY.get()); 56 overpassServer.setText(OverpassDownloadReader.OVERPASS_SERVER.get()); 66 57 67 58 panel.add(forMultiFetch, GBC.eop()); 68 forMultiFetch.setSelected( useForMultiFetch());59 forMultiFetch.setSelected(OverpassDownloadReader.FOR_MULTI_FETCH.get()); 69 60 70 61 panel.add(Box.createVerticalGlue(), GBC.eol().fill()); … … 75 66 @Override 76 67 public boolean ok() { 77 O VERPASS_SERVER.put(overpassServer.getText());78 O VERPASS_SERVER_HISTORY.put(overpassServer.getHistory());79 FOR_MULTI_FETCH.put(forMultiFetch.isSelected());68 OverpassDownloadReader.OVERPASS_SERVER.put(overpassServer.getText()); 69 OverpassDownloadReader.OVERPASS_SERVER_HISTORY.put(overpassServer.getHistory()); 70 OverpassDownloadReader.FOR_MULTI_FETCH.put(forMultiFetch.isSelected()); 80 71 return false; 81 72 } … … 89 80 * Returns the URL of the currently selected Overpass server. 90 81 * @return the URL of the currently selected Overpass server. 82 * @deprecated To be removed end of 2017. Use {@code OverpassDownloadReader.OVERPASS_SERVER.get()} instead 91 83 */ 84 @Deprecated 92 85 public static String getOverpassServer() { 93 return O VERPASS_SERVER.get();86 return OverpassDownloadReader.OVERPASS_SERVER.get(); 94 87 } 95 88 … … 97 90 * Returns true if objects should be fetched from an Overpass server instead of the OSM API. 98 91 * @return true if objects should be fetched from an Overpass server instead of the OSM API. 92 * @deprecated To be removed end of 2017. Use {@code OverpassDownloadReader.FOR_MULTI_FETCH.get()} instead 99 93 */ 94 @Deprecated 100 95 public static boolean useForMultiFetch() { 101 return FOR_MULTI_FETCH.get();96 return OverpassDownloadReader.FOR_MULTI_FETCH.get(); 102 97 } 103 98 } -
trunk/src/org/openstreetmap/josm/io/GeoJSONWriter.java
r12809 r12816 30 30 import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor; 31 31 import org.openstreetmap.josm.data.projection.Projection; 32 import org.openstreetmap.josm.data.projection.Projections; 32 33 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 33 34 import org.openstreetmap.josm.gui.mappaint.ElemStyles; 34 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;35 35 import org.openstreetmap.josm.tools.Logging; 36 36 import org.openstreetmap.josm.tools.Pair; … … 65 65 public GeoJSONWriter(DataSet ds) { 66 66 this.data = ds; 67 this.projection = Projection Preference.wgs84.getProjection();67 this.projection = Projections.getProjectionByCode("EPSG:4326"); // WGS 84 68 68 } 69 69 -
trunk/src/org/openstreetmap/josm/io/MultiFetchOverpassObjectReader.java
r10689 r12816 6 6 7 7 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 8 import org.openstreetmap.josm.gui.preferences.server.OverpassServerPreference;9 8 import org.openstreetmap.josm.tools.Utils; 10 9 … … 25 24 @Override 26 25 protected String getBaseUrl() { 27 return Overpass ServerPreference.getOverpassServer();26 return OverpassDownloadReader.OVERPASS_SERVER.get(); 28 27 } 29 28 -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r12620 r12816 35 35 import org.openstreetmap.josm.data.osm.SimplePrimitiveId; 36 36 import org.openstreetmap.josm.data.osm.Way; 37 import org.openstreetmap.josm.gui.preferences.server.OverpassServerPreference;38 37 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 39 38 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 87 86 /** 88 87 * Creates a new instance of {@link MultiFetchServerObjectReader} or {@link MultiFetchOverpassObjectReader} 89 * depending on the {@link Overpass ServerPreference#useForMultiFetchpreference}.88 * depending on the {@link OverpassDownloadReader#FOR_MULTI_FETCH preference}. 90 89 * 91 90 * @return a new instance … … 93 92 */ 94 93 public static MultiFetchServerObjectReader create() { 95 return create(Overpass ServerPreference.useForMultiFetch());94 return create(OverpassDownloadReader.FOR_MULTI_FETCH.get()); 96 95 } 97 96 -
trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java
r12714 r12816 11 11 import java.time.Period; 12 12 import java.time.ZoneOffset; 13 import java.util.Arrays; 13 14 import java.util.EnumMap; 14 15 import java.util.Locale; … … 31 32 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 32 33 import org.openstreetmap.josm.data.osm.PrimitiveId; 34 import org.openstreetmap.josm.data.preferences.BooleanProperty; 35 import org.openstreetmap.josm.data.preferences.CollectionProperty; 36 import org.openstreetmap.josm.data.preferences.StringProperty; 33 37 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 34 38 import org.openstreetmap.josm.io.NameFinder.SearchResult; … … 44 48 */ 45 49 public class OverpassDownloadReader extends BoundingBoxDownloader { 50 51 /** 52 * Property for current Overpass server. 53 * @since 12816 54 */ 55 public static final StringProperty OVERPASS_SERVER = new StringProperty("download.overpass.server", 56 "https://overpass-api.de/api/"); 57 /** 58 * Property for list of known Overpass servers. 59 * @since 12816 60 */ 61 public static final CollectionProperty OVERPASS_SERVER_HISTORY = new CollectionProperty("download.overpass.servers", 62 Arrays.asList("https://overpass-api.de/api/", "http://overpass.osm.rambler.ru/cgi/")); 63 /** 64 * Property to determine if Overpass API should be used for multi-fetch download. 65 * @since 12816 66 */ 67 public static final BooleanProperty FOR_MULTI_FETCH = new BooleanProperty("download.overpass.for-multi-fetch", false); 46 68 47 69 private static final String DATA_PREFIX = "?data=";
Note:
See TracChangeset
for help on using the changeset viewer.