Interface IGeometry
- All Superinterfaces:
Cloneable,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
A glance at the list of implementing classes reveals that the
IGeometry interface bundles all the basic common methods for planar
geometric objects. These methods enable you to test if a Point
belongs to an IGeometry using the contains(Point) method.
The getBounds() method returns a bounding box of the
IGeometry that you call that method on. Moreover, you can bake a copy
of an IGeometry using its getCopy() method. To apply an
AffineTransform to an IGeometry, use the
getTransformed(AffineTransform) method. Additionally, every
IGeometry can be transfered into a Path by using the
toPath() method. And you can check if two IGeometrys are
touching each other, i.e. they have at least one Point in common, via
the touches(IGeometry) method.
-
Method Details
-
contains
-
getBounds
Rectangle getBounds() -
getCopy
IGeometry getCopy()Returns a new identical copy of thisIGeometry.- Returns:
- a copy identical to this
IGeometry
-
getTransformed
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.
-
toPath
Path toPath() -
touches
-