Class RMSwitchShape

  • All Implemented Interfaces:
    RMArchiver.Archiving, java.lang.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 Detail

      • RMSwitchShape

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

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

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

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

        public void setAlternates​(java.util.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​(java.lang.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 java.util.List 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.
      • 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,
                                java.lang.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​(java.lang.Object anObj)
        Standard equals implementation.
        Overrides:
        equals in class RMShape
      • copy

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

        public java.lang.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,
                                 java.awt.event.MouseEvent anEvent)
        Viewer method.
        Overrides:
        mouseEntered in class RMShape
      • mouseExited

        public void mouseExited​(RMViewer aViewer,
                                java.awt.event.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