|
The Physiologist's Friend Simulation API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.unizh.ini.friend.graphics.ConcreteSeparateTransforms
public class ConcreteSeparateTransforms
Provides the facilities to keep a geometric object in its original state while buffering applied transformations. A transformed geometric object will only be created on request. The individual transformations 'general', 'scaling', 'rotation', 'translation' are kept atored individuallly each and are applied in that order.
Field Summary | |
---|---|
protected Transformable |
geometry
Transformable against which transformations are buffered |
protected AffineTransform |
rotation
The rotations. |
protected AffineTransform |
scaling
The scalings. |
protected AffineTransform |
transformation
The generic transformations. |
protected Transformable |
transformed
A transformed clone, null if uncached. |
protected AffineTransform |
translation
The translations. |
Constructor Summary | |
---|---|
ConcreteSeparateTransforms(Transformable geometry)
Creates a new instance with the given geometric object |
Method Summary | |
---|---|
Transformable |
apply(AffineTransform at)
Applies the given transformation to the geometric object. |
Object |
clone()
Clones this geometric object. |
Transformable |
getGeometry()
Returns the original geometric object. |
AffineTransform |
getRotation()
Returns the buffered rotation. |
AffineTransform |
getScaling()
Returns the buffered scaling. |
AffineTransform |
getTransformation()
Returns the buffered generic transformation. |
Transformable |
getTransformed()
Returns the transformed geometric object. |
AffineTransform |
getTranslation()
Returns the buffered translation. |
Transformable |
rotate(float phi)
Rotates the geometric object by the given angle around the origin. |
Transformable |
rotate(float phi,
float x,
float y)
Rotates the geometric object by the given angle around the given point. |
Transformable |
rotateTo(float phi)
Rotates the geometric object by the given angle around the origin. |
Transformable |
rotateTo(float phi,
float x,
float y)
Rotates the geometric object by the given angle around the given point. |
Transformable |
scale(float sx,
float sy)
Scales the geometric object by the given values in x- and y-coordinates with the origin as center. |
Transformable |
scale(float sx,
float sy,
float x,
float y)
Scales the geometric object by the given values in x- and y-coordinates with the given center (x, y). |
Transformable |
scaleTo(float sx,
float sy)
Scales the geomtric object by the given values in x- and y-coordinates with the origin as center. |
Transformable |
scaleTo(float sx,
float sy,
float x,
float y)
Scales the geomtric object by the given values in x- and y-coordinates with the given center (x, y). |
void |
setGeometry(Transformable geometry)
Sets the original geometric object. |
void |
setRotation(AffineTransform rotation)
Sets the buffered rotation. |
void |
setScaling(AffineTransform scaling)
Sets the buffered scaling. |
void |
setTransformation(AffineTransform transformation)
Sets the buffered generic transformation. |
void |
setTranslation(AffineTransform translation)
Sets the buffered translation. |
String |
toString()
return string representation of the transforms |
Transformable |
translate(float dx,
float dy)
Translates the geometric object by the given coordinates. |
Transformable |
translateTo(float dx,
float dy)
Translates the geometric object by the given coordinates. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Transformable geometry
Transformable
against which transformations are buffered
protected Transformable transformed
null
if uncached.
protected AffineTransform transformation
protected AffineTransform scaling
protected AffineTransform rotation
protected AffineTransform translation
Constructor Detail |
---|
public ConcreteSeparateTransforms(Transformable geometry)
geometry
- The geometric object the transformations will be buffered againstMethod Detail |
---|
public Transformable apply(AffineTransform at)
apply
in interface Transformable
at
- The affine transformation to apply.
public Transformable rotate(float phi)
rotate
in interface Transformable
phi
- Rotation angle.
public Transformable rotate(float phi, float x, float y)
rotate
in interface Transformable
phi
- Rotation angle.x
- x-coordinate of the rotation center.y
- y-coordinate of the rotation center.
public Transformable scale(float sx, float sy)
scale
in interface Transformable
sx
- Scalar for x-coordinates.sy
- Scalar for y-coordinates.
public Transformable scale(float sx, float sy, float x, float y)
scale
in interface Transformable
sx
- Scalar for x-coordinates.sy
- Scalar for y-coordinates.x
- x-coordinate of the center.y
- y-coordinate of the center.
public Transformable translate(float dx, float dy)
translate
in interface Transformable
dx
- Translation in x-coordinates.dy
- Translation in y-coordinates.
public Transformable getGeometry()
getGeometry
in interface SeparateTransforms
public void setGeometry(Transformable geometry)
setGeometry
in interface SeparateTransforms
geometry
- The geometric object.public Transformable getTransformed()
getTransformed
in interface BufferedTransform
getTransformed
in interface SeparateTransforms
public AffineTransform getTransformation()
getTransformation
in interface SeparateTransforms
public void setTransformation(AffineTransform transformation)
setTransformation
in interface SeparateTransforms
transformation
- The generic transformation.public AffineTransform getScaling()
getScaling
in interface SeparateTransforms
public void setScaling(AffineTransform scaling)
setScaling
in interface SeparateTransforms
scaling
- The scaling.public AffineTransform getRotation()
getRotation
in interface SeparateTransforms
public void setRotation(AffineTransform rotation)
setRotation
in interface SeparateTransforms
rotation
- The rotation.public AffineTransform getTranslation()
getTranslation
in interface SeparateTransforms
public void setTranslation(AffineTransform translation)
setTranslation
in interface SeparateTransforms
translation
- The translation.public Object clone()
clone
in interface Transformable
clone
in class Object
public Transformable rotateTo(float phi)
rotateTo
in interface SeparateTransforms
phi
- Rotation angle.
public Transformable rotateTo(float phi, float x, float y)
rotateTo
in interface SeparateTransforms
phi
- Rotation angle.x
- x-coordinate of the rotation center.y
- y-coordinate of the rotation center.
public Transformable scaleTo(float sx, float sy)
scaleTo
in interface SeparateTransforms
sx
- Scalar for x-coordinates.sy
- Scalar for y-coordinates.
public Transformable scaleTo(float sx, float sy, float x, float y)
scaleTo
in interface SeparateTransforms
sx
- Scalar for x-coordinates.sy
- Scalar for y-coordinates.x
- x-coordinate of the center.y
- y-coordinate of the center.
public Transformable translateTo(float dx, float dy)
translateTo
in interface SeparateTransforms
dx
- Translation in x-coordinates.dy
- Translation in y-coordinates.
public String toString()
toString
in class Object
|
http://www.ini.unizh.ch/~tobi/friend | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |