Package org.eclipse.gef.geometry.planar
Class Ring
java.lang.Object
org.eclipse.gef.geometry.planar.Ring
- All Implemented Interfaces:
Serializable
,Cloneable
,IGeometry
,IMultiShape
,IRotatable<Ring>
,IScalable<Ring>
,ITranslatable<Ring>
A combination of Polygons....
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Overridden with public visibility as recommended withinCloneable
.boolean
Checks if the givenIGeometry
is fully contained by thisIMultiShape
.boolean
boolean
protected Line[]
Collects all edges of the internalIShape
s.getCopy()
Returns a new identical copy of thisIGeometry
.Polyline[]
Computes the outlines of thisIMultiShape
.Line[]
Computes the outline segments of thisAbstractMultiShape
.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
.Polygon[]
Returns theIShape
s that constitute thisIMultiShape
.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()
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()
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
-
Ring
public Ring()Constructs a new emptyRing
. -
Ring
-
Ring
-
-
Method Details
-
add
-
contains
Description copied from interface:IMultiShape
Checks if the givenIGeometry
is fully contained by thisIMultiShape
.- Specified by:
contains
in interfaceIMultiShape
- Parameters:
g
- TheIGeometry
which is tested for containment.- Returns:
true
if theIGeometry
is contained by thisIMultiShape
, otherwisefalse
-
equals
-
getAllEdges
Collects all edges of the internalIShape
s. For aRegion
the internalIShape
s areRectangle
s. For aRing
the internalIShape
s arePolygon
s (triangles). The internal edges are needed to determine inner and outer segments of theIMultiShape
. Based on the outline of theIMultiShape
, the outline intersections can be computed. These outline intersections are required to test if anICurve
is fully-contained by theIMultiShape
.- Returns:
- the edges of all internal
IShape
s
-
getBounds
Description copied from interface:IGeometry
-
getCopy
Description copied from interface:IGeometry
Returns a new identical copy of thisIGeometry
. -
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<Ring>
- 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<Ring>
- 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<Ring>
- 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<Ring>
- 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<Ring>
- 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<Ring>
- 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
. -
getScaled
Description copied from interface:IScalable
Scales a copy of the calling object by the given factors relative to its centerPoint
. -
getScaled
Description copied from interface:IScalable
Scales a copy of the calling object by the given factor relative to the given centerPoint
(cx, cy). -
getScaled
Description copied from interface:IScalable
Scales a copy of the calling object by the given factors relative to the given centerPoint
(cx, cy). -
getScaled
Description copied from interface:IScalable
Scales a copy of the calling object by the given factors relative to the given centerPoint
. -
getScaled
Description copied from interface:IScalable
Scales a copy of the calling object by the given factor relative to the given centerPoint
. -
getShapes
Description copied from interface:IMultiShape
Returns theIShape
s that constitute thisIMultiShape
.- Specified by:
getShapes
in interfaceIMultiShape
- Returns:
- an array of
IShape
s, representing the parts that make up thisIMultiShape
.
-
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
- Parameters:
t
- TheAffineTransform
to be applied- Returns:
- a transformed
Path
representation of thisIGeometry
-
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<Ring>
- 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<Ring>
- Parameters:
d
- translationPoint
- Returns:
- a new, translated object
-
rotateCCW
Directly rotates thisRing
counter-clock-wise around its centerPoint
by the givenAngle
. Direct adaptation means, thatthis
PolyBezier
is modified in-place.- Parameters:
angle
- rotationAngle
- Returns:
this
for convenience
-
rotateCCW
Directly rotates thisRing
counter-clock-wise around the given point (specified by cx and cy) by the givenAngle
. Direct adaptation means, thatthis
PolyBezier
is modified in-place. -
rotateCCW
Directly rotates thisRing
counter-clock-wise around the givenPoint
by the givenAngle
. Direct adaptation means, thatthis
PolyBezier
is modified in-place. -
rotateCW
Directly rotates thisRing
clock-wise around its centerPoint
by the givenAngle
. Direct adaptation means, thatthis
PolyBezier
is modified in-place.- Parameters:
angle
- rotationAngle
- Returns:
this
for convenience
-
rotateCW
Directly rotates thisRing
clock-wise around the given point (specified by cx and cy) by the givenAngle
. Direct adaptation means, thatthis
PolyBezier
is modified in-place. -
rotateCW
Directly rotates thisRing
clock-wise around the givenPoint
by the givenAngle
. Direct adaptation means, thatthis
PolyBezier
is modified in-place. -
scale
Description copied from interface:IScalable
Scales the calling object by the given factor relative to its centerPoint
. -
scale
Description copied from interface:IScalable
Scales the calling object by the given factors relative to the given centerPoint
. -
scale
Description copied from interface:IScalable
Scales the calling object by the given factor relative to the given centerPoint
(cx, cy). -
scale
Description copied from interface:IScalable
Scales the calling object by the given factors relative to the given centerPoint
(cx, cy). -
scale
Description copied from interface:IScalable
Scales the calling object by the given factors relative to the given centerPoint
. -
scale
Description copied from interface:IScalable
Scales the calling object by the given factor relative to the given centerPoint
. -
translate
Description copied from interface:ITranslatable
Translates the object by the given values in x and y direction.- Specified by:
translate
in interfaceITranslatable<Ring>
- 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<Ring>
- Parameters:
d
- translationPoint
- Returns:
this
for convenience
-
contains
Description copied from interface:IGeometry
-
getOutlines
Description copied from interface:IMultiShape
Computes the outlines of this
IMultiShape
.The outlines are returned as an array of
ICurve
s. For every closed outline of thisIMultiShape
oneICurve
is returned.- Specified by:
getOutlines
in interfaceIMultiShape
- Returns:
- an array of
ICurve
s, one for each closed outline
-
getOutlineSegments
Computes the outline segments of this
AbstractMultiShape
.The outline segments of this
AbstractMultiShape
are those outline segments of the internalIShape
s that only exist once.- Specified by:
getOutlineSegments
in interfaceIMultiShape
- Returns:
- the outline segments of this
AbstractMultiShape
-
toPath
Description copied from interface:IGeometry
-
clone
Overridden with public visibility as recommended withinCloneable
. -
hashCode
public final int hashCode() -
touches
Description copied from interface:IGeometry
-