The Physiologist's Friend Simulation API

ch.unizh.ini.friend.graphics
Class AbstractTransformable

java.lang.Object
  extended by ch.unizh.ini.friend.graphics.AbstractTransformable
All Implemented Interfaces:
Transformable, Cloneable
Direct Known Subclasses:
ConvexPolygon

public abstract class AbstractTransformable
extends Object
implements Transformable

Provides default implementations for all methods of Transformable except apply on which all other methods depend.

Version:
$Revision: 1.5 $
Author:
Christof Marti

Constructor Summary
AbstractTransformable()
           
 
Method Summary
 Object clone()
          Clones this geometric object.
 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 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 translate(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, toString, wait, wait, wait
 
Methods inherited from interface ch.unizh.ini.friend.graphics.Transformable
apply
 

Constructor Detail

AbstractTransformable

public AbstractTransformable()
Method Detail

rotate

public Transformable rotate(float phi)
Rotates the geometric object by the given angle around the origin.

Specified by:
rotate in interface Transformable
Parameters:
phi - Rotation angle.
Returns:
this for easy concatenation or a transformed clone.

rotate

public Transformable rotate(float phi,
                            float x,
                            float y)
Rotates the geometric object by the given angle around the given point.

Specified by:
rotate in interface Transformable
Parameters:
phi - Rotation angle.
x - x-coordinate of the rotation center.
y - y-coordinate of the rotation center.
Returns:
this for easy concatenation or a transformed clone.

scale

public Transformable scale(float sx,
                           float sy)
Scales the geometric object by the given values in x- and y-coordinates with the origin as center.

Specified by:
scale in interface Transformable
Parameters:
sx - Scalar for x-coordinates.
sy - Scalar for y-coordinates.
Returns:
this for easy concatenation or a transformed clone.

scale

public 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).

Specified by:
scale in interface Transformable
Parameters:
sx - Scalar for x-coordinates.
sy - Scalar for y-coordinates.
x - x-coordinate of the center.
y - y-coordinate of the center.
Returns:
this for easy concatenation or a transformed clone.

translate

public Transformable translate(float dx,
                               float dy)
Translates the geometric object by the given coordinates.

Specified by:
translate in interface Transformable
Parameters:
dx - Translation in x-coordinates.
dy - Translation in y-coordinates.
Returns:
this for easy concatenation or a transformed clone.

clone

public Object clone()
Clones this geometric object.

Specified by:
clone in interface Transformable
Overrides:
clone in class Object
Returns:
The clone.

http://www.ini.unizh.ch/~tobi/friend