prefuse.action.distortion
Class Distortion

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
Direct Known Subclasses:
BifocalDistortion, FisheyeDistortion

public abstract class Distortion
extends Layout

Abstract base class providing a structure for space-distortion techniques.

Version:
1.0
Author:
jeffrey heer

Field Summary
protected  boolean m_distortSize
           
protected  boolean m_distortX
           
protected  boolean 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
Distortion()
          Create a new Distortion instance.
Distortion(java.lang.String group)
          Create a new Distortion instance that processes the given data group.
 
Method Summary
protected  java.awt.geom.Point2D correct(java.awt.geom.Point2D anchor, java.awt.geom.Rectangle2D bounds)
          Corrects the anchor position, such that if the anchor is outside the layout bounds, the anchor is adjusted to be the nearest point on the edge of the bounds.
protected abstract  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 abstract  double distortX(double x, java.awt.geom.Point2D anchor, java.awt.geom.Rectangle2D bounds)
          Distorts an item's x-coordinate.
protected abstract  double distortY(double y, java.awt.geom.Point2D anchor, java.awt.geom.Rectangle2D bounds)
          Distorts an item's y-coordinate.
 boolean isSizeDistorted()
          Indicates whether the item sizes are distorted along with the item locations.
 void run(double frac)
          Runs this Action, triggering whatever processing this Action performs.
 void setSizeDistorted(boolean s)
          Controls whether item sizes are distorted along with the item locations.
 
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
 

Field Detail

m_distortSize

protected boolean m_distortSize

m_distortX

protected boolean m_distortX

m_distortY

protected boolean m_distortY
Constructor Detail

Distortion

public Distortion()
Create a new Distortion instance.


Distortion

public Distortion(java.lang.String group)
Create a new Distortion instance that processes the given data group.

Parameters:
group - the data group processed by this Distortion instance
Method Detail

setSizeDistorted

public void setSizeDistorted(boolean s)
Controls whether item sizes are distorted along with the item locations.

Parameters:
s - true to distort size, false to distort positions only

isSizeDistorted

public boolean isSizeDistorted()
Indicates whether the item sizes are distorted along with the item locations.

Returns:
true if item sizes are distorted by this action, false otherwise

run

public void run(double frac)
Description copied from class: Action
Runs this Action, triggering whatever processing this Action performs. Subclass this method to create custom Actions.

Specified by:
run in class GroupAction
Parameters:
frac - the fraction of this Action's duration that has elapsed.
See Also:
Action.run(double)

correct

protected java.awt.geom.Point2D correct(java.awt.geom.Point2D anchor,
                                        java.awt.geom.Rectangle2D bounds)
Corrects the anchor position, such that if the anchor is outside the layout bounds, the anchor is adjusted to be the nearest point on the edge of the bounds.

Parameters:
anchor - the un-corrected anchor point
bounds - the layout bounds
Returns:
the corrected anchor point

distortX

protected abstract double distortX(double x,
                                   java.awt.geom.Point2D anchor,
                                   java.awt.geom.Rectangle2D bounds)
Distorts an item's x-coordinate.

Parameters:
x - the undistorted x coordinate
anchor - the anchor or focus point of the display
bounds - the layout bounds
Returns:
the distorted x-coordinate

distortY

protected abstract double distortY(double y,
                                   java.awt.geom.Point2D anchor,
                                   java.awt.geom.Rectangle2D bounds)
Distorts an item's y-coordinate.

Parameters:
y - the undistorted y coordinate
anchor - the anchor or focus point of the display
bounds - the layout bounds
Returns:
the distorted y-coordinate

distortSize

protected abstract 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.

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


Copyright © 2007 Regents of the University of California