Package snap.view

Class PathView

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable

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

  • Constructor Details

    • PathView

      public PathView()
      Constructor.
  • Method Details

    • getSvgString

      public String getSvgString()
      Returns the SvgString.
    • setSvgString

      public void setSvgString(String svgString)
      Sets the SvgString.
    • 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
    • initProps

      protected void initProps(PropSet aPropSet)
      Override to support props for this class.
      Overrides:
      initProps in class View
    • getPropValue

      public Object getPropValue(String aPropName)
      Override to support props for this class.
      Overrides:
      getPropValue in class View
    • setPropValue

      public void setPropValue(String aPropName, Object aValue)
      Override to support props for this class.
      Overrides:
      setPropValue 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