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.
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 |
---|
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.
|
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 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.
|
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 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.
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 areapublic 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.
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 areayrange
- 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 areaprotected double distortX(double x, java.awt.geom.Point2D a, java.awt.geom.Rectangle2D b)
Distortion
distortX
in class Distortion
x
- the undistorted x coordinatea
- the anchor or focus point of the displayb
- the layout boundsDistortion.distortX(double, java.awt.geom.Point2D, java.awt.geom.Rectangle2D)
protected double distortY(double y, java.awt.geom.Point2D a, java.awt.geom.Rectangle2D b)
Distortion
distortY
in class Distortion
y
- the undistorted y coordinatea
- the anchor or focus point of the displayb
- 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)
public double getXMagnification()
public void setXMagnification(double mx)
mx
- The magnification factor for the x-axis.public double getYMagnification()
public void setYMagnification(double my)
my
- The magnification factor for the y-axis.public double getXRange()
public void setXRange(double rx)
rx
- The focal range for the x-axis, a value between 0 and 1.public double getYRange()
public void setYRange(double ry)
ry
- The focal range for the y-axis, a value between 0 and 1.Copyright ? 2013 Regents of the University of California