com.swfm.mica.core
Class MiTransforms

java.lang.Object
  extended bycom.swfm.mica.core.MiTransforms
All Implemented Interfaces:
MiiCommandHandler, MiiCommandNames, MiiTransform

public class MiTransforms
extends java.lang.Object
implements MiiTransform, MiiCommandHandler

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
   
Constructor Summary
MiTransforms()
           
 
Method Summary
 boolean boundsClipped(MiBounds bounds)
          Return 'True' if rejected, i.e.
 void clearClipBounds()
           
 void clearTransforms()
           
 void dtow(MiBounds dBounds, MiBounds wBounds)
          Convert the given device space bounds to world space bounds.
 void dtow(MiDeviceBounds dBounds, MiBounds wBounds)
          Convert the given integer device space bounds to world space bounds.
 void dtow(MiDevicePoint dPoint, MiDeviceVector dVector, MiVector wVector)
          Convert the vector at the given location in device space to the corresponding vector in world space.
 void dtow(MiDevicePoint dPoint, MiPoint wPoint)
          Convert the coordinate in integer device space to it's corresponding coordinate in world space.
 void dtow(MiPoint dPoint, MiPoint wPoint)
          Convert the coordinate in device space to it's corresponding coordinate in world space.
 void dtow(MiPoint dPoint, MiVector dVector, MiVector wVector)
          Convert the vector at the given location in device space to the corresponding vector in world space.
 MiBounds getClipBounds()
           
 MiBounds getClipBounds(MiBounds b)
           
 MiVector getDeviceTranslation(MiVector vector)
          Get the device translation.
 int getIndentX()
           
 MiiCommandHandler getObserver()
          Gets the observer that will be notified whenever this transform changes.
 double getRotation()
          Get the current rotation in radians.
 MiPoint getRotationPoint(MiPoint center)
          Get the point to rotate about.
 MiScale getScale(MiScale scale)
          Get the horizontal and vertical scale factors.
 void getTotalDeviceTranslation(MiVector dVector)
           
 MiVector getWorldTranslation(MiVector vector)
          Get the world translation.
 void invalidateTransform()
           
 boolean isPositionDependent()
          Returns whether this transform has constant scaleFactors and translations across the world space.
 void popTransform()
           
 void processCommand(java.lang.String command)
          Processes the given command.
 void pushTransform(MiiTransform transform)
           
 void rotate(double radians)
          Adjust the rotation by the given amount.
 void scale(MiScale scale)
          Increase/decrease the scale factor by the given amount.
 void setClipBounds(MiBounds bounds)
           
 void setDeviceTranslation(MiVector vector)
          Set the device translation to the given amount.
 void setIndentX(int indent)
           
 void setObserver(MiiCommandHandler handler)
          Specifies the observer that will be notified whenever this transform changes.
 void setRotation(double radians)
          Set the rotation to the given amount.
 void setRotationPoint(MiPoint center)
          Set the point to rotate about.
 void setScale(MiScale scale)
          Set the scale factor to the given amount.
 void setWorldTranslation(MiVector vector)
          Set the world translation to the given amount.
 java.lang.String toString()
          Prints information about this transform.
 void translate(MiDeviceVector vector)
           
 void translate(MiVector vector)
          Adjust the world translation by the given amount.
 void validateTransform()
           
 void wtod(MiBounds wBounds, MiBounds dBounds)
          Convert the given world space bounds to device space bounds.
 void wtod(MiBounds wBounds, MiDeviceBounds dBounds)
          Convert the given world space bounds to integer device space bounds.
 void wtod(MiPoint wPoint, MiDevicePoint dPoint)
          Convert the coordinate in world space to it's corresponding coordinate in device space.
 void wtod(MiPoint wPoint, MiPoint dPoint)
          Convert the coordinate in world space to it's corresponding coordinate in device space.
 void wtod(MiPoint wPoint, MiVector wVector, MiDeviceVector dVector)
          Convert the vector at the given location in world space to the corresponding vector in device space.
 void wtod(MiPoint wPoint, MiVector wVector, MiVector dVector)
          Convert the vector at the given location in world space to the corresponding vector in device space.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MiTransforms

public MiTransforms()
Method Detail

setObserver

public void setObserver(MiiCommandHandler handler)
Specifies the observer that will be notified whenever this transform changes. This is used by tranforms that are concatenations of other transforms (i.e. MiTranforms).

Specified by:
setObserver in interface MiiTransform
Parameters:
handler - the observer
See Also:
getObserver()

getObserver

public MiiCommandHandler getObserver()
Gets the observer that will be notified whenever this transform changes.

Specified by:
getObserver in interface MiiTransform
Returns:
the observer
See Also:
setObserver(com.swfm.mica.commands.MiiCommandHandler)

setIndentX

public void setIndentX(int indent)

getIndentX

public int getIndentX()

setClipBounds

public void setClipBounds(MiBounds bounds)

getClipBounds

public MiBounds getClipBounds()

getClipBounds

public MiBounds getClipBounds(MiBounds b)

clearClipBounds

public void clearClipBounds()

pushTransform

public void pushTransform(MiiTransform transform)

invalidateTransform

public void invalidateTransform()

validateTransform

public void validateTransform()

processCommand

public void processCommand(java.lang.String command)
Description copied from interface: MiiCommandHandler
Processes the given command.

Specified by:
processCommand in interface MiiCommandHandler

popTransform

public void popTransform()

clearTransforms

public void clearTransforms()

boundsClipped

public boolean boundsClipped(MiBounds bounds)
Return 'True' if rejected, i.e. the extrema, in the world coordinates specified, is entirely outside the current view.


isPositionDependent

public boolean isPositionDependent()
Returns whether this transform has constant scaleFactors and translations across the world space. In effect this returns true if scale = f(x,y) or translation = f(x,y)

Specified by:
isPositionDependent in interface MiiTransform
Returns:
true if transform depends on location.

scale

public void scale(MiScale scale)
Increase/decrease the scale factor by the given amount.

Specified by:
scale in interface MiiTransform
Parameters:
scale - the scale that is combined with the current scale factor.

translate

public void translate(MiVector vector)
Adjust the world translation by the given amount.

Specified by:
translate in interface MiiTransform
Parameters:
vector - the translation that is combined with the current translation.

rotate

public void rotate(double radians)
Adjust the rotation by the given amount. The rotation is performed about the current rotation point. If none has been set then the center of the world is used.

Specified by:
rotate in interface MiiTransform
Parameters:
radians - the angle that is combined with the current rotation.

setScale

public void setScale(MiScale scale)
Set the scale factor to the given amount.

Specified by:
setScale in interface MiiTransform
Parameters:
scale - the new scale factor.

getScale

public MiScale getScale(MiScale scale)
Get the horizontal and vertical scale factors. These are the ratio of the world space sizes to the device space size.

Specified by:
getScale in interface MiiTransform
Parameters:
scale - the (returned) scale factor.
Returns:
the scale factor.

setWorldTranslation

public void setWorldTranslation(MiVector vector)
Set the world translation to the given amount.

Specified by:
setWorldTranslation in interface MiiTransform
Parameters:
vector - the new translation.

getWorldTranslation

public MiVector getWorldTranslation(MiVector vector)
Get the world translation.

Specified by:
getWorldTranslation in interface MiiTransform
Parameters:
vector - the (returned) translation.
Returns:
the translation.

setDeviceTranslation

public void setDeviceTranslation(MiVector vector)
Set the device translation to the given amount.

Specified by:
setDeviceTranslation in interface MiiTransform
Parameters:
vector - the new translation.

getDeviceTranslation

public MiVector getDeviceTranslation(MiVector vector)
Get the device translation.

Specified by:
getDeviceTranslation in interface MiiTransform
Parameters:
vector - the (returned) translation.
Returns:
the translation.

setRotation

public void setRotation(double radians)
Set the rotation to the given amount. The rotation is performed about the given point.

Specified by:
setRotation in interface MiiTransform
Parameters:
radians - the new angle of rotation.

getRotation

public double getRotation()
Get the current rotation in radians.

Specified by:
getRotation in interface MiiTransform
Returns:
the angle of rotation in radians.

setRotationPoint

public void setRotationPoint(MiPoint center)
Set the point to rotate about.

Specified by:
setRotationPoint in interface MiiTransform
Parameters:
center - the center of rotation.

getRotationPoint

public MiPoint getRotationPoint(MiPoint center)
Get the point to rotate about.

Specified by:
getRotationPoint in interface MiiTransform
Parameters:
center - the (returned) center of rotation.
Returns:
the center of rotation.

translate

public void translate(MiDeviceVector vector)

dtow

public void dtow(MiDevicePoint dPoint,
                 MiPoint wPoint)
Convert the coordinate in integer device space to it's corresponding coordinate in world space.

Specified by:
dtow in interface MiiTransform
Parameters:
dPoint - the device space coordinate
wPoint - the (returned) world space coordinate

dtow

public void dtow(MiPoint dPoint,
                 MiPoint wPoint)
Convert the coordinate in device space to it's corresponding coordinate in world space.

Specified by:
dtow in interface MiiTransform
Parameters:
dPoint - the device space coordinate
wPoint - the (returned) world space coordinate

dtow

public void dtow(MiPoint dPoint,
                 MiVector dVector,
                 MiVector wVector)
Convert the vector at the given location in device space to the corresponding vector in world space.

Specified by:
dtow in interface MiiTransform
Parameters:
dPoint - the device space coordinate
dVector - the device space vector
wVector - the (returned) world space vector

dtow

public void dtow(MiDevicePoint dPoint,
                 MiDeviceVector dVector,
                 MiVector wVector)
Convert the vector at the given location in device space to the corresponding vector in world space.

Specified by:
dtow in interface MiiTransform
Parameters:
dPoint - the device space coordinate
dVector - the device space vector
wVector - the (returned) world space vector

dtow

public void dtow(MiBounds dBounds,
                 MiBounds wBounds)
Convert the given device space bounds to world space bounds. The given bounds may reference the same MiBounds instance.

Specified by:
dtow in interface MiiTransform
Parameters:
dBounds - the device space bounds
wBounds - the (returned) world space bounds

dtow

public void dtow(MiDeviceBounds dBounds,
                 MiBounds wBounds)
Convert the given integer device space bounds to world space bounds. The given bounds may reference the same MiBounds instance.

Specified by:
dtow in interface MiiTransform
Parameters:
dBounds - the device space bounds
wBounds - the (returned) world space bounds

wtod

public void wtod(MiPoint wPoint,
                 MiDevicePoint dPoint)
Convert the coordinate in world space to it's corresponding coordinate in device space.

Specified by:
wtod in interface MiiTransform
Parameters:
wPoint - the world space coordinate
dPoint - the (returned) device space coordinate

wtod

public void wtod(MiPoint wPoint,
                 MiPoint dPoint)
Convert the coordinate in world space to it's corresponding coordinate in device space.

Specified by:
wtod in interface MiiTransform
Parameters:
wPoint - the world space point
dPoint - the device space point

wtod

public void wtod(MiPoint wPoint,
                 MiVector wVector,
                 MiVector dVector)
Convert the vector at the given location in world space to the corresponding vector in device space.

Specified by:
wtod in interface MiiTransform
Parameters:
wPoint - the world space coordinate
wVector - the world space vector
dVector - the (returned) device space vector

wtod

public void wtod(MiPoint wPoint,
                 MiVector wVector,
                 MiDeviceVector dVector)
Convert the vector at the given location in world space to the corresponding vector in device space.

Specified by:
wtod in interface MiiTransform
Parameters:
wPoint - the world space coordinate
wVector - the world space vector
dVector - the (returned) device space vector

wtod

public void wtod(MiBounds wBounds,
                 MiBounds dBounds)
Convert the given world space bounds to device space bounds. The given bounds may reference the same MiBounds instance.

Specified by:
wtod in interface MiiTransform
Parameters:
wBounds - the world space bounds
dBounds - the (returned) device space bounds

wtod

public void wtod(MiBounds wBounds,
                 MiDeviceBounds dBounds)
Convert the given world space bounds to integer device space bounds.

Specified by:
wtod in interface MiiTransform
Parameters:
wBounds - the world space bounds
dBounds - the (returned) device space bounds

toString

public java.lang.String toString()
Prints information about this transform.


getTotalDeviceTranslation

public void getTotalDeviceTranslation(MiVector dVector)