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 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 TypeMethodDescriptionvoidAdds aChangeListener.voidconcatenate(AffineTransform xform) voidNotifies all listeners that have registered interest for notification on this event type.Returns an array of all theChangeListeners added with addChangeListener().voidpreConcatenate(AffineTransform xform) voidRemoves a ChangeListener.voidrotate(double radians, double x, double y) rotates the current transform at the supplied pointsvoidpreconcatenates the rotation at the supplied point with the current transformvoidsetter for the scale fires a PropertyChangeEvent with the AffineTransforms representing the previous and new values for scale and offsetvoidsetter for the scale fires a PropertyChangeEvent with the AffineTransforms representing the previous and new values for scale and offsetvoidvoidsetTranslate(double tx, double ty) Replace the Transform's translate x and y values with the passed values, leaving the scale values unchanged.voidshears the transform by passed parameterstoString()voidtranslate(double offsetx, double offsety) Apply the passed values to the current TransformMethods inherited from class AffineTransformer
getInverse, getRotation, getScale, getScaleX, getScaleY, getShearX, getShearY, getTransform, getTranslateX, getTranslateY, inverseTransform, inverseTransform, setTransform, transform, transformMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface BidirectionalTransformer
inverseTransform, transformMethods inherited from interface MutableTransformer
getRotation, getScale, getScaleX, getScaleY, getShearX, getShearY, getTransform, getTranslateX, getTranslateYMethods inherited from interface 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:
toStringin classAffineTransformer
-
scale
setter for the scale fires a PropertyChangeEvent with the AffineTransforms representing the previous and new values for scale and offset- Specified by:
scalein 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:
setScalein 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:
shearin 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:
setTranslatein 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:
translatein interfaceMutableTransformer- Parameters:
offsetx- the x-valueoffsety- the y-value
-
rotate
preconcatenates the rotation at the supplied point with the current transform- Specified by:
rotatein 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:
rotatein 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:
concatenatein interfaceMutableTransformer
-
preConcatenate
- Specified by:
preConcatenatein interfaceMutableTransformer
-
addChangeListener
Adds aChangeListener.- Specified by:
addChangeListenerin interfaceChangeEventSupport- Parameters:
l- the listener to be added
-
removeChangeListener
Removes a ChangeListener.- Specified by:
removeChangeListenerin interfaceChangeEventSupport- Parameters:
l- the listener to be removed
-
getChangeListeners
Returns an array of all theChangeListeners added with addChangeListener().- Specified by:
getChangeListenersin interfaceChangeEventSupport- Returns:
- all of the
ChangeListeners 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:
fireStateChangedin interfaceChangeEventSupport- See Also:
-
setToIdentity
public void setToIdentity()- Specified by:
setToIdentityin interfaceMutableTransformer
-