Java Statistical Classes

jsc.swt.virtualgraphics
Class VirtualTransform

java.lang.Object
  |
  +--java.awt.geom.AffineTransform
        |
        +--jsc.swt.virtualgraphics.VirtualTransform
All Implemented Interfaces:
Cloneable, Serializable

public class VirtualTransform
extends AffineTransform

This class represents a 2D transformation from virtual co-ordinates to device (pixel) co-ordinates. It provides a simpler version of the AffineTransform class for transformations from a rectangular virtual co-ordinate system to device co-ordinates (e.g. the pixel co-ordinates of a panel or window). The simplified transformation consists of a scaling and translation such that a rectangular area is defined with an arbitrary origin in its lower-left corner and arbitrary x (horizontal) and y (vertical) scales. The x direction is from left to right and the y direction is from bottom to top.

Version:
1.0
Author:
A. J. Bertie.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.geom.AffineTransform
TYPE_FLIP, TYPE_GENERAL_ROTATION, TYPE_GENERAL_SCALE, TYPE_GENERAL_TRANSFORM, TYPE_IDENTITY, TYPE_MASK_ROTATION, TYPE_MASK_SCALE, TYPE_QUADRANT_ROTATION, TYPE_TRANSLATION, TYPE_UNIFORM_SCALE
 
Constructor Summary
VirtualTransform(VRectangle vr, Dimension deviceSize)
          Creates the virtual transformation.
 
Method Summary
 VDimension pixelToVirtual(Dimension d)
          Returns the virtual dimension corresponding to a device (pixel) dimension d.
 VPoint pixelToVirtual(Point p)
          Returns the virtual point corresponding to a device (pixel) point p.
 
Methods inherited from class java.awt.geom.AffineTransform
clone, concatenate, createInverse, createTransformedShape, deltaTransform, deltaTransform, equals, getDeterminant, getMatrix, getRotateInstance, getRotateInstance, getScaleInstance, getScaleX, getScaleY, getShearInstance, getShearX, getShearY, getTranslateInstance, getTranslateX, getTranslateY, getType, hashCode, inverseTransform, inverseTransform, isIdentity, preConcatenate, rotate, rotate, scale, setToIdentity, setToRotation, setToRotation, setToScale, setToShear, setToTranslation, setTransform, setTransform, shear, toString, transform, transform, transform, transform, transform, transform, translate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VirtualTransform

public VirtualTransform(VRectangle vr,
                        Dimension deviceSize)
Creates the virtual transformation. The specified virtual rectangle is mapped onto the device (window, panel etc.) that has the specified size.

Parameters:
vr - the virtual rectangle.
deviceSize - the size of the device in pixels.
Method Detail

pixelToVirtual

public VDimension pixelToVirtual(Dimension d)
Returns the virtual dimension corresponding to a device (pixel) dimension d.

Parameters:
d - the device (pixel) dimension.
Returns:
the equivalent virtual dimension.

pixelToVirtual

public VPoint pixelToVirtual(Point p)
Returns the virtual point corresponding to a device (pixel) point p.

Parameters:
p - the device (pixel) point.
Returns:
the equivalent virtual point.

Java Statistical Classes

Copyright © Andrew James Bertie, 2005, all rights reserved. Updated 12th Aug 2005