Class RMAnimPathShape

  • All Implemented Interfaces:
    Archivable, DeepChangeListener, RMPropertyChanger, RMTypes, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.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 Detail

      • RMAnimPathShape

        public RMAnimPathShape()
        Creates a new RMAnimPathShape.
      • RMAnimPathShape

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

      • 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
      • contains

        public boolean contains​(RMPoint aPoint)
        Overridden to just reflect bounds of anim child.
        Overrides:
        contains in class RMShape
      • 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
      • getDistance

        public float getDistance()
        Returns distance along the path where children are positioned.
        See Also:
        setDistance(float)
      • 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(boolean)
      • 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
      • getSegments

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

        public void positionChildren()
        PositionChildren