Package edu.uci.ics.jung.visualization
Class BasicTransformer
java.lang.Object
edu.uci.ics.jung.visualization.BasicTransformer
- All Implemented Interfaces:
MultiLayerTransformer,BidirectionalTransformer,ShapeTransformer,ChangeEventSupport,EventListener,ChangeListener
public class BasicTransformer
extends Object
implements MultiLayerTransformer, ShapeTransformer, ChangeListener, ChangeEventSupport
A basic implementation of the MultiLayerTransformer interface that
provides two Layers: VIEW and LAYOUT. It also provides ChangeEventSupport
- Author:
- Tom Nelson - tomnelson@dev.java.net
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChangeEventSupportprotected MutableTransformerprotected MutableTransformer -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance and notifies the view and layout Functions to listen to changes published by this instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidReturns an array of all theChangeListeners added with addChangeListener().protected MutableTransformergetTransformer(Layer layer) protected MutableTransformerprotected Point2Dprotected ShapeinverseLayoutTransform(Shape shape) inverseTransform(Layer layer, Point2D p) inverseTransform(Layer layer, Shape shape) convert the supplied screen coordinate to the graph coordinate.inverseTransform(Shape shape) protected Point2Dprotected ShapeinverseViewTransform(Shape shape) protected Point2Dprotected ShapelayoutTransform(Shape shape) voidRemoves a ChangeListener.protected voidsetLayoutTransformer(MutableTransformer Function) voidvoidsetTransformer(Layer layer, MutableTransformer Function) protected voidsetViewTransformer(MutableTransformer Function) voidconvert the supplied graph coordinate to the screen coordinatemap a shape from graph coordinate system to the screen coordinate systemprotected Point2Dprotected ShapeviewTransform(Shape shape)
-
Field Details
-
changeSupport
-
viewTransformer
-
layoutTransformer
-
-
Constructor Details
-
BasicTransformer
public BasicTransformer()Creates an instance and notifies the view and layout Functions to listen to changes published by this instance.
-
-
Method Details
-
setViewTransformer
-
setLayoutTransformer
-
getLayoutTransformer
-
getViewTransformer
-
inverseTransform
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
-
inverseViewTransform
-
inverseLayoutTransform
-
transform
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
-
viewTransform
-
layoutTransform
-
inverseTransform
- Specified by:
inverseTransformin interfaceShapeTransformer
-
inverseViewTransform
-
inverseLayoutTransform
-
transform
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
-
viewTransform
-
layoutTransform
-
setToIdentity
public void setToIdentity()- Specified by:
setToIdentityin interfaceMultiLayerTransformer
-
addChangeListener
- Specified by:
addChangeListenerin interfaceChangeEventSupport
-
removeChangeListener
Description copied from interface:ChangeEventSupportRemoves a ChangeListener.- Specified by:
removeChangeListenerin interfaceChangeEventSupport- Parameters:
l- the listener to be removed
-
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
-
fireStateChanged
public void fireStateChanged()- Specified by:
fireStateChangedin interfaceChangeEventSupport
-
stateChanged
- Specified by:
stateChangedin interfaceChangeListener
-
getTransformer
- Specified by:
getTransformerin interfaceMultiLayerTransformer
-
inverseTransform
- Specified by:
inverseTransformin interfaceMultiLayerTransformer
-
setTransformer
- Specified by:
setTransformerin interfaceMultiLayerTransformer
-
transform
- Specified by:
transformin interfaceMultiLayerTransformer
-
transform
- Specified by:
transformin interfaceMultiLayerTransformer
-
inverseTransform
- Specified by:
inverseTransformin interfaceMultiLayerTransformer
-