@Test public void zoomTest() { MapViewPosition mapViewPosition = new MapViewPosition(new DisplayModel()); Assert.assertEquals(0, mapViewPosition.getZoomLevel()); mapViewPosition.zoom((byte) 1); Assert.assertEquals(1, mapViewPosition.getZoomLevel()); mapViewPosition.zoom((byte) -1); Assert.assertEquals(0, mapViewPosition.getZoomLevel()); mapViewPosition.zoom((byte) 5); Assert.assertEquals(5, mapViewPosition.getZoomLevel()); mapViewPosition.zoom((byte) -2); Assert.assertEquals(3, mapViewPosition.getZoomLevel()); mapViewPosition.zoom(Byte.MAX_VALUE); Assert.assertEquals(Byte.MAX_VALUE, mapViewPosition.getZoomLevel()); mapViewPosition.zoom(Byte.MIN_VALUE); Assert.assertEquals(0, mapViewPosition.getZoomLevel()); }
public void zoom(byte zoomLevelDiff) { synchronized (this) { setZoomLevelInternal(this.zoomLevel + zoomLevelDiff); } notifyObservers(); }
MapViewPosition extends Observable implements Persistable { public void zoom(byte zoomLevelDiff) { synchronized (this) { setZoomLevelInternal(this.zoomLevel + zoomLevelDiff); } notifyObservers(); } }
MapViewPosition extends Observable implements Persistable { public void zoom(byte zoomLevelDiff) { synchronized (this) { setZoomLevelInternal(this.zoomLevel + zoomLevelDiff); } notifyObservers(); } MapViewPosition(DisplayModel displayModel); }
MapViewPosition extends Observable implements Persistable { public void zoom(byte zoomLevelDiff) { synchronized (this) { setZoomLevelInternal(this.zoomLevel + zoomLevelDiff); } notifyObservers(); } MapViewPosition(DisplayModel displayModel); void animateTo(final LatLong pos); boolean animationInProgress(); void destroy(); synchronized LatLong getCenter(); synchronized BoundingBox getMapLimit(); synchronized MapPosition getMapPosition(); synchronized LatLong getPivot(); synchronized Point getPivotXY(byte zoomLevel); synchronized double getScaleFactor(); synchronized byte getZoomLevel(); synchronized byte getZoomLevelMax(); synchronized byte getZoomLevelMin(); @Override synchronized void init(PreferencesFacade preferencesFacade); void moveCenter(double moveHorizontal, double moveVertical); void moveCenterAndZoom(double moveHorizontal, double moveVertical, byte zoomLevelDiff); @Override synchronized void save(PreferencesFacade preferencesFacade); void setCenter(LatLong latLong); void setMapLimit(BoundingBox mapLimit); void setMapPosition(MapPosition mapPosition); void setPivot(LatLong pivot); void setScaleFactor(double scaleFactor); void setScaleFactorAdjustment(double adjustment); void setZoomLevel(byte zoomLevel); void setZoomLevelMax(byte zoomLevelMax); void setZoomLevelMin(byte zoomLevelMin); void zoom(byte zoomLevelDiff); void zoomIn(); void zoomOut(); }
MapViewPosition extends Observable implements Persistable { public void zoom(byte zoomLevelDiff) { synchronized (this) { setZoomLevelInternal(this.zoomLevel + zoomLevelDiff); } notifyObservers(); } MapViewPosition(DisplayModel displayModel); void animateTo(final LatLong pos); boolean animationInProgress(); void destroy(); synchronized LatLong getCenter(); synchronized BoundingBox getMapLimit(); synchronized MapPosition getMapPosition(); synchronized LatLong getPivot(); synchronized Point getPivotXY(byte zoomLevel); synchronized double getScaleFactor(); synchronized byte getZoomLevel(); synchronized byte getZoomLevelMax(); synchronized byte getZoomLevelMin(); @Override synchronized void init(PreferencesFacade preferencesFacade); void moveCenter(double moveHorizontal, double moveVertical); void moveCenterAndZoom(double moveHorizontal, double moveVertical, byte zoomLevelDiff); @Override synchronized void save(PreferencesFacade preferencesFacade); void setCenter(LatLong latLong); void setMapLimit(BoundingBox mapLimit); void setMapPosition(MapPosition mapPosition); void setPivot(LatLong pivot); void setScaleFactor(double scaleFactor); void setScaleFactorAdjustment(double adjustment); void setZoomLevel(byte zoomLevel); void setZoomLevelMax(byte zoomLevelMax); void setZoomLevelMin(byte zoomLevelMin); void zoom(byte zoomLevelDiff); void zoomIn(); void zoomOut();  }