RectRegion { public XYCoords transform(Number x, Number y, RectRegion region2, boolean flipX, boolean flipY) { Number xx = xRegion.transform(x.doubleValue(), region2.xRegion, flipX); Number yy = yRegion.transform(y.doubleValue(), region2.yRegion, flipY); return new XYCoords(xx, yy); } RectRegion();  RectRegion(XYCoords min, XYCoords max);  RectRegion(Number minX, Number maxX, Number minY, Number maxY, String label);  RectRegion(RectF rect); @SuppressWarnings("SameParameterValue")  RectRegion(Number minX, Number maxX, Number minY, Number maxY); static RectRegion withDefaults(RectRegion defaults); XYCoords transform(Number x, Number y, RectRegion region2, boolean flipX, boolean flipY); XYCoords transform(Number x, Number y, RectRegion region2); XYCoords transform(XYCoords value, RectRegion region2); RectRegion transform(RectRegion r, RectRegion r2, boolean flipX, boolean flipY); PointF transformScreen(Number x, Number y, RectF region2); void transformScreen(PointF result, Number x, Number y, RectF region2); void transform(PointF result, Number x, Number y, RectF region2, boolean flipX, boolean flipY); PointF transform(Number x, Number y, RectF region2, boolean flipX, boolean flipY); PointF transformScreen(XYCoords value, RectF region2); PointF transform(XYCoords value, RectF region2, boolean flipX, boolean flipY); void union(Number x, Number y); void union(RectRegion input); boolean intersects(RectRegion region); boolean intersects(Number minX, Number maxX, Number minY, Number maxY); RectF asRectF(); void intersect(RectRegion clippingBounds); List<RectRegion> intersects(List<RectRegion> regions); Number getWidth(); Number getHeight(); void set(Number minX, Number maxX, Number minY, Number maxY); boolean isMinXSet(); Number getMinX(); void setMinX(Number minX); boolean isMaxXSet(); Number getMaxX(); void setMaxX(Number maxX); boolean isMinYSet(); Number getMinY(); void setMinY(Number minY); boolean isMaxYSet(); Number getMaxY(); void setMaxY(Number maxY); String getLabel(); void setLabel(String label); Region getxRegion(); void setxRegion(Region xRegion); Region getyRegion(); void setyRegion(Region yRegion); boolean isFullyDefined(); boolean contains(Number x, Number y); @Override String toString();  }
@Test public void testTransform() throws Exception { RectRegion r1 = new RectRegion(1, 2, 0, 10); RectRegion r2 = new RectRegion(2, 4, 10, 20); final XYCoords trans1 = r1.transform(new XYCoords(1.5, 5), r2); assertEquals(3.0, trans1.x); assertEquals(15.0, trans1.y); RectF screen = new RectF(0, 0, 100, 100); PointF result = r1.transform(2, 10, screen, false, true); assertEquals(100f, result.x); assertEquals(0f, result.y); RectRegion screenRegion = new RectRegion(screen); XYCoords result2 = screenRegion.transform(result.x, result.y, r1, false, true); assertEquals(2d, result2.x); assertEquals(10d, result2.y); }