|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.berkeley.guir.lib.awt.geom.AffineTransformLib
Miscellaneous affine transform utilities.
This software is distributed under the Berkeley Software License.
Revisions: - GUIRLib-v1.3-1.0.0, Aug 03 1999, JH Created class - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH Touched for GUIRLib v1.4 release
Method Summary | |
static AffineTransform[] |
animateLinearly(AffineTransform txFinish,
int numFrames)
|
static AffineTransform[] |
animateSlowInSlowOut(AffineTransform txFinish,
int numFrames)
|
static double |
getRotationFactor(AffineTransform tx)
Given a transform, figure out its rotation factor. |
static double |
getScaleFactor(AffineTransform tx)
Given a transform, figure out its scaling factor. |
static Point2D |
getTranslateFactor(AffineTransform tx)
|
static AffineTransform[] |
interpolate(AffineTransform txStart,
AffineTransform txFinish,
Interpolation intrp,
int numFrames)
|
static void |
main(String[] argv)
|
static AffineTransform |
resize(Rectangle2D oldRect,
Rectangle2D newRect)
Calculate the AffineTransform that transforms oldRect into newRect. |
static AffineTransform |
scaleAndCenterAt(double scale,
double x,
double y,
Rectangle2D rect)
Scale, using the specified point as the new center (absolute coords) after scaling. |
static AffineTransform |
scaleAndKeepConstant(double scale,
double x,
double y)
Scale, keeping the specified point constant (ie same absolute coordinates) before and after scaling. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static AffineTransform scaleAndCenterAt(double scale, double x, double y, Rectangle2D rect)
scale
- is the scale factor to zoom in to.x
- is where we want to be centered (absolute coords).y
- is where we want to be centered (absolute coords).rect
- is the bounding box of whatever we are zooming, so we
know where to center at. For GraphicalObjects
, use getBounds2D(COORD_ABS).public static AffineTransform scaleAndKeepConstant(double scale, double x, double y)
public static AffineTransform[] interpolate(AffineTransform txStart, AffineTransform txFinish, Interpolation intrp, int numFrames)
txStart
- is our starting transform, usually identity.txFinish
- is our goal transform.interpolate
- is a function that can interpolate values for us.numFrames
- is the number of intermediate steps.public static AffineTransform[] animateLinearly(AffineTransform txFinish, int numFrames)
public static AffineTransform[] animateSlowInSlowOut(AffineTransform txFinish, int numFrames)
public static AffineTransform resize(Rectangle2D oldRect, Rectangle2D newRect)
oldRect
- is the starting Rectangle.newRect
- is the ending Rectangle.public static final double getScaleFactor(AffineTransform tx)
Because of optimizations, this method is not thread-safe.
tx
- is the AffineTransform whose scale factor we want.public static final Point2D getTranslateFactor(AffineTransform tx)
public static final double getRotationFactor(AffineTransform tx)
tx
- is the AffineTransform whose rotation factor we want.public static void main(String[] argv) throws Exception
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |