edu.uci.ics.jung.visualization.transform
Class MutableAffineTransformer

java.lang.Object
  extended by edu.uci.ics.jung.visualization.transform.AffineTransformer
      extended by 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.

Author:
Tom Nelson

Field Summary
protected  ChangeEventSupport changeSupport
           
 
Fields inherited from class edu.uci.ics.jung.visualization.transform.AffineTransformer
inverse, transform
 
Constructor Summary
MutableAffineTransformer()
          create an instance that does not transform points
MutableAffineTransformer(AffineTransform transform)
          Create an instance with the supplied transform
 
Method Summary
 void addChangeListener(ChangeListener l)
          Adds a ChangeListener.
 void concatenate(AffineTransform xform)
           
 void fireStateChanged()
          Notifies all listeners that have registered interest for notification on this event type.
 ChangeListener[] getChangeListeners()
          Returns an array of all the ChangeListeners added with addChangeListener().
 void preConcatenate(AffineTransform xform)
           
 void removeChangeListener(ChangeListener l)
          Removes a ChangeListener.
 void rotate(double radians, double x, double y)
          rotates the current transform at the supplied points
 void rotate(double theta, Point2D from)
          preconcatenates the rotation at the supplied point with the current transform
 void scale(double scalex, double scaley, Point2D from)
          setter for the scale fires a PropertyChangeEvent with the AffineTransforms representing the previous and new values for scale and offset
 void setScale(double scalex, double scaley, Point2D from)
          setter for the scale fires a PropertyChangeEvent with the AffineTransforms representing the previous and new values for scale and offset
 void setToIdentity()
           
 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 shear(double shx, double shy, Point2D from)
          shears the transform by passed parameters
 String toString()
           
 void translate(double offsetx, double offsety)
          Apply the passed values to the current Transform
 
Methods 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.MutableTransformer
getRotation, getScale, getScaleX, getScaleY, getShearX, getShearY, getTransform, getTranslateX, getTranslateY
 
Methods inherited from interface edu.uci.ics.jung.visualization.transform.shape.ShapeTransformer
inverseTransform, transform
 
Methods inherited from interface edu.uci.ics.jung.visualization.transform.BidirectionalTransformer
inverseTransform, transform
 

Field Detail

changeSupport

protected ChangeEventSupport changeSupport
Constructor Detail

MutableAffineTransformer

public MutableAffineTransformer()
create an instance that does not transform points


MutableAffineTransformer

public MutableAffineTransformer(AffineTransform transform)
Create an instance with the supplied transform

Method Detail

toString

public String toString()
Overrides:
toString in class AffineTransformer

scale

public void scale(double scalex,
                  double scaley,
                  Point2D from)
setter for the scale fires a PropertyChangeEvent with the AffineTransforms representing the previous and new values for scale and offset

Specified by:
scale in interface MutableTransformer
Parameters:
scalex -
scaley -

setScale

public void setScale(double scalex,
                     double scaley,
                     Point2D from)
setter for the scale fires a PropertyChangeEvent with the AffineTransforms representing the previous and new values for scale and offset

Specified by:
setScale in interface MutableTransformer
Parameters:
scalex -
scaley -

shear

public void shear(double shx,
                  double shy,
                  Point2D from)
shears the transform by passed parameters

Specified by:
shear in interface MutableTransformer
Parameters:
shx - x value to shear
shy - y value to shear

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 interface MutableTransformer
Parameters:
tx - the x value
ty - the y value

translate

public void translate(double offsetx,
                      double offsety)
Apply the passed values to the current Transform

Specified by:
translate in interface MutableTransformer
Parameters:
offsetx - the x-value
offsety - the y-value

rotate

public void rotate(double theta,
                   Point2D from)
preconcatenates the rotation at the supplied point with the current transform

Specified by:
rotate in interface MutableTransformer

rotate

public void rotate(double radians,
                   double x,
                   double y)
rotates the current transform at the supplied points

Specified by:
rotate in interface MutableTransformer

concatenate

public void concatenate(AffineTransform xform)
Specified by:
concatenate in interface MutableTransformer

preConcatenate

public void preConcatenate(AffineTransform xform)
Specified by:
preConcatenate in interface MutableTransformer

addChangeListener

public void addChangeListener(ChangeListener l)
Adds a ChangeListener.

Specified by:
addChangeListener in interface ChangeEventSupport
Parameters:
l - the listener to be added

removeChangeListener

public void removeChangeListener(ChangeListener l)
Removes a ChangeListener.

Specified by:
removeChangeListener in interface ChangeEventSupport
Parameters:
l - the listener to be removed

getChangeListeners

public ChangeListener[] getChangeListeners()
Returns an array of all the ChangeListeners added with addChangeListener().

Specified by:
getChangeListeners in interface ChangeEventSupport
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:
fireStateChanged in interface ChangeEventSupport
See Also:
EventListenerList

setToIdentity

public void setToIdentity()
Specified by:
setToIdentity in interface MutableTransformer


Copyright © 2009. All Rights Reserved.