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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Overridden with public visibility as recommended withinCloneable.booleanChecks if the givenIGeometryis fully contained by thisIMultiShape.booleanbooleanprotected Line[]Collects all edges of the internalIShapes.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 theIShapes 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 inthashCode()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()booleantranslate(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:IMultiShapeChecks if the givenIGeometryis fully contained by thisIMultiShape.- Specified by:
containsin interfaceIMultiShape- Parameters:
g- TheIGeometrywhich is tested for containment.- Returns:
trueif theIGeometryis contained by thisIMultiShape, otherwisefalse
-
equals
-
getAllEdges
Collects all edges of the internalIShapes. For aRegionthe internalIShapes areRectangles. For aRingthe internalIShapes arePolygons (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 anICurveis fully-contained by theIMultiShape.- Returns:
- the edges of all internal
IShapes
-
getBounds
Description copied from interface:IGeometry -
getCopy
Description copied from interface:IGeometryReturns a new identical copy of thisIGeometry. -
getRotatedCCW
Description copied from interface:IRotatableRotates the calling object by specifiedAnglecounter-clock-wise (CCW) around its centerPoint. Does not necessarily return an object of the same type.- Specified by:
getRotatedCCWin interfaceIRotatable<Ring>- Parameters:
angle- rotationAngle- Returns:
- an
IGeometryrepresenting the result of the rotation
-
getRotatedCCW
Description copied from interface:IRotatableRotates the calling object by the specifiedAnglecounter-clock-wise (CCW) around the specified centerPoint(cx, cy). Does not necessarily return an object of the same type.- Specified by:
getRotatedCCWin interfaceIRotatable<Ring>- Parameters:
angle- rotationAnglecx- x-coordinate of the relativePointfor the rotationcy- y-coordinate of the relativePointfor the rotation- Returns:
- an
IGeometryrepresenting the result of the rotation
-
getRotatedCCW
Description copied from interface:IRotatableRotates the calling object by the specifiedAnglecounter-clock-wise (CCW) around the specified centerPoint. Does not necessarily return an object of the same type.- Specified by:
getRotatedCCWin interfaceIRotatable<Ring>- Parameters:
angle- rotationAnglecenter- relativePointfor the rotation- Returns:
- an
IGeometryrepresenting the result of the rotation
-
getRotatedCW
Description copied from interface:IRotatableRotates the calling object by specifiedAngleclock-wise (CW) around its centerPoint. Does not necessarily return an object of the same type.- Specified by:
getRotatedCWin interfaceIRotatable<Ring>- Parameters:
angle- rotationAngle- Returns:
- an
IGeometryrepresenting the result of the rotation
-
getRotatedCW
Description copied from interface:IRotatableRotates the calling object by the specifiedAngleclock-wise (CW) around the specified centerPoint(cx, cy). Does not necessarily return an object of the same type.- Specified by:
getRotatedCWin interfaceIRotatable<Ring>- Parameters:
angle- rotationAnglecx- x-coordinate of the relativePointfor the rotationcy- y-coordinate of the relativePointfor the rotation- Returns:
- an
IGeometryrepresenting the result of the rotation
-
getRotatedCW
Description copied from interface:IRotatableRotates the calling object by the specifiedAngleclock-wise (CW) around the specified centerPoint. Does not necessarily return an object of the same type.- Specified by:
getRotatedCWin interfaceIRotatable<Ring>- Parameters:
angle- rotationAnglecenter- relativePointfor the rotation- Returns:
- an
IGeometryrepresenting the result of the rotation
-
getScaled
Description copied from interface:IScalableScales a copy of the calling object by the given factor relative to its centerPoint. -
getScaled
Description copied from interface:IScalableScales a copy of the calling object by the given factors relative to its centerPoint. -
getScaled
Description copied from interface:IScalableScales a copy of the calling object by the given factor relative to the given centerPoint(cx, cy). -
getScaled
Description copied from interface:IScalableScales a copy of the calling object by the given factors relative to the given centerPoint(cx, cy). -
getScaled
Description copied from interface:IScalableScales a copy of the calling object by the given factors relative to the given centerPoint. -
getScaled
Description copied from interface:IScalableScales a copy of the calling object by the given factor relative to the given centerPoint. -
getShapes
Description copied from interface:IMultiShapeReturns theIShapes that constitute thisIMultiShape.- Specified by:
getShapesin interfaceIMultiShape- Returns:
- an array of
IShapes, representing the parts that make up thisIMultiShape.
-
getTransformed
Default implementation returning a transformedPathrepresentation of thisIGeometry. Subclasses may override this method to return a more specific representation.- Specified by:
getTransformedin interfaceIGeometry- Parameters:
t- TheAffineTransformto be applied- Returns:
- a transformed
Pathrepresentation of thisIGeometry
-
getTranslated
Description copied from interface:ITranslatableTranslates a copy of this object by the given values in x and y direction.- Specified by:
getTranslatedin interfaceITranslatable<Ring>- Parameters:
dx- x-translationdy- y-translation- Returns:
- a new, translated object
-
getTranslated
Description copied from interface:ITranslatableTranslates a copy of this object by the givenPoint.- Specified by:
getTranslatedin interfaceITranslatable<Ring>- Parameters:
d- translationPoint- Returns:
- a new, translated object
-
rotateCCW
Directly rotates thisRingcounter-clock-wise around its centerPointby the givenAngle. Direct adaptation means, thatthisPolyBezieris modified in-place.- Parameters:
angle- rotationAngle- Returns:
thisfor convenience
-
rotateCCW
Directly rotates thisRingcounter-clock-wise around the given point (specified by cx and cy) by the givenAngle. Direct adaptation means, thatthisPolyBezieris modified in-place. -
rotateCCW
Directly rotates thisRingcounter-clock-wise around the givenPointby the givenAngle. Direct adaptation means, thatthisPolyBezieris modified in-place. -
rotateCW
Directly rotates thisRingclock-wise around its centerPointby the givenAngle. Direct adaptation means, thatthisPolyBezieris modified in-place.- Parameters:
angle- rotationAngle- Returns:
thisfor convenience
-
rotateCW
Directly rotates thisRingclock-wise around the given point (specified by cx and cy) by the givenAngle. Direct adaptation means, thatthisPolyBezieris modified in-place. -
rotateCW
Directly rotates thisRingclock-wise around the givenPointby the givenAngle. Direct adaptation means, thatthisPolyBezieris modified in-place. -
scale
Description copied from interface:IScalableScales the calling object by the given factor relative to its centerPoint. -
scale
Description copied from interface:IScalableScales the calling object by the given factors relative to the given centerPoint. -
scale
Description copied from interface:IScalableScales the calling object by the given factor relative to the given centerPoint(cx, cy). -
scale
Description copied from interface:IScalableScales the calling object by the given factors relative to the given centerPoint(cx, cy). -
scale
Description copied from interface:IScalableScales the calling object by the given factors relative to the given centerPoint. -
scale
Description copied from interface:IScalableScales the calling object by the given factor relative to the given centerPoint. -
translate
Description copied from interface:ITranslatableTranslates the object by the given values in x and y direction.- Specified by:
translatein interfaceITranslatable<Ring>- Parameters:
dx- x-translationdy- y-translation- Returns:
thisfor convenience
-
translate
Description copied from interface:ITranslatableTranslates the object by the givenPoint.- Specified by:
translatein interfaceITranslatable<Ring>- Parameters:
d- translationPoint- Returns:
thisfor convenience
-
contains
Description copied from interface:IGeometry -
getOutlines
Description copied from interface:IMultiShapeComputes the outlines of this
IMultiShape.The outlines are returned as an array of
ICurves. For every closed outline of thisIMultiShapeoneICurveis returned.- Specified by:
getOutlinesin interfaceIMultiShape- Returns:
- an array of
ICurves, one for each closed outline
-
getOutlineSegments
Computes the outline segments of this
AbstractMultiShape.The outline segments of this
AbstractMultiShapeare those outline segments of the internalIShapes that only exist once.- Specified by:
getOutlineSegmentsin 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
-