/** * Tests if the interior of the <code>Shape</code> intersects the interior of a specified <code> * Rectangle2D</code>. This method might conservatively return <code>true</code>. */ public boolean intersects(final Rectangle2D r) { try { return shape.intersects(XAffineTransform.inverseTransform(this, r, rectangle)); } catch (NoninvertibleTransformException exception) { exceptionOccured(exception, "intersects"); return false; } }
/** * Tests if the interior of the <code>Shape</code> entirely contains the specified <code> * Rectangle2D</code>. This method might conservatively return <code>false</code>. */ public boolean contains(final Rectangle2D r) { try { return shape.contains(XAffineTransform.inverseTransform(this, r, rectangle)); } catch (NoninvertibleTransformException exception) { exceptionOccured(exception, "contains"); return false; } }
/** * Tests if the interior of the <code>Shape</code> entirely contains the * specified <code>Rectangle2D</code>. This method might conservatively * return <code>false</code>. */ public boolean contains(final Rectangle2D r) { try { return shape.contains(XAffineTransform.inverseTransform(this, r, rectangle)); } catch (NoninvertibleTransformException exception) { exceptionOccured(exception, "contains"); return false; } }
/** * Tests if the interior of the <code>Shape</code> intersects the interior * of a specified <code>Rectangle2D</code>. This method might * conservatively return <code>true</code>. */ public boolean intersects(final Rectangle2D r) { try { return shape.intersects(XAffineTransform.inverseTransform(this, r, rectangle)); } catch (NoninvertibleTransformException exception) { exceptionOccured(exception, "intersects"); return false; } }
/** * Tests if the interior of the <code>Shape</code> entirely contains the * specified <code>Rectangle2D</code>. This method might conservatively * return <code>false</code>. */ public boolean contains(final Rectangle2D r) { try { return shape.contains(XAffineTransform.inverseTransform(this, r, rectangle)); } catch (NoninvertibleTransformException exception) { exceptionOccured(exception, "contains"); return false; } }
/** * Tests if the interior of the <code>Shape</code> intersects the interior * of a specified <code>Rectangle2D</code>. This method might * conservatively return <code>true</code>. */ public boolean intersects(final Rectangle2D r) { try { return shape.intersects(XAffineTransform.inverseTransform(this, r, rectangle)); } catch (NoninvertibleTransformException exception) { exceptionOccured(exception, "intersects"); return false; } }
/** * Modifies the position in pixels of the visible part of {@code ZoomPane}. {@code viewSize} * is the size {@code ZoomPane} would be (in pixels) if its visible surface covered the whole * of the {@link #getArea} region with the current zoom (Note: {@code viewSize} can be obtained * by {@link #getPreferredSize} if {@link #setPreferredSize} hasn't been called with a non-null * value). Therefore, by definition, the region {@link #getArea} converted into pixel space * would give the rectangle * <code>bounds=Rectangle(0, 0, ,viewSize.width, ,viewSize.height)</code>. * <p> * This {@code scrollRectToVisible} method allows us to define the sub-region of {@code bounds} * which must appear in the {@code ZoomPane} window. */ public void scrollRectToVisible(final Rectangle rect) { Rectangle2D area = getArea(); if (isValid(area)) { area = XAffineTransform.transform(zoom, area, null); area.setRect(area.getX() + rect.getX(), area.getY() + rect.getY(), rect.getWidth(), rect.getHeight()); try { setVisibleArea(XAffineTransform.inverseTransform(zoom, area, area)); } catch (NoninvertibleTransformException exception) { unexpectedException("scrollRectToVisible", exception); } } }
dest = XAffineTransform.inverseTransform(zoom, dest, null); } catch (NoninvertibleTransformException exception) { unexpectedException("setVisibleArea", exception);
/** * Implementation of {@link #getVisibleArea()}. */ private Rectangle2D getVisibleArea(final Rectangle zoomableBounds) { if (zoomableBounds.isEmpty()) { return (Rectangle2D) visibleArea.clone(); } Rectangle2D visible; try { visible = XAffineTransform.inverseTransform(zoom, zoomableBounds, null); } catch (NoninvertibleTransformException exception) { unexpectedException("getVisibleArea", exception); visible = new Rectangle2D.Double(zoomableBounds.getCenterX(), zoomableBounds.getCenterY(), 0, 0); } visibleArea.setRect(visible); return visible; }
bounds = getBounds(bounds); try { area = XAffineTransform.inverseTransform(zoom, area, area); try { isAdjusting = true;