ROIGeometry extends ROI { @Override public boolean contains(Point p) { return contains(p.getX(), p.getY()); } ROIGeometry(Geometry geom);  ROIGeometry(Rectangle rect);  ROIGeometry(Geometry geom, final boolean useFixedPrecision);  ROIGeometry(Geometry geom, final boolean antiAliasing, final boolean useFixedPrecision);  ROIGeometry(Geometry geom, final RenderingHints hints);  ROIGeometry(Geometry geom, final boolean antiAliasing, 
            final boolean useFixedPrecision, final RenderingHints hints); @Override ROI add(ROI roi); @Override boolean contains(Point p); @Override boolean contains(Point2D p); @Override boolean contains(int x, int y); @Override boolean contains(double x, double y); @Override boolean contains(Rectangle rect); @Override boolean contains(Rectangle2D rect); @Override boolean contains(int x, int y, int w, int h); @Override boolean contains(double x, double y, double w, double h); @Override ROI exclusiveOr(ROI roi); @Override int[][] getAsBitmask(int x, int y, int width, int height, int[][] mask); @Override PlanarImage getAsImage(); @Override LinkedList getAsRectangleList(int x, int y, int width, int height); @Override Shape getAsShape(); Geometry getAsGeometry(); @Override Rectangle getBounds(); @Override Rectangle2D getBounds2D(); @Override int getThreshold(); @Override ROI intersect(ROI roi); @Override boolean intersects(Rectangle rect); @Override boolean intersects(Rectangle2D rect); @Override boolean intersects(int x, int y, int w, int h); @Override boolean intersects(double x, double y, double w, double h); @Override ROI performImageOp(RenderedImageFactory RIF, ParameterBlock paramBlock, int sourceIndex, RenderingHints renderHints); @Override ROI performImageOp(String name, ParameterBlock paramBlock, int sourceIndex, RenderingHints renderHints); @Override void setThreshold(int threshold); @Override ROI subtract(ROI roi); @Override ROI transform(AffineTransform at, Interpolation interp); @Override ROI transform(AffineTransform at); @Override String toString(); static final boolean DEFAULT_ROIGEOMETRY_ANTIALISING; static final boolean DEFAULT_ROIGEOMETRY_USEFIXEDPRECISION; }
@Test public void testContains_Point() { ROIGeometry roi = createRectROI(-1.1, -2.2, 3.3, 4.4); java.awt.Point p0 = new java.awt.Point(-1, 2); java.awt.Point p1 = new java.awt.Point(-2, 1); assertTrue(roi.contains(p0)); assertFalse(roi.contains(p1)); }
@Test public void testContains_Point2D() { ROIGeometry roi = createRectROI(-1.1, -2.2, 3.3, 4.4); Point2D p0 = new Point2D.Double(-1.0, 2.5); Point2D p1 = new Point2D.Double(-2.5, 1.0); assertTrue(roi.contains(p0)); assertFalse(roi.contains(p1)); }
@Test public void testContains_int_int() { ROIGeometry roi = createRectROI(-1.1, -2.2, 3.3, 4.4); assertTrue(roi.contains(-1, 2)); assertFalse(roi.contains(-2, 1)); }
@Test public void testContains_double_double() { ROIGeometry roi = createRectROI(-1.1, -2.2, 3.3, 4.4); assertTrue(roi.contains(-1.0, 2.5)); assertFalse(roi.contains(-2.5, 1.0)); }
@Test public void testContains_Rectangle() { ROIGeometry roi = createRectROI(-1.1, -2.2, 3.3, 4.4); Rectangle r = new Rectangle(-1, -2, 4, 6); assertTrue(roi.contains(r)); r.width += 1; assertFalse(roi.contains(r)); }
@Test public void testContains_Rectangle2D() { ROIGeometry roi = createRectROI(-1.1, -2.2, 3.3, 4.4); Rectangle2D r = new Rectangle2D.Double(-1.0, -2.0, 4.0, 6.0); assertTrue(roi.contains(r)); r = new Rectangle2D.Double(-1.2, -2.0, 4.0, 6.0); assertFalse(roi.contains(r)); }
@Test public void testContains_intRectArgs() { ROIGeometry roi = createRectROI(-1.1, -2.2, 3.3, 4.4); assertTrue(roi.contains(-1, -2, 4, 6)); assertFalse(roi.contains(-1, -2, 5, 6)); }
@Test public void testContains_doubleRectArgs() { ROIGeometry roi = createRectROI(-1.1, -2.2, 3.3, 4.4); assertTrue(roi.contains(-1.0, -2.0, 4.0, 6.0)); assertFalse(roi.contains(-1.0, -2.0, 5.0, 6.0)); }
@Test public void emptyROIContainsPoint() { ROIGeometry roi = createEmptyROI(); assertFalse(roi.contains(0, 0)); }
@Test public void emptyROIContainsRect() { ROIGeometry empty = createEmptyROI(); assertFalse(empty.contains(0, 0, 1, 1)); }