Class POffscreenCanvas

java.lang.Object
edu.umd.cs.piccolo.POffscreenCanvas
All Implemented Interfaces:
PComponent

public final class POffscreenCanvas extends Object implements PComponent
Offscreen canvas.
Since:
1.3
  • Constructor Summary

    Constructors
    Constructor
    Description
    POffscreenCanvas(int width, int height)
    Create a new offscreen canvas the specified width and height.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the camera for this offscreen canvas.
    int
    Return the render quality hint for this offscreen canvas.
    void
    Sends a repaint notification the repaint manager if PComponent is not already painting immediately.
    void
    Pops the topmost cursor from the stack and sets it as the current one.
    void
    Pushes the given cursor onto the cursor stack and sets the current cursor to the one provided.
    void
    render(Graphics2D graphics)
    Render this offscreen canvas to the specified graphics.
    void
    repaint(PBounds repaintBounds)
    Called to notify PComponent that given bounds need repainting.
    void
    Set the camera for this offscreen canvas to camera.
    void
    setInteracting(boolean interacting)
    Sets whether the component is currently being interacted with.
    void
    setRenderQuality(int renderQuality)
    Set the render quality hint for this offscreen canvas to renderQuality.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 zero
      height - height of this offscreen canvas, must be at least zero
  • Method Details

    • render

      public void render(Graphics2D graphics)
      Render this offscreen canvas to the specified graphics.
      Parameters:
      graphics - graphics to render this offscreen canvas to, must not be null
    • setCamera

      public void setCamera(PCamera camera)
      Set the camera for this offscreen canvas to camera.
      Parameters:
      camera - camera for this offscreen canvas
    • getCamera

      public PCamera 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 to renderQuality.
      Parameters:
      renderQuality - render quality hint, must be one of PPaintContext.HIGH_QUALITY_RENDERING or PPaintContext.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:
      paintImmediately in interface PComponent
    • popCursor

      public void popCursor()
      Pops the topmost cursor from the stack and sets it as the current one.
      Specified by:
      popCursor in interface PComponent
    • pushCursor

      public void pushCursor(Cursor cursor)
      Pushes the given cursor onto the cursor stack and sets the current cursor to the one provided.
      Specified by:
      pushCursor in interface PComponent
      Parameters:
      cursor - The cursor to set as the current one and push
    • repaint

      public void repaint(PBounds repaintBounds)
      Called to notify PComponent that given bounds need repainting.
      Specified by:
      repaint in interface PComponent
      Parameters:
      repaintBounds - bounds needing repaint
    • setInteracting

      public void setInteracting(boolean interacting)
      Sets whether the component is currently being interacted with.
      Specified by:
      setInteracting in interface PComponent
      Parameters:
      interacting - whether the component is currently being interacted with