Class RMShape

All Implemented Interfaces:
Archivable, DeepChangeListener, RMPropertyChanger, RMTypes, PropertyChangeListener, Cloneable, EventListener
Direct Known Subclasses:
AbstractJ2DShape, RMGraphPartBars, RMGraphPartPie, RMGraphPartSeries, RMMorphShape, RMOvalShape, RMPainterShape, RMParentShape, RMRectShape, RMShapeTable.STCell, RMSoundShape, RMStarShape

public class RMShape extends RMObject implements PropertyChangeListener, DeepChangeListener, RMTypes, Archivable
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 Details

  • Constructor Details

    • RMShape

      public RMShape()
  • Method Details

    • x

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

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

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

      public double 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 double getX()
      Returns the X location of the shape.
    • setX

      public void setX(double aValue)
      Sets the X location of the shape.
    • getY

      public double getY()
      Returns the Y location of the shape.
    • setY

      public void setY(double aValue)
      Sets the Y location of the shape.
    • getWidth

      public double getWidth()
      Returns the width of the shape.
    • setWidth

      public void setWidth(double aValue)
      Sets the width of the shape.
    • getHeight

      public double getHeight()
      Returns the height of the shape.
    • setHeight

      public void setHeight(double aValue)
      Sets the height of the shape.
    • getMaxX

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

      public double 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(Point2D aPoint)
      Sets the X and Y location of the shape to the given point (convenience).
    • setXY

      public void setXY(double anX, double aY)
      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 aWidth, double aHeight)
      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(Rectangle2D aRect)
      Sets X, Y, width and height of shape to dimensions in given rect.
    • setBounds

      public void setBounds(double anX, double aY, double aW, double aH)
      Sets X, Y, width and height of shape to given dimensions.
    • getFrame

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

      public void setFrame(Rectangle2D aRect)
      Sets the bounds of the shape such that it exactly fits in the given parent coord rect.
    • setFrame

      public void setFrame(double anX, double aY, double aWidth, double aHeight)
      Sets the bounds of the shape such that it exactly fits in the given parent coord rect.
    • getFrameX

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

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

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

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

      public double getFrameWidth()
      Returns the width of the rect that fully encloses the shape in parent coords.
    • getFrameHeight

      public double getFrameHeight()
      Returns the height of the rect that fully encloses the shape in parent coords.
    • 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 anX, double aY)
      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 aWidth, double aHeight)
      Sets the height of the rect that fully encloses the shape in parent coords.
    • getFrameMaxX

      public double getFrameMaxX()
      Returns the max X of the shape's frame.
    • getFrameMaxY

      public double getFrameMaxY()
      Returns the max Y of the shape's frame.
    • getXYP

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

      public void setXYP(double anX, double aY)
      Sets the origin point of the shape to the given X and Y in parent's coords.
    • offsetXY

      public void offsetXY(double dx, double dy)
      Offsets the X and Y location of the shape by the given dx & dy amount (convenience).
    • 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 its children.
    • getRoll

      public double getRoll()
      Returns the roll of the shape.
    • setRoll

      public void setRoll(double aValue)
      Sets the roll of the shape.
    • getScaleX

      public double getScaleX()
      Returns the scale of the X axis of the shape.
    • setScaleX

      public void setScaleX(double aValue)
      Sets the scale of the X axis of the shape.
    • getScaleY

      public double getScaleY()
      Returns the scale of the Y axis of the shape.
    • setScaleY

      public void setScaleY(double aValue)
      Sets the scale of the Y axis of the shape.
    • setScaleXY

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

      public double getSkewX()
      Returns the skew of the X axis of the shape.
    • setSkewX

      public void setSkewX(double aValue)
      Sets the skew of the X axis of the shape.
    • getSkewY

      public double getSkewY()
      Returns the skew of the Y axis of the shape.
    • setSkewY

      public void setSkewY(double aValue)
      Sets the skew of the Y axis of the shape.
    • setSkewXY

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

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

      protected RMShapeRSS getRSS()
      Returns the roll scale skew object.
    • 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.
    • getDisplayedStroke

      public RMStroke getDisplayedStroke()
    • isUseStroke

      public boolean isUseStroke()
    • setUseStroke

      public void setUseStroke(boolean useStroke)
    • getStrokeStyle

      public int getStrokeStyle()
    • setStrokeStyle

      public void setStrokeStyle(int style)
    • getDashPhase

      public float getDashPhase()
      Returns the dash phase. Used for the properties panel.
    • setDashPhase

      public void setDashPhase(float dashPhase)
    • getDashArrayString

      public String getDashArrayString()
      Returns the dash array for this stroke as a string.
    • setDashArrayString

      public void setDashArrayString(String aString)
      Sets the dash array for this stroke from a string.
    • getFill

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

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

      public RMFill getDisplayedFill()
    • isUseFill

      public boolean isUseFill()
    • setUseFill

      public void setUseFill(boolean useFill)
    • getEffect

      public RMEffect getEffect()
      Returns the effect for this shape.
    • setEffect

      public void setEffect(RMEffect anEffect)
      Sets the effect for this shape.
    • 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.
    • getStrokeWidth

      public float getStrokeWidth()
      Returns the stroke width of the shape's stroke in printer points.
    • setStrokeWidth

      public void setStrokeWidth(float aValue)
      Sets the stroke 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.
    • getLayoutInfo

      public Object getLayoutInfo()
      Returns an object describing layout paramaters of this shape in its parent's layout.
    • setLayoutInfo

      public void setLayoutInfo(Object theLayoutInfo)
      Sets an object describing layout parameters of this shape in its parent's layout.
    • getAutosizing

      public String getAutosizing()
      Returns the autosizing settings as a string with hyphens for struts and tilde for springs (horiz,vert).
    • setAutosizing

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

      public String getAutosizingDefault()
      Returns the autosizing default.
    • isShowing

      public boolean isShowing()
      Returns whether this shape is visible in its parent.
    • setShowing

      public void setShowing(boolean aValue)
      Sets whether shape is showing.
    • shapeShown

      protected void shapeShown()
      Notifies shape that it or one of its ancestors was made visible.
    • shapeHidden

      protected void shapeHidden()
      Notifies shape that it or one of its ancestors was made non-visible or removed from hierarchy.
    • isHittable

      public boolean isHittable()
      Returns whether this shape is hittable in its parent.
    • isViewing

      public boolean isViewing()
      Returns whether this shape is being viewed in a viewer.
    • isEditing

      public boolean isEditing()
      Returns whether this shape is being edited in an editor.
    • getTextColor

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

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

      public boolean isFontSet()
      Returns whether font has been set.
    • getFont

      public RMFont getFont()
      Returns the font for the shape (defaults to parent font).
    • 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.
    • getAlignment

      public RMTypes.Align getAlignment()
      Returns the alignment.
    • setAlignment

      public void setAlignment(RMTypes.Align anAlign)
      Sets the alignment.
    • getAlignmentX

      public RMTypes.AlignX getAlignmentX()
      Returns the horizontal alignment.
    • setAlignmentX

      public void setAlignmentX(RMTypes.AlignX anAlignX)
      Sets the horizontal alignment.
    • getAlignmentY

      public RMTypes.AlignY getAlignmentY()
      Returns the vertical alignment.
    • setAlignmentY

      public void setAlignmentY(RMTypes.AlignY anAlignX)
      Sets the vertical alignment.
    • getFormat

      @Nullable public RMFormat getFormat()
      Returns the format for the shape.
    • setFormat

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

      public void addDeepChangeListener(DeepChangeListener aListener)
      Adds a deep change listener to shape to listen for shape changes and property changes received by shape.
    • removeDeepChangeListener

      public void removeDeepChangeListener(DeepChangeListener aLstnr)
      Removes a deep change listener from shape.
    • propertyChange

      public void propertyChange(PropertyChangeEvent anEvent)
      Property change listener implementation.
      Specified by:
      propertyChange in interface PropertyChangeListener
    • deepChange

      public void deepChange(PropertyChangeListener aListener, PropertyChangeEvent anEvent)
      Deep property change listener implementation.
      Specified by:
      deepChange in interface DeepChangeListener
    • getName

      @Nonnull public String getName()
      Returns the name for the shape.
    • setName

      public void setName(String aName)
      Sets the name for the shape.
    • getURL

      public String getURL()
      Sets the URL for the shape.
    • setURL

      public void setURL(String aURL)
      Returns the URL for the shape.
    • getHover

      public String getHover()
      Sets the Hover string for the shape.
    • setHover

      public void setHover(String aString)
      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).
    • getTimeline

      public RMTimeline getTimeline()
      Returns the timeline for animating shape property changes.
    • getTimeline

      public RMTimeline getTimeline(boolean create)
      Returns the timeline for animating shape property changes, with an option to create if absent.
    • setTimeline

      protected void setTimeline(RMTimeline aTimeline)
      Sets the shape timeline.
    • setTime

      public void setTime(int aTime)
      Tells the shape's timeline to update the shape to the given time in milliseconds. Recurses to shape children.
    • get

      public Object get(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 Object put(String aName, Object anObj)
      Sets an Object to be associated with the given name for the shape.
    • get

      public Object get(String aName, Object aDefault)
      Returns the object associated with given key, using the given default if not found.
    • 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 RMParentShape getParent()
      Returns the parent of this shape.
    • setParent

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

      public <T extends RMShape> T getParent(Class<T> aClass)
      Returns the first parent with given class by iterating up parent hierarchy.
    • removeFromParent

      public void removeFromParent()
      Removes this shape from its parent.
    • indexOf

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

      public int getChildCount()
      Returns the child count.
    • getChild

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

      public List<RMShape> getChildren()
      Returns the children list.
    • 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 RMParentShape getPageShape()
      Returns the RMPage ancestor of this shape (or null if not there).
    • getUndoer

      public RMUndoer getUndoer()
      Returns the undoer for this shape (or null if not there).
    • undoerSetUndoTitle

      public void undoerSetUndoTitle(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

      @Nonnull public List<RMShape> getShapesToAncestor(RMShape aShape)
      Returns a list of shapes from this shape to a given ancestor, inclusive.
    • getShapesToDescendant

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

      @Nonnull public List<RMShape> getShapesToShape(RMShape aShape)
      Returns a list of shapes from this shape to given shape.
    • getTransform

      public RMTransform getTransform()
      Returns the transform to this shape from its parent.
    • getTransformInverse

      public RMTransform getTransformInverse()
      Returns the transform from this shape to its parent.
    • getTransformToShape

      public RMTransform getTransformToShape(RMShape aShape)
      Returns the transform from this shape to the given shape.
    • getTransformFromShape

      public 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).
    • 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.
    • 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.
    • isMinWidthSet

      public boolean isMinWidthSet()
      Returns whether shape minimum width is set.
    • getMinWidth

      public double getMinWidth()
      Returns the shape minimum width.
    • getMinWidth

      public double getMinWidth(double aValue)
      Returns the shape minimum width.
    • setMinWidth

      public void setMinWidth(double aWidth)
      Sets the shape minimum width.
    • isMinHeightSet

      public boolean isMinHeightSet()
      Returns whether shape minimum height is set.
    • getMinHeight

      public double getMinHeight()
      Returns the shape minimum height.
    • getMinHeight

      public double getMinHeight(double aValue)
      Returns the shape minimum height.
    • setMinHeight

      public void setMinHeight(double aHeight)
      Sets the shape minimum height.
    • setMinSize

      public void setMinSize(double aWidth, double aHeight)
      Sets the shape minimum size.
    • isPrefWidthSet

      public boolean isPrefWidthSet()
      Returns whether shape preferred width is set.
    • getPrefWidth

      public double getPrefWidth()
      Returns the shape preferred width.
    • getPrefWidth

      public double getPrefWidth(double aValue)
      Returns the shape preferred width.
    • setPrefWidth

      public void setPrefWidth(double aWidth)
      Sets the shape preferred width.
    • computePrefWidth

      protected double computePrefWidth(double aHeight)
      Computes the preferred width for given height.
    • isPrefHeightSet

      public boolean isPrefHeightSet()
      Returns whether shape preferred height is set.
    • getPrefHeight

      public double getPrefHeight()
      Returns the shape preferred height.
    • getPrefHeight

      public double getPrefHeight(double aValue)
      Returns the shape preferred height.
    • setPrefHeight

      public void setPrefHeight(double aHeight)
      Sets the shape preferred height.
    • computePrefHeight

      protected double computePrefHeight(double aWidth)
      Computes the preferred height for given width.
    • getBestWidth

      public double getBestWidth()
      Returns the best width for current height.
    • getBestWidth

      public double getBestWidth(double aValue)
      Returns the best width for current height.
    • getBestHeight

      public double getBestHeight()
      Returns the best height for current width.
    • getBestHeight

      public double getBestHeight(double aValue)
      Returns the best height for current width.
    • setBestHeight

      public void setBestHeight()
      Sets the shape to its best height (which is just the current height for most shapes).
    • setBestSize

      public void setBestSize()
      Sets the shape to its best size.
    • divideShapeFromTop

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

      @Nonnull public RMShape divideShapeFromEdge(double anAmount, byte anEdge, RMShape aNewShape)
      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

      @Nonnull protected RMShape createDivideShapeRemainder(byte anEdge)
      Creates a shape suitable for the "remainder" portion of a divideShape call (just a clone by default).
    • getAnimator

      public RMAnimator getAnimator()
      Returns the animator that this shape registers changes with.
    • getAnimator

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

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

      public 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).
    • addMouseListener

      public void addMouseListener(RMShapeMouseListener aListener)
      Add mouse listener.
    • removeMouseListener

      public void removeMouseListener(RMShapeMouseListener aLsnr)
      Remove mouse listener.
    • acceptsMouse

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

      public void mousePressed(RMShapeMouseEvent anEvent)
      Handles mouse pressed events.
    • mouseDragged

      public void mouseDragged(RMShapeMouseEvent anEvent)
      Handles mouse dragged events.
    • mouseReleased

      public void mouseReleased(RMShapeMouseEvent anEvent)
      Handles mouse released events.
    • mouseClicked

      public void mouseClicked(RMShapeMouseEvent anEvent)
      Handles mouse clicked events.
    • mouseEntered

      public void mouseEntered(RMShapeMouseEvent anEvent)
      Handles mouse entered events.
    • mouseMoved

      public void mouseMoved(RMShapeMouseEvent anEvent)
      Handles mouse moved events.
    • mouseExited

      public void mouseExited(RMShapeMouseEvent anEvent)
      Handles mouse exited events.
    • 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.
    • getDatasetKey

      public String getDatasetKey()
      Returns the dataset key associated with this shape.
    • getDatasetEntity

      @Nullable public Entity getDatasetEntity()
      Returns the entity this shape should show in keys browser.
    • getPropertyNames

      public List<String> getPropertyNames()
      Returns the property names for helper's instance class.
    • getPropertyNameMapped

      public String getPropertyNameMapped(String aName)
      Returns a mapped property name.
    • getPropertyNames

      protected void getPropertyNames(List<String> aList)
      Returns the property names for RMShape.
    • getBindingCount

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

      public Binding getBinding(int anIndex)
      Returns the individual binding at the given index.
    • getBindings

      protected List<Binding> getBindings(boolean doCreate)
      Returns the list of bindings, with an option to create if missing.
    • addBinding

      public void addBinding(Binding aBinding)
      Adds the individual binding to the shape's bindings list.
    • removeBinding

      public Binding removeBinding(int anIndex)
      Removes the binding at the given index from shape's bindings list.
    • getBinding

      @Nullable public Binding getBinding(String aPropertyName)
      Returns the individual binding with the given property name.
    • removeBinding

      public boolean removeBinding(String aPropertyName)
      Removes the binding with given property name.
    • addBinding

      public void addBinding(String aPropName, String aKey)
      Adds a binding for given name and key.
    • isEnabled

      public boolean isEnabled(UIEvent.Type aType)
      Returns whether given event is enabled.
    • setEnabled

      public void setEnabled(UIEvent.Type aType, boolean aValue)
      Sets whether given event is enabled.
    • getEventAdapter

      public RMShapeEventAdapter getEventAdapter(boolean doCreate)
      Returns the ShapeEventAdapter for this shape.
    • clone

      @Nonnull public RMShape clone()
      Standard implementation of Object clone. Nulls out shape's parent and children.
      Overrides:
      clone in class RMListenerList
    • 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.).
    • rpgAll

      @Nonnull public RMShape rpgAll(ReportOwner anRptOwner, RMShape aParent)
      Generate report with report owner.
    • rpgShape

      @Nonnull protected RMShape rpgShape(ReportOwner anRptOwner, RMShape aParent)
      Generate report with report owner.
    • rpgBindings

      public void rpgBindings(ReportOwner anRptOwner, RMShape aShapeRPG)
      Report generation for URL and bindings.
    • resolvePageReferences

      protected void resolvePageReferences(ReportOwner aRptOwner, Object userInfo)
      Replaces all @Page@ style keys with their actual values for this shape and its children.
    • repaint

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

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

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

      public boolean acceptsChildren()
      Editor method.
    • childrenSuperSelectImmediately

      public boolean childrenSuperSelectImmediately()
      Editor method.
    • isDeletable

      public boolean isDeletable()
      Override this for shapes (like a table row) that don't don't make sense to delete by themselves.
    • 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(RMShapePainter aPntr)
      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(RMShapePainter aPntr)
      Calls paintShape, paintShapeChildren and paintShapeOver.
    • paintShape

      public void paintShape(RMShapePainter aPntr)
      Basic shape painting - paints shape fill and stroke.
    • paintShapeChildren

      public void paintShapeChildren(RMShapePainter aPntr)
      Paints shape children.
    • paintShapeOver

      public void paintShapeOver(RMShapePainter aPntr)
      Paints after (on top) of children.
    • getStrokeOnTop

      public boolean getStrokeOnTop()
      Returns whether to stroke on top.
    • getClipShape

      public Shape getClipShape()
      Returns clip shape for shape.
    • getChildClipShape

      public Shape getChildClipShape()
      Returns clip shape to be used for children.
    • getVisbileBounds

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

      public 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 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 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(PropertyChangeEvent anEvent)
      Called to update shape anim.
      Overrides:
      animUpdate in class RMObject
    • isAnimProperty

      public boolean isAnimProperty(String aPropertyName)
      Returns whether given property name is anim property.
    • toXML

      public RXElement toXML(RXArchiver anArchiver)
      XML Archival.
      Specified by:
      toXML in interface Archivable
    • fromXML

      public Object fromXML(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      Specified by:
      fromXML in interface Archivable
    • toString

      @Nonnull public String toString()
      Standard to string implementation (prints class name and shape bounds).
      Overrides:
      toString in class RMObject