Package com.inductiveautomation.rm.shape
Class RMShape
java.lang.Object
com.inductiveautomation.rm.base.RMListenerList
com.inductiveautomation.rm.base.RMObject
com.inductiveautomation.rm.shape.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);
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.inductiveautomation.rm.base.RMTypes
RMTypes.Align, RMTypes.AlignX, RMTypes.AlignY
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Name of property change fired when binding configuration is changedstatic final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Editor method.boolean
Returns whether shape accepts mouse events.void
addBinding
(Binding aBinding) Adds the individual binding to the shape's bindings list.void
addBinding
(String aPropName, String aKey) Adds a binding for given name and key.void
addDeepChangeListener
(DeepChangeListener aListener) Adds a deep change listener to shape to listen for shape changes and property changes received by shape.void
addMouseListener
(RMShapeMouseListener aListener) Add mouse listener.void
animUpdate
(PropertyChangeEvent anEvent) Called to update shape anim.bounds()
Returns raw x, y, width and height of shape as rect (preserves possible negative sizes).boolean
Editor method.clone()
Standard implementation of Object clone.Clones all attributes of this shape with complete clones of its children as well.protected double
computePrefHeight
(double aWidth) Computes the preferred height for given width.protected double
computePrefWidth
(double aHeight) Computes the preferred width for given height.boolean
Returns whether this shape is hit by the point, given in this shape's parent's coords.convertedPointFromShape
(RMPoint aPoint, RMShape aShape) Returns the given point converted from the given shape's coords.convertedPointToShape
(RMPoint aPoint, RMShape aShape) Returns the given point converted to the given shape's coords.convertedRectFromShape
(RMRect aRect, RMShape aShape) Returns the rect encompassing the given rect converted from the given shape's coords.convertedRectToShape
(RMRect aRect, RMShape aShape) Returns the rect encompassing the given rect converted to the given shape's coords.convertedVectorFromShape
(RMSize aSize, RMShape aShape) Returns the given size converted from the given shape's coords and normalized.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.convertPathFromShape
(RMPath aPath, RMShape aShape) Returns the given path converted from the given shape's coords.convertPathToShape
(RMPath aPath, RMShape aShape) Returns the given path converted to the given shape's coords.convertPointFromShape
(RMPoint point, RMShape shape) Converts the given point to the given shape's coords (returns it for convenience).convertPointToShape
(RMPoint point, RMShape shape) Converts the given point to the given shape's coords (returns it for convenience).convertRectFromShape
(RMRect rect, RMShape shape) Converts the given rect from the given shape's coords (returns it for convenience).convertRectToShape
(RMRect rect, RMShape shape) Converts the given rect to the given shape's coords (returns it for convenience).void
convertToShape
(RMShape aShape) Transforms the given shape to this shape's coords.convertVectorFromShape
(RMSize size, RMShape shape) Converts the given size (as a vector) from the given shape's coords (returns it for convenience).convertVectorToShape
(RMSize size, RMShape shape) Converts the given size (as a vector) to the given shape's coords (returns it for convenience).void
Copies basic shape attributes from given RMShape (location, size, fill, stroke, roll, scale, name, url, etc.).protected RMShape
createDivideShapeRemainder
(byte anEdge) Creates a shape suitable for the "remainder" portion of a divideShape call (just a clone by default).void
deepChange
(PropertyChangeListener aListener, PropertyChangeEvent anEvent) Deep property change listener implementation.divideShapeFromEdge
(double anAmount, byte anEdge, RMShape aNewShape) Divides the shape by a given amount from the given edge.divideShapeFromTop
(double anAmount) Divides the shape by a given amount from the top.fromXML
(RXArchiver anArchiver, RXElement anElement) XML unarchival.Returns the Object associated with the given name for the shape.Returns the object associated with given key, using the given default if not found.Returns the alignment.Returns the horizontal alignment.Returns the vertical alignment.getAncestor
(int anIndex) Returns the ancestor at the given index (parent is ancestor 0).int
Returns the number of ancestors (from this shape's parent up to the document).getAncestorInCommon
(RMShape aShape) Returns first ancestor that the given shape and this shape have in common.Returns the animator that this shape registers changes with.getAnimator
(boolean create) Returns the animator that this shape registers changes with (creating, if requested and currently null).Returns the autosizing settings as a string with hyphens for struts and tilde for springs (horiz,vert).Returns the autosizing default.double
Returns the best height for current width.double
getBestHeight
(double aValue) Returns the best height for current width.double
Returns the best width for current height.double
getBestWidth
(double aValue) Returns the best width for current height.getBinding
(int anIndex) Returns the individual binding at the given index.getBinding
(String aPropertyName) Returns the individual binding with the given property name.int
Returns the number of bindings associated with shape.getBindings
(boolean doCreate) Returns the list of bindings, with an option to create if missing.Returns the X, Y, width and height of the shape as a rect (use getFrame if shape has roll/scale/skew).Returns the bounds of the shape in the shape's own coords.Returns the bounds of the path associated with this shape in local coords, adjusted to account for stroke width.Returns the marked bounds of this shape and its children.getChild
(int anIndex) Returns the child at given index.Returns the animator that this shape's children use.getChildAnimator
(boolean create) Returns the animator that this shape's children use (creating, if requested and currently null).Returns clip shape to be used for children.int
Returns the child count.Returns the children list.Returns clip shape for shape.getColor()
Returns the color of the shape.Returns the dash array for this stroke as a string.float
Returns the dash phase.Returns the entity this shape should show in keys browser.Returns the dataset key associated with this shape.Returns the RMDocument ancestor of this shape (or null if not there).Returns the effect for this shape.getEventAdapter
(boolean doCreate) Returns the ShapeEventAdapter for this shape.getFill()
Returns the fill for this shape.getFont()
Returns the font for the shape (defaults to parent font).Returns the format for the shape.getFrame()
Returns the rect in parent coords that fully encloses the shape.double
Returns the height of the rect that fully encloses the shape in parent coords.double
Returns the max X of the shape's frame.double
Returns the max Y of the shape's frame.double
Returns the width of the rect that fully encloses the shape in parent coords.double
Returns the X of the rect that fully encloses the shape in parent coords.Returns the origin of the shape's bounds rect in parent coords.double
Returns the Y of the rect that fully encloses the shape in parent coords.double
Returns the height of the shape.getHover()
Sets the Hover string for the shape.Returns an object describing layout paramaters of this shape in its parent's layout.Returns the outline of the shape as a path.double
getMaxX()
Returns the max X of the shape (assumes not rotated, scaled or skewed).double
getMaxY()
Returns the max Y of the shape (assumes not rotated, scaled or skewed).double
Returns the shape minimum height.double
getMinHeight
(double aValue) Returns the shape minimum height.double
Returns the shape minimum width.double
getMinWidth
(double aValue) Returns the shape minimum width.getName()
Returns the name for the shape.float
Returns the opacity of the shape (1 for opaque, 0 for transparent).float
Returns the combined opacity of this shape and its parent.Returns the outline for the shape.int
Returns the "PageBreak" for this shape as defined by shapes that define a page break (currently only RMTable).int
Returns the "PageBreakMax" for this shape as defined by shapes that define a page break (currently only RMTable).int
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
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).Returns the RMPage ancestor of this shape (or null if not there).Returns the parent of this shape.<T extends RMShape>
TReturns the first parent with given class by iterating up parent hierarchy.getPath()
Returns the shape's path.Returns the shape's path scaled to the shape's current bounds.double
Returns the shape preferred height.double
getPrefHeight
(double aValue) Returns the shape preferred height.double
Returns the shape preferred width.double
getPrefWidth
(double aValue) Returns the shape preferred width.getPropertyNameMapped
(String aName) Returns a mapped property name.Returns the property names for helper's instance class.protected void
getPropertyNames
(List<String> aList) Returns the property names for RMShape.double
getRoll()
Returns the roll of the shape.Returns the top level shape (usually an RMDocument).protected RMShapeRSS
getRSS()
Returns the roll scale skew object.double
Returns the scale of the X axis of the shape.double
Returns the scale of the Y axis of the shape.getShapesToAncestor
(RMShape aShape) Returns a list of shapes from this shape to a given ancestor, inclusive.getShapesToDescendant
(RMShape aShape) Returns a list of shape's from this shape to given descendant, inclusive.getShapesToShape
(RMShape aShape) Returns a list of shapes from this shape to given shape.getSize()
Returns the size of the shape.double
getSkewX()
Returns the skew of the X axis of the shape.double
getSkewY()
Returns the skew of the Y axis of the shape.Returns the stroke for this shape.Returns the stroke color of the shape.boolean
Returns whether to stroke on top.int
float
Returns the stroke width of the shape's stroke in printer points.Returns the text color for the shape.Returns the timeline for animating shape property changes.getTimeline
(boolean create) Returns the timeline for animating shape property changes, with an option to create if absent.Returns the transform to this shape from its parent.getTransformFromShape
(RMShape aShape) Returns the transform from the given shape to this shape.Returns the transform from this shape to its parent.getTransformToShape
(RMShape aShape) Returns the transform from this shape to the given shape.Returns the undoer for this shape (or null if not there).getURL()
Sets the URL for the shape.Returns the visible bounds in shape coords, by intersecting this shape's bounds with ancester clip and child clip.getVisibleBounds
(RMRect aRect) Returns the visible bounds of given rect in shape coords, by intersecting rect with ancester clip and child clip.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.getVisibleBounds
(RMShape anAncestor) Returns the visible bounds in given ancestor coords, by intersecting this shape's bounds with ancester clip and child clip.double
getWidth()
Returns the width of the shape.double
getX()
Returns the X location of the shape.getXY()
Returns the XY location of the shape as a point.getXYP()
Returns the origin point of the shape in parent's coords.double
getY()
Returns the Y location of the shape.double
height()
Returns raw height of shape.int
indexOf()
Returns the index of this child in its parent.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
(String aPropertyName) Returns whether given property name is anim property.boolean
Override this for shapes (like a table row) that don't don't make sense to delete by themselves.boolean
isDescendant
(RMShape aShape) Returns true if given shape is one of this shape's descendants.boolean
Returns whether this shape is being edited in an editor.boolean
isEnabled
(UIEvent.Type aType) Returns whether given event is enabled.boolean
Returns whether font has been set.boolean
Returns whether this shape is hittable in its parent.boolean
isLocked()
Returns the locked state of the shape (really just to prevent location/size changes in the editor).boolean
Returns whether shape minimum height is set.boolean
Returns whether shape minimum width is set.boolean
Returns whether shape preferred height is set.boolean
Returns whether shape preferred width is set.boolean
isRoot()
Editor method - returns whether this shape is at the top level (usually RMPage).boolean
isRSS()
Returns whether the shape has been rotated, scaled or skewed (for efficiency).boolean
Returns whether this shape is visible in its parent.boolean
Returns whether the shape is underlined.boolean
boolean
boolean
Returns whether this shape is being viewed in a viewer.boolean
Returns whether this shape is visible.void
mouseClicked
(RMShapeMouseEvent anEvent) Handles mouse clicked events.void
mouseDragged
(RMShapeMouseEvent anEvent) Handles mouse dragged events.void
mouseEntered
(RMShapeMouseEvent anEvent) Handles mouse entered events.void
mouseExited
(RMShapeMouseEvent anEvent) Handles mouse exited events.void
mouseMoved
(RMShapeMouseEvent anEvent) Handles mouse moved events.void
mousePressed
(RMShapeMouseEvent anEvent) Handles mouse pressed events.void
mouseReleased
(RMShapeMouseEvent anEvent) Handles mouse released events.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
(RMShapePainter aPntr) Top-level generic shape painting - sets transform and opacity then does a paintAll.void
paintShape
(RMShapePainter aPntr) Basic shape painting - paints shape fill and stroke.void
paintShapeAll
(RMShapePainter aPntr) Calls paintShape, paintShapeChildren and paintShapeOver.void
paintShapeChildren
(RMShapePainter aPntr) Paints shape children.void
paintShapeOver
(RMShapePainter aPntr) Paints after (on top) of children.void
propertyChange
(PropertyChangeEvent anEvent) Property change listener implementation.Sets an Object to be associated with the given name for the shape.removeBinding
(int anIndex) Removes the binding at the given index from shape's bindings list.boolean
removeBinding
(String aPropertyName) Removes the binding with given property name.void
Removes a deep change listener from shape.void
Removes this shape from its parent.void
Remove mouse listener.void
repaint()
Visual change notification - call before making changes that will require repaint.protected void
Visual change notification - call before making changes that will require repaint.protected void
resolvePageReferences
(ReportOwner aRptOwner, Object userInfo) Replaces all @Page@ style keys with their actual values for this shape and its children.rpgAll
(ReportOwner anRptOwner, RMShape aParent) Generate report with report owner.void
rpgBindings
(ReportOwner anRptOwner, RMShape aShapeRPG) Report generation for URL and bindings.protected RMShape
rpgShape
(ReportOwner anRptOwner, RMShape aParent) Generate report with report owner.void
setAlignment
(RMTypes.Align anAlign) Sets the alignment.void
setAlignmentX
(RMTypes.AlignX anAlignX) Sets the horizontal alignment.void
setAlignmentY
(RMTypes.AlignY anAlignX) Sets the vertical alignment.void
setAutosizing
(String aValue) Sets the autosizing settings as a string with hyphens for struts and tilde for sprints (horiz,vert).void
Sets the shape to its best height (which is just the current height for most shapes).void
Sets the shape to its best size.void
setBounds
(double anX, double aY, double aW, double aH) Sets X, Y, width and height of shape to given dimensions.void
setBounds
(Rectangle2D aRect) Sets X, Y, width and height of shape to dimensions in given rect.void
Sets the color of the shape.void
setDashArrayString
(String aString) Sets the dash array for this stroke from a string.void
setDashPhase
(float dashPhase) void
Sets the effect for this shape.void
setEnabled
(UIEvent.Type aType, boolean aValue) Sets whether given event is enabled.void
Sets the fill for this shape.void
Sets the font for the shape.void
Sets the format for the shape.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.void
setFrame
(Rectangle2D aRect) Sets the bounds of the shape such that it exactly fits in the given parent coord rect.void
setFrameSize
(double aWidth, double aHeight) Sets the height of the rect that fully encloses the shape in parent coords.void
setFrameX
(double anX) Sets a shape's X such that its bounds rect (in parent coords) has origin at the given X.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.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 aY) Sets a shape's Y such that its bounds rect (in parent coords) has origin at the given Y.void
setHeight
(double aValue) Sets the height of the shape.void
Returns the URL for the shape.void
setLayoutInfo
(Object theLayoutInfo) Sets an object describing layout parameters of this shape in its parent's layout.void
setLocked
(boolean aValue) Sets the locked state of the shape (really just to prevent location/size changes in the editor).void
setMinHeight
(double aHeight) Sets the shape minimum height.void
setMinSize
(double aWidth, double aHeight) Sets the shape minimum size.void
setMinWidth
(double aWidth) Sets the shape minimum width.void
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
(RMParentShape aShape) Sets the parent of this shape (called automatically by addChild()).void
setPrefHeight
(double aHeight) Sets the shape preferred height.void
setPrefWidth
(double aWidth) Sets the shape preferred width.void
setRoll
(double aValue) Sets the roll of the shape.void
setScaleX
(double aValue) Sets the scale of the X axis of the shape.void
setScaleXY
(double sx, double sy) Sets the scale of the X and Y axis.void
setScaleY
(double aValue) Sets the scale of the Y axis of the shape.void
setShowing
(boolean aValue) Sets whether shape is showing.void
setSize
(double aWidth, double aHeight) Sets the size of the shape.void
Sets the size of the shape.void
setSkewX
(double aValue) Sets the skew of the X axis of the shape.void
setSkewXY
(double skx, double sky) Sets the skew of the X and Y axis.void
setSkewY
(double aValue) Sets the skew of the Y axis of the shape.void
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
setStrokeStyle
(int style) void
setStrokeWidth
(float aValue) Sets the stroke width of the shape's stroke in printer points.void
setTextColor
(RMColor aColor) Sets the text color for the shape.void
setTime
(int aTime) Tells the shape's timeline to update the shape to the given time in milliseconds.protected void
setTimeline
(RMTimeline aTimeline) Sets the shape timeline.void
setUnderlined
(boolean aFlag) Sets the shape to underline.void
Returns the URL for the shape.void
setUseFill
(boolean useFill) void
setUseStroke
(boolean useStroke) void
setVisible
(boolean aValue) Sets whether this shape is visible.void
setWidth
(double aValue) Sets the width of the shape.void
setX
(double aValue) Sets the X location of the shape.void
setXY
(double anX, double aY) Sets the X and Y location of the shape to the given point (convenience).void
Sets the X and Y location of the shape to the given point (convenience).void
setXYP
(double anX, double aY) Sets the origin point of the shape to the given X and Y in parent's coords.void
setY
(double aValue) Sets the Y location of the shape.protected void
Notifies shape that it or one of its ancestors was made non-visible or removed from hierarchy.protected void
Notifies shape that it or one of its ancestors was made visible.boolean
Editor method - indicates whether this shape can be super selected.toString()
Standard to string implementation (prints class name and shape bounds).toXML
(RXArchiver anArchiver) XML Archival.void
Undoer convenience - disable the undoer.void
Undoer convenience - enables the undoer.void
undoerSetUndoTitle
(String aTitle) Undoer convenience - sets title of next registered undo.double
width()
Returns raw width of shape.double
x()
Returns raw x location of shape.double
y()
Returns raw y location of shape.Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
Field Details
-
BINDING_PROP_NAME
Name of property change fired when binding configuration is changed- See Also:
-
STROKE_HIDDEN
public static final int STROKE_HIDDEN- See Also:
-
STROKE_SHAPE
public static final int STROKE_SHAPE- See Also:
-
STROKE_BORDER
public static final int STROKE_BORDER- See Also:
-
STROKE_DOUBLE
public static final int STROKE_DOUBLE- See Also:
-
-
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
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
Returns the XY location of the shape as a point. -
setXY
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
Returns the size of the shape. -
setSize
Sets the size of the shape. -
setSize
public void setSize(double aWidth, double aHeight) Sets the size of the shape. -
getBounds
Returns the X, Y, width and height of the shape as a rect (use getFrame if shape has roll/scale/skew). -
setBounds
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
Returns the rect in parent coords that fully encloses the shape. -
setFrame
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
Returns the origin of the shape's bounds rect in parent coords. -
setFrameXY
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
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
Returns the bounds of the shape in the shape's own coords. -
getBoundsMarked
Returns the bounds of the path associated with this shape in local coords, adjusted to account for stroke width. -
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
Returns the roll scale skew object. -
getStroke
Returns the stroke for this shape. -
setStroke
Sets the stroke for this shape, with an option to turn on drawsStroke. -
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
Returns the dash array for this stroke as a string. -
setDashArrayString
Sets the dash array for this stroke from a string. -
getFill
Returns the fill for this shape. -
setFill
Sets the fill for this shape. -
getDisplayedFill
-
isUseFill
public boolean isUseFill() -
setUseFill
public void setUseFill(boolean useFill) -
getEffect
Returns the effect for this shape. -
setEffect
Sets the effect for this shape. -
getColor
Returns the color of the shape. -
setColor
Sets the color of the shape. -
getStrokeColor
Returns the stroke color of the shape. -
setStrokeColor
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
Returns an object describing layout paramaters of this shape in its parent's layout. -
setLayoutInfo
Sets an object describing layout parameters of this shape in its parent's layout. -
getAutosizing
Returns the autosizing settings as a string with hyphens for struts and tilde for springs (horiz,vert). -
setAutosizing
Sets the autosizing settings as a string with hyphens for struts and tilde for sprints (horiz,vert). -
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
Returns the text color for the shape. -
setTextColor
Sets the text color for the shape. -
isFontSet
public boolean isFontSet()Returns whether font has been set. -
getFont
Returns the font for the shape (defaults to parent font). -
setFont
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
Returns the outline for the shape. -
setOutline
Sets the outline for the shape. -
getAlignment
Returns the alignment. -
setAlignment
Sets the alignment. -
getAlignmentX
Returns the horizontal alignment. -
setAlignmentX
Sets the horizontal alignment. -
getAlignmentY
Returns the vertical alignment. -
setAlignmentY
Sets the vertical alignment. -
getFormat
Returns the format for the shape. -
setFormat
Sets the format for the shape. -
addDeepChangeListener
Adds a deep change listener to shape to listen for shape changes and property changes received by shape. -
removeDeepChangeListener
Removes a deep change listener from shape. -
propertyChange
Property change listener implementation.- Specified by:
propertyChange
in interfacePropertyChangeListener
-
deepChange
Deep property change listener implementation.- Specified by:
deepChange
in interfaceDeepChangeListener
-
getName
Returns the name for the shape. -
setName
Sets the name for the shape. -
getURL
Sets the URL for the shape. -
setURL
Returns the URL for the shape. -
getHover
Sets the Hover string for the shape. -
setHover
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
Returns the timeline for animating shape property changes. -
getTimeline
Returns the timeline for animating shape property changes, with an option to create if absent. -
setTimeline
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
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
Sets an Object to be associated with the given name for the shape. -
get
Returns the object associated with given key, using the given default if not found. -
getPath
Returns the shape's path. -
getPathInBounds
Returns the shape's path scaled to the shape's current bounds. -
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
Returns the parent of this shape. -
setParent
Sets the parent of this shape (called automatically by addChild()). -
getParent
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
Returns the child at given index. -
getChildren
Returns the children list. -
getRootShape
Returns the top level shape (usually an RMDocument). -
getDocument
Returns the RMDocument ancestor of this shape (or null if not there). -
getPageShape
Returns the RMPage ancestor of this shape (or null if not there). -
getUndoer
Returns the undoer for this shape (or null if not there). -
undoerSetUndoTitle
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
Returns the ancestor at the given index (parent is ancestor 0). -
isAncestor
Returns true if given shape is one of this shape's ancestors. -
isDescendant
Returns true if given shape is one of this shape's descendants. -
getAncestorInCommon
Returns first ancestor that the given shape and this shape have in common. -
getShapesToAncestor
Returns a list of shapes from this shape to a given ancestor, inclusive. -
getShapesToDescendant
Returns a list of shape's from this shape to given descendant, inclusive. -
getShapesToShape
Returns a list of shapes from this shape to given shape. -
getTransform
Returns the transform to this shape from its parent. -
getTransformInverse
Returns the transform from this shape to its parent. -
getTransformToShape
Returns the transform from this shape to the given shape. -
getTransformFromShape
Returns the transform from the given shape to this shape. -
convertPointToShape
Converts the given point to the given shape's coords (returns it for convenience). -
convertPointFromShape
Converts the given point to the given shape's coords (returns it for convenience). -
convertVectorToShape
Converts the given size (as a vector) to the given shape's coords (returns it for convenience). -
convertVectorFromShape
Converts the given size (as a vector) from the given shape's coords (returns it for convenience). -
convertRectToShape
Converts the given rect to the given shape's coords (returns it for convenience). -
convertRectFromShape
Converts the given rect from the given shape's coords (returns it for convenience). -
convertedPointToShape
Returns the given point converted to the given shape's coords. -
convertedPointFromShape
Returns the given point converted from the given shape's coords. -
convertedVectorToShape
Returns the given size converted to the given shape's coords and normalized. -
convertedVectorFromShape
Returns the given size converted from the given shape's coords and normalized. -
convertedRectToShape
Returns the rect encompassing the given rect converted to the given shape's coords. -
convertedRectFromShape
Returns the rect encompassing the given rect converted from the given shape's coords. -
convertPathToShape
Returns the given path converted to the given shape's coords. -
convertPathFromShape
Returns the given path converted from the given shape's coords. -
convertToShape
Transforms the given shape to this shape's coords. -
convertFromShape
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
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
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
Creates a shape suitable for the "remainder" portion of a divideShape call (just a clone by default). -
getAnimator
Returns the animator that this shape registers changes with. -
getAnimator
Returns the animator that this shape registers changes with (creating, if requested and currently null). -
getChildAnimator
Returns the animator that this shape's children use. -
getChildAnimator
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
Add mouse listener. -
removeMouseListener
Remove mouse listener. -
acceptsMouse
public boolean acceptsMouse()Returns whether shape accepts mouse events. -
mousePressed
Handles mouse pressed events. -
mouseDragged
Handles mouse dragged events. -
mouseReleased
Handles mouse released events. -
mouseClicked
Handles mouse clicked events. -
mouseEntered
Handles mouse entered events. -
mouseMoved
Handles mouse moved events. -
mouseExited
Handles mouse exited events. -
contains
Returns whether this shape is hit by the point, given in this shape's parent's coords. -
intersects
Returns whether this shape is hit by the path, given in this shape's parent's coords. -
getDatasetKey
Returns the dataset key associated with this shape. -
getDatasetEntity
Returns the entity this shape should show in keys browser. -
getPropertyNames
Returns the property names for helper's instance class. -
getPropertyNameMapped
Returns a mapped property name. -
getPropertyNames
Returns the property names for RMShape. -
getBindingCount
public int getBindingCount()Returns the number of bindings associated with shape. -
getBinding
Returns the individual binding at the given index. -
getBindings
Returns the list of bindings, with an option to create if missing. -
addBinding
Adds the individual binding to the shape's bindings list. -
removeBinding
Removes the binding at the given index from shape's bindings list. -
getBinding
Returns the individual binding with the given property name. -
removeBinding
Removes the binding with given property name. -
addBinding
Adds a binding for given name and key. -
isEnabled
Returns whether given event is enabled. -
setEnabled
Sets whether given event is enabled. -
getEventAdapter
Returns the ShapeEventAdapter for this shape. -
clone
Standard implementation of Object clone. Nulls out shape's parent and children.- Overrides:
clone
in classRMListenerList
-
cloneDeep
Clones all attributes of this shape with complete clones of its children as well. -
copyShape
Copies basic shape attributes from given RMShape (location, size, fill, stroke, roll, scale, name, url, etc.). -
rpgAll
Generate report with report owner. -
rpgShape
Generate report with report owner. -
rpgBindings
Report generation for URL and bindings. -
resolvePageReferences
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
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
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
Calls paintShape, paintShapeChildren and paintShapeOver. -
paintShape
Basic shape painting - paints shape fill and stroke. -
paintShapeChildren
Paints shape children. -
paintShapeOver
Paints after (on top) of children. -
getStrokeOnTop
public boolean getStrokeOnTop()Returns whether to stroke on top. -
getClipShape
Returns clip shape for shape. -
getChildClipShape
Returns clip shape to be used for children. -
getVisbileBounds
Returns the visible bounds in shape coords, by intersecting this shape's bounds with ancester clip and child clip. -
getVisibleBounds
Returns the visible bounds of given rect in shape coords, by intersecting rect with ancester clip and child clip. -
getVisibleBounds
Returns the visible bounds in given ancestor coords, by intersecting this shape's bounds with ancester clip and child clip. -
getVisibleBounds
Returns the visible bounds of given rect in given ancestor coords, by intersecting the rect with ancester clip and child clip. -
animUpdate
Called to update shape anim.- Overrides:
animUpdate
in classRMObject
-
isAnimProperty
Returns whether given property name is anim property. -
toXML
XML Archival.- Specified by:
toXML
in interfaceArchivable
-
fromXML
XML unarchival.- Specified by:
fromXML
in interfaceArchivable
-
toString
Standard to string implementation (prints class name and shape bounds).
-