Package snap.gfx

Class PainterDVR


public class PainterDVR extends PainterImpl
A Painter subclass that records painting operations for later execution instead of executing them immediately.
  • Constructor Details

    • PainterDVR

      public PainterDVR()
      Constructor.
    • PainterDVR

      public PainterDVR(Painter aPntr)
      Creates a new PainterDVR for given painter (which supports applyEffect()).
  • Method Details

    • exec

      public void exec(Painter aPntr)
      Executes the instructions stored in this PainterDVR to given painter.
    • clear

      public void clear()
      Clears the instructions stored in this PainterDVR.
    • getImage

      public Image getImage(Rect aRect, int anInset)
      Returns image of given shape inside a gutter of given inset (maybe should be insets one day).
    • setFont

      public void setFont(Font aFont)
      Sets the font.
      Overrides:
      setFont in class PainterImpl
    • setPaint

      public void setPaint(Paint aPaint)
      Sets the paint.
      Overrides:
      setPaint in class PainterImpl
    • setStroke

      public void setStroke(Stroke aStroke)
      Sets the stroke.
      Overrides:
      setStroke in class PainterImpl
    • setOpacity

      public void setOpacity(double aValue)
      Sets the opacity.
      Overrides:
      setOpacity in class PainterImpl
    • draw

      public void draw(Shape aShape)
      Stroke the given shape.
      Overrides:
      draw in class PainterImpl
    • fill

      public void fill(Shape aShape)
      Fill the given shape.
      Overrides:
      fill in class PainterImpl
    • drawImage

      public void drawImage(Image anImg, Transform aTrans)
      Draw image with transform.
      Overrides:
      drawImage in class PainterImpl
    • drawImage

      public void drawImage(Image img, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh)
      Draw image in rect.
      Overrides:
      drawImage in class PainterImpl
    • drawString

      public void drawString(String aStr, double aX, double aY, double charSpacing)
      Draw string at location with char spacing.
      Overrides:
      drawString in class PainterImpl
    • strokeString

      public void strokeString(String aStr, double aX, double aY, double charSpacing)
      Stroke string at location with char spacing.
      Overrides:
      strokeString in class PainterImpl
    • setTransform

      public void setTransform(Transform aTrans)
      Transform by transform.
      Overrides:
      setTransform in class PainterImpl
    • transform

      public void transform(Transform aTrans)
      Transform by transform.
      Overrides:
      transform in class PainterImpl
    • clip

      public void clip(Shape aShape)
      Clip by shape.
      Overrides:
      clip in class PainterImpl
    • save

      public void save()
      Standard clone implementation.
      Overrides:
      save in class PainterImpl
    • restore

      public void restore()
      Disposes this painter.
      Overrides:
      restore in class PainterImpl
    • getProps

      public Painter.Props getProps()
      Override to forward to real painter.
      Overrides:
      getProps in class Painter
    • add

      public void add(PainterDVR.Instruction anInstr)
      Adds an instruction.
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class Object