Package snap.gfx
Class PainterDVR
java.lang.Object
snap.gfx.Painter
snap.gfx.PainterImpl
snap.gfx.PainterDVR
A Painter subclass that records painting operations for later execution instead of executing them immediately.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An instruction to clip().static class
An instruction to drawImage(Image,Transform).static class
An instruction to drawImage(Image,Transform).static class
An instruction to draw(Shape).static class
An instruction to drawString(str,x,y,cs).static class
An instruction to fill(Shape).static class
A class to represent instructions.static class
An instruction to restore().static class
An instruction to save().static class
An instruction to setFont().static class
An instruction to setOpacity().static class
An instruction to setPaint().static class
An instruction to setStroke().static class
An instruction to setTransform().static class
An instruction to strokeString(str,x,y,cs).static class
An instruction to transform().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
Fields inherited from class snap.gfx.PainterImpl
_gsize, _gstate, _gstates
-
Constructor Summary
ConstructorDescriptionConstructor.PainterDVR
(Painter aPntr) Creates a new PainterDVR for given painter (which supports applyEffect()). -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(PainterDVR.Instruction anInstr) Adds an instruction.void
clear()
Clears the instructions stored in this PainterDVR.void
Clip by shape.void
Stroke the given shape.void
drawImage
(Image img, 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.Returns image of given shape inside a gutter of given inset (maybe should be insets one day).getProps()
Override to forward to real painter.void
restore()
Disposes this painter.void
save()
Standard clone implementation.void
Sets the font.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
clearRect, clipRect, drawButton, drawButton, drawImage, drawImage, drawLine, drawLineWithPaint, drawRect, drawRectWithPaint, drawString, drawWithPaint, fill3DRect, fillRect, fillRectWithPaint, fillWithPaint, flush, getClipBounds, getColor, getComposite, getImageQuality, getNative, getNative, isPrinting, isStrokePure, rotate, rotateAround, scale, setAntialiasing, setColor, setComposite, setImageQuality, setPrinting, setProps, setStrokePure, setStrokeWidth, setTransform, toString, transform, translate
-
Constructor Details
-
PainterDVR
public PainterDVR()Constructor. -
PainterDVR
Creates a new PainterDVR for given painter (which supports applyEffect()).
-
-
Method Details
-
exec
Executes the instructions stored in this PainterDVR to given painter. -
clear
public void clear()Clears the instructions stored in this PainterDVR. -
getImage
Returns image of given shape inside a gutter of given inset (maybe should be insets one day). -
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 img, 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
-
getProps
Override to forward to real painter. -
add
Adds an instruction. -
equals
Standard equals implementation.
-