Package com.inductiveautomation.rm.shape
Class RMSwitchShape
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMListenerList
-
- com.inductiveautomation.rm.base.RMObject
-
- com.inductiveautomation.rm.shape.RMShape
-
- com.inductiveautomation.rm.shape.RMParentShape
-
- com.inductiveautomation.rm.shape.RMSwitchShape
-
- All Implemented Interfaces:
Archivable,DeepChangeListener,RMPropertyChanger,RMTypes,java.beans.PropertyChangeListener,java.lang.Cloneable,java.util.EventListener
- Direct Known Subclasses:
RMTableRow
public class RMSwitchShape extends RMParentShape
This class represents a sophisticated shape that can maintain multiple versions of itself. For example, a shape can have a "Standard" version and an "Alternate" version (for alternating TableRows).
-
-
Nested Class Summary
-
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 RMSwitchShape()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsChildren()Editor method - specifies that switch shape accepts children.RMSwitchShapeclone()Standard clone implementation.RMSwitchShapecloneDeep()Standard clone deep implementation.protected voidfromXMLShape(RXArchiver anArchiver, RXElement anElement)XML unarchival.java.util.Map<java.lang.String,RMSwitchShape>getAlternates()Returns the map used to hold alternate versions.java.util.Map<java.lang.String,RMSwitchShape>getAlternates(boolean doCreate)Returns the map used to hold alternate versions.RMAnimatorgetChildAnimator(boolean doCreate)Returns the child animator of the switch shape (creating it if absent and requested).java.lang.StringgetDefaultVersionName()Returns the default version name.protected voidgetPropertyNames(java.util.List<java.lang.String> aList)Overridden to add 'Version' to the list of property names you can bind to.java.lang.StringgetVersion()Returns the currently selected version string for the switch shape.RMSwitchShapegetVersion(java.lang.String aName)Returns the switch shape associated with the given version name.java.lang.StringgetVersionKey()Returns the version key used to get the version used in a report.java.util.List<java.lang.String>getVersionNames()Returns a sorted list of all version names contained in the switch shape.booleanhasVersion(java.lang.String aString)Returns whether switch shape has a version with the given name.booleanisDeletable()Override this for shapes (like a table row) that don't don't make sense to delete by themselves.voidpaintShape(RMShapePainter aPntr)Paints switch shape.voidremoveVersion(java.lang.String aString)Removes the version shape associated with the given name from the alternates map.RMShaperpgAll(ReportOwner anRptOwner, RMShape aParent)Report generation.protected RMShaperpgAllSuper(ReportOwner anRptOwner, RMShape aParent)Report generation.protected voidsetChildAnimator(RMAnimator anAnimator)Sets the child animator to the given animator.voidsetVersion(java.lang.String aName)Sets the currently selected version of the switch shape to given version name.voidsetVersionKey(java.lang.String aVersionKey)Sets the version key used to get the version used in a report.voidsetWidth(double aWidth)Overrides standard shape method to resize alternates.voidshapeHidden()Overrides shape implementation to stop animator if it should be playing.protected voidshapeShown()Overrides shape implementation to start animator if it should be playing.booleansuperSelectable()Editor method - specifies that switch shape is super selectable.RXElementtoXML(RXArchiver anArchiver)XML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.protected voidtoXMLChildren(RXArchiver anArchiver, RXElement anElement)XML child archival - override to archive alternates.protected RXElementtoXMLShape(RXArchiver anArchiver)XML archival.protected voidtransferAttributes(RMSwitchShape toShape)This method is used by setVersion to transfers attributes to/from alternate versions.-
Methods inherited from class com.inductiveautomation.rm.shape.RMParentShape
addChild, addChild, addChild, addChild, addLayoutChild, bringShapesToFront, 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, rpgChildren, sendShapesToBack, setHeight, setLayout, setNeedsLayout, setSourceURL
-
Methods inherited from class com.inductiveautomation.rm.shape.RMShape
acceptsMouse, addBinding, addBinding, addDeepChangeListener, addMouseListener, animUpdate, bounds, childrenSuperSelectImmediately, contains, 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, getBoundsMarked, getBoundsMarkedDeep, 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, getPath, getPathInBounds, getPrefHeight, getPrefHeight, getPrefWidth, getPrefWidth, getPropertyNameMapped, 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, 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, paintShapeOver, 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, 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
-
-
-
-
Method Detail
-
getVersion
public java.lang.String getVersion()
Returns the currently selected version string for the switch shape.
-
setVersion
public void setVersion(java.lang.String aName)
Sets the currently selected version of the switch shape to given version name. If the specified version name doesn't yet exist, this method creates a new version for it.
-
transferAttributes
protected void transferAttributes(RMSwitchShape toShape)
This method is used by setVersion to transfers attributes to/from alternate versions.
-
getVersion
public RMSwitchShape getVersion(java.lang.String aName)
Returns the switch shape associated with the given version name.
-
removeVersion
public void removeVersion(java.lang.String aString)
Removes the version shape associated with the given name from the alternates map.
-
getAlternates
public java.util.Map<java.lang.String,RMSwitchShape> getAlternates()
Returns the map used to hold alternate versions.
-
getAlternates
public java.util.Map<java.lang.String,RMSwitchShape> getAlternates(boolean doCreate)
Returns the map used to hold alternate versions.
-
hasVersion
public boolean hasVersion(java.lang.String aString)
Returns whether switch shape has a version with the given name.
-
getVersionNames
public java.util.List<java.lang.String> getVersionNames()
Returns a sorted list of all version names contained in the switch shape.
-
getDefaultVersionName
public java.lang.String getDefaultVersionName()
Returns the default version name.
-
getVersionKey
public java.lang.String getVersionKey()
Returns the version key used to get the version used in a report.
-
setVersionKey
public void setVersionKey(java.lang.String aVersionKey)
Sets the version key used to get the version used in a report.
-
getPropertyNames
protected void getPropertyNames(java.util.List<java.lang.String> aList)
Overridden to add 'Version' to the list of property names you can bind to.- Overrides:
getPropertyNamesin classRMShape
-
getChildAnimator
public RMAnimator getChildAnimator(boolean doCreate)
Returns the child animator of the switch shape (creating it if absent and requested).- Overrides:
getChildAnimatorin classRMShape
-
setChildAnimator
protected void setChildAnimator(RMAnimator anAnimator)
Sets the child animator to the given animator.
-
setWidth
public void setWidth(double aWidth)
Overrides standard shape method to resize alternates.- Overrides:
setWidthin classRMParentShape
-
paintShape
public void paintShape(RMShapePainter aPntr)
Paints switch shape.- Overrides:
paintShapein classRMShape
-
shapeShown
protected void shapeShown()
Overrides shape implementation to start animator if it should be playing.- Overrides:
shapeShownin classRMShape
-
shapeHidden
public void shapeHidden()
Overrides shape implementation to stop animator if it should be playing.- Overrides:
shapeHiddenin classRMShape
-
rpgAll
public RMShape rpgAll(ReportOwner anRptOwner, RMShape aParent)
Report generation.- Overrides:
rpgAllin classRMParentShape
-
rpgAllSuper
protected RMShape rpgAllSuper(ReportOwner anRptOwner, RMShape aParent)
Report generation.
-
clone
public RMSwitchShape clone()
Standard clone implementation.- Overrides:
clonein classRMParentShape
-
cloneDeep
public RMSwitchShape cloneDeep()
Standard clone deep implementation.- Overrides:
cloneDeepin classRMParentShape
-
superSelectable
public boolean superSelectable()
Editor method - specifies that switch shape is super selectable.- Overrides:
superSelectablein classRMShape
-
acceptsChildren
public boolean acceptsChildren()
Editor method - specifies that switch shape accepts children.- Overrides:
acceptsChildrenin classRMShape
-
isDeletable
public boolean isDeletable()
Description copied from class:RMShapeOverride this for shapes (like a table row) that don't don't make sense to delete by themselves.- Overrides:
isDeletablein classRMShape
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.- Specified by:
toXMLin interfaceArchivable- Overrides:
toXMLin classRMParentShape
-
toXMLShape
protected RXElement toXMLShape(RXArchiver anArchiver)
XML archival.- Overrides:
toXMLShapein classRMParentShape
-
toXMLChildren
protected void toXMLChildren(RXArchiver anArchiver, RXElement anElement)
XML child archival - override to archive alternates.- Overrides:
toXMLChildrenin classRMParentShape
-
fromXMLShape
protected void fromXMLShape(RXArchiver anArchiver, RXElement anElement)
XML unarchival.- Overrides:
fromXMLShapein classRMParentShape
-
-