Class RMStarShape

All Implemented Interfaces:
Archivable, DeepChangeListener, RMPropertyChanger, RMTypes, PropertyChangeListener, Cloneable, EventListener

public class RMStarShape extends RMShape
An n pointed star.

A Star is defined as a shape with n equal triangles rotated about a circle such that the startpoint of one triangle is equivalent to the endpoint of the triangle before it. 5 and six pointed triangles give what you'd expect. Other values give interesting, although undoubtedly less useful shapes.

  • Field Details

  • Constructor Details

    • RMStarShape

      public RMStarShape()
  • Method Details

    • getNumPoints

      public int getNumPoints()
      Return the point count.
    • setNumPoints

      public void setNumPoints(int aCount)
      Sets the point count.
    • getBloat

      public double getBloat()
      Return the bloat.
    • setBloat

      public void setBloat(double aBloat)
      Sets the bloat.
    • getOptimalBloat

      public double getOptimalBloat(int npts)
      Returns a value for the inner radius so the stars look reasonable by default.
    • isPolygon

      public boolean isPolygon()
      Returns whether star/polygon is polygon.
    • setIsPolygon

      public void setIsPolygon(boolean pflag)
      Sets whether star/polygon is polygon.
    • setStarType

      public void setStarType(int aType)
      Sets star/polygon type.
    • getStarType

      public int getStarType()
    • setStartAngle

      public void setStartAngle(double anAngle)
    • getPath

      public RMPath getPath()
      Returns the star path.
      Overrides:
      getPath in class RMShape
    • toXML

      public RXElement toXML(RXArchiver anArchiver)
      XML archival.
      Specified by:
      toXML in interface Archivable
      Overrides:
      toXML in class RMShape
    • fromXML

      public Object fromXML(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      Specified by:
      fromXML in interface Archivable
      Overrides:
      fromXML in class RMShape