Class MutableAffineTransformer
java.lang.Object
edu.uci.ics.jung.visualization.transform.AffineTransformer
edu.uci.ics.jung.visualization.transform.MutableAffineTransformer
- All Implemented Interfaces:
BidirectionalTransformer
,MutableTransformer
,ShapeTransformer
,ChangeEventSupport
public class MutableAffineTransformer
extends AffineTransformer
implements MutableTransformer, ShapeTransformer, ChangeEventSupport
Provides methods to mutate the AffineTransform used by AffineTransformer
base class to map points from one coordinate system to
another.
-
Field Summary
FieldsFields inherited from class edu.uci.ics.jung.visualization.transform.AffineTransformer
inverse, transform
-
Constructor Summary
ConstructorsConstructorDescriptioncreate an instance that does not transform pointsMutableAffineTransformer
(AffineTransform transform) Create an instance with the supplied transform -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds aChangeListener
.void
concatenate
(AffineTransform xform) void
Notifies all listeners that have registered interest for notification on this event type.Returns an array of all theChangeListener
s added with addChangeListener().void
preConcatenate
(AffineTransform xform) void
Removes a ChangeListener.void
rotate
(double radians, double x, double y) rotates the current transform at the supplied pointsvoid
preconcatenates the rotation at the supplied point with the current transformvoid
setter for the scale fires a PropertyChangeEvent with the AffineTransforms representing the previous and new values for scale and offsetvoid
setter for the scale fires a PropertyChangeEvent with the AffineTransforms representing the previous and new values for scale and offsetvoid
void
setTranslate
(double tx, double ty) Replace the Transform's translate x and y values with the passed values, leaving the scale values unchanged.void
shears the transform by passed parameterstoString()
void
translate
(double offsetx, double offsety) Apply the passed values to the current TransformMethods inherited from class edu.uci.ics.jung.visualization.transform.AffineTransformer
getInverse, getRotation, getScale, getScaleX, getScaleY, getShearX, getShearY, getTransform, getTranslateX, getTranslateY, inverseTransform, inverseTransform, setTransform, transform, transform
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.uci.ics.jung.visualization.transform.BidirectionalTransformer
inverseTransform, transform
Methods inherited from interface edu.uci.ics.jung.visualization.transform.MutableTransformer
getRotation, getScale, getScaleX, getScaleY, getShearX, getShearY, getTransform, getTranslateX, getTranslateY
Methods inherited from interface edu.uci.ics.jung.visualization.transform.shape.ShapeTransformer
inverseTransform, transform
-
Field Details
-
changeSupport
-
-
Constructor Details
-
MutableAffineTransformer
public MutableAffineTransformer()create an instance that does not transform points -
MutableAffineTransformer
Create an instance with the supplied transform- Parameters:
transform
- the transform to use
-
-
Method Details
-
toString
- Overrides:
toString
in classAffineTransformer
-
scale
setter for the scale fires a PropertyChangeEvent with the AffineTransforms representing the previous and new values for scale and offset- Specified by:
scale
in interfaceMutableTransformer
- Parameters:
scalex
- the amount to scale in the x directionscaley
- the amount to scale in the y directionfrom
- the point to transform
-
setScale
setter for the scale fires a PropertyChangeEvent with the AffineTransforms representing the previous and new values for scale and offset- Specified by:
setScale
in interfaceMutableTransformer
- Parameters:
scalex
- the amount to scale in the x directionscaley
- the amount to scale in the y directionfrom
- the point to transform
-
shear
shears the transform by passed parameters- Specified by:
shear
in interfaceMutableTransformer
- Parameters:
shx
- x value to shearshy
- y value to shearfrom
- the point to transform
-
setTranslate
public void setTranslate(double tx, double ty) Replace the Transform's translate x and y values with the passed values, leaving the scale values unchanged.- Specified by:
setTranslate
in interfaceMutableTransformer
- Parameters:
tx
- the x value of the translationty
- the y value of the translation
-
translate
public void translate(double offsetx, double offsety) Apply the passed values to the current Transform- Specified by:
translate
in interfaceMutableTransformer
- Parameters:
offsetx
- the x-valueoffsety
- the y-value
-
rotate
preconcatenates the rotation at the supplied point with the current transform- Specified by:
rotate
in interfaceMutableTransformer
- Parameters:
theta
- the angle by which to rotate the pointfrom
- the point to transform
-
rotate
public void rotate(double radians, double x, double y) rotates the current transform at the supplied points- Specified by:
rotate
in interfaceMutableTransformer
- Parameters:
radians
- angle by which to rotate the supplied coordinatesx
- the x coordinate of the point to transformy
- the y coordinate of the point to transform
-
concatenate
- Specified by:
concatenate
in interfaceMutableTransformer
-
preConcatenate
- Specified by:
preConcatenate
in interfaceMutableTransformer
-
addChangeListener
Adds aChangeListener
.- Specified by:
addChangeListener
in interfaceChangeEventSupport
- Parameters:
l
- the listener to be added
-
removeChangeListener
Removes a ChangeListener.- Specified by:
removeChangeListener
in interfaceChangeEventSupport
- Parameters:
l
- the listener to be removed
-
getChangeListeners
Returns an array of all theChangeListener
s added with addChangeListener().- Specified by:
getChangeListeners
in interfaceChangeEventSupport
- Returns:
- all of the
ChangeListener
s added or an empty array if no listeners have been added
-
fireStateChanged
public void fireStateChanged()Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created.- Specified by:
fireStateChanged
in interfaceChangeEventSupport
- See Also:
-
setToIdentity
public void setToIdentity()- Specified by:
setToIdentity
in interfaceMutableTransformer
-