prefuse.action.distortion
Class FisheyeDistortion

java.lang.Object
  extended by prefuse.activity.Activity
      extended by prefuse.action.Action
          extended by prefuse.action.GroupAction
              extended by prefuse.action.layout.Layout
                  extended by prefuse.action.distortion.Distortion
                      extended by prefuse.action.distortion.FisheyeDistortion

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.

Author:
jeffrey heer

Field Summary
 
Fields inherited from class prefuse.action.distortion.Distortion
m_distortSize, m_distortX, m_distortY
 
Fields inherited from class prefuse.action.layout.Layout
m_anchor, m_bounds, m_bpts, m_insets, m_margin, m_tmpa, m_tmpb
 
Fields inherited from class prefuse.action.GroupAction
m_group
 
Fields inherited from class prefuse.action.Action
m_vis
 
Fields inherited from class prefuse.activity.Activity
DEFAULT_STEP_TIME, INFINITY
 
Constructor Summary
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.
 
Method Summary
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.
 
Methods inherited from class prefuse.action.distortion.Distortion
correct, isSizeDistorted, run, setSizeDistorted
 
Methods inherited from class prefuse.action.layout.Layout
getLayoutAnchor, getLayoutBounds, setLayoutAnchor, setLayoutBounds, setMargin, setX, setY
 
Methods inherited from class prefuse.action.GroupAction
getGroup, setGroup
 
Methods inherited from class prefuse.action.Action
getVisualization, run, setVisualization
 
Methods inherited from class prefuse.activity.Activity
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FisheyeDistortion

public FisheyeDistortion()
Create a new FisheyeDistortion with default distortion factor.


FisheyeDistortion

public FisheyeDistortion(double dfactor)
Create a new FisheyeDistortion with the given distortion factor for use along both the x and y directions.

Parameters:
dfactor - the distortion factor (same for both axes)

FisheyeDistortion

public FisheyeDistortion(double xfactor,
                         double yfactor)
Create a new FisheyeDistortion with the given distortion factors along the x and y directions.

Parameters:
xfactor - the distortion factor along the x axis
yfactor - the distortion factor along the y axis
Method Detail

getXDistortionFactor

public double getXDistortionFactor()
Returns the distortion factor for the x-axis.

Returns:
returns the distortion factor for the x-axis.

setXDistortionFactor

public void setXDistortionFactor(double d)
Sets the distortion factor for the x-axis.

Parameters:
d - The distortion factor to set.

getYDistortionFactor

public double getYDistortionFactor()
Returns the distortion factor for the y-axis.

Returns:
returns the distortion factor for the y-axis.

setYDistortionFactor

public void setYDistortionFactor(double d)
Sets the distortion factor for the y-axis.

Parameters:
d - The distortion factor to set.

distortX

protected double distortX(double x,
                          java.awt.geom.Point2D anchor,
                          java.awt.geom.Rectangle2D bounds)
Description copied from class: Distortion
Distorts an item's x-coordinate.

Specified by:
distortX in class Distortion
Parameters:
x - the undistorted x coordinate
anchor - the anchor or focus point of the display
bounds - the layout bounds
Returns:
the distorted x-coordinate
See Also:
Distortion.distortX(double, java.awt.geom.Point2D, java.awt.geom.Rectangle2D)

distortY

protected double distortY(double y,
                          java.awt.geom.Point2D anchor,
                          java.awt.geom.Rectangle2D bounds)
Description copied from class: Distortion
Distorts an item's y-coordinate.

Specified by:
distortY in class Distortion
Parameters:
y - the undistorted y coordinate
anchor - the anchor or focus point of the display
bounds - the layout bounds
Returns:
the distorted y-coordinate
See Also:
Distortion.distortY(double, java.awt.geom.Point2D, java.awt.geom.Rectangle2D)

distortSize

protected double distortSize(java.awt.geom.Rectangle2D bbox,
                             double x,
                             double y,
                             java.awt.geom.Point2D anchor,
                             java.awt.geom.Rectangle2D bounds)
Description copied from class: Distortion
Returns the scaling factor by which to transform the size of an item.

Specified by:
distortSize in class Distortion
Parameters:
bbox - the bounding box of the undistorted item
x - the x-coordinate of the distorted item
y - the y-coordinate of the distorted item
anchor - the anchor or focus point of the display
bounds - the layout bounds
Returns:
the scaling factor by which to change the size
See Also:
Distortion.distortSize(java.awt.geom.Rectangle2D, double, double, java.awt.geom.Point2D, java.awt.geom.Rectangle2D)


Copyright © 2007 Regents of the University of California