Class RMSwitchShape

All Implemented Interfaces:
Archivable, DeepChangeListener, RMPropertyChanger, RMTypes, PropertyChangeListener, Cloneable, 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 Details

    • RMSwitchShape

      public RMSwitchShape()
  • Method Details

    • getVersion

      public String getVersion()
      Returns the currently selected version string for the switch shape.
    • setVersion

      public void setVersion(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(String aName)
      Returns the switch shape associated with the given version name.
    • removeVersion

      public void removeVersion(String aString)
      Removes the version shape associated with the given name from the alternates map.
    • getAlternates

      public Map<String,RMSwitchShape> getAlternates()
      Returns the map used to hold alternate versions.
    • getAlternates

      public Map<String,RMSwitchShape> getAlternates(boolean doCreate)
      Returns the map used to hold alternate versions.
    • hasVersion

      public boolean hasVersion(String aString)
      Returns whether switch shape has a version with the given name.
    • getVersionNames

      public List<String> getVersionNames()
      Returns a sorted list of all version names contained in the switch shape.
    • getDefaultVersionName

      public String getDefaultVersionName()
      Returns the default version name.
    • getVersionKey

      public String getVersionKey()
      Returns the version key used to get the version used in a report.
    • setVersionKey

      public void setVersionKey(String aVersionKey)
      Sets the version key used to get the version used in a report.
    • getPropertyNames

      protected void getPropertyNames(List<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
    • paintShape

      public void paintShape(RMShapePainter aPntr)
      Paints switch shape.
      Overrides:
      paintShape in class RMShape
    • 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
    • rpgAll

      public RMShape rpgAll(ReportOwner anRptOwner, RMShape aParent)
      Report generation.
      Overrides:
      rpgAll in class RMParentShape
    • rpgAllSuper

      protected RMShape rpgAllSuper(ReportOwner anRptOwner, RMShape aParent)
      Report generation.
    • clone

      public RMSwitchShape clone()
      Standard clone implementation.
      Overrides:
      clone in class RMParentShape
    • cloneDeep

      public RMSwitchShape cloneDeep()
      Standard clone deep implementation.
      Overrides:
      cloneDeep in class RMParentShape
    • 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
    • toXML

      public RXElement toXML(RXArchiver anArchiver)
      XML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.
      Specified by:
      toXML in interface Archivable
      Overrides:
      toXML in class RMParentShape
    • toXMLShape

      protected RXElement toXMLShape(RXArchiver anArchiver)
      XML archival.
      Overrides:
      toXMLShape in class RMParentShape
    • toXMLChildren

      protected void toXMLChildren(RXArchiver anArchiver, RXElement anElement)
      XML child archival - override to archive alternates.
      Overrides:
      toXMLChildren in class RMParentShape
    • fromXMLShape

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