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

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

Location:
trunk/src/org/openstreetmap/josm/io
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/GeoJSONWriter.java

    r12809 r12816  
    3030import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor;
    3131import org.openstreetmap.josm.data.projection.Projection;
     32import org.openstreetmap.josm.data.projection.Projections;
    3233import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3334import org.openstreetmap.josm.gui.mappaint.ElemStyles;
    34 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
    3535import org.openstreetmap.josm.tools.Logging;
    3636import org.openstreetmap.josm.tools.Pair;
     
    6565    public GeoJSONWriter(DataSet ds) {
    6666        this.data = ds;
    67         this.projection = ProjectionPreference.wgs84.getProjection();
     67        this.projection = Projections.getProjectionByCode("EPSG:4326"); // WGS 84
    6868    }
    6969
  • trunk/src/org/openstreetmap/josm/io/MultiFetchOverpassObjectReader.java

    r10689 r12816  
    66
    77import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    8 import org.openstreetmap.josm.gui.preferences.server.OverpassServerPreference;
    98import org.openstreetmap.josm.tools.Utils;
    109
     
    2524    @Override
    2625    protected String getBaseUrl() {
    27         return OverpassServerPreference.getOverpassServer();
     26        return OverpassDownloadReader.OVERPASS_SERVER.get();
    2827    }
    2928
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r12620 r12816  
    3535import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
    3636import org.openstreetmap.josm.data.osm.Way;
    37 import org.openstreetmap.josm.gui.preferences.server.OverpassServerPreference;
    3837import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    3938import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     
    8786    /**
    8887     * Creates a new instance of {@link MultiFetchServerObjectReader} or {@link MultiFetchOverpassObjectReader}
    89      * depending on the {@link OverpassServerPreference#useForMultiFetch preference}.
     88     * depending on the {@link OverpassDownloadReader#FOR_MULTI_FETCH preference}.
    9089     *
    9190     * @return a new instance
     
    9392     */
    9493    public static MultiFetchServerObjectReader create() {
    95         return create(OverpassServerPreference.useForMultiFetch());
     94        return create(OverpassDownloadReader.FOR_MULTI_FETCH.get());
    9695    }
    9796
  • trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java

    r12714 r12816  
    1111import java.time.Period;
    1212import java.time.ZoneOffset;
     13import java.util.Arrays;
    1314import java.util.EnumMap;
    1415import java.util.Locale;
     
    3132import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    3233import org.openstreetmap.josm.data.osm.PrimitiveId;
     34import org.openstreetmap.josm.data.preferences.BooleanProperty;
     35import org.openstreetmap.josm.data.preferences.CollectionProperty;
     36import org.openstreetmap.josm.data.preferences.StringProperty;
    3337import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    3438import org.openstreetmap.josm.io.NameFinder.SearchResult;
     
    4448 */
    4549public 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);
    4668
    4769    private static final String DATA_PREFIX = "?data=";
Note: See TracChangeset for help on using the changeset viewer.