Class RMAnimPathShape

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

public class RMAnimPathShape extends RMPolygonShape
A shape that can orient its children along a bezier path.

By being an RMPolygon subclass, this class inherits all the path editing behavior of the polygon. Unlike the base polygon, however, this shape always has 1 or more children. The children shapes will be positioned and oriented at _distance along the path.

  • Constructor Details

    • RMAnimPathShape

      public RMAnimPathShape()
      Creates a new RMAnimPathShape.
    • RMAnimPathShape

      public RMAnimPathShape(RMShape aShape)
      Creates an animpath shape from another shape.
  • Method Details

    • getAnimChild

      public RMShape getAnimChild()
      Returns the animated child shape.
    • setAnimChild

      public void setAnimChild(RMShape aChild)
      Sets the shape which will be positioned along the path
    • addChild

      public void addChild(RMShape aChild, int anIndex)
      Override add child to handle animated child shape special
      Overrides:
      addChild in class RMParentShape
    • getBoundsMarked

      public RMRect getBoundsMarked()
      Overridden to just reflect bounds of anim child.
      Overrides:
      getBoundsMarked in class RMShape
    • getBoundsMarkedDeep

      public RMRect getBoundsMarkedDeep()
      Overridden to just reflect bounds of anim child.
      Overrides:
      getBoundsMarkedDeep in class RMShape
    • contains

      public boolean contains(RMPoint aPoint)
      Overridden to just reflect bounds of anim child.
      Overrides:
      contains in class RMShape
    • clone

      public RMAnimPathShape clone()
      Standard clone implementation.
      Overrides:
      clone in class RMPolygonShape
    • paintShape

      public void paintShape(RMShapePainter aPntr)
      Overridden to skip painting at preview time and to paint stroke (anim path) under child.
      Overrides:
      paintShape in class RMPolygonShape
    • paintShapeOver

      public void paintShapeOver(RMShapePainter aPntr)
      Overridden to skip painting stroke on top.
      Overrides:
      paintShapeOver in class RMShape
    • getDistance

      public float getDistance()
      Returns distance along the path where children are positioned.
      See Also:
    • setDistance

      public void setDistance(float aValue)
      Sets distance along path to position children. Distance is in the range of [0-1] with 0 representing the start of the path and 1 the end.
    • getTotalLength

      public float getTotalLength()
      Returns the actual total arclength of the curve. Used internally by the AnimPath to convert a distance of 0 through 1 to an actual point on the path.
    • getPreservesOrientation

      public boolean getPreservesOrientation()
      Returns whether the children will have their rotation adjusted as they move along the path.
      See Also:
    • setPreservesOrientation

      public void setPreservesOrientation(boolean aValue)
      Sets whether the children's rotation should get adjusted as they move along the path. If flag is true, the original rotation of the shape is 'preserved' relative to the tangent to the path at the current point.
    • getChildOrigin

      public int getChildOrigin()
      Returns the child origin.
    • setChildOrigin

      public void setChildOrigin(int aValue)
      Sets child origin.
    • pathChanged

      public void pathChanged()
      Called by the tool when the path has been changed.
    • setWidth

      public void setWidth(double aValue)
      Overridden to mark the path dirty.
      Overrides:
      setWidth in class RMParentShape
    • setHeight

      public void setHeight(double aValue)
      Overridden to mark the path dirty.
      Overrides:
      setHeight in class RMParentShape
    • setPath

      public void setPath(RMPath aPath)
      Overridden to mark the path dirty
      Overrides:
      setPath in class RMPolygonShape
    • getSegments

      public RMLine[] getSegments()
      Builds the segment list and caches it
    • positionChildren

      public void positionChildren()
      PositionChildren
    • toXMLShape

      protected RXElement toXMLShape(RXArchiver anArchiver)
      XML archival.
      Overrides:
      toXMLShape in class RMPolygonShape
    • fromXMLShape

      protected void fromXMLShape(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      Overrides:
      fromXMLShape in class RMPolygonShape