|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.visualization.transform.MutableTransformerDecorator
edu.uci.ics.jung.visualization.transform.LensTransformer
public abstract class LensTransformer
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.
Nested Class Summary | |
---|---|
protected class |
LensTransformer.ComponentListenerImpl
react to size changes on a component |
protected static class |
LensTransformer.PolarPoint
a convenience class to represent a point in polar coordinates |
Field Summary | |
---|---|
protected Ellipse2D |
ellipse
the area affected by the transform |
protected float |
magnification
|
Fields inherited from class edu.uci.ics.jung.visualization.transform.MutableTransformerDecorator |
---|
delegate |
Constructor Summary | |
---|---|
LensTransformer(Component component)
create an instance, setting values from the passed component and registering to listen for size changes on the component |
|
LensTransformer(Component component,
MutableTransformer delegate)
create an instance with a possibly shared transform |
Method Summary | |
---|---|
protected LensTransformer.PolarPoint |
cartesianToPolar(double x,
double y)
Returns the result of converting (x, y) to polar coordinates. |
protected LensTransformer.PolarPoint |
cartesianToPolar(Point2D point)
Returns the result of converting point to polar coordinates. |
double |
getDistanceFromCenter(Point2D p)
|
Ellipse2D |
getEllipse()
|
float |
getMagnification()
|
double |
getRatio()
|
Point2D |
getViewCenter()
|
double |
getViewRadius()
|
abstract Point2D |
inverseTransform(Point2D viewPoint)
override base class to un-project the fisheye effect |
protected Point2D |
polarToCartesian(double theta,
double radius)
Returns the result of converting (theta, radius) to Cartesian coordinates. |
protected Point2D |
polarToCartesian(LensTransformer.PolarPoint polar)
Returns the result of converting polar to Cartesian coordinates. |
void |
setEllipse(Ellipse2D ellipse)
|
void |
setMagnification(float magnification)
|
void |
setToIdentity()
|
void |
setViewCenter(Point2D viewCenter)
|
void |
setViewRadius(double viewRadius)
|
abstract Point2D |
transform(Point2D graphPoint)
override base class transform to project the fisheye effect |
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, inverseTransform, preConcatenate, removeChangeListener, rotate, rotate, 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 edu.uci.ics.jung.visualization.transform.MutableTransformer |
---|
concatenate, getRotation, getScale, getScaleX, getScaleY, getShearX, getShearY, getTransform, getTranslateX, getTranslateY, preConcatenate, rotate, rotate, scale, setScale, setTranslate, shear, translate |
Methods inherited from interface edu.uci.ics.jung.visualization.transform.shape.ShapeTransformer |
---|
inverseTransform, transform |
Methods inherited from interface edu.uci.ics.jung.utils.ChangeEventSupport |
---|
addChangeListener, fireStateChanged, getChangeListeners, removeChangeListener |
Field Detail |
---|
protected Ellipse2D ellipse
protected float magnification
Constructor Detail |
---|
public LensTransformer(Component component)
component
- public LensTransformer(Component component, MutableTransformer delegate)
component
- delegate
- Method Detail |
---|
public float getMagnification()
public void setMagnification(float magnification)
magnification
- The magnification to set.public Point2D getViewCenter()
public void setViewCenter(Point2D viewCenter)
viewCenter
- The viewCenter to set.public double getViewRadius()
public void setViewRadius(double viewRadius)
viewRadius
- The viewRadius to set.public double getRatio()
public void setEllipse(Ellipse2D ellipse)
public Ellipse2D getEllipse()
public void setToIdentity()
setToIdentity
in interface MutableTransformer
setToIdentity
in class MutableTransformerDecorator
protected Point2D polarToCartesian(LensTransformer.PolarPoint polar)
polar
to Cartesian coordinates.
protected Point2D polarToCartesian(double theta, double radius)
(theta, radius)
to Cartesian coordinates.
protected LensTransformer.PolarPoint cartesianToPolar(Point2D point)
point
to polar coordinates.
protected LensTransformer.PolarPoint cartesianToPolar(double x, double y)
(x, y)
to polar coordinates.
public abstract Point2D transform(Point2D graphPoint)
transform
in interface Transformer
transform
in class MutableTransformerDecorator
graphPoint
- graph point to convert
public abstract Point2D inverseTransform(Point2D viewPoint)
inverseTransform
in interface Transformer
inverseTransform
in class MutableTransformerDecorator
viewPoint
- screen point to convert
public double getDistanceFromCenter(Point2D p)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |