public class FisheyeDistortion extends Distortion
Computes a graphical fisheye distortion of a graph view. This distortion allocates more space to items near the layout anchor and less space to items further away, magnifying space near the anchor and demagnifying distant space in a continuous fashion.
For more details on this form of transformation, see Manojit Sarkar and Marc H. Brown, "Graphical Fisheye Views of Graphs", in Proceedings of CHI'92, Human Factors in Computing Systems, p. 83-91, 1992. Available online at http://citeseer.ist.psu.edu/sarkar92graphical.html.
m_distortSize, m_distortX, m_distortY
m_anchor, m_bounds, m_bpts, m_insets, m_margin, m_tmpa, m_tmpb
m_group
DEFAULT_STEP_TIME, INFINITY
Constructor and Description |
---|
FisheyeDistortion()
Create a new FisheyeDistortion with default distortion factor.
|
FisheyeDistortion(double dfactor)
Create a new FisheyeDistortion with the given distortion factor
for use along both the x and y directions.
|
FisheyeDistortion(double xfactor,
double yfactor)
Create a new FisheyeDistortion with the given distortion factors
along the x and y directions.
|
Modifier and Type | Method and Description |
---|---|
protected double |
distortSize(java.awt.geom.Rectangle2D bbox,
double x,
double y,
java.awt.geom.Point2D anchor,
java.awt.geom.Rectangle2D bounds)
Returns the scaling factor by which to transform the size of an item.
|
protected double |
distortX(double x,
java.awt.geom.Point2D anchor,
java.awt.geom.Rectangle2D bounds)
Distorts an item's x-coordinate.
|
protected double |
distortY(double y,
java.awt.geom.Point2D anchor,
java.awt.geom.Rectangle2D bounds)
Distorts an item's y-coordinate.
|
double |
getXDistortionFactor()
Returns the distortion factor for the x-axis.
|
double |
getYDistortionFactor()
Returns the distortion factor for the y-axis.
|
void |
setXDistortionFactor(double d)
Sets the distortion factor for the x-axis.
|
void |
setYDistortionFactor(double d)
Sets the distortion factor for the y-axis.
|
correct, isSizeDistorted, run, setSizeDistorted
getLayoutAnchor, getLayoutBounds, setLayoutAnchor, setLayoutBounds, setMargin, setX, setY
getGroup, setGroup
getVisualization, run, setVisualization
addActivityListener, alwaysRunAfter, cancel, fireActivityCancelled, fireActivityFinished, fireActivityScheduled, fireActivityStarted, fireActivityStepped, getDuration, getNextTime, getPace, getPacingFunction, getStartTime, getStepTime, getStopTime, isEnabled, isRunning, isScheduled, removeActivityListener, run, runAfter, runAt, setDuration, setEnabled, setPacingFunction, setStartTime, setStepTime
public FisheyeDistortion()
public FisheyeDistortion(double dfactor)
dfactor
- the distortion factor (same for both axes)public FisheyeDistortion(double xfactor, double yfactor)
xfactor
- the distortion factor along the x axisyfactor
- the distortion factor along the y axispublic double getXDistortionFactor()
public void setXDistortionFactor(double d)
d
- The distortion factor to set.public double getYDistortionFactor()
public void setYDistortionFactor(double d)
d
- The distortion factor to set.protected double distortX(double x, java.awt.geom.Point2D anchor, java.awt.geom.Rectangle2D bounds)
Distortion
distortX
in class Distortion
x
- the undistorted x coordinateanchor
- the anchor or focus point of the displaybounds
- the layout boundsDistortion.distortX(double, java.awt.geom.Point2D, java.awt.geom.Rectangle2D)
protected double distortY(double y, java.awt.geom.Point2D anchor, java.awt.geom.Rectangle2D bounds)
Distortion
distortY
in class Distortion
y
- the undistorted y coordinateanchor
- the anchor or focus point of the displaybounds
- the layout boundsDistortion.distortY(double, java.awt.geom.Point2D, java.awt.geom.Rectangle2D)
protected double distortSize(java.awt.geom.Rectangle2D bbox, double x, double y, java.awt.geom.Point2D anchor, java.awt.geom.Rectangle2D bounds)
Distortion
distortSize
in class Distortion
bbox
- the bounding box of the undistorted itemx
- the x-coordinate of the distorted itemy
- the y-coordinate of the distorted itemanchor
- the anchor or focus point of the displaybounds
- the layout boundsDistortion.distortSize(java.awt.geom.Rectangle2D, double, double, java.awt.geom.Point2D, java.awt.geom.Rectangle2D)
Copyright ? 2013 Regents of the University of California