gishur.x2.gui
Class ScreenX2Transformation

java.lang.Object
  |
  +--gishur.gui2.ScreenTransformation
        |
        +--gishur.x2.gui.ScreenX2Transformation

public class ScreenX2Transformation
extends ScreenTransformation

Transformation class for planar graphics using the x2-package. This class can convert XPoints and arrays of XPoints.

Version:
1.0
Author:
Thomas Wolf

Constructor Summary
ScreenX2Transformation()
          Default constructor.
 
Method Summary
 java.awt.Point deltaTransform(java.lang.Object point)
          Transforms a relative distance vector object in user space to a relative distance vector in screen coordinates.
 java.awt.Point[] deltaTransform(java.lang.Object[] points, int off, int len)
          Transforms a subarray of relative distance vector objects in user space to a relative distance vector array in screen coordinates.
 java.lang.Object inverseDeltaTransform(java.awt.Point point)
          Transforms a relative distance vector in screen coordinates to a relative distance vector object in user space.
 java.lang.Object inverseDeltaTransform(java.awt.Point[] points, int off, int len)
          Transforms a subarray of relative distance vectors in screen coordinates to an array of relative distance vector objects in user space.
 AffineTransformation inverseTransform(double m00, double m01, double m02, double m10, double m11, double m12)
          Transforms the given transformation matrix for an affine transformation in screen coordinates to a transformation matrix in user space that does the same transformation with the original object.
 java.lang.Object inverseTransform(int x, int y)
          Transforms one point on the screen to a point object in user space.
 java.lang.Object[] inverseTransform(java.awt.Point[] points, int off, int len)
          Transforms a subarray of points in screen coordinates to an array of point objects in user space.
 void resetTransform()
          Resets the ScreenTransformation to its initial values (identity).
 void restoreStatus(java.lang.Object status)
          Restores a state saved via saveStatus().
 java.lang.Object saveStatus()
          Returns the status of the ScreenTransformation to restore it via restoreStatus(java.lang.Object).
 void screenTransform(double m00, double m01, double m02, double m10, double m11, double m12)
          Transforms the ScreenTransformation with the given transformation matrix.
 java.awt.Point transform(java.lang.Object point)
          Transforms one point object in user space to a point on the screen.
 java.awt.Point[] transform(java.lang.Object[] points, int off, int len)
          Transforms a subarray of point objects in user space to a point array in screen coordinates.
 
Methods inherited from class gishur.gui2.ScreenTransformation
bounds, deltaTransform, inverseDeltaTransform, inverseTransform, inverseTransform, rotate, rotate, rotate, scale, scale, transform, transformedBounds, translate, zoomTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenX2Transformation

public ScreenX2Transformation()
Default constructor.
Method Detail

saveStatus

public java.lang.Object saveStatus()
Returns the status of the ScreenTransformation to restore it via restoreStatus(java.lang.Object).
Overrides:
saveStatus in class ScreenTransformation
Returns:
the status of the ScreenTransformation.

restoreStatus

public void restoreStatus(java.lang.Object status)
Restores a state saved via saveStatus().
Overrides:
restoreStatus in class ScreenTransformation
Parameters:
status - the status to restore (must be saved via saveStatus()).

transform

public java.awt.Point transform(java.lang.Object point)
Transforms one point object in user space to a point on the screen.
Overrides:
transform in class ScreenTransformation
Parameters:
point - point object in user space
Returns:
Point in screen coordinates.

transform

public java.awt.Point[] transform(java.lang.Object[] points,
                                  int off,
                                  int len)
Transforms a subarray of point objects in user space to a point array in screen coordinates.
Overrides:
transform in class ScreenTransformation
Parameters:
points - array of point objects in user space
off - offset of the subarray
len - length of the subarray
Returns:
Array of points in screen coordinates.

inverseTransform

public java.lang.Object inverseTransform(int x,
                                         int y)
Transforms one point on the screen to a point object in user space.
Overrides:
inverseTransform in class ScreenTransformation
Parameters:
point - point in screen coordinates
Returns:
x,y point in screen coordinates.

inverseTransform

public java.lang.Object[] inverseTransform(java.awt.Point[] points,
                                           int off,
                                           int len)
Transforms a subarray of points in screen coordinates to an array of point objects in user space.
Overrides:
inverseTransform in class ScreenTransformation
Parameters:
points - array of points in screen coordinates
off - offset of the subarray
len - length of the subarray
Returns:
Array of point objects in user space.

deltaTransform

public java.awt.Point deltaTransform(java.lang.Object point)
Transforms a relative distance vector object in user space to a relative distance vector in screen coordinates.
Overrides:
deltaTransform in class ScreenTransformation
Parameters:
point - vector in user space
Returns:
Vector in screen coordinates.

deltaTransform

public java.awt.Point[] deltaTransform(java.lang.Object[] points,
                                       int off,
                                       int len)
Transforms a subarray of relative distance vector objects in user space to a relative distance vector array in screen coordinates.
Overrides:
deltaTransform in class ScreenTransformation
Parameters:
points - array of relative distance vector objects in user space
off - offset of the subarray
len - length of the subarray
Returns:
Array of relative distance vectors in screen coordinates.

inverseDeltaTransform

public java.lang.Object inverseDeltaTransform(java.awt.Point point)
Transforms a relative distance vector in screen coordinates to a relative distance vector object in user space.
Overrides:
inverseDeltaTransform in class ScreenTransformation
Parameters:
point - vector in user space
Returns:
Vector in screen coordinates.

inverseDeltaTransform

public java.lang.Object inverseDeltaTransform(java.awt.Point[] points,
                                              int off,
                                              int len)
Transforms a subarray of relative distance vectors in screen coordinates to an array of relative distance vector objects in user space.
Overrides:
inverseDeltaTransform in class ScreenTransformation
Parameters:
points - array of relative distance vectors in screen coordinates
off - offset of the subarray
len - length of the subarray
Returns:
Array of relative distance vector objects in user space.

inverseTransform

public AffineTransformation inverseTransform(double m00,
                                             double m01,
                                             double m02,
                                             double m10,
                                             double m11,
                                             double m12)
Transforms the given transformation matrix for an affine transformation in screen coordinates to a transformation matrix in user space that does the same transformation with the original object. Let T be the screen transformation matrix used to transform objects from user space to screen coordinates, let T' be its inverse and A the given matrix, the returned matrix is T'AT.
Parameters:
m00,m01,m02 - first row of the transformation matrix
m10,m11,m12 - second row of the transformation matrix
Returns:
the transformation matrix transformed in user space

resetTransform

public void resetTransform()
Resets the ScreenTransformation to its initial values (identity).
Overrides:
resetTransform in class ScreenTransformation

screenTransform

public void screenTransform(double m00,
                            double m01,
                            double m02,
                            double m10,
                            double m11,
                            double m12)
Transforms the ScreenTransformation with the given transformation matrix.
Overrides:
screenTransform in class ScreenTransformation
Parameters:
m00,m01,m02 - first row of the transformation matrix
m10,m11,m12 - second row of the transformation matrix