Class RMSwitchShape

All Implemented Interfaces:
RMArchiver.Archiving, Cloneable
Direct Known Subclasses:
RMGraph.BarLabel, RMTableRow, RMTableRowRPG

public class RMSwitchShape extends RMShape
This class represents a sophisticated shape that can maintain multiple versions of itself. For example, a shape can have a "Standard" version and a "Mouse Over" version (to define the attributes of this shape when the mouse hovers over it).
  • Constructor Details

    • RMSwitchShape

      public RMSwitchShape()
      Creates a plain switch shape.
  • 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.
    • getVersion

      public RMSwitchShape getVersion(String aName)
      Returns the switch shape associated with the given version name.
    • setVersion

      public void setVersion(String aString, RMSwitchShape aShape, boolean makeActive)
      Sets given shape to be the version for the given name. If makeActive, then it makes given version active as well.
    • removeVersion

      public void removeVersion(String aString)
      Removes the version shape associated with the given name from the alternates map.
    • 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.
    • getAlternates

      public Map getAlternates()
      Returns the map used to hold alternate versions.
    • setAlternates

      public void setAlternates(Map aMap)
      Sets the map used to hold alternate versions.
    • transferAttributes

      protected void transferAttributes(RMSwitchShape toShape)
      This method is used by setVersion to transfers attributes to/from alternate versions.
    • hasVersion

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

      public boolean hasAlternateVersions()
      Returns whether switch shape has version(s) other than the default.
    • hasMouseVersions

      public boolean hasMouseVersions()
      Returns whether switch shape has any mouse versions ("Mouse Over" or "Mouse Down").
    • getVersionNames

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

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

      public RMAnimator getChildAnimator(boolean create)
      Returns the child animator of the switch shape (creating it if absent and requested).
      Overrides:
      getChildAnimator in class RMShape
    • alternateShapeInstance

      public RMSwitchShape alternateShapeInstance()
      Creates a new switch shape of this same class.
    • rpgClone

      public RMShape rpgClone(ReportMill aReportMill)
      Standard RPG clone method.
      Overrides:
      rpgClone in class RMShape
    • rpgClone

      public RMShape rpgClone(ReportMill aReportMill, String aVersion)
      RPG clone with specified version.
    • setWidthDeep

      public void setWidthDeep(float width, boolean constrain)
      Overrides standard shape method to resize alternates.
      Overrides:
      setWidthDeep in class RMShape
    • equals

      public boolean equals(Object anObj)
      Standard equals implementation.
      Overrides:
      equals in class RMShape
    • copy

      public void copy(Object anObj)
      Standard copy implementation.
      Overrides:
      copy in class RMShape
    • clone

      public Object clone()
      Standard clone implementation.
      Overrides:
      clone in class RMShape
    • cloneDeep

      public RMShape cloneDeep()
      Standard clone deep implementation.
      Overrides:
      cloneDeep in class RMShape
    • acceptsMouse

      public boolean acceptsMouse()
      Viewer method.
      Overrides:
      acceptsMouse in class RMShape
    • mouseEntered

      public void mouseEntered(RMViewer aViewer, MouseEvent anEvent)
      Viewer method.
      Overrides:
      mouseEntered in class RMShape
    • mouseExited

      public void mouseExited(RMViewer aViewer, MouseEvent anEvent)
      Viewer method.
      Overrides:
      mouseExited 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
    • toXML

      public RXElement toXML(RXArchiver anArchiver)
      XML archival.
      Overrides:
      toXML in class RMShape
    • fromXML

      public Object fromXML(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      Overrides:
      fromXML in class RMShape
    • initWithArchiver

      public Object initWithArchiver(RMArchiver anArchiver)
      Legacy unarchival.
      Specified by:
      initWithArchiver in interface RMArchiver.Archiving
      Overrides:
      initWithArchiver in class RMShape