Package snap.games

Class PenActor

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable

public class PenActor extends Actor
This actor subclass manages a pen to draw the path that it moves.
  • Field Details

  • Constructor Details

    • PenActor

      public PenActor()
      Constructor.
  • Method Details

    • getPenPoint

      public Point getPenPoint()
      Returns the pen point.
    • isPenDown

      public boolean isPenDown()
      Returns pen down.
    • setPenDown

      public void setPenDown(boolean aValue)
      Sets pen down.
    • penDown

      public void penDown()
      Set pen down.
    • penDown

      public void penDown(Point aPnt)
      Sets the pen down at given location.
    • clearPen

      public void clearPen()
      Clears the pen.
    • setPenColor

      public void setPenColor(String aString)
      Sets the stroke color.
    • setPenWidth

      public void setPenWidth(double aValue)
      Sets the stroke width.
    • lineTo

      public void lineTo(Point aPnt)
      Does a move to.
    • createPath

      protected Path2D createPath()
      Creates a new path.
    • moveBy

      public void moveBy(double aCount)
      Move sprite forward.
      Overrides:
      moveBy in class Actor
    • setShowing

      protected void setShowing(boolean aValue)
      Override to update pen location.
      Overrides:
      setShowing in class ParentView
    • paintPen

      protected void paintPen(Painter aPntr)
      Paints the pen.