Package snap.gfx
Class PainterImpl
java.lang.Object
snap.gfx.Painter
snap.gfx.PainterImpl
- Direct Known Subclasses:
PainterDVR
A basic implementation of a painter.
-
Nested Class Summary
Nested classes/interfaces inherited from class snap.gfx.Painter
Painter.Composite, Painter.Props
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected PainterImpl.GState
protected PainterImpl.GState[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.void
Fill the given shape.getClip()
Return clip shape.getFont()
Returns the current font.Returns the current gstate.Returns the marked shape.double
Returns the opacity.getPaint()
Returns the current paint.Returns the current stroke.Transform by transform.boolean
Returns whether marked shape is opaque.void
restore()
Restores the graphics state.void
save()
Saves the graphics state.void
Sets the current font.void
setOpacity
(double aValue) Sets the opacity.void
Sets the current paint.void
Sets the current 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.Painter
clearRect, clipRect, drawButton, drawButton, drawImage, drawImage, drawLine, drawLineWithPaint, drawRect, drawRectWithPaint, drawString, drawWithPaint, fill3DRect, fillRect, fillRectWithPaint, fillWithPaint, flush, getClipBounds, getColor, getComposite, getImageQuality, getNative, getNative, getProps, isPrinting, isStrokePure, rotate, rotateAround, scale, setAntialiasing, setColor, setComposite, setImageQuality, setPrinting, setProps, setStrokePure, setStrokeWidth, setTransform, toString, transform, translate
-
Field Details
-
_gstate
-
_gstates
-
_gsize
protected int _gsize
-
-
Constructor Details
-
PainterImpl
public PainterImpl()
-
-
Method Details
-
getFont
Returns the current font. -
setFont
Sets the current font. -
getPaint
Returns the current paint. -
setPaint
Sets the current paint. -
getStroke
Returns the current stroke. -
setStroke
Sets the current stroke. -
getOpacity
public double getOpacity()Returns the opacity.- Specified by:
getOpacity
in classPainter
-
setOpacity
public void setOpacity(double aValue) Sets the opacity.- Specified by:
setOpacity
in classPainter
-
draw
Stroke the given shape. -
fill
Fill the given shape. -
drawImage
Draw image with transform. -
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. -
drawString
Draw string at location with char spacing.- Overrides:
drawString
in classPainter
-
strokeString
Stroke string at location with char spacing.- Overrides:
strokeString
in classPainter
-
getMarkedShape
Returns the marked shape. -
isMarkedShapeOpaque
public boolean isMarkedShapeOpaque()Returns whether marked shape is opaque. -
getTransform
Transform by transform.- Specified by:
getTransform
in classPainter
-
setTransform
Transform by transform.- Specified by:
setTransform
in classPainter
-
transform
Transform by transform. -
getClip
Return clip shape. -
clip
Clip by shape. -
save
public void save()Saves the graphics state. -
restore
public void restore()Restores the graphics state. -
getGState
Returns the current gstate.
-