Package snap.view

Class PathView

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable

public class PathView extends View
A class to show a path shape.
  • Constructor Details

    • PathView

      public PathView()
      Constructor.
  • Method Details

    • getPath

      public Path2D getPath()
      Returns the path.
    • setPath

      public void setPath(Shape aPath)
      Sets the path.
    • resetPathAndBounds

      public void resetPathAndBounds(Shape aShape)
      Replace the polygon's current path with a new path, adjusting the shape's bounds to match the new path.
    • getBoundsShape

      public Shape getBoundsShape()
      Override to return path as bounds shape.
      Overrides:
      getBoundsShape in class View
    • getPrefWidthImpl

      protected double getPrefWidthImpl(double aH)
      Calculates the preferred width.
      Overrides:
      getPrefWidthImpl in class View
    • getPrefHeightImpl

      protected double getPrefHeightImpl(double aW)
      Calculates the preferred height.
      Overrides:
      getPrefHeightImpl in class View
    • toXML

      public XMLElement toXML(XMLArchiver anArchiver)
      XML archival.
      Specified by:
      toXML in interface XMLArchiver.Archivable
      Overrides:
      toXML in class View
    • fromXML

      public Object fromXML(XMLArchiver anArchiver, XMLElement anElement)
      XML unarchival.
      Specified by:
      fromXML in interface XMLArchiver.Archivable
      Overrides:
      fromXML in class View