comirva.visu.epsgraphics.objects
Class EpsTransform

java.lang.Object
  extended by comirva.visu.epsgraphics.objects.EpsTransform
All Implemented Interfaces:
EpsObject

public class EpsTransform
extends Object
implements EpsObject

this class represents an eps transformation. It is used to represent affine transformations


Field Summary
protected  AffineTransform at
          user defined transformations
protected static String[] code
          postscript code definition
protected  boolean rad
          boolean defining whether given theta is in degree or radiant, default: rad
protected  double theta
          theta parameter for angles (in degree)
protected  int type
          transformation types.
static int TYPE_ROTATE
          rotation
static int TYPE_ROTATE2
          "extended rotation" consisting of translation, rotation, and reverse translation
static int TYPE_SCALE
          scaling
static int TYPE_SHEAR
          performs shearing
static int TYPE_TRANSFORM
          user defined transformation
static int TYPE_TRANSLATE
          translation
protected  double x
          x parameter for points/vectors
protected  double y
          y parameter for points/vectors
 
Constructor Summary
EpsTransform(AffineTransform at)
          Constructs an Eps Transformation object which is equivalent by the given AffineTransform
EpsTransform(double theta)
          Constructs an Eps Transformation object which performs a rotation by a given angle theta in degree.
EpsTransform(double theta, double x, double y)
          Constructs an Eps Transfomration object which performs an "extended rotation": Calling this method is equivalent to translate(x,y); rotate(theta); translate(-x,-y);
EpsTransform(int type, double x, double y)
          Constructs an Eps Transformation object which performs a transformation given by the parameters.
 
Method Summary
 boolean equals(Object obj)
           
 boolean isRadiant()
          ability to check if angles are treated as radiant or degree values
 void setToDegree()
          specify theta angles to be degree values (range 0-360) the given values are not changed.
 void setToRadiant()
          specify theta angles to be radiant values.
 String toEps()
          returns a String that represents the object in postscript code
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_TRANSFORM

public static final int TYPE_TRANSFORM
user defined transformation

See Also:
Constant Field Values

TYPE_SCALE

public static final int TYPE_SCALE
scaling

See Also:
Constant Field Values

TYPE_TRANSLATE

public static final int TYPE_TRANSLATE
translation

See Also:
Constant Field Values

TYPE_ROTATE

public static final int TYPE_ROTATE
rotation

See Also:
Constant Field Values

TYPE_ROTATE2

public static final int TYPE_ROTATE2
"extended rotation" consisting of translation, rotation, and reverse translation

See Also:
Constant Field Values

TYPE_SHEAR

public static final int TYPE_SHEAR
performs shearing

See Also:
Constant Field Values

code

protected static final String[] code
postscript code definition


type

protected int type
transformation types. Must be one of TYPE_SCALE, TYPE_ROTATE, TYPE_ROTATE2 TYPE_SHEAR and TYPE_TRANSFORM


x

protected double x
x parameter for points/vectors


y

protected double y
y parameter for points/vectors


theta

protected double theta
theta parameter for angles (in degree)


at

protected AffineTransform at
user defined transformations


rad

protected boolean rad
boolean defining whether given theta is in degree or radiant, default: rad

Constructor Detail

EpsTransform

public EpsTransform(AffineTransform at)
Constructs an Eps Transformation object which is equivalent by the given AffineTransform

Parameters:
at - The transformation which should be represented by this object

EpsTransform

public EpsTransform(int type,
                    double x,
                    double y)
Constructs an Eps Transformation object which performs a transformation given by the parameters. The meaning of the x and y parameters depends on the given type but it is equivalent when using an AffineTransform.

Parameters:
type - The type of the transformation. May be TYPE_TRANSLATE, TYPE_SCALE or TYPE_SHEAR.
x - The x parameter for the transformation
y - The y coordinate for the transformation

EpsTransform

public EpsTransform(double theta)
Constructs an Eps Transformation object which performs a rotation by a given angle theta in degree.

Parameters:
theta - the rotation angle in degree (0-360).

EpsTransform

public EpsTransform(double theta,
                    double x,
                    double y)
Constructs an Eps Transfomration object which performs an "extended rotation": Calling this method is equivalent to translate(x,y); rotate(theta); translate(-x,-y);

Parameters:
theta - The rotation angle in degree
x - The x coordinate for translation
y - The y coordinate for translation
Method Detail

setToRadiant

public void setToRadiant()
specify theta angles to be radiant values. the given theta values are regarded to be radiant values and therefore multiplied by 360/PI.


setToDegree

public void setToDegree()
specify theta angles to be degree values (range 0-360) the given values are not changed.


isRadiant

public boolean isRadiant()
ability to check if angles are treated as radiant or degree values

Returns:
rad (true if radiant, false if degree)

toEps

public String toEps()
Description copied from interface: EpsObject
returns a String that represents the object in postscript code

Specified by:
toEps in interface EpsObject

equals

public boolean equals(Object obj)
Overrides:
equals in class Object