Package org.eclipse.gef.geometry.planar
Interface ITranslatable<T extends IGeometry>
-
- Type Parameters:
T
- the implementing type
- All Known Implementing Classes:
Arc
,BezierCurve
,CubicCurve
,CurvedPolygon
,Ellipse
,Line
,Pie
,PolyBezier
,Polygon
,Polyline
,QuadraticCurve
,Rectangle
,Region
,Ring
,RoundedRectangle
public interface ITranslatable<T extends IGeometry>
The
ITranslatable
interface collects all translation short-cut methods.Translation can be applied directly on an object via the
translate(Point)
andtranslate(double, double)
methods. They return the scaled, calling object for convenience.On the other hand, the
getTranslated(Point)
andgetTranslated(double, double)
methods create a translated copy of the original object.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
getTranslated(double dx, double dy)
Translates a copy of this object by the given values in x and y direction.T
getTranslated(Point d)
Translates a copy of this object by the givenPoint
.T
translate(double dx, double dy)
Translates the object by the given values in x and y direction.T
translate(Point d)
Translates the object by the givenPoint
.
-
-
-
Method Detail
-
getTranslated
T getTranslated(double dx, double dy)
Translates a copy of this object by the given values in x and y direction.- Parameters:
dx
- x-translationdy
- y-translation- Returns:
- a new, translated object
-
getTranslated
T getTranslated(Point d)
Translates a copy of this object by the givenPoint
.- Parameters:
d
- translationPoint
- Returns:
- a new, translated object
-
translate
T translate(double dx, double dy)
Translates the object by the given values in x and y direction.- Parameters:
dx
- x-translationdy
- y-translation- Returns:
this
for convenience
-
-