ReportMill 11 API

com.reportmill.shape
Class RMShape

java.lang.Object
  extended by com.reportmill.base.RMObject
      extended by com.reportmill.shape.RMShape
All Implemented Interfaces:
com.reportmill.base.RMPropertyChanger, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
RMDocument, RMGraph, RMGraphArea, RMGraphPartBars, RMGraphPartPie, RMGraphViewBar, RMGraphViewPie, RMLabel, RMLabels, RMLineSegment, RMOval, RMPage, RMPolygon, RMRectangle, com.reportmill.shape.RMScene3D, RMSound, com.reportmill.shape.RMSplitShape, RMSwitchShape, RMTableGroup

public class RMShape
extends com.reportmill.base.RMObject
implements java.beans.PropertyChangeListener

This class is the basis for all graphic elements in a ReportMill document. You'll rarely use this class directly, however, it encapsulates all the basic shape attributes and the most common methods used in template manipulation, like setX(), setY(), setWidth(), setColor(), etc. Here's an example of programatically adding a watermark to a document:

   RMFont font = RMFont.getFont("Arial Bold", 72);
   RMColor color = new RMColor(.9f, .9f, .9f);
   RMXString string = new RMXString("REPORTMILL", font, color);
   RMText shape = new RMText(string);
   myDocument.getPage(0).addChild(shape);
   shape.setBounds(36, 320, 540, 140);
   shape.setRoll(45);
   shape.setOpacity(.667f);
 


Field Summary
static byte WRAP_TYPE_BOTH
           
static byte WRAP_TYPE_NONE
           
 
Constructor Summary
RMShape()
          Creates a plain shape.
RMShape(RMShape aShape)
          Creates a shape with the same basic attributes as the given shape.
 
Method Summary
 boolean acceptsChildren()
          Editor method.
 boolean acceptsMouse()
          Returns whether shape accepts mouse events.
 void addBinding(com.reportmill.binder.RMBinding aBinding)
          Adds the individual binding to the shape's bindings list.
 void addChild(RMShape aChild)
          Adds the given child to the end of this shape's children list.
 void addChild(RMShape aChild, int anIndex)
          Adds the given child to this shape's children list at the given index.
 void animUpdate(java.beans.PropertyChangeEvent anEvent)
          Called to update shape anim.
 RMRect bounds()
          Returns raw x, y, width and height of shape as rect (preserves possible negative sizes).
 void boundsChanged()
          Notifies a shape and its parents that its bounds changed.
 void boundsChanged(RMShape aShape)
          Notifies this shape that a given shape's bounds have changed (presumably a descendant).
 void bringShapesToFront(java.util.List<RMShape> shapes)
          Moves the subset of children in the given list to the front of the children list.
 void checkBindings()
          Notifies shape that binder was added.
 boolean childrenSuperSelectImmediately()
          Editor method.
 RMShape clone()
          Standard implementation of Object clone.
 RMShape cloneDeep()
          Clones all attributes of this shape with complete clones of its children as well.
 boolean contains(RMPoint aPoint)
          Returns whether this shape is hit by the point, given in this shape's parent's coords.
 RMPoint convertedPointFromShape(RMPoint aPoint, RMShape aShape)
          Returns the given point converted from the given shape's coords.
 RMPoint convertedPointToShape(RMPoint aPoint, RMShape aShape)
          Returns the given point converted to the given shape's coords.
 RMRect convertedRectFromShape(RMRect aRect, RMShape aShape)
          Returns the rect encompassing the given rect converted from the given shape's coords.
 RMRect convertedRectToShape(RMRect aRect, RMShape aShape)
          Returns the rect encompassing the given rect converted to the given shape's coords.
 RMSize convertedSizeFromShape(RMSize aSize, RMShape aShape)
          Returns the given size converted from the given shape's coords.
 RMSize convertedSizeToShape(RMSize aSize, RMShape aShape)
          Returns the given size converted to the given shape's coords.
 RMSize convertedVectorFromShape(RMSize aSize, RMShape aShape)
          Returns the given size converted from the given shape's coords and normalized.
 RMSize convertedVectorToShape(RMSize aSize, RMShape aShape)
          Returns the given size converted to the given shape's coords and normalized.
 void convertFromShape(RMShape aShape)
          Transforms the given shape from this shape's coords.
 RMPath convertPathFromShape(RMPath aPath, RMShape aShape)
          Returns the given path converted from the given shape's coords.
 RMPath convertPathToShape(RMPath aPath, RMShape aShape)
          Returns the given path converted to the given shape's coords.
 RMPoint convertPointFromShape(RMPoint point, RMShape shape)
          Converts the given point to the given shape's coords (returns it for convenience).
 RMPoint convertPointToShape(RMPoint point, RMShape shape)
          Converts the given point to the given shape's coords (returns it for convenience).
 RMRect convertRectFromShape(RMRect rect, RMShape shape)
          Converts the given rect from the given shape's coords (returns it for convenience).
 RMRect convertRectToShape(RMRect rect, RMShape shape)
          Converts the given rect to the given shape's coords (returns it for convenience).
 RMSize convertSizeFromShape(RMSize size, RMShape shape)
          Converts the given size from the given shape's coords (returns it for convenience).
 RMSize convertSizeToShape(RMSize size, RMShape shape)
          Converts the given size to the given shape's coords (returns it for convenience).
 void convertToShape(RMShape aShape)
          Transforms the given shape to this shape's coords.
 RMSize convertVectorFromShape(RMSize size, RMShape shape)
          Converts the given size (as a vector) from the given shape's coords (returns it for convenience).
 RMSize convertVectorToShape(RMSize size, RMShape shape)
          Converts the given size (as a vector) to the given shape's coords (returns it for convenience).
 void copyShape(RMShape aShape)
          Copies basic shape attributes from given RMShape (location, size, fill, stroke, roll, scale, name, url, etc.).
 RMShape createDivideShapeRemainder(byte anEdge)
          Creates a shape suitable for the "remainder" portion of a divideShape call (just a clone by default).
 com.reportmill.shape.RMShapeLayout createLayout()
          Creates a new layout.
 RMShape createPartClone()
          Creates a new clone of this shape to hold multi-part children.
 RMShape divideShapeFromEdge(float amount, byte edge, RMShape newShape)
          Divides the shape by a given amount from the given edge.
 RMShape divideShapeFromTop(float anAmount)
          Divides the shape by a given amount from the top.
 void doLayout()
          Does immediate layout.
 boolean equals(java.lang.Object anObj)
          Standard implementation of Object equals.
 void firePropertyChange(java.lang.String aProperty, java.lang.Object oldValue, java.lang.Object newValue, int anIndex)
          Fires an indexed property change.
 java.lang.Object fromXML(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
          XML unarchival generic - break fromXML into fromXMLShape and fromXMLShapeChildren.
 java.lang.Object fromXMLShape(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
          XML unarchival.
 void fromXMLShapeChildren(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
          XML unarchival for shape children.
 java.lang.Object get(java.lang.String aName)
          Returns the Object associated with the given name for the shape.
 com.reportmill.shape.action.RMAction getAction()
          Returns the action for this shape.
 RMShape getAncestor(int anIndex)
          Returns the ancestor at the given index (parent is ancestor 0).
 int getAncestorCount()
          Returns the number of ancestors (from this shape's parent up to the document).
 RMShape getAncestorInCommon(RMShape aShape)
          Returns first ancestor that the given shape and this shape have in common.
 com.reportmill.shape.RMShapeAnim getAnim()
          Returns the collection of animation records for this shape.
 com.reportmill.shape.RMShapeAnim getAnim(boolean create)
          Returns the collection of animation records for this shape, with an option to create if absent.
 com.reportmill.graphics.RMAnimator getAnimator()
          Returns the animator that this shape registers changes with.
 com.reportmill.graphics.RMAnimator getAnimator(boolean create)
          Returns the animator that this shape registers changes with (creating, if requested and currently null).
 java.lang.String getAspectMapped(java.lang.String anAspect)
          Returns a mapped aspect name.
 java.util.List<java.lang.String> getAspects()
          Returns the aspects for helper's instance class.
 boolean getAutosizeHeight()
          Returns whether the shape's height is set automatically to its ideal height during report generation.
 java.lang.String getAutosizing()
          Returns the autosizing settings as a string with hyphens for struts and tilde for sprints (horiz,vert).
 com.reportmill.binder.RMBinder getBinder(java.lang.String aName)
          Returns the named binder.
 com.reportmill.binder.RMBinding getBinding(int anIndex)
          Returns the individual binding at the given index.
 com.reportmill.binder.RMBinding getBinding(java.lang.String anAspect)
          Returns the individual binding with the given aspect name.
 int getBindingCount()
          Returns the number of bindings associated with shape.
 RMRect getBounds()
          Returns the X, Y, width and height of the shape as a rect (use getFrame if shape has roll/scale/skew).
 RMRect getBoundsInside()
          Returns the bounds of the shape in the shape's own coords.
 RMRect getBoundsMarked()
          Returns the bounds of the path associated with this shape in local coords, adjusted to account for stroke width.
 RMRect getBoundsMarkedDeep()
          Returns the marked bounds of this shape and it's children.
 RMRect getBoundsOfChildren()
          Returns bounds of all children of this shape, which can sometimes differ from this shapes bounds.
 boolean getCausesWrap()
          Returns whether this shape causes text wrap.
 byte getCausesWrapType()
          Returns how this shape causes text wrap.
 RMShape getChild(int anIndex)
          Returns the child at the given index.
 com.reportmill.graphics.RMAnimator getChildAnimator()
          Returns the animator that this shape's children use.
 com.reportmill.graphics.RMAnimator getChildAnimator(boolean create)
          Returns the animator that this shape's children use (creating, if requested and currently null).
 RMShape[] getChildArray()
          Returns a copy of the children as an array.
 java.awt.Shape getChildClipShape()
          Returns clip shape to be used for children.
 RMShape getChildContaining(RMPoint aPoint)
          Returns the first (top) shape hit by the point given in this shape's coords.
 int getChildCount()
          Returns the number of children associated with this shape.
 int getChildCountHitable()
          Returns the child count for hitable children (just the normal child count by default).
 int getChildCountLayout()
          Returns the child count for children who need layout (just the normal child count by default).
 int getChildCountVisible()
          Returns the child count for visible children (just the normal child count by default).
 RMShape getChildHitable(int anIndex)
          Returns the specific hitable child at the given index (just the normal child at index by default).
 RMShape getChildLast()
          Returns the last child of this shape.
 RMShape getChildLayout(int anIndex)
          Returns the specific layout child at the given index (just the normal child at index by default).
 java.util.List getChildren()
          Returns the list of children associated with this shape.
 java.util.List getChildrenIntersecting(RMPath aPath)
          Returns the child shapes hit by the path given in this shape's coords.
 java.util.List getChildrenWhoCauseWrap(RMShape aPeer)
          Returns the subset of children that cause wrap.
<T extends RMShape>
java.util.List<T>
getChildrenWithClass(java.lang.Class<T> aClass)
          Returns all the shapes in the shape hierarchy of a particular class.
<T extends RMShape>
java.util.List<T>
getChildrenWithClass(java.util.List aList, java.lang.Class<T> aClass)
          Adds all the shapes in the shape hierarchy of a particular class to the list.
 RMShape getChildVisible(int anIndex)
          Returns the specific visible child at the given index (just the normal child at index by default).
<T extends RMShape>
T
getChildWithClass(java.lang.Class<T> aClass)
          Returns first child found with the given class (called recursively on children if not found at current level).
 RMShape getChildWithName(java.lang.String aName)
          Returns first child found with the given name (called recursively on children if not found at current level).
 java.awt.Shape getClipShape()
          Returns clip shape for shape.
 RMColor getColor()
          Returns the color of the shape.
 RMEntity getDatasetEntity()
          Returns the entity this shape should show in keys browser.
 java.lang.String getDatasetKey()
          Returns the dataset key associated with this shape.
 RMDocument getDocument()
          Returns the RMDocument ancestor of this shape (or null if not there).
 com.reportmill.shape.fill.RMEffect getEffect()
          Returns the effect for this shape.
 RMFill getFill()
          Returns the fill for this shape.
 RMFill getFill(int anIndex)
           
 int getFillCount()
          Obsolete methods to treat fills as a list.
 RMFont getFont()
          Returns the font for the shape.
 RMFormat getFormat()
          Returns the format for the shape.
 RMRect getFrame()
          Returns the rect in parent coords that fully encloses the shape.
 RMRect getFrame(RMShape aShape)
          Returns the rect that fully encloses the receiver in the given shape's coords.
 float getFrameMaxX()
          Returns the max X of the shape's frame.
 float getFrameMaxY()
          Returns the max Y of the shape's frame.
 float getFrameX()
          Returns the X of the rect that fully encloses the shape in parent coords.
 RMPoint getFrameXY()
          Returns the origin of the shape's bounds rect in parent coords.
 float getFrameY()
          Returns the Y of the rect that fully encloses the shape in parent coords.
 float getHeight()
          Returns the height of the shape.
 float getHeightToFit()
          Returns the ideal height of this shape to accommodate its contents (just the current height for most shapes).
 RMImageFill getImageFill()
          Returns the imageFill for this shape (or null, if fill isn't an RMImageFill).
 com.reportmill.shape.RMShapeLayout getLayout()
          Returns the layout for this shape.
 float getLineWidth()
          Returns the line width of the shape's stroke in printer points.
 RMPath getMaskPath()
          Returns the outline of the shape as a path.
 float getMaxX()
          Returns the max X of the shape (assumes not rotated, scaled or skewed).
 float getMaxY()
          Returns the max Y of the shape (assumes not rotated, scaled or skewed).
 java.lang.String getName()
          Returns the name for the shape.
 float getOpacity()
          Returns the opacity of the shape (1 for opaque, 0 for transparent).
 float getOpacityDeep()
          Returns the combined opacity of this shape and its parent.
 RMShape getOriginal()
          Returns the original, if this shape was created via clone.
 RMXString.Outline getOutline()
          Returns the outline for the shape.
 int getPageBreak()
          Returns the "PageBreak" for this shape as defined by shapes that define a page break (currently only RMTable).
 int getPageBreakMax()
          Returns the "PageBreakMax" for this shape as defined by shapes that define a page break (currently only RMTable).
 int getPageBreakPage()
          Returns the "PageBreakPage" for this shape, or the page number relative to the last page break, as defined by shapes that define explicit page breaks (currently only RMTable).
 int getPageBreakPageMax()
          Returns the "PageBreakPageMax" for this shape, or the max page number relative to the last and next page breaks, as defined by shapes that define explicit page breaks (currently only RMTable).
 RMShape getPageShape()
          Returns the RMPage ancestor of this shape (or null if not there).
 RMShape getParent()
          Returns the parent of this shape.
<T extends RMShape>
T
getParentWithClass(java.lang.Class<T> aClass)
          Returns the first parent with given class by iterating up parent hierarchy.
 RMShape getPart(int anIndex)
          Returns the individual part at the given index.
 int getPartCount()
          Returns the number of parts this shape needs to represent itself, if it's a multi-part shape.
 RMShape getPartDeep(int anIndex)
          Returns the individual part for given index, by getting parts deep.
 int getPartDeepCount()
          Returns the number of parts needed to represent this shape and its children.
 RMPath getPath()
          Returns the shape's path.
 RMPath getPathInBounds()
          Returns the shape's path scaled to the shape's current bounds.
 com.reportmill.base.ReportMill getReportMill()
          Returns the reportmill available for this shape.
 float getRoll()
          Returns the roll of the shape.
 RMShape getRootShape()
          Returns the top level shape (usually an RMDocument).
 float getScaleX()
          Returns the scale of the X axis of the shape.
 float getScaleY()
          Returns the scale of the Y axis of the shape.
 java.util.List<RMShape> getShapesToAncestor(RMShape aShape)
          Returns a list of shapes from this shape to a given ancestor, inclusive.
 java.util.List<RMShape> getShapesToDescendant(RMShape aShape)
          Returns a list of shape's from this shape to given descendant, inclusive.
 java.util.List<RMShape> getShapesToShape(RMShape aShape)
          Returns a list of shapes from this shape to given shape.
 RMSize getSize()
          Returns the size of the shape.
 RMSize getSizeP()
          Returns the size of the shape in parent coords.
 float getSkewX()
          Returns the skew of the X axis of the shape.
 float getSkewY()
          Returns the skew of the Y axis of the shape.
 RMStroke getStroke()
          Returns the stroke for this shape.
 RMColor getStrokeColor()
          Returns the stroke color of the shape.
 RMColor getTextColor()
          Returns the text color for the shape.
 com.reportmill.graphics.RMTransform getTransform()
          Returns the transform to this shape from its parent.
 com.reportmill.graphics.RMTransform getTransformFromShape(RMShape aShape)
          Returns the transform from the given shape to this shape.
 com.reportmill.graphics.RMTransform getTransformInverse()
          Returns the transform from this shape to it's parent.
 com.reportmill.graphics.RMTransform getTransformToShape(RMShape aShape)
          Returns the transform from this shape to the given shape.
 com.reportmill.base.RMUndoer getUndoer()
          Returns the undoer for this shape (or null if not there).
 java.lang.String getUrl()
          Sets the URL for the shape.
 java.awt.Shape getVisbileBounds()
          Returns the visible bounds in shape coords, by intersecting this shape's bounds with ancester clip and child clip.
 java.awt.Shape getVisibleBounds(RMRect aRect)
          Returns the visible bounds of given rect in shape coords, by intersecting rect with ancester clip and child clip.
 java.awt.Shape getVisibleBounds(RMRect aRect, RMShape anAncestor)
          Returns the visible bounds of given rect in given ancestor coords, by intersecting the rect with ancester clip and child clip.
 java.awt.Shape getVisibleBounds(RMShape anAncestor)
          Returns the visible bounds in given ancestor coords, by intersecting this shape's bounds with ancester clip and child clip.
 float getWidth()
          Returns the width of the shape.
 float getWidthToFit()
          Returns the ideal width of this shape to accommodate its contents (just the current width for most shapes).
 float getX()
          Returns the X location of the shape.
 RMPoint getXY()
          Returns the XY location of the shape as a point.
 RMPoint getXYP()
          Returns the origin point of the shape in parent's coords.
 float getY()
          Returns the Y location of the shape.
 float height()
          Returns raw height of shape.
 int indexOf()
          Returns the index of this child in its parent.
 int indexOfChild(RMShape aChild)
          Returns the index of the given child in this shape's children list.
 boolean intersects(RMPath aPath)
          Returns whether this shape is hit by the path, given in this shape's parent's coords.
 boolean isAncestor(RMShape aShape)
          Returns true if given shape is one of this shape's ancestors.
 boolean isAnimProperty(java.lang.String aPropertyName)
          Returns whether given property name is anim property.
 boolean isDescendant(RMShape aShape)
          Returns true if given shape is one of this shape's descendants.
 boolean isEditing()
          Returns whether this shape (and its parents) is visible in a editor.
 boolean isLocked()
          Returns the locked state of the shape (really just to prevent location/size changes in the editor).
 boolean isMouseDown()
          Returns whether mouse was pressed on this shape in current mouse loop.
 boolean isMouseOver()
          Returns whether mouse is over this shape.
 boolean isRoot()
          Editor method - returns whether this shape is at the top level (usually RMPage).
 boolean isShowing()
          Returns whether this shape (and its parents) is visible in a viewer or editor.
 boolean isUnderlined()
          Returns whether the shape is underlined.
 boolean isValid()
          Returns whether shape layout is valid (up to date).
 boolean isViewing()
          Returns whether this shape (and its parents) is visible in a viewer.
 boolean isVisible()
          Returns whether this shape is visible.
 void layoutReset()
          Resets the shape layout (convenience to account for null layouts).
 void mouseDragged(com.reportmill.shape.RMShapeMouseEvent anEvent)
          Handles mouse dragged events.
 void mouseEntered(com.reportmill.shape.RMShapeMouseEvent anEvent)
          Handles mouse entered events.
 void mouseExited(com.reportmill.shape.RMShapeMouseEvent anEvent)
          Handles mouse exited events.
 void mouseMoved(com.reportmill.shape.RMShapeMouseEvent anEvent)
          Handles mouse moved events.
 void mousePressed(com.reportmill.shape.RMShapeMouseEvent anEvent)
          Handles mouse pressed events.
 void mouseReleased(com.reportmill.shape.RMShapeMouseEvent anEvent)
          Handles mouse released events.
 boolean notRSS()
          Returns whether the shape has been rotated, scaled or skewed (for efficiency).
 void offsetChildrenXY(float dx, float dy)
          Offsets this shape's children by the given dx, dy.
 void offsetXY(double dx, double dy)
          Offsets the X and Y location of the shape by the given dx & dy amount (convenience).
 int page()
          Page number resolution.
 int pageMax()
          Page number resolution.
 void paint(com.reportmill.shape.RMShapePainter aPainter, java.awt.Graphics2D aGraphics)
          Top-level generic shape painting - sets transform and opacity then does a paintAll.
 void paintShape(com.reportmill.shape.RMShapePainter aPainter, java.awt.Graphics2D aGraphics)
          Basic shape painting - paints shape fill and stroke.
 void paintShapeAll(com.reportmill.shape.RMShapePainter aPainter, java.awt.Graphics2D aGraphics)
          Calls paintShape, paintShapeChildren and paintShapeOver.
 void paintShapeChildren(com.reportmill.shape.RMShapePainter aPainter, java.awt.Graphics2D aGraphics)
          Paints shape children.
 void paintShapeOver(com.reportmill.shape.RMShapePainter aPainter, java.awt.Graphics2D aGraphics)
          Paints after (on top) of children.
 void propertyChange(java.beans.PropertyChangeEvent anEvent)
          Property change listener implementation.
 void put(java.lang.String aName, java.lang.Object anObj)
          Sets an Object to be associated with the given name for the shape.
 com.reportmill.binder.RMBinding removeBinding(int anIndex)
          Removes the binding at the given index from shape's bindings list.
 boolean removeBinding(java.lang.String anAspect)
          Removes the binding with given aspect
 RMShape removeChild(int anIndex)
          Remove's the child at the given index from this shape's children list.
 int removeChild(RMShape aChild)
          Removes the given child from this shape's children list.
 void removeChildren()
          Removes all children from this shape (in reverse order).
 void removeFromParent()
          Removes this shape from it's parent.
 void repaint()
          Visual change notification - call before making changes that will require repaint.
 void repaint(RMShape aShape)
          Visual change notification - call before making changes that will require repaint.
 void resolvePageReferences(com.reportmill.base.ReportMill rm, java.lang.Object userInfo)
          Replaces all @Page@ style keys with their actual values for this shape and it's children.
 void revalidate()
          Sets shape layout to invalid.
 void sendShapesToBack(java.util.List<RMShape> shapes)
          Moves the subset of children in the given list to the back of the children list.
 void setAction(com.reportmill.shape.action.RMAction anAction)
          Sets the action for this shape.
 void setAnim(com.reportmill.shape.RMShapeAnim anAnim)
          Sets the collection of animation records for this shape.
 void setAutosizeHeight(boolean aValue)
          Sets whether the shape's height is set automatically to its ideal height during report generation.
 void setAutosizing(java.lang.String aVal)
          Sets the autosizing settings as a string with hyphens for struts and tilde for sprints (horiz,vert).
 void setBounds(double x, double y, double w, double h)
          Sets X, Y, width and height of shape to given dimensions.
 void setBounds(java.awt.geom.Rectangle2D aRect)
          Sets X, Y, width and height of shape to dimensions in given rect.
 void setCausesWrap(boolean aValue)
          Sets whether this shape causes text wrap.
 void setCausesWrapType(byte aType)
          Sets how this shape causes text wrap.
 void setColor(RMColor aColor)
          Sets the color of the shape.
 void setEffect(com.reportmill.shape.fill.RMEffect anEffect)
          Sets the effect for this shape.
 void setFill(RMFill aFill)
          Sets the fill for this shape.
 void setFont(RMFont aFont)
          Sets the font for the shape.
 void setFormat(RMFormat aFormat)
          Sets the format for the shape.
 void setFrame(double x, double y, double w, double h)
          Sets the bounds of the shape such that it exacly fits in the given parent coord rect.
 void setFrame(java.awt.geom.Rectangle2D aRect)
          Sets the bounds of the shape such that it exacly fits in the given parent coord rect.
 void setFrameSize(double w, double h)
          Sets a shape's size such that its frame (enclosing rect in parent coords) will have the given width and height.
 void setFrameX(double x)
          Sets a shape's X such that its bounds rect (in parent coords) has origin at the given X.
 void setFrameXY(double x, double y)
          Sets a shape's origin such that its frame (enclosing rect in parent coords) will have the given X and Y.
 void setFrameXY(RMPoint aPoint)
          Sets a shape's origin such that its bounds rect (in parent coords) has origin at the given point.
 void setFrameY(double y)
          Sets a shape's Y such that its bounds rect (in parent coords) has origin at the given Y.
 void setHeight(float aValue)
          Sets the height of the shape.
 void setHeightToFit()
          Sets the shape to its getHeightToFit (which is just the current height for most shapes).
 void setLayout(com.reportmill.shape.RMShapeLayout aLayout)
          Sets the layout for this shape.
 void setLayoutEnabled(boolean aFlag)
          Sets the shape layout enabled flag (convenience to account for null layouts).
 void setLineWidth(float aValue)
          Sets the line width of the shape's stroke in printer points.
 void setLocked(boolean aValue)
          Sets the locked state of the shape (really just to prevent location/size changes in the editor).
 void setName(java.lang.String aName)
          Sets the name for the shape.
 void setOpacity(float aValue)
          Sets the opacity of the shape (1 for opaque, 0 for transparent).
 void setOutline(RMXString.Outline anOutline)
          Sets the outline for the shape.
 void setParent(RMShape aShape)
          Sets the parent of this shape (called automatically by addChild()).
 void setReportMill(com.reportmill.base.ReportMill aReportMill)
          Report generation.
 void setReportMillBindings(com.reportmill.base.ReportMill aReportMill)
          Report generation for URL and bindings.
 void setReportMillDeep(com.reportmill.base.ReportMill aReportMill)
          Sets reportmill deep.
 void setRoll(float aValue)
          Sets the roll of the shape.
 void setScaleX(float aValue)
          Sets the scale of the X axis of the shape.
 void setScaleXY(float sx, float sy)
          Sets the scale of the X and Y axis.
 void setScaleY(float aValue)
          Sets the scale of the Y axis of the shape.
 void setSize(double width, double height)
          Sets the size of the shape.
 void setSize(RMSize aSize)
          Sets the size of the shape.
 void setSizeP(double w, double h)
          Sets the size of the shape to the given width and height in parent's coords.
 void setSizeToFit()
          Sets the shape to its ideal size from getWidthToFit and getHeightToFit.
 void setSizeToFit(float maxWidth, float maxHeight)
          This convenience method sets the shape to its ideal size from getWidthToFit and getHeightToFit, allowing you to additionally specify a maxWidth and maxHeight.
 void setSkewX(float aValue)
          Sets the skew of the X axis of the shape.
 void setSkewXY(float skx, float sky)
          Sets the skew of the X and Y axis.
 void setSkewY(float aValue)
          Sets the skew of the Y axis of the shape.
 void setStroke(RMStroke aStroke)
          Sets the stroke for this shape, with an option to turn on drawsStroke.
 void setStrokeColor(RMColor aColor)
          Sets the stroke color of the shape.
 void setTextColor(RMColor aColor)
          Sets the text color for the shape.
 void setTime(float aTime)
          Tells the shape's anim records to update the shape to the given time.
 void setUnderlined(boolean aFlag)
          Sets the shape to underline.
 void setUrl(java.lang.String aUrl)
          Returns the URL for the shape.
 void setVisible(boolean aValue)
          Sets whether this shape is visible.
 void setWidth(float aValue)
          Sets the width of the shape.
 void setWidthToFit()
          Sets the shape to its getWidthToFit (which is just the current width for most shapes).
 void setX(float aValue)
          Sets the X location of the shape.
 void setXY(double x, double y)
          Sets the X and Y location of the shape to the given point (convenience).
 void setXY(java.awt.geom.Point2D aPoint)
          Sets the X and Y location of the shape to the given point (convenience).
 void setXYP(float x, float y)
          Sets the origin point of the shape to the given X and Y in parent's coords.
 void setY(float aValue)
          Sets the Y location of the shape.
 void shapeHidden()
          Notifies shape that it or one of it's ancestors was made non-visible or removed from hierarchy.
 void shapeShown()
          Notifies shape that it or one of it's ancestors was made visible.
 boolean sizesToFitChildren()
          Editor method.
 boolean superSelectable()
          Editor method - indicates whether this shape can be super selected.
 java.lang.String toString()
          Standard to string implementation (prints class name and shape bounds).
 com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver, java.lang.Object anOwner)
          XML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.
 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 archival of children.
 void undoerDisable()
          Undoer convenience - disable the undoer.
 void undoerEnable()
          Undoer convenience - enables the undoer.
 void undoerSetUndoTitle(java.lang.String aTitle)
          Undoer convenience - sets title of next registered undo.
 void validate()
          Does immediate layout if invalid.
 float width()
          Returns raw width of shape.
 float x()
          Returns raw x location of shape.
 float y()
          Returns raw y location of shape.
 
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
 

Field Detail

WRAP_TYPE_NONE

public static final byte WRAP_TYPE_NONE
See Also:
Constant Field Values

WRAP_TYPE_BOTH

public static final byte WRAP_TYPE_BOTH
See Also:
Constant Field Values
Constructor Detail

RMShape

public RMShape()
Creates a plain shape.


RMShape

public RMShape(RMShape aShape)
Creates a shape with the same basic attributes as the given shape.

Method Detail

x

public float x()
Returns raw x location of shape. Developers should use the more common getX, which presents positive x.


y

public float y()
Returns raw y location of shape. Developers should use the more common getY, which presents positive y.


width

public float width()
Returns raw width of shape. Developers should use the more common getWidth, which presents positive width.


height

public float height()
Returns raw height of shape. Developers should use the more common getHeight, which presents positive height.


bounds

public RMRect bounds()
Returns raw x, y, width and height of shape as rect (preserves possible negative sizes).


getX

public float getX()
Returns the X location of the shape.


setX

public void setX(float aValue)
Sets the X location of the shape.


getY

public float getY()
Returns the Y location of the shape.


setY

public void setY(float aValue)
Sets the Y location of the shape.


getWidth

public float getWidth()
Returns the width of the shape.


setWidth

public void setWidth(float aValue)
Sets the width of the shape.


getHeight

public float getHeight()
Returns the height of the shape.


setHeight

public void setHeight(float aValue)
Sets the height of the shape.


getMaxX

public float getMaxX()
Returns the max X of the shape (assumes not rotated, scaled or skewed).


getMaxY

public float getMaxY()
Returns the max Y of the shape (assumes not rotated, scaled or skewed).


getXY

public RMPoint getXY()
Returns the XY location of the shape as a point.


setXY

public void setXY(java.awt.geom.Point2D aPoint)
Sets the X and Y location of the shape to the given point (convenience).


setXY

public void setXY(double x,
                  double y)
Sets the X and Y location of the shape to the given point (convenience).


getSize

public RMSize getSize()
Returns the size of the shape.


setSize

public void setSize(RMSize aSize)
Sets the size of the shape.


setSize

public void setSize(double width,
                    double height)
Sets the size of the shape.


getBounds

public RMRect getBounds()
Returns the X, Y, width and height of the shape as a rect (use getFrame if shape has roll/scale/skew).


setBounds

public void setBounds(java.awt.geom.Rectangle2D aRect)
Sets X, Y, width and height of shape to dimensions in given rect.


setBounds

public void setBounds(double x,
                      double y,
                      double w,
                      double h)
Sets X, Y, width and height of shape to given dimensions.


offsetXY

public void offsetXY(double dx,
                     double dy)
Offsets the X and Y location of the shape by the given dx & dy amount (convenience).


getXYP

public RMPoint getXYP()
Returns the origin point of the shape in parent's coords.


setXYP

public void setXYP(float x,
                   float y)
Sets the origin point of the shape to the given X and Y in parent's coords.


getSizeP

public RMSize getSizeP()
Returns the size of the shape in parent coords.


setSizeP

public void setSizeP(double w,
                     double h)
Sets the size of the shape to the given width and height in parent's coords.


getFrame

public RMRect getFrame()
Returns the rect in parent coords that fully encloses the shape.


setFrame

public void setFrame(java.awt.geom.Rectangle2D aRect)
Sets the bounds of the shape such that it exacly fits in the given parent coord rect.


setFrame

public void setFrame(double x,
                     double y,
                     double w,
                     double h)
Sets the bounds of the shape such that it exacly fits in the given parent coord rect.


getFrameX

public float getFrameX()
Returns the X of the rect that fully encloses the shape in parent coords.


setFrameX

public void setFrameX(double x)
Sets a shape's X such that its bounds rect (in parent coords) has origin at the given X.


getFrameY

public float getFrameY()
Returns the Y of the rect that fully encloses the shape in parent coords.


setFrameY

public void setFrameY(double y)
Sets a shape's Y such that its bounds rect (in parent coords) has origin at the given Y.


getFrameXY

public RMPoint getFrameXY()
Returns the origin of the shape's bounds rect in parent coords.


setFrameXY

public void setFrameXY(RMPoint aPoint)
Sets a shape's origin such that its bounds rect (in parent coords) has origin at the given point.


setFrameXY

public void setFrameXY(double x,
                       double y)
Sets a shape's origin such that its frame (enclosing rect in parent coords) will have the given X and Y.


setFrameSize

public void setFrameSize(double w,
                         double h)
Sets a shape's size such that its frame (enclosing rect in parent coords) will have the given width and height.


getFrameMaxX

public float getFrameMaxX()
Returns the max X of the shape's frame.


getFrameMaxY

public float getFrameMaxY()
Returns the max Y of the shape's frame.


getFrame

public RMRect getFrame(RMShape aShape)
Returns the rect that fully encloses the receiver in the given shape's coords.


getBoundsInside

public RMRect getBoundsInside()
Returns the bounds of the shape in the shape's own coords.


getBoundsMarked

public RMRect getBoundsMarked()
Returns the bounds of the path associated with this shape in local coords, adjusted to account for stroke width.


getBoundsMarkedDeep

public RMRect getBoundsMarkedDeep()
Returns the marked bounds of this shape and it's children.


getBoundsOfChildren

public RMRect getBoundsOfChildren()
Returns bounds of all children of this shape, which can sometimes differ from this shapes bounds.


getRoll

public float getRoll()
Returns the roll of the shape.


setRoll

public void setRoll(float aValue)
Sets the roll of the shape.


getScaleX

public float getScaleX()
Returns the scale of the X axis of the shape.


setScaleX

public void setScaleX(float aValue)
Sets the scale of the X axis of the shape.


getScaleY

public float getScaleY()
Returns the scale of the Y axis of the shape.


setScaleY

public void setScaleY(float aValue)
Sets the scale of the Y axis of the shape.


setScaleXY

public void setScaleXY(float sx,
                       float sy)
Sets the scale of the X and Y axis.


getSkewX

public float getSkewX()
Returns the skew of the X axis of the shape.


setSkewX

public void setSkewX(float aValue)
Sets the skew of the X axis of the shape.


getSkewY

public float getSkewY()
Returns the skew of the Y axis of the shape.


setSkewY

public void setSkewY(float aValue)
Sets the skew of the Y axis of the shape.


setSkewXY

public void setSkewXY(float skx,
                      float sky)
Sets the skew of the X and Y axis.


notRSS

public boolean notRSS()
Returns whether the shape has been rotated, scaled or skewed (for efficiency).


getStroke

public RMStroke getStroke()
Returns the stroke for this shape.


setStroke

public void setStroke(RMStroke aStroke)
Sets the stroke for this shape, with an option to turn on drawsStroke.


getFill

public RMFill getFill()
Returns the fill for this shape.


setFill

public void setFill(RMFill aFill)
Sets the fill for this shape.


getEffect

public com.reportmill.shape.fill.RMEffect getEffect()
Returns the effect for this shape.


setEffect

public void setEffect(com.reportmill.shape.fill.RMEffect anEffect)
Sets the effect for this shape.


getImageFill

public RMImageFill getImageFill()
Returns the imageFill for this shape (or null, if fill isn't an RMImageFill).


getFillCount

public int getFillCount()
Obsolete methods to treat fills as a list. This will go soon.


getFill

public RMFill getFill(int anIndex)

getColor

public RMColor getColor()
Returns the color of the shape.


setColor

public void setColor(RMColor aColor)
Sets the color of the shape.


getStrokeColor

public RMColor getStrokeColor()
Returns the stroke color of the shape.


setStrokeColor

public void setStrokeColor(RMColor aColor)
Sets the stroke color of the shape.


getLineWidth

public float getLineWidth()
Returns the line width of the shape's stroke in printer points.


setLineWidth

public void setLineWidth(float aValue)
Sets the line width of the shape's stroke in printer points.


getOpacity

public float getOpacity()
Returns the opacity of the shape (1 for opaque, 0 for transparent).


setOpacity

public void setOpacity(float aValue)
Sets the opacity of the shape (1 for opaque, 0 for transparent).


getOpacityDeep

public float getOpacityDeep()
Returns the combined opacity of this shape and its parent.


isVisible

public boolean isVisible()
Returns whether this shape is visible.


setVisible

public void setVisible(boolean aValue)
Sets whether this shape is visible.


isShowing

public boolean isShowing()
Returns whether this shape (and its parents) is visible in a viewer or editor.


isViewing

public boolean isViewing()
Returns whether this shape (and its parents) is visible in a viewer.


isEditing

public boolean isEditing()
Returns whether this shape (and its parents) is visible in a editor.


shapeShown

public void shapeShown()
Notifies shape that it or one of it's ancestors was made visible.


shapeHidden

public void shapeHidden()
Notifies shape that it or one of it's ancestors was made non-visible or removed from hierarchy.


getAction

public com.reportmill.shape.action.RMAction getAction()
Returns the action for this shape.


setAction

public void setAction(com.reportmill.shape.action.RMAction anAction)
Sets the action for this shape.


getTextColor

public RMColor getTextColor()
Returns the text color for the shape.


setTextColor

public void setTextColor(RMColor aColor)
Sets the text color for the shape.


getFont

public RMFont getFont()
Returns the font for the shape.


setFont

public void setFont(RMFont aFont)
Sets the font for the shape.


isUnderlined

public boolean isUnderlined()
Returns whether the shape is underlined.


setUnderlined

public void setUnderlined(boolean aFlag)
Sets the shape to underline.


getOutline

public RMXString.Outline getOutline()
Returns the outline for the shape.


setOutline

public void setOutline(RMXString.Outline anOutline)
Sets the outline for the shape.


getFormat

public RMFormat getFormat()
Returns the format for the shape.


setFormat

public void setFormat(RMFormat aFormat)
Sets the format for the shape.


getAutosizing

public java.lang.String getAutosizing()
Returns the autosizing settings as a string with hyphens for struts and tilde for sprints (horiz,vert).


setAutosizing

public void setAutosizing(java.lang.String aVal)
Sets the autosizing settings as a string with hyphens for struts and tilde for sprints (horiz,vert).


getAutosizeHeight

public boolean getAutosizeHeight()
Returns whether the shape's height is set automatically to its ideal height during report generation.


setAutosizeHeight

public void setAutosizeHeight(boolean aValue)
Sets whether the shape's height is set automatically to its ideal height during report generation.


getCausesWrap

public boolean getCausesWrap()
Returns whether this shape causes text wrap.


setCausesWrap

public void setCausesWrap(boolean aValue)
Sets whether this shape causes text wrap.


getCausesWrapType

public byte getCausesWrapType()
Returns how this shape causes text wrap.


setCausesWrapType

public void setCausesWrapType(byte aType)
Sets how this shape causes text wrap.


firePropertyChange

public void firePropertyChange(java.lang.String aProperty,
                               java.lang.Object oldValue,
                               java.lang.Object newValue,
                               int anIndex)
Fires an indexed property change.

Overrides:
firePropertyChange in class com.reportmill.base.RMObject

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent anEvent)
Property change listener implementation.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

getName

public java.lang.String getName()
Returns the name for the shape.


setName

public void setName(java.lang.String aName)
Sets the name for the shape.


getUrl

public java.lang.String getUrl()
Sets the URL for the shape.


setUrl

public void setUrl(java.lang.String aUrl)
Returns the URL for the shape.


isLocked

public boolean isLocked()
Returns the locked state of the shape (really just to prevent location/size changes in the editor).


setLocked

public void setLocked(boolean aValue)
Sets the locked state of the shape (really just to prevent location/size changes in the editor).


getAnim

public com.reportmill.shape.RMShapeAnim getAnim()
Returns the collection of animation records for this shape.


getAnim

public com.reportmill.shape.RMShapeAnim getAnim(boolean create)
Returns the collection of animation records for this shape, with an option to create if absent.


setAnim

public void setAnim(com.reportmill.shape.RMShapeAnim anAnim)
Sets the collection of animation records for this shape.


setTime

public void setTime(float aTime)
Tells the shape's anim records to update the shape to the given time. Recurses to shape children.


get

public java.lang.Object get(java.lang.String aName)
Returns the Object associated with the given name for the shape. This is a general purpose property facility to allow shapes to hold many less common properties without the overhead of explicitly including ivars for them. The map that holds these properties is shared so that there is only ever one instance of the map for each unique permutation of attributes.


put

public void put(java.lang.String aName,
                java.lang.Object anObj)
Sets an Object to be associated with the given name for the shape.


getPath

public RMPath getPath()
Returns the shape's path.


getPathInBounds

public RMPath getPathInBounds()
Returns the shape's path scaled to the shape's current bounds.


getMaskPath

public RMPath getMaskPath()
Returns the outline of the shape as a path. For simple shape this is the same as getPath(), and for group shapes it's the union of all the children paths.


getParent

public RMShape getParent()
Returns the parent of this shape.


setParent

public void setParent(RMShape aShape)
Sets the parent of this shape (called automatically by addChild()).


getChildCount

public int getChildCount()
Returns the number of children associated with this shape.


getChild

public RMShape getChild(int anIndex)
Returns the child at the given index.


getChildLast

public RMShape getChildLast()
Returns the last child of this shape.


getChildArray

public RMShape[] getChildArray()
Returns a copy of the children as an array.


getChildren

public java.util.List getChildren()
Returns the list of children associated with this shape.


addChild

public void addChild(RMShape aChild)
Adds the given child to the end of this shape's children list.


addChild

public void addChild(RMShape aChild,
                     int anIndex)
Adds the given child to this shape's children list at the given index.


removeChild

public RMShape removeChild(int anIndex)
Remove's the child at the given index from this shape's children list.


removeChild

public int removeChild(RMShape aChild)
Removes the given child from this shape's children list.


removeChildren

public void removeChildren()
Removes all children from this shape (in reverse order).


removeFromParent

public void removeFromParent()
Removes this shape from it's parent.


indexOf

public int indexOf()
Returns the index of this child in its parent.


indexOfChild

public int indexOfChild(RMShape aChild)
Returns the index of the given child in this shape's children list.


getParentWithClass

public <T extends RMShape> T getParentWithClass(java.lang.Class<T> aClass)
Returns the first parent with given class by iterating up parent hierarchy.


getChildWithName

public RMShape getChildWithName(java.lang.String aName)
Returns first child found with the given name (called recursively on children if not found at current level).


getChildWithClass

public <T extends RMShape> T getChildWithClass(java.lang.Class<T> aClass)
Returns first child found with the given class (called recursively on children if not found at current level).


getChildrenWithClass

public <T extends RMShape> java.util.List<T> getChildrenWithClass(java.lang.Class<T> aClass)
Returns all the shapes in the shape hierarchy of a particular class.


getChildrenWithClass

public <T extends RMShape> java.util.List<T> getChildrenWithClass(java.util.List aList,
                                                                  java.lang.Class<T> aClass)
Adds all the shapes in the shape hierarchy of a particular class to the list. Returns the list as a convenience.


offsetChildrenXY

public void offsetChildrenXY(float dx,
                             float dy)
Offsets this shape's children by the given dx, dy.


getOriginal

public RMShape getOriginal()
Returns the original, if this shape was created via clone.


getLayout

public com.reportmill.shape.RMShapeLayout getLayout()
Returns the layout for this shape.


setLayout

public void setLayout(com.reportmill.shape.RMShapeLayout aLayout)
Sets the layout for this shape.


createLayout

public com.reportmill.shape.RMShapeLayout createLayout()
Creates a new layout.


isValid

public boolean isValid()
Returns whether shape layout is valid (up to date).


revalidate

public void revalidate()
Sets shape layout to invalid.


validate

public void validate()
Does immediate layout if invalid.


doLayout

public void doLayout()
Does immediate layout.


setLayoutEnabled

public void setLayoutEnabled(boolean aFlag)
Sets the shape layout enabled flag (convenience to account for null layouts).


layoutReset

public void layoutReset()
Resets the shape layout (convenience to account for null layouts).


getRootShape

public RMShape getRootShape()
Returns the top level shape (usually an RMDocument).


getDocument

public RMDocument getDocument()
Returns the RMDocument ancestor of this shape (or null if not there).


getPageShape

public RMShape getPageShape()
Returns the RMPage ancestor of this shape (or null if not there).


getUndoer

public com.reportmill.base.RMUndoer getUndoer()
Returns the undoer for this shape (or null if not there).


undoerSetUndoTitle

public void undoerSetUndoTitle(java.lang.String aTitle)
Undoer convenience - sets title of next registered undo.


undoerDisable

public void undoerDisable()
Undoer convenience - disable the undoer.


undoerEnable

public void undoerEnable()
Undoer convenience - enables the undoer.


isRoot

public boolean isRoot()
Editor method - returns whether this shape is at the top level (usually RMPage).


getAncestorCount

public int getAncestorCount()
Returns the number of ancestors (from this shape's parent up to the document).


getAncestor

public RMShape getAncestor(int anIndex)
Returns the ancestor at the given index (parent is ancestor 0).


isAncestor

public boolean isAncestor(RMShape aShape)
Returns true if given shape is one of this shape's ancestors.


isDescendant

public boolean isDescendant(RMShape aShape)
Returns true if given shape is one of this shape's descendants.


getAncestorInCommon

public RMShape getAncestorInCommon(RMShape aShape)
Returns first ancestor that the given shape and this shape have in common.


getShapesToAncestor

public java.util.List<RMShape> getShapesToAncestor(RMShape aShape)
Returns a list of shapes from this shape to a given ancestor, inclusive.


getShapesToDescendant

public java.util.List<RMShape> getShapesToDescendant(RMShape aShape)
Returns a list of shape's from this shape to given descendant, inclusive.


getShapesToShape

public java.util.List<RMShape> getShapesToShape(RMShape aShape)
Returns a list of shapes from this shape to given shape.


getTransform

public com.reportmill.graphics.RMTransform getTransform()
Returns the transform to this shape from its parent.


getTransformInverse

public com.reportmill.graphics.RMTransform getTransformInverse()
Returns the transform from this shape to it's parent.


getTransformToShape

public com.reportmill.graphics.RMTransform getTransformToShape(RMShape aShape)
Returns the transform from this shape to the given shape.


getTransformFromShape

public com.reportmill.graphics.RMTransform getTransformFromShape(RMShape aShape)
Returns the transform from the given shape to this shape.


convertPointToShape

public RMPoint convertPointToShape(RMPoint point,
                                   RMShape shape)
Converts the given point to the given shape's coords (returns it for convenience).


convertPointFromShape

public RMPoint convertPointFromShape(RMPoint point,
                                     RMShape shape)
Converts the given point to the given shape's coords (returns it for convenience).


convertVectorToShape

public RMSize convertVectorToShape(RMSize size,
                                   RMShape shape)
Converts the given size (as a vector) to the given shape's coords (returns it for convenience).


convertVectorFromShape

public RMSize convertVectorFromShape(RMSize size,
                                     RMShape shape)
Converts the given size (as a vector) from the given shape's coords (returns it for convenience).


convertSizeToShape

public RMSize convertSizeToShape(RMSize size,
                                 RMShape shape)
Converts the given size to the given shape's coords (returns it for convenience).


convertSizeFromShape

public RMSize convertSizeFromShape(RMSize size,
                                   RMShape shape)
Converts the given size from the given shape's coords (returns it for convenience).


convertRectToShape

public RMRect convertRectToShape(RMRect rect,
                                 RMShape shape)
Converts the given rect to the given shape's coords (returns it for convenience).


convertRectFromShape

public RMRect convertRectFromShape(RMRect rect,
                                   RMShape shape)
Converts the given rect from the given shape's coords (returns it for convenience).


convertedPointToShape

public RMPoint convertedPointToShape(RMPoint aPoint,
                                     RMShape aShape)
Returns the given point converted to the given shape's coords.


convertedPointFromShape

public RMPoint convertedPointFromShape(RMPoint aPoint,
                                       RMShape aShape)
Returns the given point converted from the given shape's coords.


convertedVectorToShape

public RMSize convertedVectorToShape(RMSize aSize,
                                     RMShape aShape)
Returns the given size converted to the given shape's coords and normalized.


convertedVectorFromShape

public RMSize convertedVectorFromShape(RMSize aSize,
                                       RMShape aShape)
Returns the given size converted from the given shape's coords and normalized.


convertedSizeToShape

public RMSize convertedSizeToShape(RMSize aSize,
                                   RMShape aShape)
Returns the given size converted to the given shape's coords.


convertedSizeFromShape

public RMSize convertedSizeFromShape(RMSize aSize,
                                     RMShape aShape)
Returns the given size converted from the given shape's coords.


convertedRectToShape

public RMRect convertedRectToShape(RMRect aRect,
                                   RMShape aShape)
Returns the rect encompassing the given rect converted to the given shape's coords.


convertedRectFromShape

public RMRect convertedRectFromShape(RMRect aRect,
                                     RMShape aShape)
Returns the rect encompassing the given rect converted from the given shape's coords.


convertPathToShape

public RMPath convertPathToShape(RMPath aPath,
                                 RMShape aShape)
Returns the given path converted to the given shape's coords.


convertPathFromShape

public RMPath convertPathFromShape(RMPath aPath,
                                   RMShape aShape)
Returns the given path converted from the given shape's coords.


convertToShape

public void convertToShape(RMShape aShape)
Transforms the given shape to this shape's coords.


convertFromShape

public void convertFromShape(RMShape aShape)
Transforms the given shape from this shape's coords.


getWidthToFit

public float getWidthToFit()
Returns the ideal width of this shape to accommodate its contents (just the current width for most shapes).


setWidthToFit

public void setWidthToFit()
Sets the shape to its getWidthToFit (which is just the current width for most shapes).


getHeightToFit

public float getHeightToFit()
Returns the ideal height of this shape to accommodate its contents (just the current height for most shapes).


setHeightToFit

public void setHeightToFit()
Sets the shape to its getHeightToFit (which is just the current height for most shapes).


setSizeToFit

public void setSizeToFit()
Sets the shape to its ideal size from getWidthToFit and getHeightToFit.


setSizeToFit

public void setSizeToFit(float maxWidth,
                         float maxHeight)
This convenience method sets the shape to its ideal size from getWidthToFit and getHeightToFit, allowing you to additionally specify a maxWidth and maxHeight.


divideShapeFromTop

public RMShape divideShapeFromTop(float anAmount)
Divides the shape by a given amount from the top. Returns a clone of the given shape with bounds set to the remainder. Divies children among the two shapes (recursively calling divide shape for those stradling).


divideShapeFromEdge

public RMShape divideShapeFromEdge(float amount,
                                   byte edge,
                                   RMShape newShape)
Divides the shape by a given amount from the given edge. Returns newShape (or, if null, a clone) whose bounds have been set to the remainder.


createDivideShapeRemainder

public RMShape createDivideShapeRemainder(byte anEdge)
Creates a shape suitable for the "remainder" portion of a divideShape call (just a clone by default).


getAnimator

public com.reportmill.graphics.RMAnimator getAnimator()
Returns the animator that this shape registers changes with.


getAnimator

public com.reportmill.graphics.RMAnimator getAnimator(boolean create)
Returns the animator that this shape registers changes with (creating, if requested and currently null).


getChildAnimator

public com.reportmill.graphics.RMAnimator getChildAnimator()
Returns the animator that this shape's children use.


getChildAnimator

public com.reportmill.graphics.RMAnimator getChildAnimator(boolean create)
Returns the animator that this shape's children use (creating, if requested and currently null). The base implementation passes request onto ancestors, but some subclasses create and manage one (RMPage, RMSwitchShape).


acceptsMouse

public boolean acceptsMouse()
Returns whether shape accepts mouse events.


mousePressed

public void mousePressed(com.reportmill.shape.RMShapeMouseEvent anEvent)
Handles mouse pressed events.


mouseDragged

public void mouseDragged(com.reportmill.shape.RMShapeMouseEvent anEvent)
Handles mouse dragged events.


mouseReleased

public void mouseReleased(com.reportmill.shape.RMShapeMouseEvent anEvent)
Handles mouse released events.


mouseEntered

public void mouseEntered(com.reportmill.shape.RMShapeMouseEvent anEvent)
Handles mouse entered events.


mouseMoved

public void mouseMoved(com.reportmill.shape.RMShapeMouseEvent anEvent)
Handles mouse moved events.


mouseExited

public void mouseExited(com.reportmill.shape.RMShapeMouseEvent anEvent)
Handles mouse exited events.


isMouseDown

public boolean isMouseDown()
Returns whether mouse was pressed on this shape in current mouse loop.


isMouseOver

public boolean isMouseOver()
Returns whether mouse is over this shape.


contains

public boolean contains(RMPoint aPoint)
Returns whether this shape is hit by the point, given in this shape's parent's coords.


intersects

public boolean intersects(RMPath aPath)
Returns whether this shape is hit by the path, given in this shape's parent's coords.


getChildContaining

public RMShape getChildContaining(RMPoint aPoint)
Returns the first (top) shape hit by the point given in this shape's coords.


getChildrenIntersecting

public java.util.List getChildrenIntersecting(RMPath aPath)
Returns the child shapes hit by the path given in this shape's coords.


bringShapesToFront

public void bringShapesToFront(java.util.List<RMShape> shapes)
Moves the subset of children in the given list to the front of the children list.


sendShapesToBack

public void sendShapesToBack(java.util.List<RMShape> shapes)
Moves the subset of children in the given list to the back of the children list.


getChildCountVisible

public int getChildCountVisible()
Returns the child count for visible children (just the normal child count by default).


getChildVisible

public RMShape getChildVisible(int anIndex)
Returns the specific visible child at the given index (just the normal child at index by default).


getChildCountHitable

public int getChildCountHitable()
Returns the child count for hitable children (just the normal child count by default).


getChildHitable

public RMShape getChildHitable(int anIndex)
Returns the specific hitable child at the given index (just the normal child at index by default).


getChildCountLayout

public int getChildCountLayout()
Returns the child count for children who need layout (just the normal child count by default).


getChildLayout

public RMShape getChildLayout(int anIndex)
Returns the specific layout child at the given index (just the normal child at index by default).


getChildrenWhoCauseWrap

public java.util.List getChildrenWhoCauseWrap(RMShape aPeer)
Returns the subset of children that cause wrap.


getDatasetKey

public java.lang.String getDatasetKey()
Returns the dataset key associated with this shape.


getDatasetEntity

public RMEntity getDatasetEntity()
Returns the entity this shape should show in keys browser.


getAspects

public java.util.List<java.lang.String> getAspects()
Returns the aspects for helper's instance class.


getAspectMapped

public java.lang.String getAspectMapped(java.lang.String anAspect)
Returns a mapped aspect name.


getBindingCount

public int getBindingCount()
Returns the number of bindings associated with shape.


getBinding

public com.reportmill.binder.RMBinding getBinding(int anIndex)
Returns the individual binding at the given index.


getBinding

public com.reportmill.binder.RMBinding getBinding(java.lang.String anAspect)
Returns the individual binding with the given aspect name.


addBinding

public void addBinding(com.reportmill.binder.RMBinding aBinding)
Adds the individual binding to the shape's bindings list.


removeBinding

public com.reportmill.binder.RMBinding removeBinding(int anIndex)
Removes the binding at the given index from shape's bindings list.


removeBinding

public boolean removeBinding(java.lang.String anAspect)
Removes the binding with given aspect


getBinder

public com.reportmill.binder.RMBinder getBinder(java.lang.String aName)
Returns the named binder.


checkBindings

public void checkBindings()
Notifies shape that binder was added.


equals

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

Overrides:
equals in class java.lang.Object

clone

public RMShape clone()
Standard implementation of Object clone. Null's out shape's parent and children.

Overrides:
clone in class com.reportmill.base.RMObject

cloneDeep

public RMShape cloneDeep()
Clones all attributes of this shape with complete clones of its children as well.


copyShape

public void copyShape(RMShape aShape)
Copies basic shape attributes from given RMShape (location, size, fill, stroke, roll, scale, name, url, etc.).


getReportMill

public com.reportmill.base.ReportMill getReportMill()
Returns the reportmill available for this shape.


setReportMill

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


setReportMillDeep

public void setReportMillDeep(com.reportmill.base.ReportMill aReportMill)
Sets reportmill deep.


setReportMillBindings

public void setReportMillBindings(com.reportmill.base.ReportMill aReportMill)
Report generation for URL and bindings.


getPartCount

public int getPartCount()
Returns the number of parts this shape needs to represent itself, if it's a multi-part shape.


getPart

public RMShape getPart(int anIndex)
Returns the individual part at the given index.


getPartDeepCount

public int getPartDeepCount()
Returns the number of parts needed to represent this shape and its children.


getPartDeep

public RMShape getPartDeep(int anIndex)
Returns the individual part for given index, by getting parts deep.


createPartClone

public RMShape createPartClone()
Creates a new clone of this shape to hold multi-part children.


resolvePageReferences

public void resolvePageReferences(com.reportmill.base.ReportMill rm,
                                  java.lang.Object userInfo)
Replaces all @Page@ style keys with their actual values for this shape and it's children.


repaint

public void repaint()
Visual change notification - call before making changes that will require repaint.


repaint

public void repaint(RMShape aShape)
Visual change notification - call before making changes that will require repaint.


boundsChanged

public void boundsChanged()
Notifies a shape and its parents that its bounds changed.


boundsChanged

public void boundsChanged(RMShape aShape)
Notifies this shape that a given shape's bounds have changed (presumably a descendant).


superSelectable

public boolean superSelectable()
Editor method - indicates whether this shape can be super selected.


acceptsChildren

public boolean acceptsChildren()
Editor method.


sizesToFitChildren

public boolean sizesToFitChildren()
Editor method.


childrenSuperSelectImmediately

public boolean childrenSuperSelectImmediately()
Editor method.


toString

public java.lang.String toString()
Standard to string implementation (prints class name and shape bounds).

Overrides:
toString in class java.lang.Object

page

public int page()
Page number resolution.


pageMax

public int pageMax()
Page number resolution.


getPageBreak

public int getPageBreak()
Returns the "PageBreak" for this shape as defined by shapes that define a page break (currently only RMTable).


getPageBreakMax

public int getPageBreakMax()
Returns the "PageBreakMax" for this shape as defined by shapes that define a page break (currently only RMTable).


getPageBreakPage

public int getPageBreakPage()
Returns the "PageBreakPage" for this shape, or the page number relative to the last page break, as defined by shapes that define explicit page breaks (currently only RMTable).


getPageBreakPageMax

public int getPageBreakPageMax()
Returns the "PageBreakPageMax" for this shape, or the max page number relative to the last and next page breaks, as defined by shapes that define explicit page breaks (currently only RMTable).


paint

public void paint(com.reportmill.shape.RMShapePainter aPainter,
                  java.awt.Graphics2D aGraphics)
Top-level generic shape painting - sets transform and opacity then does a paintAll. If a effect is present, has it paint instead of doing paintAll.


paintShapeAll

public void paintShapeAll(com.reportmill.shape.RMShapePainter aPainter,
                          java.awt.Graphics2D aGraphics)
Calls paintShape, paintShapeChildren and paintShapeOver.


paintShape

public void paintShape(com.reportmill.shape.RMShapePainter aPainter,
                       java.awt.Graphics2D aGraphics)
Basic shape painting - paints shape fill and stroke.


paintShapeChildren

public void paintShapeChildren(com.reportmill.shape.RMShapePainter aPainter,
                               java.awt.Graphics2D aGraphics)
Paints shape children.


paintShapeOver

public void paintShapeOver(com.reportmill.shape.RMShapePainter aPainter,
                           java.awt.Graphics2D aGraphics)
Paints after (on top) of children.


getClipShape

public java.awt.Shape getClipShape()
Returns clip shape for shape.


getChildClipShape

public java.awt.Shape getChildClipShape()
Returns clip shape to be used for children.


getVisbileBounds

public java.awt.Shape getVisbileBounds()
Returns the visible bounds in shape coords, by intersecting this shape's bounds with ancester clip and child clip.


getVisibleBounds

public java.awt.Shape getVisibleBounds(RMRect aRect)
Returns the visible bounds of given rect in shape coords, by intersecting rect with ancester clip and child clip.


getVisibleBounds

public java.awt.Shape getVisibleBounds(RMShape anAncestor)
Returns the visible bounds in given ancestor coords, by intersecting this shape's bounds with ancester clip and child clip.


getVisibleBounds

public java.awt.Shape getVisibleBounds(RMRect aRect,
                                       RMShape anAncestor)
Returns the visible bounds of given rect in given ancestor coords, by intersecting the rect with ancester clip and child clip.


animUpdate

public void animUpdate(java.beans.PropertyChangeEvent anEvent)
Called to update shape anim.

Overrides:
animUpdate in class com.reportmill.base.RMObject

isAnimProperty

public boolean isAnimProperty(java.lang.String aPropertyName)
Returns whether given property name is anim property.


toXML

public com.reportmill.archiver.RXElement toXML(com.reportmill.archiver.RXArchiver anArchiver,
                                               java.lang.Object anOwner)
XML Archival generic - break toXML into toXMLShape and toXMLShapeChildren.


toXMLShape

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


toXMLShapeChildren

public void toXMLShapeChildren(com.reportmill.archiver.RXArchiver anArchiver,
                               com.reportmill.archiver.RXElement anElement,
                               java.lang.Object anOwner)
XML archival of children.


fromXML

public java.lang.Object fromXML(com.reportmill.archiver.RXArchiver anArchiver,
                                com.reportmill.archiver.RXElement anElement,
                                java.lang.Object anOwner)
XML unarchival generic - break fromXML into fromXMLShape and fromXMLShapeChildren.


fromXMLShape

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


fromXMLShapeChildren

public void fromXMLShapeChildren(com.reportmill.archiver.RXArchiver anArchiver,
                                 com.reportmill.archiver.RXElement anElement,
                                 java.lang.Object anOwner)
XML unarchival for shape children.


ReportMill 11 API