Changeset 7817 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2014-12-17T13:46:53+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r7816 r7817 529 529 @Override public void paint(Graphics g) { 530 530 if (initialViewport != null) { 531 if (initialViewport.getBounds() != null) { 532 BoundingXYVisitor box = new BoundingXYVisitor(); 533 box.visit(initialViewport.getBounds()); 534 recalculateCenterScale(box); 535 } else { 536 zoomTo(initialViewport.getCenter(), initialViewport.getScale(), true); 537 } 531 zoomTo(initialViewport); 538 532 initialViewport = null; 539 533 } … … 693 687 /** 694 688 * Set the new dimension to the view. 695 */ 689 * 690 * @deprecated use #zoomTo(BoundingXYVisitor) 691 */ 692 @Deprecated 696 693 public void recalculateCenterScale(BoundingXYVisitor box) { 697 if (box == null) { 698 box = new BoundingXYVisitor(); 699 } 700 if (box.getBounds() == null) { 701 box.visit(getProjection().getWorldBoundsLatLon()); 702 } 703 if (!box.hasExtend()) { 704 box.enlargeBoundingBox(); 705 } 706 707 zoomTo(box.getBounds()); 694 zoomTo(box); 708 695 } 709 696 -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r7816 r7817 43 43 import org.openstreetmap.josm.data.osm.Way; 44 44 import org.openstreetmap.josm.data.osm.WaySegment; 45 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 45 46 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 46 47 import org.openstreetmap.josm.data.preferences.IntegerProperty; … … 580 581 zoomTo(new ProjectionBounds(getProjection().latlon2eastNorth(box.getMin()), 581 582 getProjection().latlon2eastNorth(box.getMax()))); 583 } 584 585 public void zoomTo(ViewportData viewport) { 586 if (viewport == null) return; 587 if (viewport.getBounds() != null) { 588 BoundingXYVisitor box = new BoundingXYVisitor(); 589 box.visit(viewport.getBounds()); 590 zoomTo(box); 591 } else { 592 zoomTo(viewport.getCenter(), viewport.getScale(), true); 593 } 594 } 595 596 /** 597 * Set the new dimension to the view. 598 */ 599 public void zoomTo(BoundingXYVisitor box) { 600 if (box == null) { 601 box = new BoundingXYVisitor(); 602 } 603 if (box.getBounds() == null) { 604 box.visit(getProjection().getWorldBoundsLatLon()); 605 } 606 if (!box.hasExtend()) { 607 box.enlargeBoundingBox(); 608 } 609 610 zoomTo(box.getBounds()); 582 611 } 583 612 -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r7781 r7817 451 451 return; 452 452 box.enlargeBoundingBox(); 453 Main.map.mapView. recalculateCenterScale(box);453 Main.map.mapView.zoomTo(box); 454 454 } 455 455 -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r7578 r7817 746 746 BoundingXYVisitor bbox = new BoundingXYVisitor(); 747 747 yLayer.visitBoundingBox(bbox); 748 Main.map.mapView. recalculateCenterScale(bbox);748 Main.map.mapView.zoomTo(bbox); 749 749 } 750 750
Note:
See TracChangeset
for help on using the changeset viewer.