com.sun.scenario.scenegraph
Class SGTransform.Translate

java.lang.Object
  extended by com.sun.scenario.scenegraph.SGNode
      extended by com.sun.scenario.scenegraph.SGParent
          extended by com.sun.scenario.scenegraph.SGFilter
              extended by com.sun.scenario.scenegraph.SGTransform
                  extended by com.sun.scenario.scenegraph.SGTransform.Translate
Enclosing class:
SGTransform

public abstract static class SGTransform.Translate
extends SGTransform

A subclass of SGTransform that applies a simple translation transform. A translation transform simply adds a constant value to the X and Y coordinates of the source coordinates. The transform x',y' of a source point x,y is represented by the equations:

     x' = x + transx;
     y' = y + transy;
 
Instances of this class can only be created by calling the SGTransform.createTranslation(double, double, com.sun.scenario.scenegraph.SGNode) factory method.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.scenario.scenegraph.SGTransform
SGTransform.Affine, SGTransform.Rotate, SGTransform.Scale, SGTransform.Shear, SGTransform.Translate
 
Field Summary
 
Fields inherited from class com.sun.scenario.scenegraph.SGFilter
BOTH, CACHED, NONE, TRANSFORMED, UNTRANSFORMED
 
Method Summary
abstract  double getTranslateX()
          Returns the translation offset applied to the X coordinates.
abstract  double getTranslateY()
          Returns the translation offset applied to the Y coordinates.
 void reset()
          Resets this transform node to an identity operation which has no effect on the input points.
abstract  void setTranslateX(double tx)
          Sets the translation offset applied to the X coordinates.
abstract  void setTranslateY(double ty)
          Sets the translation offset applied to the Y coordinates.
abstract  void setTranslation(double tx, double ty)
          Sets the X and Y translation offets to the specified new values.
abstract  void translateBy(double tx, double ty)
          Offsets the X and Y translation offets by the specified additional offset values.
 
Methods inherited from class com.sun.scenario.scenegraph.SGTransform
canSkipRendering, concatenateInto, createAffine, createAffineTransform, createRotation, createScale, createShear, createTranslation, getBounds, getTransform, invalidateTransform, inverseTransform, transform
 
Methods inherited from class com.sun.scenario.scenegraph.SGFilter
canExpandBounds, canSkipChildren, getChild, getChildren, needsSourceContent, remove, remove, renderFinalImage, renderFromCache, setChild, setupRenderGraphics
 
Methods inherited from class com.sun.scenario.scenegraph.SGNode
addFocusListener, addKeyListener, addMouseListener, addNodeListener, contains, getAttribute, getBounds, getCursor, getID, getPanel, getParent, globalToLocal, isMouseBlocker, isVisible, localToGlobal, pick, putAttribute, removeFocusListener, removeKeyListener, removeMouseListener, removeNodeListener, render, requestFocus, setCursor, setID, setMouseBlocker, setVisible, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getTranslateX

public abstract double getTranslateX()
Returns the translation offset applied to the X coordinates.

Returns:
the X translation

getTranslateY

public abstract double getTranslateY()
Returns the translation offset applied to the Y coordinates.

Returns:
the Y translation

setTranslateX

public abstract void setTranslateX(double tx)
Sets the translation offset applied to the X coordinates.

Parameters:
tx - the new X translation

setTranslateY

public abstract void setTranslateY(double ty)
Sets the translation offset applied to the Y coordinates.

Parameters:
ty - the new Y translation

setTranslation

public abstract void setTranslation(double tx,
                                    double ty)
Sets the X and Y translation offets to the specified new values.

Parameters:
tx - the new X translation offset
ty - the new Y translation offset

translateBy

public abstract void translateBy(double tx,
                                 double ty)
Offsets the X and Y translation offets by the specified additional offset values. This method is equivalent to:
     tt.setTranslation(tt.getTranslateX() + tx, tt.getTranslateY() + ty);
 

Parameters:
tx - the additional X translation offset
ty - the additional Y translation offset

reset

public void reset()
Description copied from class: SGTransform
Resets this transform node to an identity operation which has no effect on the input points.

Specified by:
reset in class SGTransform