Ignore:
Timestamp:
2017-09-10T13:58:18+02:00 (3 years ago)
Author:
Don-vip
Message:

see #15229 - see #15182 - remove GUI references from I/O subsystem

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/OverpassDownloadSource.java

    r12733 r12816  
    3535import org.openstreetmap.josm.gui.MainApplication;
    3636import org.openstreetmap.josm.gui.download.DownloadSourceSizingPolicy.AdjustableDownloadSizePolicy;
    37 import org.openstreetmap.josm.gui.preferences.server.OverpassServerPreference;
    3837import org.openstreetmap.josm.gui.util.GuiHelper;
    3938import org.openstreetmap.josm.gui.widgets.JosmTextArea;
     
    6362        task.setZoomAfterDownload(settings.zoomToData());
    6463        Future<?> future = task.download(
    65                 new OverpassDownloadReader(area, OverpassServerPreference.getOverpassServer(), data.getQuery()),
     64                new OverpassDownloadReader(area, OverpassDownloadReader.OVERPASS_SERVER.get(), data.getQuery()),
    6665                settings.asNewLayer(), area, null);
    6766        MainApplication.worker.submit(new PostDownloadHandler(task, future, data.getErrorReporter()));
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OverpassServerPreference.java

    r10306 r12816  
    55
    66import java.awt.GridBagLayout;
    7 import java.util.Arrays;
    87
    98import javax.swing.BorderFactory;
     
    1312import javax.swing.JPanel;
    1413
    15 import org.openstreetmap.josm.data.preferences.BooleanProperty;
    16 import org.openstreetmap.josm.data.preferences.CollectionProperty;
    17 import org.openstreetmap.josm.data.preferences.StringProperty;
    1814import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
    1915import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
     
    2218import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
    2319import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
     20import org.openstreetmap.josm.io.OverpassDownloadReader;
    2421import org.openstreetmap.josm.tools.GBC;
    2522
     
    3027 */
    3128public 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);
    3829
    3930    private final HistoryComboBox overpassServer = new HistoryComboBox();
     
    6253        panel.add(new JLabel(tr("Overpass server: ")), GBC.std().insets(5, 5, 5, 5));
    6354        panel.add(overpassServer, GBC.eop().fill(GBC.HORIZONTAL));
    64         overpassServer.setPossibleItems(OVERPASS_SERVER_HISTORY.get());
    65         overpassServer.setText(OVERPASS_SERVER.get());
     55        overpassServer.setPossibleItems(OverpassDownloadReader.OVERPASS_SERVER_HISTORY.get());
     56        overpassServer.setText(OverpassDownloadReader.OVERPASS_SERVER.get());
    6657
    6758        panel.add(forMultiFetch, GBC.eop());
    68         forMultiFetch.setSelected(useForMultiFetch());
     59        forMultiFetch.setSelected(OverpassDownloadReader.FOR_MULTI_FETCH.get());
    6960
    7061        panel.add(Box.createVerticalGlue(), GBC.eol().fill());
     
    7566    @Override
    7667    public boolean ok() {
    77         OVERPASS_SERVER.put(overpassServer.getText());
    78         OVERPASS_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());
    8071        return false;
    8172    }
     
    8980     * Returns the URL of the currently selected Overpass server.
    9081     * @return the URL of the currently selected Overpass server.
     82     * @deprecated To be removed end of 2017. Use {@code OverpassDownloadReader.OVERPASS_SERVER.get()} instead
    9183     */
     84    @Deprecated
    9285    public static String getOverpassServer() {
    93         return OVERPASS_SERVER.get();
     86        return OverpassDownloadReader.OVERPASS_SERVER.get();
    9487    }
    9588
     
    9790     * Returns true if objects should be fetched from an Overpass server instead of the OSM API.
    9891     * @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
    9993     */
     94    @Deprecated
    10095    public static boolean useForMultiFetch() {
    101         return FOR_MULTI_FETCH.get();
     96        return OverpassDownloadReader.FOR_MULTI_FETCH.get();
    10297    }
    10398}
Note: See TracChangeset for help on using the changeset viewer.