public class BifocalDistortion extends Distortion
Computes a bifocal distortion of space, magnifying a focus region of space and uniformly de-magnifying 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_distortYm_anchor, m_bounds, m_bpts, m_insets, m_margin, m_tmpa, m_tmpbm_groupDEFAULT_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, setSizeDistortedgetLayoutAnchor, getLayoutBounds, setLayoutAnchor, setLayoutBounds, setMargin, setX, setYgetGroup, setGroupgetVisualization, run, setVisualizationaddActivityListener, 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, setStepTimepublic 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)
DistortiondistortX in class Distortionx - 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)
DistortiondistortY in class Distortiony - 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)
DistortiondistortSize in class DistortionbBox - 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.