Package org.eclipse.gef.geometry.planar
Class CurvedPolygon
java.lang.Object
org.eclipse.gef.geometry.planar.CurvedPolygon
- All Implemented Interfaces:
Serializable
,Cloneable
,IGeometry
,IRotatable<CurvedPolygon>
,IScalable<CurvedPolygon>
,IShape
,ITranslatable<CurvedPolygon>
public class CurvedPolygon
extends Object
implements IShape, ITranslatable<CurvedPolygon>, IRotatable<CurvedPolygon>, IScalable<CurvedPolygon>
- See Also:
-
Constructor Summary
ConstructorDescriptionCurvedPolygon
(List<BezierCurve> curvedSides) Constructs a newCurvedPolygon
from the given list ofBezierCurve
s.CurvedPolygon
(BezierCurve... curvedSides) Constructs a newCurvedPolygon
from the givenBezierCurve
s. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Overridden with public visibility as recommended withinCloneable
.boolean
boolean
boolean
Returns an approximated centerPoint
of thisCurvedPolygon
.getCopy()
Returns a new identical copy of thisIGeometry
.getRotatedCCW
(Angle angle) getRotatedCCW
(Angle angle, double cx, double cy) getRotatedCCW
(Angle angle, Point center) getRotatedCW
(Angle angle) getRotatedCW
(Angle angle, double cx, double cy) getRotatedCW
(Angle angle, Point center) getScaled
(double factor) Scales a copy of the calling object by the given factor relative to its centerPoint
.getScaled
(double fx, double fy) Scales a copy of the calling object by the given factors relative to its centerPoint
.getScaled
(double factor, double cx, double cy) Scales a copy of the calling object by the given factor relative to the given centerPoint
(cx, cy).getScaled
(double fx, double fy, double cx, double cy) Scales a copy of the calling object by the given factors relative to the given centerPoint
(cx, cy).Scales a copy of the calling object by the given factors relative to the given centerPoint
.Scales a copy of the calling object by the given factor relative to the given centerPoint
.getTranslated
(double dx, double dy) Translates a copy of this object by the given values in x and y direction.Translates a copy of this object by the givenPoint
.final int
hashCode()
Rotates thisCurvedPolygon
counter-clockwise (CCW) by the givenAngle
around the centerPoint
of thisCurvedPolygon
.Rotates thisCurvedPolygon
counter-clockwise (CCW) by the givenAngle
around thePoint
specified by the given x and y coordinates.Rotates thisCurvedPolygon
counter-clockwise (CCW) by the givenAngle
around the centerPoint
of thisCurvedPolygon
.Rotates thisCurvedPolygon
clockwise (CW) by the givenAngle
around thePoint
specified by the given x and y coordinates.scale
(double factor) Scales the calling object by the given factor relative to its centerPoint
.scale
(double fx, double fy) Scales the calling object by the given factors relative to the given centerPoint
.scale
(double factor, double cx, double cy) Scales the calling object by the given factor relative to the given centerPoint
(cx, cy).scale
(double fx, double fy, double cx, double cy) Scales the calling object by the given factors relative to the given centerPoint
(cx, cy).Scales the calling object by the given factors relative to the given centerPoint
.Scales the calling object by the given factor relative to the given centerPoint
.toPath()
toString()
boolean
translate
(double dx, double dy) Translates the object by the given values in x and y direction.Translates the object by the givenPoint
.
-
Constructor Details
-
CurvedPolygon
Constructs a newCurvedPolygon
from the givenBezierCurve
s. SubsequentBezierCurve
s need to be connected with each other and the closing segment has to be supplied, too, otherwise anIllegalArgumentException
is thrown.- Parameters:
curvedSides
- theBezierCurve
s representing the edges of the newCurvedPolygon
-
CurvedPolygon
Constructs a newCurvedPolygon
from the given list ofBezierCurve
s. SubsequentBezierCurve
s need to be connected with each other and the closing segment has to be supplied, too, otherwise anIllegalArgumentException
is thrown.- Parameters:
curvedSides
- theBezierCurve
s representing the edges of the newCurvedPolygon
- See Also:
-
-
Method Details
-
contains
Description copied from interface:IShape
-
contains
Description copied from interface:IGeometry
-
equals
-
getBounds
Description copied from interface:IGeometry
-
getCenter
Returns an approximated centerPoint
of thisCurvedPolygon
.- Returns:
- an approximated center
Point
of thisCurvedPolygon
-
getCopy
Description copied from interface:IGeometry
Returns a new identical copy of thisIGeometry
. -
getOutline
Description copied from interface:IShape
- Specified by:
getOutline
in interfaceIShape
- Returns:
- An
ICurve
representing thisIShape
's outline.
-
getOutlineSegments
Description copied from interface:IShape
- Specified by:
getOutlineSegments
in interfaceIShape
- Returns:
- The
ICurve
segments of thisIShape
's outline.
-
getRotatedCCW
Description copied from interface:IRotatable
Rotates the calling object by specifiedAngle
counter-clock-wise (CCW) around its centerPoint
. Does not necessarily return an object of the same type.- Specified by:
getRotatedCCW
in interfaceIRotatable<CurvedPolygon>
- Parameters:
angle
- rotationAngle
- Returns:
- an
IGeometry
representing the result of the rotation
-
getRotatedCCW
Description copied from interface:IRotatable
Rotates the calling object by the specifiedAngle
counter-clock-wise (CCW) around the specified centerPoint
(cx, cy). Does not necessarily return an object of the same type.- Specified by:
getRotatedCCW
in interfaceIRotatable<CurvedPolygon>
- Parameters:
angle
- rotationAngle
cx
- x-coordinate of the relativePoint
for the rotationcy
- y-coordinate of the relativePoint
for the rotation- Returns:
- an
IGeometry
representing the result of the rotation
-
getRotatedCCW
Description copied from interface:IRotatable
Rotates the calling object by the specifiedAngle
counter-clock-wise (CCW) around the specified centerPoint
. Does not necessarily return an object of the same type.- Specified by:
getRotatedCCW
in interfaceIRotatable<CurvedPolygon>
- Parameters:
angle
- rotationAngle
center
- relativePoint
for the rotation- Returns:
- an
IGeometry
representing the result of the rotation
-
getRotatedCW
Description copied from interface:IRotatable
Rotates the calling object by specifiedAngle
clock-wise (CW) around its centerPoint
. Does not necessarily return an object of the same type.- Specified by:
getRotatedCW
in interfaceIRotatable<CurvedPolygon>
- Parameters:
angle
- rotationAngle
- Returns:
- an
IGeometry
representing the result of the rotation
-
getRotatedCW
Description copied from interface:IRotatable
Rotates the calling object by the specifiedAngle
clock-wise (CW) around the specified centerPoint
(cx, cy). Does not necessarily return an object of the same type.- Specified by:
getRotatedCW
in interfaceIRotatable<CurvedPolygon>
- Parameters:
angle
- rotationAngle
cx
- x-coordinate of the relativePoint
for the rotationcy
- y-coordinate of the relativePoint
for the rotation- Returns:
- an
IGeometry
representing the result of the rotation
-
getRotatedCW
Description copied from interface:IRotatable
Rotates the calling object by the specifiedAngle
clock-wise (CW) around the specified centerPoint
. Does not necessarily return an object of the same type.- Specified by:
getRotatedCW
in interfaceIRotatable<CurvedPolygon>
- Parameters:
angle
- rotationAngle
center
- relativePoint
for the rotation- Returns:
- an
IGeometry
representing the result of the rotation
-
getScaled
Description copied from interface:IScalable
Scales a copy of the calling object by the given factor relative to its centerPoint
.- Specified by:
getScaled
in interfaceIScalable<CurvedPolygon>
- Parameters:
factor
- scale-factor- Returns:
- the new, scaled object
-
getScaled
Description copied from interface:IScalable
Scales a copy of the calling object by the given factors relative to its centerPoint
.- Specified by:
getScaled
in interfaceIScalable<CurvedPolygon>
- Parameters:
fx
- x-scale-factorfy
- y-scale-factor- Returns:
- the new, scaled object
-
getScaled
Description copied from interface:IScalable
Scales a copy of the calling object by the given factor relative to the given centerPoint
(cx, cy).- Specified by:
getScaled
in interfaceIScalable<CurvedPolygon>
- Parameters:
factor
- scale-factorcx
- x-coordinate of the relativePoint
for the scalingcy
- y-coordinate of the relativePoint
for the scaling- Returns:
- the new, scaled object
-
getScaled
Description copied from interface:IScalable
Scales a copy of the calling object by the given factors relative to the given centerPoint
(cx, cy).- Specified by:
getScaled
in interfaceIScalable<CurvedPolygon>
- Parameters:
fx
- x-scale-factorfy
- y-scale-factorcx
- x-coordinate of the relativePoint
for the scalingcy
- y-coordinate of the relativePoint
for the scaling- Returns:
- the new, scaled object
-
getScaled
Description copied from interface:IScalable
Scales a copy of the calling object by the given factors relative to the given centerPoint
.- Specified by:
getScaled
in interfaceIScalable<CurvedPolygon>
- Parameters:
fx
- x-scale-factorfy
- y-scale-factorcenter
- relativePoint
for the scaling- Returns:
- the new, scaled object
-
getScaled
Description copied from interface:IScalable
Scales a copy of the calling object by the given factor relative to the given centerPoint
.- Specified by:
getScaled
in interfaceIScalable<CurvedPolygon>
- Parameters:
factor
- scale-factorcenter
- relativePoint
for the scaling- Returns:
- the new, scaled object
-
getTransformed
Default implementation returning a transformedPath
representation of thisIGeometry
. Subclasses may override this method to return a more specific representation.- Specified by:
getTransformed
in interfaceIGeometry
- Specified by:
getTransformed
in interfaceIShape
- Parameters:
t
- TheAffineTransform
to be applied- Returns:
- a transformed
Path
representation of thisIGeometry
- See Also:
-
getTranslated
Description copied from interface:ITranslatable
Translates a copy of this object by the given values in x and y direction.- Specified by:
getTranslated
in interfaceITranslatable<CurvedPolygon>
- Parameters:
dx
- x-translationdy
- y-translation- Returns:
- a new, translated object
-
getTranslated
Description copied from interface:ITranslatable
Translates a copy of this object by the givenPoint
.- Specified by:
getTranslated
in interfaceITranslatable<CurvedPolygon>
- Parameters:
d
- translationPoint
- Returns:
- a new, translated object
-
rotateCCW
Rotates thisCurvedPolygon
counter-clockwise (CCW) by the givenAngle
around the centerPoint
of thisCurvedPolygon
.- Parameters:
angle
- the rotationAngle
- Returns:
this
for convenience
-
rotateCCW
Rotates thisCurvedPolygon
counter-clockwise (CCW) by the givenAngle
around thePoint
specified by the given x and y coordinates. -
rotateCCW
-
rotateCW
Rotates thisCurvedPolygon
counter-clockwise (CCW) by the givenAngle
around the centerPoint
of thisCurvedPolygon
.- Parameters:
angle
- the rotationAngle
- Returns:
this
for convenience
-
rotateCW
Rotates thisCurvedPolygon
clockwise (CW) by the givenAngle
around thePoint
specified by the given x and y coordinates. -
rotateCW
-
scale
Description copied from interface:IScalable
Scales the calling object by the given factor relative to its centerPoint
.- Specified by:
scale
in interfaceIScalable<CurvedPolygon>
- Parameters:
factor
- scale-factor- Returns:
this
for convenience
-
scale
Description copied from interface:IScalable
Scales the calling object by the given factors relative to the given centerPoint
.- Specified by:
scale
in interfaceIScalable<CurvedPolygon>
- Parameters:
fx
- x-scale-factorfy
- y-scale-factor- Returns:
this
for convenience
-
scale
Description copied from interface:IScalable
Scales the calling object by the given factor relative to the given centerPoint
(cx, cy).- Specified by:
scale
in interfaceIScalable<CurvedPolygon>
- Parameters:
factor
- scale-factorcx
- x-coordinate of the relativePoint
for the scalingcy
- y-coordinate of the relativePoint
for the scaling- Returns:
this
for convenience
-
scale
Description copied from interface:IScalable
Scales the calling object by the given factors relative to the given centerPoint
(cx, cy).- Specified by:
scale
in interfaceIScalable<CurvedPolygon>
- Parameters:
fx
- x-scale-factorfy
- y-scale-factorcx
- x-coordinate of the relativePoint
for the scalingcy
- y-coordinate of the relativePoint
for the scaling- Returns:
this
for convenience
-
scale
Description copied from interface:IScalable
Scales the calling object by the given factors relative to the given centerPoint
.- Specified by:
scale
in interfaceIScalable<CurvedPolygon>
- Parameters:
fx
- x-scale-factorfy
- y-scale-factorcenter
- relativePoint
for the scaling- Returns:
this
for convenience
-
scale
Description copied from interface:IScalable
Scales the calling object by the given factor relative to the given centerPoint
.- Specified by:
scale
in interfaceIScalable<CurvedPolygon>
- Parameters:
factor
- scale-factorcenter
- relativePoint
for the scaling- Returns:
this
for convenience
-
toPath
Description copied from interface:IGeometry
-
toString
-
translate
Description copied from interface:ITranslatable
Translates the object by the given values in x and y direction.- Specified by:
translate
in interfaceITranslatable<CurvedPolygon>
- Parameters:
dx
- x-translationdy
- y-translation- Returns:
this
for convenience
-
translate
Description copied from interface:ITranslatable
Translates the object by the givenPoint
.- Specified by:
translate
in interfaceITranslatable<CurvedPolygon>
- Parameters:
d
- translationPoint
- Returns:
this
for convenience
-
clone
Overridden with public visibility as recommended withinCloneable
. -
hashCode
public final int hashCode() -
touches
Description copied from interface:IGeometry
-