Class Lens
- java.lang.Object
-
- org.jungrapht.visualization.transform.Lens
-
public class Lens extends Object
Provides a magnification area (elliptical or rectangular) in a visualization
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLens.Builderbuilds a with a provided shape and initial magnificationstatic classLens.Shapesupported lens shapes are Ellipse and Rectangle
-
Field Summary
Fields Modifier and Type Field Description protected RectangularShapelensShapethe area affected by the transformprotected floatmagnification
-
Constructor Summary
Constructors Constructor Description Lens()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Lens.Builderbuilder()static Lens.Builderbuilder(Lens.Shape lensShape)Point2DgetCenter()doublegetCenterToCorner()doublegetDistanceFromCenter(Point2D p)RectangularShapegetLensShape()floatgetMagnification()doublegetRadius()doublegetRatio()voidsetCenter(Point2D viewCenter)voidsetLensShape(RectangularShape ellipse)voidsetMagnification(float magnification)voidsetRadius(double viewRadius)
-
-
-
Field Detail
-
lensShape
protected RectangularShape lensShape
the area affected by the transform
-
magnification
protected float magnification
-
-
Method Detail
-
builder
public static Lens.Builder builder(Lens.Shape lensShape)
-
builder
public static Lens.Builder builder()
-
getMagnification
public float getMagnification()
-
setMagnification
public void setMagnification(float magnification)
-
getCenter
public Point2D getCenter()
-
setCenter
public void setCenter(Point2D viewCenter)
-
getRadius
public double getRadius()
-
getCenterToCorner
public double getCenterToCorner()
-
setRadius
public void setRadius(double viewRadius)
-
getRatio
public double getRatio()
- Returns:
- the ratio between the lens height and lens width
-
setLensShape
public void setLensShape(RectangularShape ellipse)
-
getLensShape
public RectangularShape getLensShape()
-
getDistanceFromCenter
public double getDistanceFromCenter(Point2D p)
-
-