/** * {@inheritDoc} */ public void setWorldByNumPixels(Rectangle2D bounds, int numX, int numY) { if (bounds == null || bounds.isEmpty()) { throw new IllegalArgumentException("bounds cannot be null or empty"); } if (numX <= 0 || numY <= 0) { throw new IllegalArgumentException("numX and numY must be greater than 0"); } doSetWorld(bounds, bounds.getWidth() / numX, bounds.getHeight() / numY); }
/** * {@inheritDoc} */ public void setWorldByResolution(Rectangle2D bounds, double xres, double yres) { if (bounds == null || bounds.isEmpty()) { throw new IllegalArgumentException("bounds cannot be null or empty"); } if (xres < EPS || yres < EPS) { throw new IllegalArgumentException("xres and yres but must be greater than 0"); } doSetWorld(bounds, xres, yres); }
/** * {@inheritDoc} */ public void setWorldByResolution(Rectangle2D bounds, double xres, double yres) { if (bounds == null || bounds.isEmpty()) { throw new IllegalArgumentException("bounds cannot be null or empty"); } if (xres < EPS || yres < EPS) { throw new IllegalArgumentException("xres and yres but must be greater than 0"); } doSetWorld(bounds, xres, yres); }
/** * {@inheritDoc} */ public void setWorldByNumPixels(Rectangle2D bounds, int numX, int numY) { if (bounds == null || bounds.isEmpty()) { throw new IllegalArgumentException("bounds cannot be null or empty"); } if (numX <= 0 || numY <= 0) { throw new IllegalArgumentException("numX and numY must be greater than 0"); } doSetWorld(bounds, bounds.getWidth() / numX, bounds.getHeight() / numY); }