public class PPaintContext extends Object
Modifier and Type | Field and Description |
---|---|
protected PStack |
cameraStack
Stack of cameras through which the node being painted is being viewed.
|
protected PStack |
clipStack
Used to optimize clipping region.
|
protected PStack |
compositeStack
Used while computing transparency.
|
static int |
HIGH_QUALITY_RENDERING
Used for improving quality of rendering when requested.
|
protected PStack |
localClipStack
Tracks clipping region in local coordinate system.
|
static int |
LOW_QUALITY_RENDERING
Used for lowering quality of rendering when requested.
|
static FontRenderContext |
RENDER_QUALITY_HIGH_FRC
Font context to use while in high quality rendering.
|
static FontRenderContext |
RENDER_QUALITY_LOW_FRC
Font context to use while in low quality rendering.
|
protected int |
renderQuality
The current render quality that all rendering should be done in.
|
protected PStack |
transformStack
Stack of transforms being applied to the drawing context.
|
Constructor and Description |
---|
PPaintContext(Graphics2D graphics)
Creates a PPaintContext associated with the given graphics context.
|
Modifier and Type | Method and Description |
---|---|
PCamera |
getCamera()
Returns the camera at the top of the camera stack, or null if stack is
empty.
|
Graphics2D |
getGraphics()
Returns the graphics context associated with this paint context.
|
Rectangle2D |
getLocalClip()
Returns the clipping region in the local coordinate system applied by
graphics.
|
int |
getRenderQuality()
Return the render quality used by this paint context.
|
double |
getScale()
Returns scale of the current graphics context.
|
void |
popCamera()
Removes the camera at the top of the camera stack.
|
void |
popClip(Shape clip)
Removes the topmost clipping region from the clipping stack.
|
void |
popTransform(PAffineTransform transform)
Pops the topmost Transform from the top of the transform if the passed in
transform is not null.
|
void |
popTransparency(float transparency)
Removes the topmost transparency if the given transparency is not opaque
(1f).
|
void |
pushCamera(PCamera aCamera)
Pushes the camera onto the camera stack.
|
void |
pushClip(Shape clip)
Pushes the given clip to the pain context.
|
void |
pushTransform(PAffineTransform transform)
Pushed the provided transform onto the transform stack if it is not null.
|
void |
pushTransparency(float transparency)
Pushes the provided transparency onto the transparency stack if
necessary.
|
void |
setRenderQuality(int requestedQuality)
Set the rendering hints for this paint context.
|
public static final int LOW_QUALITY_RENDERING
public static final int HIGH_QUALITY_RENDERING
public static final FontRenderContext RENDER_QUALITY_LOW_FRC
public static final FontRenderContext RENDER_QUALITY_HIGH_FRC
protected PStack compositeStack
protected PStack clipStack
protected PStack localClipStack
protected PStack cameraStack
protected PStack transformStack
protected int renderQuality
public PPaintContext(Graphics2D graphics)
graphics
- graphics context to associate with this paint contextpublic Graphics2D getGraphics()
public Rectangle2D getLocalClip()
public double getScale()
public void pushCamera(PCamera aCamera)
aCamera
- camera to push onto the stackpublic void popCamera()
public PCamera getCamera()
public void pushClip(Shape clip)
clip
- clip to be pushedpublic void popClip(Shape clip)
clip
- not used in this methodpublic void pushTransparency(float transparency)
transparency
- transparency to be pushed onto the transparency stackpublic void popTransparency(float transparency)
transparency
- transparency to be poppedpublic void pushTransform(PAffineTransform transform)
transform
- will be pushed onto the transform stack if not nullpublic void popTransform(PAffineTransform transform)
transform
- transform that should be at the top of the stackpublic int getRenderQuality()
public void setRenderQuality(int requestedQuality)
requestedQuality
- supports PPaintContext.HIGH_QUALITY_RENDERING or
PPaintContext.LOW_QUALITY_RENDERINGCopyright © 1995-2013 Piccolo2D. All Rights Reserved.