Package snap.gfx

Class PainterImpl

java.lang.Object
snap.gfx.Painter
snap.gfx.PainterImpl
Direct Known Subclasses:
PainterDVR

public abstract class PainterImpl extends Painter
A basic implementation of a painter.
  • Field Details

  • Constructor Details

    • PainterImpl

      public PainterImpl()
  • Method Details

    • getFont

      public Font getFont()
      Returns the current font.
      Specified by:
      getFont in class Painter
    • setFont

      public void setFont(Font aFont)
      Sets the current font.
      Specified by:
      setFont in class Painter
    • getPaint

      public Paint getPaint()
      Returns the current paint.
      Specified by:
      getPaint in class Painter
    • setPaint

      public void setPaint(Paint aPaint)
      Sets the current paint.
      Specified by:
      setPaint in class Painter
    • getStroke

      public Stroke getStroke()
      Returns the current stroke.
      Specified by:
      getStroke in class Painter
    • setStroke

      public void setStroke(Stroke aStroke)
      Sets the current stroke.
      Specified by:
      setStroke in class Painter
    • getOpacity

      public double getOpacity()
      Returns the opacity.
      Specified by:
      getOpacity in class Painter
    • setOpacity

      public void setOpacity(double aValue)
      Sets the opacity.
      Specified by:
      setOpacity in class Painter
    • draw

      public void draw(Shape aShape)
      Stroke the given shape.
      Specified by:
      draw in class Painter
    • fill

      public void fill(Shape aShape)
      Fill the given shape.
      Specified by:
      fill in class Painter
    • drawImage

      public void drawImage(Image anImg, Transform aTrans)
      Draw image with transform.
      Overrides:
      drawImage in class Painter
    • 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.
      Specified by:
      drawImage in class Painter
    • drawString

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

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

      public Shape getMarkedShape()
      Returns the marked shape.
    • isMarkedShapeOpaque

      public boolean isMarkedShapeOpaque()
      Returns whether marked shape is opaque.
    • getTransform

      public Transform getTransform()
      Transform by transform.
      Specified by:
      getTransform in class Painter
    • setTransform

      public void setTransform(Transform aTrans)
      Transform by transform.
      Specified by:
      setTransform in class Painter
    • transform

      public void transform(Transform aTrans)
      Transform by transform.
      Specified by:
      transform in class Painter
    • getClip

      public Shape getClip()
      Return clip shape.
      Specified by:
      getClip in class Painter
    • clip

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

      public void save()
      Saves the graphics state.
      Specified by:
      save in class Painter
    • restore

      public void restore()
      Restores the graphics state.
      Specified by:
      restore in class Painter
    • getGState

      public PainterImpl.GState getGState()
      Returns the current gstate.