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,java.beans.PropertyChangeListener,java.lang.Cloneable,java.util.EventListener
- Direct Known Subclasses:
AbstractJ2DShape,RMGraphPartBars,RMGraphPartPie,RMGraphPartSeries,RMMorphShape,RMOvalShape,RMPainterShape,RMParentShape,RMRectShape,RMShapeTable.STCell,RMSoundShape,RMStarShape
public class RMShape extends RMObject implements java.beans.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
Fields Modifier and Type Field Description static java.lang.StringBINDING_PROP_NAMEName of property change fired when binding configuration is changedstatic intSTROKE_BORDERstatic intSTROKE_DOUBLEstatic intSTROKE_HIDDENstatic intSTROKE_SHAPE
-
Constructor Summary
Constructors Constructor Description RMShape()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsChildren()Editor method.booleanacceptsMouse()Returns whether shape accepts mouse events.voidaddBinding(Binding aBinding)Adds the individual binding to the shape's bindings list.voidaddBinding(java.lang.String aPropName, java.lang.String aKey)Adds a binding for given name and key.voidaddDeepChangeListener(DeepChangeListener aListener)Adds a deep change listener to shape to listen for shape changes and property changes received by shape.voidaddMouseListener(RMShapeMouseListener aListener)Add mouse listener.voidanimUpdate(java.beans.PropertyChangeEvent anEvent)Called to update shape anim.RMRectbounds()Returns raw x, y, width and height of shape as rect (preserves possible negative sizes).booleanchildrenSuperSelectImmediately()Editor method.RMShapeclone()Standard implementation of Object clone.RMShapecloneDeep()Clones all attributes of this shape with complete clones of its children as well.protected doublecomputePrefHeight(double aWidth)Computes the preferred height for given width.protected doublecomputePrefWidth(double aHeight)Computes the preferred width for given height.booleancontains(RMPoint aPoint)Returns whether this shape is hit by the point, given in this shape's parent's coords.RMPointconvertedPointFromShape(RMPoint aPoint, RMShape aShape)Returns the given point converted from the given shape's coords.RMPointconvertedPointToShape(RMPoint aPoint, RMShape aShape)Returns the given point converted to the given shape's coords.RMRectconvertedRectFromShape(RMRect aRect, RMShape aShape)Returns the rect encompassing the given rect converted from the given shape's coords.RMRectconvertedRectToShape(RMRect aRect, RMShape aShape)Returns the rect encompassing the given rect converted to the given shape's coords.RMSizeconvertedVectorFromShape(RMSize aSize, RMShape aShape)Returns the given size converted from the given shape's coords and normalized.RMSizeconvertedVectorToShape(RMSize aSize, RMShape aShape)Returns the given size converted to the given shape's coords and normalized.voidconvertFromShape(RMShape aShape)Transforms the given shape from this shape's coords.RMPathconvertPathFromShape(RMPath aPath, RMShape aShape)Returns the given path converted from the given shape's coords.RMPathconvertPathToShape(RMPath aPath, RMShape aShape)Returns the given path converted to the given shape's coords.RMPointconvertPointFromShape(RMPoint point, RMShape shape)Converts the given point to the given shape's coords (returns it for convenience).RMPointconvertPointToShape(RMPoint point, RMShape shape)Converts the given point to the given shape's coords (returns it for convenience).RMRectconvertRectFromShape(RMRect rect, RMShape shape)Converts the given rect from the given shape's coords (returns it for convenience).RMRectconvertRectToShape(RMRect rect, RMShape shape)Converts the given rect to the given shape's coords (returns it for convenience).voidconvertToShape(RMShape aShape)Transforms the given shape to this shape's coords.RMSizeconvertVectorFromShape(RMSize size, RMShape shape)Converts the given size (as a vector) from the given shape's coords (returns it for convenience).RMSizeconvertVectorToShape(RMSize size, RMShape shape)Converts the given size (as a vector) to the given shape's coords (returns it for convenience).voidcopyShape(RMShape aShape)Copies basic shape attributes from given RMShape (location, size, fill, stroke, roll, scale, name, url, etc.).protected RMShapecreateDivideShapeRemainder(byte anEdge)Creates a shape suitable for the "remainder" portion of a divideShape call (just a clone by default).voiddeepChange(java.beans.PropertyChangeListener aListener, java.beans.PropertyChangeEvent anEvent)Deep property change listener implementation.RMShapedivideShapeFromEdge(double anAmount, byte anEdge, RMShape aNewShape)Divides the shape by a given amount from the given edge.RMShapedivideShapeFromTop(double anAmount)Divides the shape by a given amount from the top.java.lang.ObjectfromXML(RXArchiver anArchiver, RXElement anElement)XML unarchival.java.lang.Objectget(java.lang.String aName)Returns the Object associated with the given name for the shape.java.lang.Objectget(java.lang.String aName, java.lang.Object aDefault)Returns the object associated with given key, using the given default if not found.RMTypes.AligngetAlignment()Returns the alignment.RMTypes.AlignXgetAlignmentX()Returns the horizontal alignment.RMTypes.AlignYgetAlignmentY()Returns the vertical alignment.RMShapegetAncestor(int anIndex)Returns the ancestor at the given index (parent is ancestor 0).intgetAncestorCount()Returns the number of ancestors (from this shape's parent up to the document).RMShapegetAncestorInCommon(RMShape aShape)Returns first ancestor that the given shape and this shape have in common.RMAnimatorgetAnimator()Returns the animator that this shape registers changes with.RMAnimatorgetAnimator(boolean create)Returns the animator that this shape registers changes with (creating, if requested and currently null).java.lang.StringgetAutosizing()Returns the autosizing settings as a string with hyphens for struts and tilde for springs (horiz,vert).java.lang.StringgetAutosizingDefault()Returns the autosizing default.doublegetBestHeight()Returns the best height for current width.doublegetBestHeight(double aValue)Returns the best height for current width.doublegetBestWidth()Returns the best width for current height.doublegetBestWidth(double aValue)Returns the best width for current height.BindinggetBinding(int anIndex)Returns the individual binding at the given index.BindinggetBinding(java.lang.String aPropertyName)Returns the individual binding with the given property name.intgetBindingCount()Returns the number of bindings associated with shape.protected java.util.List<Binding>getBindings(boolean doCreate)Returns the list of bindings, with an option to create if missing.RMRectgetBounds()Returns the X, Y, width and height of the shape as a rect (use getFrame if shape has roll/scale/skew).RMRectgetBoundsInside()Returns the bounds of the shape in the shape's own coords.RMRectgetBoundsMarked()Returns the bounds of the path associated with this shape in local coords, adjusted to account for stroke width.RMRectgetBoundsMarkedDeep()Returns the marked bounds of this shape and its children.RMShapegetChild(int anIndex)Returns the child at given index.RMAnimatorgetChildAnimator()Returns the animator that this shape's children use.RMAnimatorgetChildAnimator(boolean create)Returns the animator that this shape's children use (creating, if requested and currently null).java.awt.ShapegetChildClipShape()Returns clip shape to be used for children.intgetChildCount()Returns the child count.java.util.List<RMShape>getChildren()Returns the children list.java.awt.ShapegetClipShape()Returns clip shape for shape.RMColorgetColor()Returns the color of the shape.java.lang.StringgetDashArrayString()Returns the dash array for this stroke as a string.floatgetDashPhase()Returns the dash phase.EntitygetDatasetEntity()Returns the entity this shape should show in keys browser.java.lang.StringgetDatasetKey()Returns the dataset key associated with this shape.RMFillgetDisplayedFill()RMStrokegetDisplayedStroke()RMDocumentgetDocument()Returns the RMDocument ancestor of this shape (or null if not there).RMEffectgetEffect()Returns the effect for this shape.RMShapeEventAdaptergetEventAdapter(boolean doCreate)Returns the ShapeEventAdapter for this shape.RMFillgetFill()Returns the fill for this shape.RMFontgetFont()Returns the font for the shape (defaults to parent font).RMFormatgetFormat()Returns the format for the shape.RMRectgetFrame()Returns the rect in parent coords that fully encloses the shape.doublegetFrameHeight()Returns the height of the rect that fully encloses the shape in parent coords.doublegetFrameMaxX()Returns the max X of the shape's frame.doublegetFrameMaxY()Returns the max Y of the shape's frame.doublegetFrameWidth()Returns the width of the rect that fully encloses the shape in parent coords.doublegetFrameX()Returns the X of the rect that fully encloses the shape in parent coords.RMPointgetFrameXY()Returns the origin of the shape's bounds rect in parent coords.doublegetFrameY()Returns the Y of the rect that fully encloses the shape in parent coords.doublegetHeight()Returns the height of the shape.java.lang.StringgetHover()Sets the Hover string for the shape.java.lang.ObjectgetLayoutInfo()Returns an object describing layout paramaters of this shape in its parent's layout.RMPathgetMaskPath()Returns the outline of the shape as a path.doublegetMaxX()Returns the max X of the shape (assumes not rotated, scaled or skewed).doublegetMaxY()Returns the max Y of the shape (assumes not rotated, scaled or skewed).doublegetMinHeight()Returns the shape minimum height.doublegetMinHeight(double aValue)Returns the shape minimum height.doublegetMinWidth()Returns the shape minimum width.doublegetMinWidth(double aValue)Returns the shape minimum width.java.lang.StringgetName()Returns the name for the shape.floatgetOpacity()Returns the opacity of the shape (1 for opaque, 0 for transparent).floatgetOpacityDeep()Returns the combined opacity of this shape and its parent.RMXString.OutlinegetOutline()Returns the outline for the shape.intgetPageBreak()Returns the "PageBreak" for this shape as defined by shapes that define a page break (currently only RMTable).intgetPageBreakMax()Returns the "PageBreakMax" for this shape as defined by shapes that define a page break (currently only RMTable).intgetPageBreakPage()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).intgetPageBreakPageMax()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).RMParentShapegetPageShape()Returns the RMPage ancestor of this shape (or null if not there).RMParentShapegetParent()Returns the parent of this shape.<T extends RMShape>
TgetParent(java.lang.Class<T> aClass)Returns the first parent with given class by iterating up parent hierarchy.RMPathgetPath()Returns the shape's path.RMPathgetPathInBounds()Returns the shape's path scaled to the shape's current bounds.doublegetPrefHeight()Returns the shape preferred height.doublegetPrefHeight(double aValue)Returns the shape preferred height.doublegetPrefWidth()Returns the shape preferred width.doublegetPrefWidth(double aValue)Returns the shape preferred width.java.lang.StringgetPropertyNameMapped(java.lang.String aName)Returns a mapped property name.java.util.List<java.lang.String>getPropertyNames()Returns the property names for helper's instance class.protected voidgetPropertyNames(java.util.List<java.lang.String> aList)Returns the property names for RMShape.doublegetRoll()Returns the roll of the shape.RMShapegetRootShape()Returns the top level shape (usually an RMDocument).protected RMShapeRSSgetRSS()Returns the roll scale skew object.doublegetScaleX()Returns the scale of the X axis of the shape.doublegetScaleY()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.RMSizegetSize()Returns the size of the shape.doublegetSkewX()Returns the skew of the X axis of the shape.doublegetSkewY()Returns the skew of the Y axis of the shape.RMStrokegetStroke()Returns the stroke for this shape.RMColorgetStrokeColor()Returns the stroke color of the shape.booleangetStrokeOnTop()Returns whether to stroke on top.intgetStrokeStyle()floatgetStrokeWidth()Returns the stroke width of the shape's stroke in printer points.RMColorgetTextColor()Returns the text color for the shape.RMTimelinegetTimeline()Returns the timeline for animating shape property changes.RMTimelinegetTimeline(boolean create)Returns the timeline for animating shape property changes, with an option to create if absent.RMTransformgetTransform()Returns the transform to this shape from its parent.RMTransformgetTransformFromShape(RMShape aShape)Returns the transform from the given shape to this shape.RMTransformgetTransformInverse()Returns the transform from this shape to its parent.RMTransformgetTransformToShape(RMShape aShape)Returns the transform from this shape to the given shape.RMUndoergetUndoer()Returns the undoer for this shape (or null if not there).java.lang.StringgetURL()Sets the URL for the shape.java.awt.ShapegetVisbileBounds()Returns the visible bounds in shape coords, by intersecting this shape's bounds with ancester clip and child clip.java.awt.ShapegetVisibleBounds(RMRect aRect)Returns the visible bounds of given rect in shape coords, by intersecting rect with ancester clip and child clip.java.awt.ShapegetVisibleBounds(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.ShapegetVisibleBounds(RMShape anAncestor)Returns the visible bounds in given ancestor coords, by intersecting this shape's bounds with ancester clip and child clip.doublegetWidth()Returns the width of the shape.doublegetX()Returns the X location of the shape.RMPointgetXY()Returns the XY location of the shape as a point.RMPointgetXYP()Returns the origin point of the shape in parent's coords.doublegetY()Returns the Y location of the shape.doubleheight()Returns raw height of shape.intindexOf()Returns the index of this child in its parent.booleanintersects(RMPath aPath)Returns whether this shape is hit by the path, given in this shape's parent's coords.booleanisAncestor(RMShape aShape)Returns true if given shape is one of this shape's ancestors.booleanisAnimProperty(java.lang.String aPropertyName)Returns whether given property name is anim property.booleanisDeletable()Override this for shapes (like a table row) that don't don't make sense to delete by themselves.booleanisDescendant(RMShape aShape)Returns true if given shape is one of this shape's descendants.booleanisEditing()Returns whether this shape is being edited in an editor.booleanisEnabled(UIEvent.Type aType)Returns whether given event is enabled.booleanisFontSet()Returns whether font has been set.booleanisHittable()Returns whether this shape is hittable in its parent.booleanisLocked()Returns the locked state of the shape (really just to prevent location/size changes in the editor).booleanisMinHeightSet()Returns whether shape minimum height is set.booleanisMinWidthSet()Returns whether shape minimum width is set.booleanisPrefHeightSet()Returns whether shape preferred height is set.booleanisPrefWidthSet()Returns whether shape preferred width is set.booleanisRoot()Editor method - returns whether this shape is at the top level (usually RMPage).booleanisRSS()Returns whether the shape has been rotated, scaled or skewed (for efficiency).booleanisShowing()Returns whether this shape is visible in its parent.booleanisUnderlined()Returns whether the shape is underlined.booleanisUseFill()booleanisUseStroke()booleanisViewing()Returns whether this shape is being viewed in a viewer.booleanisVisible()Returns whether this shape is visible.voidmouseClicked(RMShapeMouseEvent anEvent)Handles mouse clicked events.voidmouseDragged(RMShapeMouseEvent anEvent)Handles mouse dragged events.voidmouseEntered(RMShapeMouseEvent anEvent)Handles mouse entered events.voidmouseExited(RMShapeMouseEvent anEvent)Handles mouse exited events.voidmouseMoved(RMShapeMouseEvent anEvent)Handles mouse moved events.voidmousePressed(RMShapeMouseEvent anEvent)Handles mouse pressed events.voidmouseReleased(RMShapeMouseEvent anEvent)Handles mouse released events.voidoffsetXY(double dx, double dy)Offsets the X and Y location of the shape by the given dx & dy amount (convenience).intpage()Page number resolution.intpageMax()Page number resolution.voidpaint(RMShapePainter aPntr)Top-level generic shape painting - sets transform and opacity then does a paintAll.voidpaintShape(RMShapePainter aPntr)Basic shape painting - paints shape fill and stroke.voidpaintShapeAll(RMShapePainter aPntr)Calls paintShape, paintShapeChildren and paintShapeOver.voidpaintShapeChildren(RMShapePainter aPntr)Paints shape children.voidpaintShapeOver(RMShapePainter aPntr)Paints after (on top) of children.voidpropertyChange(java.beans.PropertyChangeEvent anEvent)Property change listener implementation.java.lang.Objectput(java.lang.String aName, java.lang.Object anObj)Sets an Object to be associated with the given name for the shape.BindingremoveBinding(int anIndex)Removes the binding at the given index from shape's bindings list.booleanremoveBinding(java.lang.String aPropertyName)Removes the binding with given property name.voidremoveDeepChangeListener(DeepChangeListener aLstnr)Removes a deep change listener from shape.voidremoveFromParent()Removes this shape from its parent.voidremoveMouseListener(RMShapeMouseListener aLsnr)Remove mouse listener.voidrepaint()Visual change notification - call before making changes that will require repaint.protected voidrepaint(RMShape aShape)Visual change notification - call before making changes that will require repaint.protected voidresolvePageReferences(ReportOwner aRptOwner, java.lang.Object userInfo)Replaces all @Page@ style keys with their actual values for this shape and its children.RMShaperpgAll(ReportOwner anRptOwner, RMShape aParent)Generate report with report owner.voidrpgBindings(ReportOwner anRptOwner, RMShape aShapeRPG)Report generation for URL and bindings.protected RMShaperpgShape(ReportOwner anRptOwner, RMShape aParent)Generate report with report owner.voidsetAlignment(RMTypes.Align anAlign)Sets the alignment.voidsetAlignmentX(RMTypes.AlignX anAlignX)Sets the horizontal alignment.voidsetAlignmentY(RMTypes.AlignY anAlignX)Sets the vertical alignment.voidsetAutosizing(java.lang.String aValue)Sets the autosizing settings as a string with hyphens for struts and tilde for sprints (horiz,vert).voidsetBestHeight()Sets the shape to its best height (which is just the current height for most shapes).voidsetBestSize()Sets the shape to its best size.voidsetBounds(double anX, double aY, double aW, double aH)Sets X, Y, width and height of shape to given dimensions.voidsetBounds(java.awt.geom.Rectangle2D aRect)Sets X, Y, width and height of shape to dimensions in given rect.voidsetColor(RMColor aColor)Sets the color of the shape.voidsetDashArrayString(java.lang.String aString)Sets the dash array for this stroke from a string.voidsetDashPhase(float dashPhase)voidsetEffect(RMEffect anEffect)Sets the effect for this shape.voidsetEnabled(UIEvent.Type aType, boolean aValue)Sets whether given event is enabled.voidsetFill(RMFill aFill)Sets the fill for this shape.voidsetFont(RMFont aFont)Sets the font for the shape.voidsetFormat(RMFormat aFormat)Sets the format for the shape.voidsetFrame(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.voidsetFrame(java.awt.geom.Rectangle2D aRect)Sets the bounds of the shape such that it exactly fits in the given parent coord rect.voidsetFrameSize(double aWidth, double aHeight)Sets the height of the rect that fully encloses the shape in parent coords.voidsetFrameX(double anX)Sets a shape's X such that its bounds rect (in parent coords) has origin at the given X.voidsetFrameXY(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.voidsetFrameXY(RMPoint aPoint)Sets a shape's origin such that its bounds rect (in parent coords) has origin at the given point.voidsetFrameY(double aY)Sets a shape's Y such that its bounds rect (in parent coords) has origin at the given Y.voidsetHeight(double aValue)Sets the height of the shape.voidsetHover(java.lang.String aString)Returns the URL for the shape.voidsetLayoutInfo(java.lang.Object theLayoutInfo)Sets an object describing layout parameters of this shape in its parent's layout.voidsetLocked(boolean aValue)Sets the locked state of the shape (really just to prevent location/size changes in the editor).voidsetMinHeight(double aHeight)Sets the shape minimum height.voidsetMinSize(double aWidth, double aHeight)Sets the shape minimum size.voidsetMinWidth(double aWidth)Sets the shape minimum width.voidsetName(java.lang.String aName)Sets the name for the shape.voidsetOpacity(float aValue)Sets the opacity of the shape (1 for opaque, 0 for transparent).voidsetOutline(RMXString.Outline anOutline)Sets the outline for the shape.voidsetParent(RMParentShape aShape)Sets the parent of this shape (called automatically by addChild()).voidsetPrefHeight(double aHeight)Sets the shape preferred height.voidsetPrefWidth(double aWidth)Sets the shape preferred width.voidsetRoll(double aValue)Sets the roll of the shape.voidsetScaleX(double aValue)Sets the scale of the X axis of the shape.voidsetScaleXY(double sx, double sy)Sets the scale of the X and Y axis.voidsetScaleY(double aValue)Sets the scale of the Y axis of the shape.voidsetShowing(boolean aValue)Sets whether shape is showing.voidsetSize(double aWidth, double aHeight)Sets the size of the shape.voidsetSize(RMSize aSize)Sets the size of the shape.voidsetSkewX(double aValue)Sets the skew of the X axis of the shape.voidsetSkewXY(double skx, double sky)Sets the skew of the X and Y axis.voidsetSkewY(double aValue)Sets the skew of the Y axis of the shape.voidsetStroke(RMStroke aStroke)Sets the stroke for this shape, with an option to turn on drawsStroke.voidsetStrokeColor(RMColor aColor)Sets the stroke color of the shape.voidsetStrokeStyle(int style)voidsetStrokeWidth(float aValue)Sets the stroke width of the shape's stroke in printer points.voidsetTextColor(RMColor aColor)Sets the text color for the shape.voidsetTime(int aTime)Tells the shape's timeline to update the shape to the given time in milliseconds.protected voidsetTimeline(RMTimeline aTimeline)Sets the shape timeline.voidsetUnderlined(boolean aFlag)Sets the shape to underline.voidsetURL(java.lang.String aURL)Returns the URL for the shape.voidsetUseFill(boolean useFill)voidsetUseStroke(boolean useStroke)voidsetVisible(boolean aValue)Sets whether this shape is visible.voidsetWidth(double aValue)Sets the width of the shape.voidsetX(double aValue)Sets the X location of the shape.voidsetXY(double anX, double aY)Sets the X and Y location of the shape to the given point (convenience).voidsetXY(java.awt.geom.Point2D aPoint)Sets the X and Y location of the shape to the given point (convenience).voidsetXYP(double anX, double aY)Sets the origin point of the shape to the given X and Y in parent's coords.voidsetY(double aValue)Sets the Y location of the shape.protected voidshapeHidden()Notifies shape that it or one of its ancestors was made non-visible or removed from hierarchy.protected voidshapeShown()Notifies shape that it or one of its ancestors was made visible.booleansuperSelectable()Editor method - indicates whether this shape can be super selected.java.lang.StringtoString()Standard to string implementation (prints class name and shape bounds).RXElementtoXML(RXArchiver anArchiver)XML Archival.voidundoerDisable()Undoer convenience - disable the undoer.voidundoerEnable()Undoer convenience - enables the undoer.voidundoerSetUndoTitle(java.lang.String aTitle)Undoer convenience - sets title of next registered undo.doublewidth()Returns raw width of shape.doublex()Returns raw x location of shape.doubley()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 Detail
-
BINDING_PROP_NAME
public static final java.lang.String BINDING_PROP_NAME
Name of property change fired when binding configuration is changed- See Also:
- Constant Field Values
-
STROKE_HIDDEN
public static final int STROKE_HIDDEN
- See Also:
- Constant Field Values
-
STROKE_SHAPE
public static final int STROKE_SHAPE
- See Also:
- Constant Field Values
-
STROKE_BORDER
public static final int STROKE_BORDER
- See Also:
- Constant Field Values
-
STROKE_DOUBLE
public static final int STROKE_DOUBLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
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(java.awt.geom.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(java.awt.geom.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(java.awt.geom.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 java.lang.String getDashArrayString()
Returns the dash array for this stroke as a string.
-
setDashArrayString
public void setDashArrayString(java.lang.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
@Nonnull 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 java.lang.Object getLayoutInfo()
Returns an object describing layout paramaters of this shape in its parent's layout.
-
setLayoutInfo
public void setLayoutInfo(java.lang.Object theLayoutInfo)
Sets an object describing layout parameters of this shape in its parent's layout.
-
getAutosizing
public java.lang.String getAutosizing()
Returns the autosizing settings as a string with hyphens for struts and tilde for springs (horiz,vert).
-
setAutosizing
public void setAutosizing(java.lang.String aValue)
Sets the autosizing settings as a string with hyphens for struts and tilde for sprints (horiz,vert).
-
getAutosizingDefault
public java.lang.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(java.beans.PropertyChangeEvent anEvent)
Property change listener implementation.- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
deepChange
public void deepChange(java.beans.PropertyChangeListener aListener, java.beans.PropertyChangeEvent anEvent)Deep property change listener implementation.- Specified by:
deepChangein interfaceDeepChangeListener
-
getName
@Nonnull 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.
-
getHover
public java.lang.String getHover()
Sets the Hover string for the shape.
-
setHover
public void setHover(java.lang.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 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 java.lang.Object put(java.lang.String aName, java.lang.Object anObj)Sets an Object to be associated with the given name for the shape.
-
get
public java.lang.Object get(java.lang.String aName, java.lang.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(java.lang.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 java.util.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(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
@Nonnull public java.util.List<RMShape> getShapesToAncestor(RMShape aShape)
Returns a list of shapes from this shape to a given ancestor, inclusive.
-
getShapesToDescendant
@Nonnull public java.util.List<RMShape> getShapesToDescendant(RMShape aShape)
Returns a list of shape's from this shape to given descendant, inclusive.
-
getShapesToShape
@Nonnull public java.util.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 java.lang.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 java.util.List<java.lang.String> getPropertyNames()
Returns the property names for helper's instance class.
-
getPropertyNameMapped
public java.lang.String getPropertyNameMapped(java.lang.String aName)
Returns a mapped property name.
-
getPropertyNames
protected void getPropertyNames(java.util.List<java.lang.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 java.util.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(java.lang.String aPropertyName)
Returns the individual binding with the given property name.
-
removeBinding
public boolean removeBinding(java.lang.String aPropertyName)
Removes the binding with given property name.
-
addBinding
public void addBinding(java.lang.String aPropName, java.lang.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:
clonein classRMListenerList
-
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, java.lang.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 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:
animUpdatein classRMObject
-
isAnimProperty
public boolean isAnimProperty(java.lang.String aPropertyName)
Returns whether given property name is anim property.
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML Archival.- Specified by:
toXMLin interfaceArchivable
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.- Specified by:
fromXMLin interfaceArchivable
-
-