Package edu.umd.cs.piccolo
Class POffscreenCanvas
java.lang.Object
edu.umd.cs.piccolo.POffscreenCanvas
- All Implemented Interfaces:
PComponent
Offscreen canvas.
- Since:
- 1.3
-
Constructor Summary
ConstructorsConstructorDescriptionPOffscreenCanvas(int width, int height) Create a new offscreen canvas the specified width and height. -
Method Summary
Modifier and TypeMethodDescriptionReturn the camera for this offscreen canvas.intReturn the render quality hint for this offscreen canvas.voidSends a repaint notification the repaint manager if PComponent is not already painting immediately.voidPops the topmost cursor from the stack and sets it as the current one.voidpushCursor(Cursor cursor) Pushes the given cursor onto the cursor stack and sets the current cursor to the one provided.voidrender(Graphics2D graphics) Render this offscreen canvas to the specified graphics.voidCalled to notify PComponent that given bounds need repainting.voidSet the camera for this offscreen canvas tocamera.voidsetInteracting(boolean interacting) Sets whether the component is currently being interacted with.voidsetRenderQuality(int renderQuality) Set the render quality hint for this offscreen canvas torenderQuality.
-
Constructor Details
-
POffscreenCanvas
public POffscreenCanvas(int width, int height) Create a new offscreen canvas the specified width and height.- Parameters:
width- width of this offscreen canvas, must be at least zeroheight- height of this offscreen canvas, must be at least zero
-
-
Method Details
-
render
Render this offscreen canvas to the specified graphics.- Parameters:
graphics- graphics to render this offscreen canvas to, must not be null
-
setCamera
Set the camera for this offscreen canvas tocamera.- Parameters:
camera- camera for this offscreen canvas
-
getCamera
Return the camera for this offscreen canvas.- Returns:
- the camera for this offscreen canvas
-
setRenderQuality
public void setRenderQuality(int renderQuality) Set the render quality hint for this offscreen canvas torenderQuality.- Parameters:
renderQuality- render quality hint, must be one ofPPaintContext.HIGH_QUALITY_RENDERINGorPPaintContext.LOW_QUALITY_RENDERING
-
getRenderQuality
public int getRenderQuality()Return the render quality hint for this offscreen canvas.- Returns:
- the render quality hint for this offscreen canvas
-
paintImmediately
public void paintImmediately()Sends a repaint notification the repaint manager if PComponent is not already painting immediately.- Specified by:
paintImmediatelyin interfacePComponent
-
popCursor
public void popCursor()Pops the topmost cursor from the stack and sets it as the current one.- Specified by:
popCursorin interfacePComponent
-
pushCursor
Pushes the given cursor onto the cursor stack and sets the current cursor to the one provided.- Specified by:
pushCursorin interfacePComponent- Parameters:
cursor- The cursor to set as the current one and push
-
repaint
Called to notify PComponent that given bounds need repainting.- Specified by:
repaintin interfacePComponent- Parameters:
repaintBounds- bounds needing repaint
-
setInteracting
public void setInteracting(boolean interacting) Sets whether the component is currently being interacted with.- Specified by:
setInteractingin interfacePComponent- Parameters:
interacting- whether the component is currently being interacted with
-