|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.graphic.impl.swing.SwingSpaceMapper
A stateless SpaceMapper for Swing graphics. In Swing, spatial transformation is constrained to 2D translation. All methods throw an exception if the from and to space node graphic is not a Component.
Field Summary | |
static SpaceMapper |
INSTANCE
|
Constructor Summary | |
protected |
SwingSpaceMapper()
|
Method Summary | |
java.lang.Object |
getGraphic()
Returns this object (no Swing graphic equivalent). |
Matrix4 |
getGraphicTransform(SpaceNode from,
SpaceNode to,
Matrix4 retVal)
Default implementation: Recursively computes a new transform using matrix multiplication, updates the cache with it, and returns it. |
Point3 |
transformGraphic(Point3 point,
SpaceNode from,
SpaceNode to,
Point3 retVal)
Transforms a point from one local space to another. |
Vector3 |
transformGraphic(Vector3 vector,
SpaceNode from,
SpaceNode to,
Vector3 retVal)
Copies vector to retVal (Swing only translates, hence null op). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final SpaceMapper INSTANCE
Constructor Detail |
protected SwingSpaceMapper()
Method Detail |
public Point3 transformGraphic(Point3 point, SpaceNode from, SpaceNode to, Point3 retVal)
SpaceMapper
transformGraphic
in interface SpaceMapper
point
- Value of a point in the from space. Never null.from
- The source space. If null, the tree's absolute space.to
- The target space. If null, the tree's absolute space.retVal
- The return value object. The transformed point
Never null.
public Vector3 transformGraphic(Vector3 vector, SpaceNode from, SpaceNode to, Vector3 retVal)
transformGraphic
in interface SpaceMapper
vector
- Value of a vector in the from space. Never null.from
- The source space. If null, the tree's absolute space.to
- The target space. If null, the tree's absolute space.retVal
- The return value object. The transformed vector
Never null.
public Matrix4 getGraphicTransform(SpaceNode from, SpaceNode to, Matrix4 retVal)
getGraphicTransform
in interface SpaceMapper
from
- The source space. If null, the tree's absolute space.to
- The target space. If null, the tree's absolute space.retVal
- The return value object. The transform matrix.
Never null.
public java.lang.Object getGraphic()
getGraphic
in interface Graphic
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |