ReportMill 11 API

com.reportmill.shape
Class RMSwitchShape

java.lang.Object
  extended by com.reportmill.base.RMObject
      extended by com.reportmill.shape.RMShape
          extended by com.reportmill.shape.RMSwitchShape
All Implemented Interfaces:
com.reportmill.base.RMPropertyChanger, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
RMTableRow

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
RMSwitchShape()
          Creates a plain switch shape.
 
Method Summary
 boolean acceptsChildren()
          Editor method - specifies that switch shape accepts children.
 boolean acceptsMouse()
          Viewer method.
 RMSwitchShape clone()
          Standard clone implementation.
 RMShape cloneDeep()
          Standard clone deep implementation.
 boolean equals(java.lang.Object anObj)
          Standard equals implementation.
 java.lang.Object fromXMLShape(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
          XML unarchival.
 java.util.Map<java.lang.String,RMSwitchShape> getAlternates()
          Returns the map used to hold alternate versions.
 java.util.Map<java.lang.String,RMSwitchShape> getAlternates(boolean create)
          Returns the map used to hold alternate versions.
 com.reportmill.graphics.RMAnimator getChildAnimator(boolean create)
          Returns the child animator of the switch shape (creating it if absent and requested).
 java.lang.String getDefaultVersionName()
          Returns the default version name.
 java.lang.String getVersion()
          Returns the currently selected version string for the switch shape.
 RMSwitchShape getVersion(java.lang.String aName)
          Returns the switch shape associated with the given version name.
 java.lang.String getVersionKey()
          Returns the version key used to get the version used in a report.
 java.util.List<java.lang.String> getVersionNames()
          Returns a sorted list of all version names contained in the switch shape.
 boolean hasAlternateVersions()
          Returns whether switch shape has version(s) other than the default.
 boolean hasMouseVersions()
          Returns whether switch shape has any mouse versions ("Mouse Over" or "Mouse Down").
 boolean hasVersion(java.lang.String aString)
          Returns whether switch shape has a version with the given name.
 void paintShape(com.reportmill.shape.RMShapePainter aPainter, java.awt.Graphics2D g)
          Paints switch shape.
 void removeVersion(java.lang.String aString)
          Removes the version shape associated with the given name from the alternates map.
 void setAlternates(java.util.Map aMap)
          Sets the map used to hold alternate versions.
 void setReportMill(com.reportmill.base.ReportMill aReportMill)
          Report generation.
 void setReportMill(com.reportmill.base.ReportMill aReportMill, java.lang.String aVersion)
          Report generation.
 void setVersion(java.lang.String aName)
          Sets the currently selected version of the switch shape to given version name.
 void setVersion(java.lang.String aString, RMSwitchShape aShape, boolean makeActive)
          Sets given shape to be the version for the given name.
 void setVersionKey(java.lang.String aVersionKey)
          Sets the version key used to get the version used in a report.
 void setWidth(float aWidth)
          Overrides standard shape method to resize alternates.
 void shapeHidden()
          Overrides shape implementation to stop animator if it should be playing.
 void shapeShown()
          Overrides shape implementation to start animator if it should be playing.
 boolean superSelectable()
          Editor method - specifies that switch shape is super selectable.
 com.reportmill.archiver.RXElement toXMLShape(com.reportmill.archiver.RXArchiver anArchiver, java.lang.Object anOwner)
          XML archival.
 void toXMLShapeChildren(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
          XML child archival - override to archive alternates.
 
Methods inherited from class com.reportmill.shape.RMShape
addBinding, addChild, addChild, animUpdate, bounds, boundsChanged, boundsChanged, bringShapesToFront, checkBindings, childrenSuperSelectImmediately, contains, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedSizeFromShape, convertedSizeToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertSizeFromShape, convertSizeToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, createDivideShapeRemainder, createLayout, createPartClone, divideShapeFromEdge, divideShapeFromTop, doLayout, firePropertyChange, fromXML, fromXMLShapeChildren, get, getAction, getAncestor, getAncestorCount, getAncestorInCommon, getAnim, getAnim, getAnimator, getAnimator, getAspectMapped, getAspects, getAutosizeHeight, getAutosizing, getBinder, getBinding, getBinding, getBindingCount, getBounds, getBoundsInside, getBoundsMarked, getBoundsMarkedDeep, getBoundsOfChildren, getCausesWrap, getCausesWrapType, getChild, getChildAnimator, getChildArray, getChildClipShape, getChildContaining, getChildCount, getChildCountHitable, getChildCountLayout, getChildCountVisible, getChildHitable, getChildLast, getChildLayout, getChildren, getChildrenIntersecting, getChildrenWhoCauseWrap, getChildrenWithClass, getChildrenWithClass, getChildVisible, getChildWithClass, getChildWithName, getClipShape, getColor, getDatasetEntity, getDatasetKey, getDocument, getEffect, getFill, getFill, getFillCount, getFont, getFormat, getFrame, getFrame, getFrameMaxX, getFrameMaxY, getFrameX, getFrameXY, getFrameY, getHeight, getHeightToFit, getImageFill, getLayout, getLineWidth, getMaskPath, getMaxX, getMaxY, getName, getOpacity, getOpacityDeep, getOriginal, getOutline, getPageBreak, getPageBreakMax, getPageBreakPage, getPageBreakPageMax, getPageShape, getParent, getParentWithClass, getPart, getPartCount, getPartDeep, getPartDeepCount, getPath, getPathInBounds, getReportMill, getRoll, getRootShape, getScaleX, getScaleY, getShapesToAncestor, getShapesToDescendant, getShapesToShape, getSize, getSizeP, getSkewX, getSkewY, getStroke, getStrokeColor, getTextColor, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getUrl, getVisbileBounds, getVisibleBounds, getVisibleBounds, getVisibleBounds, getWidth, getWidthToFit, getX, getXY, getXYP, getY, height, indexOf, indexOfChild, intersects, isAncestor, isAnimProperty, isDescendant, isEditing, isLocked, isMouseDown, isMouseOver, isRoot, isShowing, isUnderlined, isValid, isViewing, isVisible, layoutReset, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, notRSS, offsetChildrenXY, offsetXY, page, pageMax, paint, paintShapeAll, paintShapeChildren, paintShapeOver, propertyChange, put, removeBinding, removeBinding, removeChild, removeChild, removeChildren, removeFromParent, repaint, repaint, resolvePageReferences, revalidate, sendShapesToBack, setAction, setAnim, setAutosizeHeight, setAutosizing, setBounds, setBounds, setCausesWrap, setCausesWrapType, setColor, setEffect, setFill, setFont, setFormat, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHeight, setHeightToFit, setLayout, setLayoutEnabled, setLineWidth, setLocked, setName, setOpacity, setOutline, setParent, setReportMillBindings, setReportMillDeep, setRoll, setScaleX, setScaleXY, setScaleY, setSize, setSize, setSizeP, setSizeToFit, setSizeToFit, setSkewX, setSkewXY, setSkewY, setStroke, setStrokeColor, setTextColor, setTime, setUnderlined, setUrl, setVisible, setWidthToFit, setX, setXY, setXY, setXYP, setY, sizesToFitChildren, toString, toXML, undoerDisable, undoerEnable, undoerSetUndoTitle, validate, width, x, y
 
Methods inherited from class com.reportmill.base.RMObject
addListener, addPropertyChangeListener, firePropertyChange, getListener, getListenerCount, getListeners, isFirePropertyChangeEnabled, isUndoing, removeListener, removePropertyChangeListener, setFirePropertyChangeEnabled, setUndoing
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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<java.lang.String,RMSwitchShape> getAlternates()
Returns the map used to hold alternate versions.


getAlternates

public java.util.Map<java.lang.String,RMSwitchShape> getAlternates(boolean create)
Returns the map used to hold alternate versions.


setAlternates

public void setAlternates(java.util.Map aMap)
Sets 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.


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<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.


getChildAnimator

public com.reportmill.graphics.RMAnimator getChildAnimator(boolean create)
Returns the child animator of the switch shape (creating it if absent and requested).

Overrides:
getChildAnimator in class RMShape

setWidth

public void setWidth(float aWidth)
Overrides standard shape method to resize alternates.

Overrides:
setWidth in class RMShape

paintShape

public void paintShape(com.reportmill.shape.RMShapePainter aPainter,
                       java.awt.Graphics2D g)
Paints switch shape.

Overrides:
paintShape in class RMShape

shapeShown

public 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

setReportMill

public void setReportMill(com.reportmill.base.ReportMill aReportMill)
Report generation.

Overrides:
setReportMill in class RMShape

setReportMill

public void setReportMill(com.reportmill.base.ReportMill aReportMill,
                          java.lang.String aVersion)
Report generation.


equals

public boolean equals(java.lang.Object anObj)
Standard equals implementation.

Overrides:
equals in class RMShape

clone

public RMSwitchShape 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

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

toXMLShape

public com.reportmill.archiver.RXElement toXMLShape(com.reportmill.archiver.RXArchiver anArchiver,
                                                    java.lang.Object anOwner)
XML archival.

Overrides:
toXMLShape in class RMShape

toXMLShapeChildren

public void toXMLShapeChildren(com.reportmill.archiver.RXArchiver anArchiver,
                               com.reportmill.archiver.RXElement anElement,
                               java.lang.Object anOwner)
XML child archival - override to archive alternates.

Overrides:
toXMLShapeChildren in class RMShape

fromXMLShape

public java.lang.Object fromXMLShape(com.reportmill.archiver.RXArchiver anArchiver,
                                     com.reportmill.archiver.RXElement anElement,
                                     java.lang.Object anOwner)
XML unarchival.

Overrides:
fromXMLShape in class RMShape

ReportMill 11 API