Class LensTransformer
- java.lang.Object
-
- org.jungrapht.visualization.transform.MutableTransformerDecorator
-
- org.jungrapht.visualization.transform.LensTransformer
-
- All Implemented Interfaces:
BidirectionalTransformer
,MutableTransformer
,ShapeTransformer
,ChangeEventSupport
- Direct Known Subclasses:
HyperbolicTransformer
,MagnifyTransformer
public abstract class LensTransformer extends MutableTransformerDecorator implements MutableTransformer
LensTransformer wraps a MutableAffineTransformer and modifies the transform and inverseTransform methods so that they create a projection of the graph points within an elliptical lens.LensTransformer uses an affine transform to cause translation, scaling, rotation, and shearing while applying a possibly non-affine filter in its transform and inverseTransform methods.
- Author:
- Tom Nelson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LensTransformer.Builder<T extends LensTransformer,B extends LensTransformer.Builder<T,B>>
-
Field Summary
Fields Modifier and Type Field Description protected Lens
lens
-
Fields inherited from class org.jungrapht.visualization.transform.MutableTransformerDecorator
delegate
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LensTransformer(Dimension d)
protected
LensTransformer(Dimension d, MutableTransformer delegate)
protected
LensTransformer(Lens lens)
Create an instance with a possibly shared lens.protected
LensTransformer(Lens lens, MutableTransformer delegate)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Lens
getLens()
Point2D
inverseTransform(double x, double y)
abstract Point2D
inverseTransform(Point2D viewPoint)
override base class to un-project the fisheye effectvoid
setToIdentity()
Point2D
transform(double x, double y)
abstract Point2D
transform(Point2D graphPoint)
override base class transform to project the fisheye effect-
Methods inherited from class org.jungrapht.visualization.transform.MutableTransformerDecorator
addChangeListener, concatenate, fireStateChanged, getChangeListeners, getDelegate, getRotation, getScale, getScaleX, getScaleY, getShearX, getShearY, getTransform, getTranslateX, getTranslateY, inverseTransform, preConcatenate, removeChangeListener, rotate, rotate, scale, scale, setDelegate, setScale, setTranslate, shear, transform, translate
-
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.util.ChangeEventSupport
addChangeListener, fireStateChanged, getChangeListeners, removeChangeListener
-
Methods inherited from interface org.jungrapht.visualization.transform.MutableTransformer
concatenate, getRotation, getScale, getScaleX, getScaleY, getShearX, getShearY, getTransform, getTranslateX, getTranslateY, preConcatenate, rotate, rotate, scale, scale, setScale, setTranslate, shear, translate
-
Methods inherited from interface org.jungrapht.visualization.transform.shape.ShapeTransformer
inverseTransform, transform
-
-
-
-
Field Detail
-
lens
protected Lens lens
-
-
Constructor Detail
-
LensTransformer
protected LensTransformer(Dimension d)
- Parameters:
d
- the size used for the lens
-
LensTransformer
protected LensTransformer(Lens lens)
Create an instance with a possibly shared lens.- Parameters:
lens
-
-
LensTransformer
protected LensTransformer(Dimension d, MutableTransformer delegate)
- Parameters:
d
- the size used for the lensdelegate
- the layoutTransformer to use
-
LensTransformer
protected LensTransformer(Lens lens, MutableTransformer delegate)
- Parameters:
lens
-delegate
- the layoutTransformer to use
-
-
Method Detail
-
getLens
public Lens getLens()
-
setToIdentity
public void setToIdentity()
- Specified by:
setToIdentity
in interfaceMutableTransformer
- Overrides:
setToIdentity
in classMutableTransformerDecorator
-
transform
public abstract Point2D transform(Point2D graphPoint)
override base class transform to project the fisheye effect- Specified by:
transform
in interfaceBidirectionalTransformer
- Overrides:
transform
in classMutableTransformerDecorator
- Parameters:
graphPoint
- graph point to convert- Returns:
- screen point
-
transform
public Point2D transform(double x, double y)
- Specified by:
transform
in interfaceBidirectionalTransformer
-
inverseTransform
public abstract Point2D inverseTransform(Point2D viewPoint)
override base class to un-project the fisheye effect- Specified by:
inverseTransform
in interfaceBidirectionalTransformer
- Overrides:
inverseTransform
in classMutableTransformerDecorator
- Parameters:
viewPoint
- screen point to convert- Returns:
- the graph point
-
inverseTransform
public Point2D inverseTransform(double x, double y)
- Specified by:
inverseTransform
in interfaceBidirectionalTransformer
-
-