Package org.eclipse.draw2d.geometry
Class Transform
java.lang.Object
org.eclipse.draw2d.geometry.Transform
Provides support for transformations of scaling, translation and rotation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a new transformed Point of the input Point based on the transformation values set.void
setRotation
(double angle) Sets the rotation angle.void
setScale
(double scale) Sets the value for the amount of scaling to be done along both axes.void
setScale
(double x, double y) Sets the value for the amount of scaling to be done along X and Y axes individually.void
setTranslation
(double x, double y) Sets the translation amounts for both axes.
-
Constructor Details
-
Transform
public Transform()
-
-
Method Details
-
setScale
public void setScale(double scale) Sets the value for the amount of scaling to be done along both axes.- Parameters:
scale
- Scale factor- Since:
- 2.0
-
setScale
public void setScale(double x, double y) Sets the value for the amount of scaling to be done along X and Y axes individually.- Parameters:
x
- Amount of scaling on X axisy
- Amount of scaling on Y axis- Since:
- 2.0
-
setRotation
public void setRotation(double angle) Sets the rotation angle.- Parameters:
angle
- Angle of rotation- Since:
- 2.0
-
setTranslation
public void setTranslation(double x, double y) Sets the translation amounts for both axes.- Parameters:
x
- Amount of shift on X axisy
- Amount of shift on Y axis- Since:
- 2.0
-
getTransformed
Returns a new transformed Point of the input Point based on the transformation values set.- Parameters:
p
- Point being transformed- Returns:
- The transformed Point
- Since:
- 2.0
-