Class 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).
    • Constructor Detail

      • RMSwitchShape

        public RMSwitchShape()
    • 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:
        getPropertyNames in class RMShape
      • getChildAnimator

        public RMAnimator getChildAnimator​(boolean doCreate)
        Returns the child animator of the switch shape (creating it if absent and requested).
        Overrides:
        getChildAnimator in class RMShape
      • 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:
        setWidth in class RMParentShape
      • shapeShown

        protected void shapeShown()
        Overrides shape implementation to start animator if it should be playing.
        Overrides:
        shapeShown in class RMShape
      • shapeHidden

        public void shapeHidden()
        Overrides shape implementation to stop animator if it should be playing.
        Overrides:
        shapeHidden in class RMShape
      • superSelectable

        public boolean superSelectable()
        Editor method - specifies that switch shape is super selectable.
        Overrides:
        superSelectable in class RMShape
      • acceptsChildren

        public boolean acceptsChildren()
        Editor method - specifies that switch shape accepts children.
        Overrides:
        acceptsChildren in class RMShape
      • isDeletable

        public boolean isDeletable()
        Description copied from class: RMShape
        Override this for shapes (like a table row) that don't don't make sense to delete by themselves.
        Overrides:
        isDeletable in class RMShape