Package com.reportmill.shape
Class RMSwitchShape
- java.lang.Object
-
- com.reportmill.base.RMObject
-
- com.reportmill.shape.RMShape
-
- com.reportmill.shape.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).
-
-
Field Summary
-
Fields inherited from class com.reportmill.shape.RMShape
WRAP_TYPE_BOTH, WRAP_TYPE_NONE
-
-
Constructor Summary
Constructors Constructor Description RMSwitchShape()Creates a plain switch shape.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsChildren()Editor method - specifies that switch shape accepts children.booleanacceptsMouse()Viewer method.RMSwitchShapealternateShapeInstance()Creates a new switch shape of this same class.java.lang.Objectclone()Standard clone implementation.RMShapecloneDeep()Standard clone deep implementation.voidcopy(java.lang.Object anObj)Standard copy implementation.booleanequals(java.lang.Object anObj)Standard equals implementation.java.lang.ObjectfromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.java.util.MapgetAlternates()Returns the map used to hold alternate versions.RMAnimatorgetChildAnimator(boolean create)Returns the child animator of the switch shape (creating it if absent and requested).java.lang.StringgetDefaultVersionName()Returns the default version name.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.ListgetVersionNames()Returns a sorted list of all version names contained in the switch shape.booleanhasAlternateVersions()Returns whether switch shape has version(s) other than the default.booleanhasMouseVersions()Returns whether switch shape has any mouse versions ("Mouse Over" or "Mouse Down").booleanhasVersion(java.lang.String aString)Returns whether switch shape has a version with the given name.java.lang.ObjectinitWithArchiver(RMArchiver anArchiver)Legacy unarchival.voidmouseEntered(RMViewer aViewer, java.awt.event.MouseEvent anEvent)Viewer method.voidmouseExited(RMViewer aViewer, java.awt.event.MouseEvent anEvent)Viewer method.voidremoveVersion(java.lang.String aString)Removes the version shape associated with the given name from the alternates map.RMShaperpgClone(ReportMill aReportMill)Standard RPG clone method.RMShaperpgClone(ReportMill aReportMill, java.lang.String aVersion)RPG clone with specified version.voidsetAlternates(java.util.Map aMap)Sets the map used to hold alternate versions.voidsetVersion(java.lang.String aName)Sets the currently selected version of the switch shape to given version name.voidsetVersion(java.lang.String aString, RMSwitchShape aShape, boolean makeActive)Sets given shape to be the version for the given name.voidsetVersionKey(java.lang.String aVersionKey)Sets the version key used to get the version used in a report.voidsetWidthDeep(float width, boolean constrain)Overrides standard shape method to resize alternates.booleansuperSelectable()Editor method - specifies that switch shape is super selectable.RXElementtoXML(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.reportmill.shape.RMShape
acceptsDragKeys, acceptsFormat, addChild, addChild, addChildBelowLastChild, bounds, boundsChanged, boundsChanged, bringShapesToFront, canBeUngrouped, childrenSuperSelectImmediately, contains, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedSizeFromShape, convertedSizeToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertSizeFromShape, convertSizeToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, delete, didChange, divideShapeFromEdge, divideShapeFromTop, dragExit, dragKeyAtPoint, dropKeyAtPoint, fromXMLDeep, get, getActionScript, getAnim, getAnim, getAnimator, getAnimator, getAutosizeHeight, getAutosizing, getBounds, getBoundsInside, getBoundsMarked, getBoundsOfChildren, getBoundsOfChildren, getBoundsSuperSelected, getCausesWrap, getCausesWrapType, getChild, getChildAnimator, getChildContaining, getChildCount, getChildLast, getChildren, getChildrenIntersecting, getChildrenWhoCauseWrap, getChildrenWhoDraw, getChildrenWhoHitTest, getChildSortedByX, getChildWithClass, getChildWithName, getColor, getCommonAncestor, getDocument, getFill, getFill, getFill, getFillCount, getFills, getFont, getFormat, getFrame, getFrame, getFrameMaxX, getFrameMaxY, getFrameX, getFrameXY, getFrameY, getGroupShape, getHeight, getHeightToFit, getImageFill, getLineWidth, getListKey, getListKeyDeep, getListKeyShape, getMaxX, getMaxY, getName, getOpacity, getOpacityDeep, getOutline, getPageCount, getPageShape, getParent, getParentCount, getParents, getPath, getPathInBounds, getPropertyKey, getPropertyKeyCount, getPropertyKeyName, getRoll, getRootShape, getScaleX, getScaleY, getShapesToAncestor, getShapesToDescendant, getShapesToShape, getSize, getSizeP, getSkewX, getSkewY, getStroke, getStrokeColor, getTextColor, getToolClassName, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getUrl, getWidth, getWidthToFit, getX, getXY, getXYP, getY, groupShapes, hasPageBreaks, height, indexOf, indexOf, intersects, isAncestor, isDescendant, isLocked, isRoot, isUnderlined, mouseDragged, mouseMoved, mousePressed, mouseReleased, notRSS, offsetChildrenXY, offsetXY, page, pageBreakMax, pageBreakPageMax, pageMax, put, putPropertyKey, reclaimChildren, removeChild, removeChild, removeChildren, removeChildren, removeFromParent, resolvePageReferences, rpgCloneBase, rpgCloneChildren, rpgCloneConclude, rpgCloneNotification, rpgClonePrepare, rpgClonePreprocess, rpgCloneUrl, sendShapesToBack, setActionScript, setAnim, setAutosizeHeight, setAutosizing, setBounds, setBounds, setCausesWrapType, setChildren, setColor, setFill, setFont, setFormat, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHeight, setHeightDeep, setHeightDeep, setHeightToFit, setLineWidth, setListKey, setLocked, setName, setNeedsRepaint, setNeedsRepaint, setOpacity, setOutline, setParent, setRoll, setScaleX, setScaleXY, setScaleY, setSize, setSize, setSizeDeep, setSizeP, setSizeToFit, setSizeToFit, setSkewX, setSkewXY, setSkewY, setStroke, setStrokeColor, setTextColor, setTime, setUnderlined, setUrl, setWidth, setWidthDeep, setWidthToFit, setX, setXY, setXY, setXYP, setY, sizesToFitChildren, toString, undoClone, undoCopy, undoEquals, undoerAddDirtyObject, undoerDisable, undoerEnable, undoerSetUndoTitle, width, willChange, willChange, x, y
-
Methods inherited from class com.reportmill.base.RMObject
didUndo, getAnimAttribute, getClassNameShort
-
-
-
-
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:
getChildAnimatorin classRMShape
-
alternateShapeInstance
public RMSwitchShape alternateShapeInstance()
Creates a new switch shape of this same class.
-
rpgClone
public RMShape rpgClone(ReportMill aReportMill)
Standard RPG clone method.
-
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:
setWidthDeepin classRMShape
-
equals
public boolean equals(java.lang.Object anObj)
Standard equals implementation.
-
copy
public void copy(java.lang.Object anObj)
Standard copy implementation.
-
clone
public java.lang.Object clone()
Standard clone implementation.
-
cloneDeep
public RMShape cloneDeep()
Standard clone deep implementation.
-
acceptsMouse
public boolean acceptsMouse()
Viewer method.- Overrides:
acceptsMousein classRMShape
-
mouseEntered
public void mouseEntered(RMViewer aViewer, java.awt.event.MouseEvent anEvent)
Viewer method.- Overrides:
mouseEnteredin classRMShape
-
mouseExited
public void mouseExited(RMViewer aViewer, java.awt.event.MouseEvent anEvent)
Viewer method.- Overrides:
mouseExitedin classRMShape
-
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
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML archival.
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.
-
initWithArchiver
public java.lang.Object initWithArchiver(RMArchiver anArchiver)
Legacy unarchival.- Specified by:
initWithArchiverin interfaceRMArchiver.Archiving- Overrides:
initWithArchiverin classRMShape
-
-