prefuse.action.distortion
Class BifocalDistortion

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.BifocalDistortion

public class BifocalDistortion
extends Distortion

Computes a bifocal distortion of space, magnifying a focus region of space and uniformly demagnifying the rest of the space. The affect is akin to passing a magnifying glass over the data.

For more details on this form of transformation, see Y. K. Leung and M. D. Apperley, "A Review and Taxonomy of Distortion-Oriented Presentation Techniques", in Transactions of Computer-Human Interaction (TOCHI), 1(2): 126-160 (1994). Available online at portal.acm.org/citation.cfm?id=180173&dl=ACM.

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
BifocalDistortion()
          Create a new BifocalDistortion with default range and magnification.
BifocalDistortion(double range, double mag)
          Create a new BifocalDistortion with the specified range and magnification.
BifocalDistortion(double xrange, double xmag, double yrange, double ymag)
          Create a new BifocalDistortion with the specified range and magnification along both axes.
 
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 a, java.awt.geom.Rectangle2D b)
          Distorts an item's x-coordinate.
protected  double distortY(double y, java.awt.geom.Point2D a, java.awt.geom.Rectangle2D b)
          Distorts an item's y-coordinate.
 double getXMagnification()
          Returns the magnification factor for the x-axis.
 double getXRange()
          Returns the range of the focal area along the x-axis.
 double getYMagnification()
          Returns the magnification factor for the y-axis.
 double getYRange()
          Returns the range of the focal area along the y-axis.
 void setXMagnification(double mx)
          Sets the magnification factor for the x-axis.
 void setXRange(double rx)
          Sets the range of the focal area along the x-axis.
 void setYMagnification(double my)
          Sets the magnification factor for the y-axis.
 void setYRange(double ry)
          Sets the range of the focal area along 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

BifocalDistortion

public BifocalDistortion()
Create a new BifocalDistortion with default range and magnification.


BifocalDistortion

public BifocalDistortion(double range,
                         double mag)

Create a new BifocalDistortion with the specified range and magnification. The same range and magnification is used for both axes.

NOTE:if the range value times the magnification value is greater than 1, the resulting distortion can exceed the display bounds.

Parameters:
range - the range around the focus that should be magnified. This specifies the size of the magnified focus region, and should be in the range of 0 to 1, 0 being no magnification range and 1 being the whole display.
mag - how much magnification should be used in the focal area

BifocalDistortion

public BifocalDistortion(double xrange,
                         double xmag,
                         double yrange,
                         double ymag)

Create a new BifocalDistortion with the specified range and magnification along both axes.

NOTE:if the range value times the magnification value is greater than 1, the resulting distortion can exceed the display bounds.

Parameters:
xrange - the range around the focus that should be magnified along the x direction. This specifies the horizontal size of the magnified focus region, and should be a value between 0 and 1, 0 indicating no focus region and 1 indicating the whole display.
xmag - how much magnification along the x direction should be used in the focal area
yrange - the range around the focus that should be magnified along the y direction. This specifies the vertical size of the magnified focus region, and should be a value between 0 and 1, 0 indicating no focus region and 1 indicating the whole display.
ymag - how much magnification along the y direction should be used in the focal area
Method Detail

distortX

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

Specified by:
distortX in class Distortion
Parameters:
x - the undistorted x coordinate
a - the anchor or focus point of the display
b - 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 a,
                          java.awt.geom.Rectangle2D b)
Description copied from class: Distortion
Distorts an item's y-coordinate.

Specified by:
distortY in class Distortion
Parameters:
y - the undistorted y coordinate
a - the anchor or focus point of the display
b - 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)

getXMagnification

public double getXMagnification()
Returns the magnification factor for the x-axis.

Returns:
Returns the magnification factor for the x-axis.

setXMagnification

public void setXMagnification(double mx)
Sets the magnification factor for the x-axis.

Parameters:
mx - The magnification factor for the x-axis.

getYMagnification

public double getYMagnification()
Returns the magnification factor for the y-axis.

Returns:
Returns the magnification factor for the y-axis.

setYMagnification

public void setYMagnification(double my)
Sets the magnification factor for the y-axis.

Parameters:
my - The magnification factor for the y-axis.

getXRange

public double getXRange()
Returns the range of the focal area along the x-axis.

Returns:
Returns the range of the focal area along the x-axis.

setXRange

public void setXRange(double rx)
Sets the range of the focal area along the x-axis.

Parameters:
rx - The focal range for the x-axis, a value between 0 and 1.

getYRange

public double getYRange()
Returns the range of the focal area along the y-axis.

Returns:
Returns the range of the focal area along the y-axis.

setYRange

public void setYRange(double ry)
Sets the range of the focal area along the y-axis.

Parameters:
ry - The focal range for the y-axis, a value between 0 and 1.


Copyright © 2007 Regents of the University of California