Class AffineTransformer
java.lang.Object
edu.uci.ics.jung.visualization.transform.AffineTransformer
- All Implemented Interfaces:
BidirectionalTransformer, ShapeTransformer
- Direct Known Subclasses:
MutableAffineTransformer
Provides methods to map points from one coordinate system to
another, by delegating to a wrapped AffineTransform (uniform)
and its inverse.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AffineTransformprotected AffineTransformThe AffineTransform to use; initialized to identity. -
Constructor Summary
ConstructorsConstructorDescriptionCreate an instance that does not transform points.AffineTransformer(AffineTransform transform) Create an instance with the supplied transform. -
Method Summary
Modifier and TypeMethodDescriptiondoubledoublegetScale()doubledoubledoubledoubledoubledoubleapplies the inverse transform to the supplied pointinverseTransform(Shape shape) Transform the supplied shape from screen (view) to graph (layout) coordinates.voidsetTransform(AffineTransform transform) toString()Applies the transform to the supplied point.Transform the supplied shape from graph (layout) to screen (view) coordinates.
-
Field Details
-
inverse
-
transform
The AffineTransform to use; initialized to identity.
-
-
Constructor Details
-
AffineTransformer
public AffineTransformer()Create an instance that does not transform points. -
AffineTransformer
Create an instance with the supplied transform.- Parameters:
transform- the transform to use
-
-
Method Details
-
getTransform
- Returns:
- Returns the transform.
-
setTransform
- Parameters:
transform- The transform to set.
-
inverseTransform
applies the inverse transform to the supplied point- Specified by:
inverseTransformin interfaceBidirectionalTransformer- Parameters:
p- the point to transform- Returns:
- the transformed point
-
getInverse
-
getScaleX
public double getScaleX()- Returns:
- the transform's x scale value
-
getScaleY
public double getScaleY()- Returns:
- the transform's y scale value
-
getScale
public double getScale()- Returns:
- the transform's overall scale magnitude
-
getShearX
public double getShearX()- Returns:
- the transform's x shear value
-
getShearY
public double getShearY()- Returns:
- the transform's y shear value
-
getTranslateX
public double getTranslateX()- Returns:
- the transform's x translate value
-
getTranslateY
public double getTranslateY()- Returns:
- the transform's y translate value
-
transform
Applies the transform to the supplied point.- Specified by:
transformin interfaceBidirectionalTransformer- Parameters:
p- the point to be transformed- Returns:
- the transformed point
-
transform
Transform the supplied shape from graph (layout) to screen (view) coordinates.- Specified by:
transformin interfaceShapeTransformer- Parameters:
shape- the Shape to transform- Returns:
- the GeneralPath of the transformed shape
-
inverseTransform
Transform the supplied shape from screen (view) to graph (layout) coordinates.- Specified by:
inverseTransformin interfaceShapeTransformer- Returns:
- the GeneralPath of the transformed shape
-
getRotation
public double getRotation() -
toString
-