public class TransformationManagerImpl extends java.lang.Object implements TransformationManager
TransformationManager
implementation.Constructor and Description |
---|
TransformationManagerImpl(Canvas canvas)
Standard constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(TransformationManagerListener listener)
Add a listener.
|
protected void |
fireTransformationChanged()
Notify listeners the top transformation have changed.
|
Transformation |
getCanvasProjection()
Return the canvas projection matrix.
|
Transformation |
getG2DProjection()
Return the canvas projection matrix for Graphics2D.
|
Transformation |
getG2DSingleProjection()
Return the projection matrix (no modelView).
|
Transformation |
getG2DWindowProjection()
Return the window projection matrix for Graphics2D.
|
TransformationStack |
getModelViewStack()
Return the model view matrix stack.
|
TransformationStack |
getProjectionStack()
Return the projection matrix stack.
|
Transformation |
getTransformation()
Return the top scene transformation.
|
Transformation |
getWindowTransformation()
Return the window transformation.
|
boolean |
isUsingSceneCoordinate()
Return true if is using scene coordinate.
|
void |
removeListener(TransformationManagerListener listener)
Remove a listener.
|
void |
reset()
Clear all stack.
|
void |
useSceneCoordinate()
Switch to scene coordinate.
|
void |
useWindowCoordinate()
Switch to window coordinate.
|
public TransformationManagerImpl(Canvas canvas)
canvas
- the canvas.public void addListener(TransformationManagerListener listener)
TransformationManager
addListener
in interface TransformationManager
listener
- added.public void removeListener(TransformationManagerListener listener)
TransformationManager
removeListener
in interface TransformationManager
listener
- removed.public TransformationStack getModelViewStack()
TransformationManager
getModelViewStack
in interface TransformationManager
public TransformationStack getProjectionStack()
TransformationManager
getProjectionStack
in interface TransformationManager
public Transformation getTransformation()
TransformationManager
getTransformation
in interface TransformationManager
public Transformation getWindowTransformation()
TransformationManager
getWindowTransformation
in interface TransformationManager
public Transformation getCanvasProjection()
TransformationManager
getCanvasProjection
in interface TransformationManager
public Transformation getG2DProjection()
TransformationManager
getG2DProjection
in interface TransformationManager
public Transformation getG2DSingleProjection()
TransformationManager
getG2DSingleProjection
in interface TransformationManager
public Transformation getG2DWindowProjection()
TransformationManager
getG2DWindowProjection
in interface TransformationManager
public void reset()
TransformationManager
reset
in interface TransformationManager
public void useWindowCoordinate()
TransformationManager
useWindowCoordinate
in interface TransformationManager
public void useSceneCoordinate()
TransformationManager
useSceneCoordinate
in interface TransformationManager
public boolean isUsingSceneCoordinate()
TransformationManager
isUsingSceneCoordinate
in interface TransformationManager
protected void fireTransformationChanged()