- Timestamp:
- 2016-01-01T19:42:27+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/OverpassDownloadAction.java
r9241 r9242 15 15 import java.awt.event.KeyEvent; 16 16 import java.util.ArrayList; 17 import java.util.Arrays;18 17 import java.util.Collection; 19 18 import java.util.Collections; … … 41 40 import org.openstreetmap.josm.data.preferences.CollectionProperty; 42 41 import org.openstreetmap.josm.data.preferences.IntegerProperty; 43 import org.openstreetmap.josm.data.preferences.StringProperty;44 42 import org.openstreetmap.josm.gui.HelpAwareOptionPane; 45 43 import org.openstreetmap.josm.gui.download.DownloadDialog; 44 import org.openstreetmap.josm.gui.preferences.server.OverpassServerPreference; 46 45 import org.openstreetmap.josm.gui.util.GuiHelper; 47 46 import org.openstreetmap.josm.gui.widgets.HistoryComboBox; … … 58 57 */ 59 58 public class OverpassDownloadAction extends JosmAction { 60 61 /**62 * The {@link StringProperty property} of the currently selected Overpass server.63 *64 * @since 924165 */66 public static final StringProperty OVERPASS_SERVER = new StringProperty("download.overpass.server", "http://overpass-api.de/api/");67 59 68 60 /** … … 88 80 DownloadOsmTask task = new DownloadOsmTask(); 89 81 Future<?> future = task.download( 90 new OverpassDownloadReader(area, dialog.getOverpassServer(), dialog.getOverpassQuery()),82 new OverpassDownloadReader(area, OverpassServerPreference.getOverpassServer(), dialog.getOverpassQuery()), 91 83 dialog.isNewLayerRequired(), area, null); 92 84 Main.worker.submit(new PostDownloadHandler(task, future)); … … 124 116 private static final class OverpassDownloadDialog extends DownloadDialog { 125 117 126 private HistoryComboBox overpassServer;127 118 private HistoryComboBox overpassWizard; 128 119 private JosmTextArea overpassQuery; 129 120 private static OverpassDownloadDialog instance; 130 private static final CollectionProperty OVERPASS_SERVER_HISTORY = new CollectionProperty("download.overpass.servers",131 Arrays.asList("http://overpass-api.de/api/", "http://overpass.osm.rambler.ru/cgi/"));132 121 private static final CollectionProperty OVERPASS_WIZARD_HISTORY = new CollectionProperty("download.overpass.wizard", 133 122 new ArrayList<String>()); … … 203 192 pnl.add(pane, gbc); 204 193 205 overpassServer = new HistoryComboBox();206 overpassServer.getEditor().getEditorComponent().addFocusListener(disableActionsFocusListener);207 pnl.add(new JLabel(tr("Overpass server: ")), GBC.std().insets(5, 5, 5, 5));208 pnl.add(overpassServer, GBC.eol().fill(GBC.HORIZONTAL));209 }210 211 public String getOverpassServer() {212 return overpassServer.getText();213 194 } 214 195 … … 224 205 public void restoreSettings() { 225 206 super.restoreSettings(); 226 overpassServer.setPossibleItems(OVERPASS_SERVER_HISTORY.get());227 overpassServer.setText(OVERPASS_SERVER.get());228 207 overpassWizard.setPossibleItems(OVERPASS_WIZARD_HISTORY.get()); 229 208 } … … 233 212 super.rememberSettings(); 234 213 overpassWizard.addCurrentItemToHistory(); 235 OVERPASS_SERVER.put(getOverpassServer());236 OVERPASS_SERVER_HISTORY.put(overpassServer.getHistory());237 214 OVERPASS_WIZARD_HISTORY.put(overpassWizard.getHistory()); 238 215 OverpassQueryHistoryPopup.addToHistory(getOverpassQuery()); -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
r9239 r9242 52 52 import org.openstreetmap.josm.gui.preferences.remotecontrol.RemoteControlPreference; 53 53 import org.openstreetmap.josm.gui.preferences.server.AuthenticationPreference; 54 import org.openstreetmap.josm.gui.preferences.server.OverpassServerPreference; 54 55 import org.openstreetmap.josm.gui.preferences.server.ProxyPreference; 55 56 import org.openstreetmap.josm.gui.preferences.server.ServerAccessPreference; … … 561 562 settingsFactories.add(new AuthenticationPreference.Factory()); 562 563 settingsFactories.add(new ProxyPreference.Factory()); 564 settingsFactories.add(new OverpassServerPreference.Factory()); 563 565 settingsFactories.add(new MapPreference.Factory()); 564 566 settingsFactories.add(new ProjectionPreference.Factory()); -
trunk/src/org/openstreetmap/josm/io/MultiFetchOverpassObjectReader.java
r9241 r9242 2 2 package org.openstreetmap.josm.io; 3 3 4 import org.openstreetmap.josm.actions.OverpassDownloadAction;5 4 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 5 import org.openstreetmap.josm.gui.preferences.server.OverpassServerPreference; 6 6 import org.openstreetmap.josm.tools.Utils; 7 7 … … 29 29 @Override 30 30 protected String getBaseUrl() { 31 return Overpass DownloadAction.OVERPASS_SERVER.get();31 return OverpassServerPreference.getOverpassServer(); 32 32 } 33 33 } -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r9241 r9242 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; 37 38 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 38 39 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 85 86 /** 86 87 * Creates a new instance of {@link MultiFetchServerObjectReader} or {@link MultiFetchOverpassObjectReader} 87 * depending on the {@ code download.overpass.for-multi-fetch} preference.88 * depending on the {@link OverpassServerPreference#useForMultiFetch preference}. 88 89 * 89 90 * @return a new instance … … 91 92 */ 92 93 public static MultiFetchServerObjectReader create() { 93 return create( Main.pref.getBoolean("download.overpass.for-multi-fetch", false));94 return create(OverpassServerPreference.useForMultiFetch()); 94 95 } 95 96
Note:
See TracChangeset
for help on using the changeset viewer.