|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.umd.cs.piccolo.util.PPaintContext
public class PPaintContext
PPaintContext is used by piccolo nodes to paint themselves on the screen. PPaintContext wraps a Graphics2D to implement painting.
| Field Summary | |
|---|---|
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 PPaintContext |
CURRENT_PAINT_CONTEXT
Deprecated. will disappear as soon as possible Global for accessing the current paint context while painting. |
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 Summary | |
|---|---|
PPaintContext(Graphics2D graphics)
Creates a PPaintContext associated with the given graphics context. |
|
| Method Summary | |
|---|---|
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 |
popCamera(PCamera aCamera)
Deprecated. in favor of popCamera() |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int LOW_QUALITY_RENDERING
public static final int HIGH_QUALITY_RENDERING
public static FontRenderContext RENDER_QUALITY_LOW_FRC
public static FontRenderContext RENDER_QUALITY_HIGH_FRC
public static PPaintContext CURRENT_PAINT_CONTEXT
protected PStack compositeStack
protected PStack clipStack
protected PStack localClipStack
protected PStack cameraStack
protected PStack transformStack
protected int renderQuality
| Constructor Detail |
|---|
public PPaintContext(Graphics2D graphics)
graphics - graphics context to associate with this paint context| Method Detail |
|---|
public Graphics2D getGraphics()
public Rectangle2D getLocalClip()
public double getScale()
public void pushCamera(PCamera aCamera)
aCamera - camera to push onto the stackpublic void popCamera(PCamera aCamera)
aCamera - absolute not used in any waypublic 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_RENDERING
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||