Class HyperbolicTransformer
- java.lang.Object
-
- org.jungrapht.visualization.transform.MutableTransformerDecorator
-
- org.jungrapht.visualization.transform.LensTransformer
-
- org.jungrapht.visualization.transform.HyperbolicTransformer
-
- All Implemented Interfaces:
BidirectionalTransformer
,MutableTransformer
,ShapeTransformer
,ChangeEventSupport
- Direct Known Subclasses:
HyperbolicShapeTransformer
public class HyperbolicTransformer extends LensTransformer implements MutableTransformer
HyperbolicTransformer wraps a MutableAffineTransformer and modifies the transform and inverseTransform methods so that they create a fisheye projection of the graph points, with points near the center spread out and points near the edges collapsed onto the circumference of an ellipse or the boundaries of a rectangleHyperbolicTransformer is not an affine transform, but it uses an affine transform to cause translation, scaling, rotation, and shearing while applying a non-affine hyperbolic filter in its transform and inverseTransform methods.
- Author:
- Tom Nelson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HyperbolicTransformer.Builder<T extends HyperbolicTransformer,B extends HyperbolicTransformer.Builder<T,B>>
-
Field Summary
-
Fields inherited from class org.jungrapht.visualization.transform.LensTransformer
lens
-
Fields inherited from class org.jungrapht.visualization.transform.MutableTransformerDecorator
delegate
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HyperbolicTransformer(Dimension d)
Create an instance, setting values from the passed component and registering to listen for layoutSize changes on the component.protected
HyperbolicTransformer(Dimension d, MutableTransformer delegate)
create an instance, setting values from the passed component and registering to listen for layoutSize changes on the componentprotected
HyperbolicTransformer(HyperbolicTransformer.Builder builder)
protected
HyperbolicTransformer(Lens lens, MutableTransformer delegate)
Create an instance with a possibly shared transform.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends HyperbolicTransformer>
HyperbolicTransformer.Builder<T,?>builder(Dimension dimension)
static <T extends HyperbolicTransformer>
HyperbolicTransformer.Builder<T,?>builder(Lens lens)
Point2D
inverseTransform(Point2D viewPoint)
override base class to un-project the fisheye effectPoint2D
transform(Point2D graphPoint)
override base class transform to project the fisheye effect-
Methods inherited from class org.jungrapht.visualization.transform.LensTransformer
getLens, inverseTransform, setToIdentity, transform
-
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.transform.BidirectionalTransformer
inverseTransform, transform
-
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, setToIdentity, setTranslate, shear, translate
-
Methods inherited from interface org.jungrapht.visualization.transform.shape.ShapeTransformer
inverseTransform, transform
-
-
-
-
Constructor Detail
-
HyperbolicTransformer
protected HyperbolicTransformer(HyperbolicTransformer.Builder builder)
-
HyperbolicTransformer
protected HyperbolicTransformer(Dimension d)
Create an instance, setting values from the passed component and registering to listen for layoutSize changes on the component.- Parameters:
d
- the size used for the lens
-
HyperbolicTransformer
protected HyperbolicTransformer(Dimension d, MutableTransformer delegate)
create an instance, setting values from the passed component and registering to listen for layoutSize changes on the component- Parameters:
d
- the size used for the lens
-
HyperbolicTransformer
protected HyperbolicTransformer(Lens lens, MutableTransformer delegate)
Create an instance with a possibly shared transform.- Parameters:
lens
- a lens created elsewhere, but on the same component
-
-
Method Detail
-
builder
public static <T extends HyperbolicTransformer> HyperbolicTransformer.Builder<T,?> builder(Lens lens)
-
builder
public static <T extends HyperbolicTransformer> HyperbolicTransformer.Builder<T,?> builder(Dimension dimension)
-
transform
public Point2D transform(Point2D graphPoint)
override base class transform to project the fisheye effect- Specified by:
transform
in interfaceBidirectionalTransformer
- Specified by:
transform
in classLensTransformer
- Parameters:
graphPoint
- graph point to convert- Returns:
- screen point
-
inverseTransform
public Point2D inverseTransform(Point2D viewPoint)
override base class to un-project the fisheye effect- Specified by:
inverseTransform
in interfaceBidirectionalTransformer
- Specified by:
inverseTransform
in classLensTransformer
- Parameters:
viewPoint
- screen point to convert- Returns:
- the graph point
-
-