Package snap.gfx

Class PainterDVR2


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

    • _instructionStack

      protected int[] _instructionStack
    • _instructionStackSize

      protected int _instructionStackSize
    • _intStack

      protected int[] _intStack
    • _intStackSize

      protected int _intStackSize
    • _doubleStack

      protected double[] _doubleStack
    • _doubleStackSize

      protected int _doubleStackSize
    • _stringStack

      protected String[] _stringStack
    • _stringStackSize

      protected int _stringStackSize
    • _nativeStack

      protected Object[] _nativeStack
    • _nativeStackSize

      protected int _nativeStackSize
    • _pntr

      protected Painter _pntr
    • SET_FONT

      public static final int SET_FONT
      See Also:
    • SET_PAINT

      public static final int SET_PAINT
      See Also:
    • SET_STROKE

      public static final int SET_STROKE
      See Also:
    • SET_OPACITY

      public static final int SET_OPACITY
      See Also:
    • DRAW_SHAPE

      public static final int DRAW_SHAPE
      See Also:
    • FILL_SHAPE

      public static final int FILL_SHAPE
      See Also:
    • CLIP_SHAPE

      public static final int CLIP_SHAPE
      See Also:
    • DRAW_IMAGE

      public static final int DRAW_IMAGE
      See Also:
    • DRAW_IMAGE2

      public static final int DRAW_IMAGE2
      See Also:
    • DRAW_STRING

      public static final int DRAW_STRING
      See Also:
    • STROKE_STRING

      public static final int STROKE_STRING
      See Also:
    • TRANSFORM

      public static final int TRANSFORM
      See Also:
    • SET_TRANSFORM

      public static final int SET_TRANSFORM
      See Also:
    • GSAVE

      public static final int GSAVE
      See Also:
    • GRESTORE

      public static final int GRESTORE
      See Also:
    • CLEAR_RECT

      public static final int CLEAR_RECT
      See Also:
    • SET_IMAGE_QUALITY

      public static final int SET_IMAGE_QUALITY
      See Also:
  • Constructor Details

    • PainterDVR2

      public PainterDVR2()
      Constructor.
    • PainterDVR2

      public PainterDVR2(Painter aPntr)
      Constructor for given painter (which supports applyEffect()).
  • Method Details

    • addInstruction

      public void addInstruction(int aValue)
      Adds an instruction.
    • addInt

      public void addInt(int aValue)
      Adds an int.
    • addDouble

      public void addDouble(double aValue)
      Adds a double.
    • addString

      public void addString(String aValue)
      Adds a string.
    • addNative

      public void addNative(Object aValue)
      Adds a double.
    • flush

      public void flush()
      Description copied from class: Painter
      Flush any buffered paint operations.
      Overrides:
      flush in class Painter
    • 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.
    • 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 image, Transform aTrans)
      Draw image with transform.
      Overrides:
      drawImage in class PainterImpl
    • drawImage

      public void drawImage(Image image, 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
    • clearRect

      public void clearRect(double aX, double aY, double aW, double aH)
      Clears a rect.
      Overrides:
      clearRect in class Painter
    • setImageQuality

      public void setImageQuality(double aValue)
      Sets image rendering quality.
      Overrides:
      setImageQuality in class Painter
    • getProps

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

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