Class MagnifyShapeTransformer
- java.lang.Object
-
- edu.uci.ics.jung.visualization.transform.MutableTransformerDecorator
-
- edu.uci.ics.jung.visualization.transform.LensTransformer
-
- edu.uci.ics.jung.visualization.transform.MagnifyTransformer
-
- edu.uci.ics.jung.visualization.transform.shape.MagnifyShapeTransformer
-
- All Implemented Interfaces:
BidirectionalTransformer
,MutableTransformer
,ShapeFlatnessTransformer
,ShapeTransformer
,ChangeEventSupport
public class MagnifyShapeTransformer extends MagnifyTransformer implements ShapeFlatnessTransformer
MagnifyShapeTransformer extends MagnifyTransformer and adds implementations for methods in ShapeTransformer. It modifies the shapes (Vertex, Edge, and Arrowheads) so that they are enlarged by the magnify transformation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.uci.ics.jung.visualization.transform.LensTransformer
LensTransformer.ComponentListenerImpl
-
-
Field Summary
-
Fields inherited from class edu.uci.ics.jung.visualization.transform.LensTransformer
lensShape, magnification
-
Fields inherited from class edu.uci.ics.jung.visualization.transform.MutableTransformerDecorator
delegate
-
-
Constructor Summary
Constructors Constructor Description MagnifyShapeTransformer(java.awt.Component component)
Create an instance, setting values from the passed component and registering to listen for size changes on the component.MagnifyShapeTransformer(java.awt.Component component, MutableTransformer delegate)
Create an instance, setting values from the passed component and registering to listen for size changes on the component, with a possibly shared transformdelegate
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.awt.geom.Point2D
_inverseTransform(java.awt.geom.Point2D viewPoint)
override base class to un-project the fisheye effectprivate java.awt.geom.Point2D
_transform(java.awt.geom.Point2D graphPoint)
java.awt.Shape
inverseTransform(java.awt.Shape shape)
Returns the supplied shape, translated to the coordinates that result from calling inverseTransform on its center.java.awt.Shape
magnify(java.awt.Shape shape)
Magnify the shape, without considering the Lens.java.awt.Shape
magnify(java.awt.Shape shape, float flatness)
java.awt.Shape
transform(java.awt.Shape shape)
Transform the supplied shape with the overridden transform method so that the shape is distorted by the magnify transform.java.awt.Shape
transform(java.awt.Shape shape, float flatness)
map a shape from graph coordinate system to the screen coordinate system-
Methods inherited from class edu.uci.ics.jung.visualization.transform.MagnifyTransformer
inverseTransform, magnify, transform
-
Methods inherited from class edu.uci.ics.jung.visualization.transform.LensTransformer
getDistanceFromCenter, getLensShape, getMagnification, getRatio, getViewCenter, getViewRadius, setLensShape, setMagnification, setToIdentity, setViewCenter, setViewRadius
-
Methods inherited from class edu.uci.ics.jung.visualization.transform.MutableTransformerDecorator
addChangeListener, concatenate, fireStateChanged, getChangeListeners, getDelegate, getRotation, getScale, getScaleX, getScaleY, getShearX, getShearY, getTransform, getTranslateX, getTranslateY, preConcatenate, removeChangeListener, rotate, rotate, scale, setDelegate, setScale, setTranslate, shear, translate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.uci.ics.jung.visualization.transform.BidirectionalTransformer
inverseTransform, transform
-
Methods inherited from interface edu.uci.ics.jung.visualization.util.ChangeEventSupport
addChangeListener, fireStateChanged, getChangeListeners, removeChangeListener
-
Methods inherited from interface edu.uci.ics.jung.visualization.transform.MutableTransformer
concatenate, getRotation, getScale, getScaleX, getScaleY, getShearX, getShearY, getTransform, getTranslateX, getTranslateY, preConcatenate, rotate, rotate, scale, setScale, setToIdentity, setTranslate, shear, translate
-
-
-
-
Constructor Detail
-
MagnifyShapeTransformer
public MagnifyShapeTransformer(java.awt.Component component)
Create an instance, setting values from the passed component and registering to listen for size changes on the component.- Parameters:
component
- the component used for rendering
-
MagnifyShapeTransformer
public MagnifyShapeTransformer(java.awt.Component component, MutableTransformer delegate)
Create an instance, setting values from the passed component and registering to listen for size changes on the component, with a possibly shared transformdelegate
.- Parameters:
component
- the component used for renderingdelegate
- the transformer to use
-
-
Method Detail
-
transform
public java.awt.Shape transform(java.awt.Shape shape)
Transform the supplied shape with the overridden transform method so that the shape is distorted by the magnify transform.- Specified by:
transform
in interfaceShapeTransformer
- Overrides:
transform
in classLensTransformer
- Parameters:
shape
- a shape to transform- Returns:
- a GeneralPath for the transformed shape
-
transform
public java.awt.Shape transform(java.awt.Shape shape, float flatness)
Description copied from interface:ShapeFlatnessTransformer
map a shape from graph coordinate system to the screen coordinate system- Specified by:
transform
in interfaceShapeFlatnessTransformer
- Parameters:
shape
- the shape to be transformedflatness
- used to break the supplied shape into segments- Returns:
- a GeneralPath (Shape) representing the screen points of the shape
-
inverseTransform
public java.awt.Shape inverseTransform(java.awt.Shape shape)
Description copied from class:LensTransformer
Returns the supplied shape, translated to the coordinates that result from calling inverseTransform on its center.- Specified by:
inverseTransform
in interfaceShapeTransformer
- Overrides:
inverseTransform
in classLensTransformer
-
_transform
private java.awt.geom.Point2D _transform(java.awt.geom.Point2D graphPoint)
-
_inverseTransform
private java.awt.geom.Point2D _inverseTransform(java.awt.geom.Point2D viewPoint)
override base class to un-project the fisheye effect
-
magnify
public java.awt.Shape magnify(java.awt.Shape shape)
Magnify the shape, without considering the Lens.- Parameters:
shape
- the shape to magnify- Returns:
- the transformed shape
-
magnify
public java.awt.Shape magnify(java.awt.Shape shape, float flatness)
-
-