Ignore:
Timestamp:
2011-06-07T19:05:14+02:00 (13 years ago)
Author:
bastiK
Message:

memory optimizations for Node & WayPoint (Patch by Gubaer, modified)

The field 'proj' in CachedLatLon is a waste of memory. For the 2 classes where this has the greatest impact, the cache for the projected coordinates is replaced by 2 simple double fields (east & north). On projection change, they have to be invalidated explicitly. This is handled by the DataSet & the GpxLayer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r4087 r4126  
    6262import org.openstreetmap.josm.data.osm.visitor.paint.MapRendererFactory;
    6363import org.openstreetmap.josm.data.osm.visitor.paint.Rendering;
     64import org.openstreetmap.josm.data.projection.Projection;
    6465import org.openstreetmap.josm.data.validation.TestError;
    6566import org.openstreetmap.josm.gui.HelpAwareOptionPane;
     
    8081 */
    8182public class OsmDataLayer extends Layer implements Listener, SelectionChangedListener {
     83    // static private final Logger logger = Logger.getLogger(OsmDataLayer.class.getName());
     84
    8285    static public final String REQUIRES_SAVE_TO_DISK_PROP = OsmDataLayer.class.getName() + ".requiresSaveToDisk";
    8386    static public final String REQUIRES_UPLOAD_TO_SERVER_PROP = OsmDataLayer.class.getName() + ".requiresUploadToServer";
     
    658661            }
    659662        }
    660 
    661663    }
    662664
     
    675677        isChanged = true;
    676678    }
     679
     680    @Override
     681    public void projectionChanged(Projection oldValue, Projection newValue) {
     682        /*
     683         * No reprojection required. The dataset itself is registered as projection
     684         * change listener and already got notified.
     685         */
     686    }
    677687}
Note: See TracChangeset for help on using the changeset viewer.