Ignore:
Timestamp:
2017-02-26T00:59:32+01:00 (3 years ago)
Author:
Don-vip
Message:

fix #3346 - improve drastically the performance of fixing duplicate nodes by:

  • caching data sources area computation
  • moving layer invalidation from UndoRedoHandler.addNoRedraw to UndoRedoHandler.add
  • avoiding any EDT call when building tag conflict dialog if it's not meant to be displayed
Location:
trunk/src/org/openstreetmap/josm/io
Files:
3 edited

Legend:

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

    r11435 r11627  
    198198            }
    199199            DataSource src = new DataSource(bounds, origin);
    200             ds.dataSources.add(src);
     200            ds.addDataSource(src);
    201201        } else {
    202202            throwException(tr("Missing mandatory attributes on element ''bounds''. " +
  • trunk/src/org/openstreetmap/josm/io/OsmWriter.java

    r10619 r11627  
    174174
    175175    public void writeDataSources(DataSet ds) {
    176         for (DataSource s : ds.dataSources) {
     176        for (DataSource s : ds.getDataSources()) {
    177177            out.println("  <bounds minlat='"
    178178                    + s.bounds.getMin().latToString(CoordinateFormat.DECIMAL_DEGREES)
  • trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java

    r11560 r11627  
    169169
    170170        // add bounds if necessary (note that Overpass API does not return bounds in the response XML)
    171         if (ds != null && ds.dataSources.isEmpty() && overpassQuery.contains("{{bbox}}")) {
     171        if (ds != null && ds.getDataSources().isEmpty() && overpassQuery.contains("{{bbox}}")) {
    172172            if (crosses180th) {
    173173                Bounds bounds = new Bounds(lat1, lon1, lat2, 180.0);
    174174                DataSource src = new DataSource(bounds, getBaseUrl());
    175                 ds.dataSources.add(src);
     175                ds.addDataSource(src);
    176176
    177177                bounds = new Bounds(lat1, -180.0, lat2, lon2);
    178178                src = new DataSource(bounds, getBaseUrl());
    179                 ds.dataSources.add(src);
     179                ds.addDataSource(src);
    180180            } else {
    181181                Bounds bounds = new Bounds(lat1, lon1, lat2, lon2);
    182182                DataSource src = new DataSource(bounds, getBaseUrl());
    183                 ds.dataSources.add(src);
     183                ds.addDataSource(src);
    184184            }
    185185        }
Note: See TracChangeset for help on using the changeset viewer.