Class MutableTransformerDecorator
- java.lang.Object
-
- org.jungrapht.visualization.transform.MutableTransformerDecorator
-
- All Implemented Interfaces:
BidirectionalTransformer,MutableTransformer,ShapeTransformer,ChangeEventSupport
- Direct Known Subclasses:
LensTransformer
public abstract class MutableTransformerDecorator extends Object implements MutableTransformer
a complete decorator that wraps a MutableTransformer. Subclasses use this to allow them to only declare methods they need to change.- Author:
- Tom Nelson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMutableTransformerDecorator.Builder<T extends LensTransformer,B extends MutableTransformerDecorator.Builder<T,B>>
-
Field Summary
Fields Modifier and Type Field Description protected MutableTransformerdelegate
-
Constructor Summary
Constructors Constructor Description MutableTransformerDecorator(MutableTransformer delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChangeListener(ChangeListener l)voidconcatenate(AffineTransform transform)voidfireStateChanged()ChangeListener[]getChangeListeners()Returns an array of all theChangeListeners added with addChangeListener().MutableTransformergetDelegate()doublegetRotation()doublegetScale()doublegetScaleX()doublegetScaleY()doublegetShearX()doublegetShearY()AffineTransformgetTransform()doublegetTranslateX()doublegetTranslateY()Point2DinverseTransform(Point2D p)convert the supplied screen coordinate to the graph coordinate.ShapeinverseTransform(Shape shape)voidpreConcatenate(AffineTransform transform)voidremoveChangeListener(ChangeListener l)Removes a ChangeListener.voidrotate(double radians, double x, double y)voidrotate(double radians, Point2D point)doublescale()voidscale(double sx, double sy, Point2D point)voidsetDelegate(MutableTransformer delegate)voidsetScale(double sx, double sy, Point2D point)voidsetToIdentity()voidsetTranslate(double dx, double dy)voidshear(double shx, double shy, Point2D from)Point2Dtransform(Point2D p)convert the supplied graph coordinate to the screen coordinateShapetransform(Shape shape)map a shape from graph coordinate system to the screen coordinate systemvoidtranslate(double dx, double dy)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jungrapht.visualization.transform.BidirectionalTransformer
inverseTransform, transform
-
-
-
-
Field Detail
-
delegate
protected MutableTransformer delegate
-
-
Constructor Detail
-
MutableTransformerDecorator
public MutableTransformerDecorator(MutableTransformer delegate)
-
-
Method Detail
-
getDelegate
public MutableTransformer getDelegate()
-
setDelegate
public void setDelegate(MutableTransformer delegate)
-
addChangeListener
public void addChangeListener(ChangeListener l)
- Specified by:
addChangeListenerin interfaceChangeEventSupport
-
concatenate
public void concatenate(AffineTransform transform)
- Specified by:
concatenatein interfaceMutableTransformer
-
fireStateChanged
public void fireStateChanged()
- Specified by:
fireStateChangedin interfaceChangeEventSupport
-
getChangeListeners
public ChangeListener[] getChangeListeners()
Description copied from interface:ChangeEventSupportReturns 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
-
getScale
public double getScale()
- Specified by:
getScalein interfaceMutableTransformer
-
scale
public double scale()
- Specified by:
scalein interfaceMutableTransformer
-
getScaleX
public double getScaleX()
- Specified by:
getScaleXin interfaceMutableTransformer
-
getScaleY
public double getScaleY()
- Specified by:
getScaleYin interfaceMutableTransformer
-
getShearX
public double getShearX()
- Specified by:
getShearXin interfaceMutableTransformer
-
getShearY
public double getShearY()
- Specified by:
getShearYin interfaceMutableTransformer
-
getTransform
public AffineTransform getTransform()
- Specified by:
getTransformin interfaceMutableTransformer
-
getTranslateX
public double getTranslateX()
- Specified by:
getTranslateXin interfaceMutableTransformer
-
getTranslateY
public double getTranslateY()
- Specified by:
getTranslateYin interfaceMutableTransformer
-
inverseTransform
public Point2D inverseTransform(Point2D p)
Description copied from interface:BidirectionalTransformerconvert the supplied screen coordinate to the graph coordinate.- Specified by:
inverseTransformin interfaceBidirectionalTransformer- Parameters:
p- screen point to convert- Returns:
- the graph point
-
inverseTransform
public Shape inverseTransform(Shape shape)
- Specified by:
inverseTransformin interfaceShapeTransformer
-
preConcatenate
public void preConcatenate(AffineTransform transform)
- Specified by:
preConcatenatein interfaceMutableTransformer
-
removeChangeListener
public void removeChangeListener(ChangeListener l)
Description copied from interface:ChangeEventSupportRemoves a ChangeListener.- Specified by:
removeChangeListenerin interfaceChangeEventSupport- Parameters:
l- the listener to be removed
-
rotate
public void rotate(double radians, Point2D point)- Specified by:
rotatein interfaceMutableTransformer
-
scale
public void scale(double sx, double sy, Point2D point)- Specified by:
scalein interfaceMutableTransformer
-
setScale
public void setScale(double sx, double sy, Point2D point)- Specified by:
setScalein interfaceMutableTransformer
-
setToIdentity
public void setToIdentity()
- Specified by:
setToIdentityin interfaceMutableTransformer
-
setTranslate
public void setTranslate(double dx, double dy)- Specified by:
setTranslatein interfaceMutableTransformer
-
shear
public void shear(double shx, double shy, Point2D from)- Specified by:
shearin interfaceMutableTransformer
-
transform
public Point2D transform(Point2D p)
Description copied from interface:BidirectionalTransformerconvert the supplied graph coordinate to the screen coordinate- Specified by:
transformin interfaceBidirectionalTransformer- Parameters:
p- graph point to convert- Returns:
- screen point
-
transform
public Shape transform(Shape shape)
Description copied from interface:ShapeTransformermap a shape from graph coordinate system to the screen coordinate system- Specified by:
transformin interfaceShapeTransformer- Parameters:
shape- the Shape to transform- Returns:
- a GeneralPath (Shape) representing the screen points of the shape
-
translate
public void translate(double dx, double dy)- Specified by:
translatein interfaceMutableTransformer
-
getRotation
public double getRotation()
- Specified by:
getRotationin interfaceMutableTransformer
-
rotate
public void rotate(double radians, double x, double y)- Specified by:
rotatein interfaceMutableTransformer
-
-