Interface IGeometry
-
- All Superinterfaces:
java.lang.Cloneable,java.io.Serializable
- All Known Subinterfaces:
ICurve,IMultiShape,IShape
- All Known Implementing Classes:
Arc,BezierCurve,CubicCurve,CurvedPolygon,Ellipse,Line,Path,Pie,PolyBezier,Polygon,Polyline,QuadraticCurve,Rectangle,Region,Ring,RoundedRectangle
public interface IGeometry extends java.lang.Cloneable, java.io.SerializableA glance at the list of implementing classes reveals that the
IGeometryinterface bundles all the basic common methods for planar geometric objects. These methods enable you to test if aPointbelongs to anIGeometryusing thecontains(Point)method. ThegetBounds()method returns a bounding box of theIGeometrythat you call that method on. Moreover, you can bake a copy of anIGeometryusing itsgetCopy()method. To apply anAffineTransformto anIGeometry, use thegetTransformed(AffineTransform)method. Additionally, everyIGeometrycan be transfered into aPathby using thetoPath()method. And you can check if twoIGeometrys are touching each other, i.e. they have at least onePointin common, via thetouches(IGeometry)method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontains(Point p)RectanglegetBounds()IGeometrygetCopy()Returns a new identical copy of thisIGeometry.IGeometrygetTransformed(AffineTransform t)Returns a newIGeometry, which represents the givenIGeometryafter the application of the givenAffineTransform.PathtoPath()booleantouches(IGeometry g)
-
-
-
Method Detail
-
contains
boolean contains(Point p)
-
getCopy
IGeometry getCopy()
Returns a new identical copy of thisIGeometry.- Returns:
- a copy identical to this
IGeometry
-
getTransformed
IGeometry getTransformed(AffineTransform t)
Returns a newIGeometry, which represents the givenIGeometryafter the application of the givenAffineTransform. In case theAffineTransformmay be performed type intrinsic (e.g. scaling on aRectangle), an object of the same type is returned.- Parameters:
t- TheAffineTransformto be applied- Returns:
- A new
IGeometryobject representing thisIGeometryafter the application of the givenAffineTransform.
-
-