DefaultViewport implements Viewport { @Override public void setZoomFactor(double zoomFactor) { Assert.argument(zoomFactor > 0.0, "zoomFactor > 0.0"); setZoomFactor(zoomFactor, getViewportCenterPoint()); } DefaultViewport();  DefaultViewport(Rectangle viewBounds);  DefaultViewport(boolean modelYAxisDown);  DefaultViewport(Rectangle viewBounds, boolean modelYAxisDown); @Override boolean isModelYAxisDown(); @Override void setModelYAxisDown(boolean modelYAxisDown); @Override Rectangle getViewBounds(); @Override void setViewBounds(Rectangle viewBounds); @Override AffineTransform getViewToModelTransform(); @Override AffineTransform getModelToViewTransform(); @Override double getOrientation(); @Override void setOrientation(double orientation); @Override double getOffsetX(); @Override double getOffsetY(); @Override void setOffset(double offsetX, double offsetY); @Override void moveViewDelta(double deltaX, double deltaY); @Override double getZoomFactor(); @Override void setZoomFactor(double zoomFactor); @Override void zoom(Rectangle2D modelBounds); @Override void setZoomFactor(double zoomFactor, double modelCenterX, double modelCenterY); @Override void addListener(ViewportListener listener); @Override void removeListener(ViewportListener listener); @Override ViewportListener[] getListeners(); @Override void setTransform(Viewport other); @Override String toString(); @SuppressWarnings({"CloneDoesntDeclareCloneNotSupportedException"}) @Override Viewport clone();  }
@Test public void testIllegalZoomFactor() { final DefaultViewport viewport = new DefaultViewport(); try { viewport.setZoomFactor(0.0); fail("IAE expected"); } catch (Exception e) { } try { viewport.setZoomFactor(-4.0); fail("IAE expected"); } catch (Exception e) { } try { viewport.setZoomFactor(0.0, 3.0, 3.0); fail("IAE expected"); } catch (IllegalArgumentException e) { } try { viewport.setZoomFactor(-0.01, 3.0, 3.0); fail("IAE expected"); } catch (IllegalArgumentException e) { } }