Package snap.gfx
Class PainterDVR2
java.lang.Object
snap.gfx.Painter
snap.gfx.PainterImpl
snap.gfx.PainterDVR2
A Painter subclass that records painting operations for later execution instead of executing them immediately.
-
Nested Class Summary
Nested classes/interfaces inherited from class snap.gfx.PainterImpl
PainterImpl.GState
Nested classes/interfaces inherited from class snap.gfx.Painter
Painter.Composite, Painter.Props
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double[]
protected int
protected int[]
protected int
protected int[]
protected int
protected Object[]
protected int
protected Painter
protected String[]
protected int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class snap.gfx.PainterImpl
_gfxState, _gfxStateStack, _gfxStateStackSize
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.PainterDVR2
(Painter aPntr) Constructor for given painter (which supports applyEffect()). -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDouble
(double aValue) Adds a double.void
addInstruction
(int aValue) Adds an instruction.void
addInt
(int aValue) Adds an int.void
Adds a double.void
Adds a string.void
clear()
Clears the instructions stored in this PainterDVR.void
clearRect
(double aX, double aY, double aW, double aH) Clears a rect.void
Clip by shape.void
Stroke the given shape.void
drawImage
(Image image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh) Draw image in rect.void
Draw image with transform.void
drawString
(String aStr, double aX, double aY, double charSpacing) Draw string at location with char spacing.boolean
Standard equals implementation.void
Executes the instructions stored in this PainterDVR to given painter.void
Fill the given shape.void
flush()
Flush any buffered paint operations.getProps()
Override to forward to real painter.void
restore()
Disposes this painter.void
save()
Standard clone implementation.void
Sets the font.void
setImageQuality
(double aValue) Sets image rendering quality.void
setOpacity
(double aValue) Sets the opacity.void
Sets the paint.void
Sets the stroke.void
setTransform
(Transform aTrans) Transform by transform.void
strokeString
(String aStr, double aX, double aY, double charSpacing) Stroke string at location with char spacing.void
Transform by transform.Methods inherited from class snap.gfx.PainterImpl
getClip, getFont, getGState, getMarkedShape, getOpacity, getPaint, getStroke, getTransform, isMarkedShapeOpaque
Methods inherited from class snap.gfx.Painter
clipRect, drawButton, drawButton, drawImage, drawImage, drawLine, drawLineWithPaint, drawRect, drawRectWithPaint, drawString, drawWithPaint, fill3DRect, fillRect, fillRectWithPaint, fillWithPaint, getClipBounds, getColor, getComposite, getImageQuality, getNative, getNative, isPrinting, isStrokePure, rotate, rotateAround, scale, scaleAround, setAntialiasing, setColor, setComposite, setPrinting, setProps, setStrokePure, setStrokeWidth, setTransform, toString, transform, translate
-
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
-
_stringStackSize
protected int _stringStackSize -
_nativeStack
-
_nativeStackSize
protected int _nativeStackSize -
_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
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
Adds a string. -
addNative
Adds a double. -
flush
public void flush()Description copied from class:Painter
Flush any buffered paint operations. -
exec
Executes the instructions stored in this PainterDVR to given painter. -
clear
public void clear()Clears the instructions stored in this PainterDVR. -
setFont
Sets the font.- Overrides:
setFont
in classPainterImpl
-
setPaint
Sets the paint.- Overrides:
setPaint
in classPainterImpl
-
setStroke
Sets the stroke.- Overrides:
setStroke
in classPainterImpl
-
setOpacity
public void setOpacity(double aValue) Sets the opacity.- Overrides:
setOpacity
in classPainterImpl
-
draw
Stroke the given shape.- Overrides:
draw
in classPainterImpl
-
fill
Fill the given shape.- Overrides:
fill
in classPainterImpl
-
drawImage
Draw image with transform.- Overrides:
drawImage
in classPainterImpl
-
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 classPainterImpl
-
drawString
Draw string at location with char spacing.- Overrides:
drawString
in classPainterImpl
-
strokeString
Stroke string at location with char spacing.- Overrides:
strokeString
in classPainterImpl
-
setTransform
Transform by transform.- Overrides:
setTransform
in classPainterImpl
-
transform
Transform by transform.- Overrides:
transform
in classPainterImpl
-
clip
Clip by shape.- Overrides:
clip
in classPainterImpl
-
save
public void save()Standard clone implementation.- Overrides:
save
in classPainterImpl
-
restore
public void restore()Disposes this painter.- Overrides:
restore
in classPainterImpl
-
clearRect
public void clearRect(double aX, double aY, double aW, double aH) Clears a rect. -
setImageQuality
public void setImageQuality(double aValue) Sets image rendering quality.- Overrides:
setImageQuality
in classPainter
-
getProps
Override to forward to real painter. -
equals
Standard equals implementation.
-