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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChangeEventSupport
protected MutableTransformer
protected 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 TypeMethodDescriptionvoid
void
Returns an array of all theChangeListener
s added with addChangeListener().protected MutableTransformer
getTransformer
(Layer layer) protected MutableTransformer
protected Point2D
protected Shape
inverseLayoutTransform
(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 Point2D
protected Shape
inverseViewTransform
(Shape shape) protected Point2D
protected Shape
layoutTransform
(Shape shape) void
Removes a ChangeListener.protected void
setLayoutTransformer
(MutableTransformer Function) void
void
setTransformer
(Layer layer, MutableTransformer Function) protected void
setViewTransformer
(MutableTransformer Function) void
convert the supplied graph coordinate to the screen coordinatemap a shape from graph coordinate system to the screen coordinate systemprotected Point2D
protected Shape
viewTransform
(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:BidirectionalTransformer
convert the supplied screen coordinate to the graph coordinate.- Specified by:
inverseTransform
in interfaceBidirectionalTransformer
- Parameters:
p
- screen point to convert- Returns:
- the graph point
-
inverseViewTransform
-
inverseLayoutTransform
-
transform
Description copied from interface:BidirectionalTransformer
convert the supplied graph coordinate to the screen coordinate- Specified by:
transform
in interfaceBidirectionalTransformer
- Parameters:
p
- graph point to convert- Returns:
- screen point
-
viewTransform
-
layoutTransform
-
inverseTransform
- Specified by:
inverseTransform
in interfaceShapeTransformer
-
inverseViewTransform
-
inverseLayoutTransform
-
transform
Description copied from interface:ShapeTransformer
map a shape from graph coordinate system to the screen coordinate system- Specified by:
transform
in 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:
setToIdentity
in interfaceMultiLayerTransformer
-
addChangeListener
- Specified by:
addChangeListener
in interfaceChangeEventSupport
-
removeChangeListener
Description copied from interface:ChangeEventSupport
Removes a ChangeListener.- Specified by:
removeChangeListener
in interfaceChangeEventSupport
- Parameters:
l
- the listener to be removed
-
getChangeListeners
Description copied from interface:ChangeEventSupport
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()- Specified by:
fireStateChanged
in interfaceChangeEventSupport
-
stateChanged
- Specified by:
stateChanged
in interfaceChangeListener
-
getTransformer
- Specified by:
getTransformer
in interfaceMultiLayerTransformer
-
inverseTransform
- Specified by:
inverseTransform
in interfaceMultiLayerTransformer
-
setTransformer
- Specified by:
setTransformer
in interfaceMultiLayerTransformer
-
transform
- Specified by:
transform
in interfaceMultiLayerTransformer
-
transform
- Specified by:
transform
in interfaceMultiLayerTransformer
-
inverseTransform
- Specified by:
inverseTransform
in interfaceMultiLayerTransformer
-