Changeset 10371 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-06-14T18:47:33+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r10340 r10371 75 75 import org.openstreetmap.josm.data.osm.OsmPrimitive; 76 76 import org.openstreetmap.josm.data.osm.PrimitiveDeepCopy; 77 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;78 77 import org.openstreetmap.josm.data.projection.Projection; 79 78 import org.openstreetmap.josm.data.projection.ProjectionChangeListener; … … 769 768 */ 770 769 public final void addLayer(final Layer layer) { 771 BoundingXYVisitor v = new BoundingXYVisitor(); 772 layer.visitBoundingBox(v); 773 addLayer(layer, v.getBounds()); 770 addLayer(layer, layer.getViewProjectionBounds()); 774 771 } 775 772 -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r10318 r10371 259 259 final OsmDataLayer layer = createNewLayer(newLayerName); 260 260 if (Main.main != null) 261 Main.main.addLayer(layer , computeBbox(bounds));261 Main.main.addLayer(layer); 262 262 return layer; 263 263 } -
trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
r10364 r10371 23 23 import org.openstreetmap.josm.actions.SaveActionBase; 24 24 import org.openstreetmap.josm.actions.SaveAsAction; 25 import org.openstreetmap.josm.data.ProjectionBounds; 25 26 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 26 27 import org.openstreetmap.josm.data.projection.Projection; … … 593 594 } 594 595 } 596 597 /** 598 * Gets the {@link ProjectionBounds} for this layer to be visible to the user. This can be the exact bounds, the UI handles padding. Return 599 * <code>null</code> if you cannot provide this information. The default implementation uses the bounds from 600 * {@link #visitBoundingBox(BoundingXYVisitor)}. 601 * @return The bounds for this layer. 602 * @since 10371 603 */ 604 public ProjectionBounds getViewProjectionBounds() { 605 BoundingXYVisitor v = new BoundingXYVisitor(); 606 visitBoundingBox(v); 607 return v.getBounds(); 608 } 595 609 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r10344 r10371 49 49 import org.openstreetmap.josm.data.Bounds; 50 50 import org.openstreetmap.josm.data.DataSource; 51 import org.openstreetmap.josm.data.ProjectionBounds; 51 52 import org.openstreetmap.josm.data.SelectionChangedListener; 52 53 import org.openstreetmap.josm.data.conflict.Conflict; … … 1079 1080 return dialog; 1080 1081 } 1082 1083 @Override 1084 public ProjectionBounds getViewProjectionBounds() { 1085 BoundingXYVisitor v = new BoundingXYVisitor(); 1086 v.visit(data.getDataSourceBoundingBox()); 1087 if (!v.hasExtend()) { 1088 v.computeBoundingBox(data.getNodes()); 1089 } 1090 return v.getBounds(); 1091 } 1081 1092 } -
trunk/src/org/openstreetmap/josm/io/OsmImporter.java
r9547 r10371 15 15 import org.openstreetmap.josm.actions.ExtensionFileFilter; 16 16 import org.openstreetmap.josm.data.osm.DataSet; 17 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;18 17 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 19 18 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 97 96 public void run() { 98 97 OsmDataLayer layer = data.getLayer(); 99 BoundingXYVisitor v = new BoundingXYVisitor(); 100 v.visit(layer.data.getDataSourceBoundingBox()); 101 if (!v.hasExtend()) { 102 v.computeBoundingBox(layer.data.getNodes()); 103 } 104 Main.main.addLayer(layer, v.getBounds()); 98 Main.main.addLayer(layer); 105 99 data.getPostLayerTask().run(); 106 100 data.getLayer().onPostLoadFromFile();
Note:
See TracChangeset
for help on using the changeset viewer.