Package com.inductiveautomation.rm.shape
Class RMAnimPathShape
- java.lang.Object
-
- 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RMAnimPathShape.RMAnimPathGroup
A shape subclass that adds the ability to be rotated about an arbitrary point.-
Nested classes/interfaces inherited from interface com.inductiveautomation.rm.base.RMTypes
RMTypes.Align, RMTypes.AlignX, RMTypes.AlignY
-
-
Field Summary
-
Fields inherited from class com.inductiveautomation.rm.shape.RMShape
BINDING_PROP_NAME, STROKE_BORDER, STROKE_DOUBLE, STROKE_HIDDEN, STROKE_SHAPE
-
-
Constructor Summary
Constructors Constructor Description RMAnimPathShape()
Creates a new RMAnimPathShape.RMAnimPathShape(RMShape aShape)
Creates an animpath shape from another shape.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(RMShape aChild, int anIndex)
Override add child to handle animated child shape specialRMAnimPathShape
clone()
Standard clone implementation.boolean
contains(RMPoint aPoint)
Overridden to just reflect bounds of anim child.protected void
fromXMLShape(RXArchiver anArchiver, RXElement anElement)
XML unarchival.RMShape
getAnimChild()
Returns the animated child shape.RMRect
getBoundsMarked()
Overridden to just reflect bounds of anim child.RMRect
getBoundsMarkedDeep()
Overridden to just reflect bounds of anim child.int
getChildOrigin()
Returns the child origin.float
getDistance()
Returns distance along the path where children are positioned.boolean
getPreservesOrientation()
Returns whether the children will have their rotation adjusted as they move along the path.RMLine[]
getSegments()
Builds the segment list and caches itfloat
getTotalLength()
Returns the actual total arclength of the curve.void
paintShape(RMShapePainter aPntr)
Overridden to skip painting at preview time and to paint stroke (anim path) under child.void
paintShapeOver(RMShapePainter aPntr)
Overridden to skip painting stroke on top.void
pathChanged()
Called by the tool when the path has been changed.void
positionChildren()
PositionChildrenvoid
setAnimChild(RMShape aChild)
Sets the shape which will be positioned along the pathvoid
setChildOrigin(int aValue)
Sets child origin.void
setDistance(float aValue)
Sets distance along path to position children.void
setHeight(double aValue)
Overridden to mark the path dirty.void
setPath(RMPath aPath)
Overridden to mark the path dirtyvoid
setPreservesOrientation(boolean aValue)
Sets whether the children's rotation should get adjusted as they move along the path.void
setWidth(double aValue)
Overridden to mark the path dirty.protected RXElement
toXMLShape(RXArchiver anArchiver)
XML archival.-
Methods inherited from class com.inductiveautomation.rm.shape.RMPolygonShape
getPath, getPathTransform, resetPath, superSelectable
-
Methods inherited from class com.inductiveautomation.rm.shape.RMParentShape
addChild, addChild, addChild, addLayoutChild, bringShapesToFront, cloneDeep, computePrefHeight, computePrefWidth, divideShapeFromTop, fromXML, fromXMLChildren, getBoundsOfChildren, getChild, getChildArray, getChildContaining, getChildCount, getChildLast, getChildren, getChildrenIntersecting, getChildrenWithClass, getChildrenWithClass, getChildWithClass, getChildWithName, getLayout, getNeedsLayout, getSourceURL, indexOfChild, isHittable, isShowing, isSourceURLSet, layout, layoutChildren, relayout, removeChild, removeChild, removeChildren, removeLayoutChild, rpgAll, rpgChildren, sendShapesToBack, setLayout, setNeedsLayout, setSourceURL, toXML, toXMLChildren
-
Methods inherited from class com.inductiveautomation.rm.shape.RMShape
acceptsChildren, acceptsMouse, addBinding, addBinding, addDeepChangeListener, addMouseListener, animUpdate, bounds, childrenSuperSelectImmediately, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, createDivideShapeRemainder, deepChange, divideShapeFromEdge, get, get, getAlignment, getAlignmentX, getAlignmentY, getAncestor, getAncestorCount, getAncestorInCommon, getAnimator, getAnimator, getAutosizing, getAutosizingDefault, getBestHeight, getBestHeight, getBestWidth, getBestWidth, getBinding, getBinding, getBindingCount, getBindings, getBounds, getBoundsInside, getChildAnimator, getChildAnimator, getChildClipShape, getClipShape, getColor, getDashArrayString, getDashPhase, getDatasetEntity, getDatasetKey, getDisplayedFill, getDisplayedStroke, getDocument, getEffect, getEventAdapter, getFill, getFont, getFormat, getFrame, getFrameHeight, getFrameMaxX, getFrameMaxY, getFrameWidth, getFrameX, getFrameXY, getFrameY, getHeight, getHover, getLayoutInfo, getMaskPath, getMaxX, getMaxY, getMinHeight, getMinHeight, getMinWidth, getMinWidth, getName, getOpacity, getOpacityDeep, getOutline, getPageBreak, getPageBreakMax, getPageBreakPage, getPageBreakPageMax, getPageShape, getParent, getParent, getPathInBounds, getPrefHeight, getPrefHeight, getPrefWidth, getPrefWidth, getPropertyNameMapped, getPropertyNames, getPropertyNames, getRoll, getRootShape, getRSS, getScaleX, getScaleY, getShapesToAncestor, getShapesToDescendant, getShapesToShape, getSize, getSkewX, getSkewY, getStroke, getStrokeColor, getStrokeOnTop, getStrokeStyle, getStrokeWidth, getTextColor, getTimeline, getTimeline, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getURL, getVisbileBounds, getVisibleBounds, getVisibleBounds, getVisibleBounds, getWidth, getX, getXY, getXYP, getY, height, indexOf, intersects, isAncestor, isAnimProperty, isDeletable, isDescendant, isEditing, isEnabled, isFontSet, isHittable, isLocked, isMinHeightSet, isMinWidthSet, isPrefHeightSet, isPrefWidthSet, isRoot, isRSS, isShowing, isUnderlined, isUseFill, isUseStroke, isViewing, isVisible, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, offsetXY, page, pageMax, paint, paintShapeAll, paintShapeChildren, propertyChange, put, removeBinding, removeBinding, removeDeepChangeListener, removeFromParent, removeMouseListener, repaint, repaint, resolvePageReferences, rpgBindings, rpgShape, setAlignment, setAlignmentX, setAlignmentY, setAutosizing, setBestHeight, setBestSize, setBounds, setBounds, setColor, setDashArrayString, setDashPhase, setEffect, setEnabled, setFill, setFont, setFormat, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHover, setLayoutInfo, setLocked, setMinHeight, setMinSize, setMinWidth, setName, setOpacity, setOutline, setParent, setPrefHeight, setPrefWidth, setRoll, setScaleX, setScaleXY, setScaleY, setShowing, setSize, setSize, setSkewX, setSkewXY, setSkewY, setStroke, setStrokeColor, setStrokeStyle, setStrokeWidth, setTextColor, setTime, setTimeline, setUnderlined, setURL, setUseFill, setUseStroke, setVisible, setX, setXY, setXY, setXYP, setY, shapeHidden, shapeShown, toString, undoerDisable, undoerEnable, undoerSetUndoTitle, width, x, y
-
Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
-
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
-
-
-
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 classRMParentShape
-
getBoundsMarked
public RMRect getBoundsMarked()
Overridden to just reflect bounds of anim child.- Overrides:
getBoundsMarked
in classRMShape
-
getBoundsMarkedDeep
public RMRect getBoundsMarkedDeep()
Overridden to just reflect bounds of anim child.- Overrides:
getBoundsMarkedDeep
in classRMShape
-
contains
public boolean contains(RMPoint aPoint)
Overridden to just reflect bounds of anim child.
-
clone
public RMAnimPathShape clone()
Standard clone implementation.- Overrides:
clone
in classRMPolygonShape
-
paintShape
public void paintShape(RMShapePainter aPntr)
Overridden to skip painting at preview time and to paint stroke (anim path) under child.- Overrides:
paintShape
in classRMPolygonShape
-
paintShapeOver
public void paintShapeOver(RMShapePainter aPntr)
Overridden to skip painting stroke on top.- Overrides:
paintShapeOver
in classRMShape
-
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 classRMParentShape
-
setHeight
public void setHeight(double aValue)
Overridden to mark the path dirty.- Overrides:
setHeight
in classRMParentShape
-
setPath
public void setPath(RMPath aPath)
Overridden to mark the path dirty- Overrides:
setPath
in classRMPolygonShape
-
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 classRMPolygonShape
-
fromXMLShape
protected void fromXMLShape(RXArchiver anArchiver, RXElement anElement)
XML unarchival.- Overrides:
fromXMLShape
in classRMPolygonShape
-
-