public class TransformContext
extends java.lang.Object
| Constructor and Description |
|---|
TransformContext(CanvasComponent component)
Create a transform context associated with the
given display component.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkCacheValid(TransformContext ancestor)
Check transform cache validity.
|
void |
concatenate(java.awt.geom.AffineTransform at)
Concatenate this transform context with the given transform.
|
CanvasComponent |
getComponent()
Get the component that this context is associated with.
|
java.awt.geom.AffineTransform |
getInverseTransform()
Get the transform from parent coordinates into
local coordinates.
|
TransformContext |
getParent()
Get the parent transform context of this one, or null
if this context is at the root of the transform tree.
|
java.awt.geom.AffineTransform |
getScreenTransform()
Get the transform from local coordinates into screen coordinates.
|
java.awt.geom.AffineTransform |
getTransform()
Get the transform of this context.
|
java.awt.geom.AffineTransform |
getTransform(TransformContext context)
Get the transform of this context, relative to the given context.
|
int |
getVersion()
Get the version number of the transform context.
|
void |
invalidateCache()
Notify that cached data based on the transform is now invalid.
|
boolean |
isCacheValid()
Test if the cache is valid.
|
void |
pop(java.awt.Graphics2D g)
Pop this transform off the graphics stack.
|
void |
preConcatenate(java.awt.geom.AffineTransform at)
Pre-concatenate this transform context with the given transform.
|
void |
push(java.awt.Graphics2D g)
Push this transform onto the graphics stack.
|
void |
setTransform(java.awt.geom.AffineTransform at)
Set the transform that maps local coordinates into the
parent's coordinates.
|
void |
translate(double x,
double y)
Translate this context the given distance.
|
public TransformContext(CanvasComponent component)
component - The given display componentpublic void checkCacheValid(TransformContext ancestor)
ancestor - The ancestor contextpublic void concatenate(java.awt.geom.AffineTransform at)
at - The transformpublic CanvasComponent getComponent()
public java.awt.geom.AffineTransform getInverseTransform()
public TransformContext getParent()
public java.awt.geom.AffineTransform getScreenTransform()
public java.awt.geom.AffineTransform getTransform()
setTransform(AffineTransform),
getTransform(TransformContext)public java.awt.geom.AffineTransform getTransform(TransformContext context)
context - The contextsetTransform(AffineTransform),
getTransform()public int getVersion()
public void invalidateCache()
public boolean isCacheValid()
public void push(java.awt.Graphics2D g)
g - The graphics contextpublic void pop(java.awt.Graphics2D g)
g - The graphics contextpublic void preConcatenate(java.awt.geom.AffineTransform at)
at - The given transformpublic void setTransform(java.awt.geom.AffineTransform at)
at - The AffineTransformgetTransform()public void translate(double x,
double y)
x - The x distance to be translatedy - The y distance to be translated