public abstract class Distortion extends Layout
Modifier and Type | Field and Description |
---|---|
protected boolean |
m_distortSize |
protected boolean |
m_distortX |
protected boolean |
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 |
---|
Distortion()
Create a new Distortion instance.
|
Distortion(java.lang.String group)
Create a new Distortion instance that processes the given data group.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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
protected boolean m_distortSize
protected boolean m_distortX
protected boolean m_distortY
public Distortion()
public Distortion(java.lang.String group)
group
- the data group processed by this Distortion instancepublic void setSizeDistorted(boolean s)
s
- true to distort size, false to distort positions onlypublic boolean isSizeDistorted()
public void run(double frac)
Action
run
in class GroupAction
frac
- the fraction of this Action's duration that has elapsed.Action.run(double)
protected java.awt.geom.Point2D correct(java.awt.geom.Point2D anchor, java.awt.geom.Rectangle2D bounds)
anchor
- the un-corrected anchor pointbounds
- the layout boundsprotected abstract double distortX(double x, java.awt.geom.Point2D anchor, java.awt.geom.Rectangle2D bounds)
x
- the undistorted x coordinateanchor
- the anchor or focus point of the displaybounds
- the layout boundsprotected abstract double distortY(double y, java.awt.geom.Point2D anchor, java.awt.geom.Rectangle2D bounds)
y
- the undistorted y coordinateanchor
- the anchor or focus point of the displaybounds
- the layout boundsprotected abstract double distortSize(java.awt.geom.Rectangle2D bbox, double x, double y, java.awt.geom.Point2D anchor, java.awt.geom.Rectangle2D bounds)
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 boundsCopyright ? 2013 Regents of the University of California