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.Serializable
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 aPoint
belongs to anIGeometry
using thecontains(Point)
method. ThegetBounds()
method returns a bounding box of theIGeometry
that you call that method on. Moreover, you can bake a copy of anIGeometry
using itsgetCopy()
method. To apply anAffineTransform
to anIGeometry
, use thegetTransformed(AffineTransform)
method. Additionally, everyIGeometry
can be transfered into aPath
by using thetoPath()
method. And you can check if twoIGeometry
s are touching each other, i.e. they have at least onePoint
in common, via thetouches(IGeometry)
method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(Point p)
Rectangle
getBounds()
IGeometry
getCopy()
Returns a new identical copy of thisIGeometry
.IGeometry
getTransformed(AffineTransform t)
Returns a newIGeometry
, which represents the givenIGeometry
after the application of the givenAffineTransform
.Path
toPath()
boolean
touches(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 givenIGeometry
after the application of the givenAffineTransform
. In case theAffineTransform
may be performed type intrinsic (e.g. scaling on aRectangle
), an object of the same type is returned.- Parameters:
t
- TheAffineTransform
to be applied- Returns:
- A new
IGeometry
object representing thisIGeometry
after the application of the givenAffineTransform
.
-
-