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.String
BINDING_PROP_NAME
Name of property change fired when binding configuration is changedstatic int
STROKE_BORDER
static int
STROKE_DOUBLE
static int
STROKE_HIDDEN
static int
STROKE_SHAPE
-
Constructor Summary
Constructors Constructor Description RMShape()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptsChildren()
Editor method.boolean
acceptsMouse()
Returns whether shape accepts mouse events.void
addBinding(Binding aBinding)
Adds the individual binding to the shape's bindings list.void
addBinding(java.lang.String aPropName, java.lang.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(java.beans.PropertyChangeEvent anEvent)
Called to update shape anim.RMRect
bounds()
Returns raw x, y, width and height of shape as rect (preserves possible negative sizes).boolean
childrenSuperSelectImmediately()
Editor method.RMShape
clone()
Standard implementation of Object clone.RMShape
cloneDeep()
Clones all attributes of this shape with complete clones of its children as well.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
contains(RMPoint aPoint)
Returns whether this shape is hit by the point, given in this shape's parent's coords.RMPoint
convertedPointFromShape(RMPoint aPoint, RMShape aShape)
Returns the given point converted from the given shape's coords.RMPoint
convertedPointToShape(RMPoint aPoint, RMShape aShape)
Returns the given point converted to the given shape's coords.RMRect
convertedRectFromShape(RMRect aRect, RMShape aShape)
Returns the rect encompassing the given rect converted from the given shape's coords.RMRect
convertedRectToShape(RMRect aRect, RMShape aShape)
Returns the rect encompassing the given rect converted to the given shape's coords.RMSize
convertedVectorFromShape(RMSize aSize, RMShape aShape)
Returns the given size converted from the given shape's coords and normalized.RMSize
convertedVectorToShape(RMSize aSize, RMShape aShape)
Returns the given size converted to the given shape's coords and normalized.void
convertFromShape(RMShape aShape)
Transforms the given shape from this shape's coords.RMPath
convertPathFromShape(RMPath aPath, RMShape aShape)
Returns the given path converted from the given shape's coords.RMPath
convertPathToShape(RMPath aPath, RMShape aShape)
Returns the given path converted to the given shape's coords.RMPoint
convertPointFromShape(RMPoint point, RMShape shape)
Converts the given point to the given shape's coords (returns it for convenience).RMPoint
convertPointToShape(RMPoint point, RMShape shape)
Converts the given point to the given shape's coords (returns it for convenience).RMRect
convertRectFromShape(RMRect rect, RMShape shape)
Converts the given rect from the given shape's coords (returns it for convenience).RMRect
convertRectToShape(RMRect rect, RMShape shape)
Converts the given rect to the given shape's coords (returns it for convenience).void
convertToShape(RMShape aShape)
Transforms the given shape to this shape's coords.RMSize
convertVectorFromShape(RMSize size, RMShape shape)
Converts the given size (as a vector) from the given shape's coords (returns it for convenience).RMSize
convertVectorToShape(RMSize size, RMShape shape)
Converts the given size (as a vector) to the given shape's coords (returns it for convenience).void
copyShape(RMShape aShape)
Copies basic shape attributes from given RMShape (location, size, fill, stroke, roll, scale, name, url, etc.).protected RMShape
createDivideShapeRemainder(byte anEdge)
Creates a shape suitable for the "remainder" portion of a divideShape call (just a clone by default).void
deepChange(java.beans.PropertyChangeListener aListener, java.beans.PropertyChangeEvent anEvent)
Deep property change listener implementation.RMShape
divideShapeFromEdge(double anAmount, byte anEdge, RMShape aNewShape)
Divides the shape by a given amount from the given edge.RMShape
divideShapeFromTop(double anAmount)
Divides the shape by a given amount from the top.java.lang.Object
fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.java.lang.Object
get(java.lang.String aName)
Returns the Object associated with the given name for the shape.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.RMTypes.Align
getAlignment()
Returns the alignment.RMTypes.AlignX
getAlignmentX()
Returns the horizontal alignment.RMTypes.AlignY
getAlignmentY()
Returns the vertical alignment.RMShape
getAncestor(int anIndex)
Returns the ancestor at the given index (parent is ancestor 0).int
getAncestorCount()
Returns the number of ancestors (from this shape's parent up to the document).RMShape
getAncestorInCommon(RMShape aShape)
Returns first ancestor that the given shape and this shape have in common.RMAnimator
getAnimator()
Returns the animator that this shape registers changes with.RMAnimator
getAnimator(boolean create)
Returns the animator that this shape registers changes with (creating, if requested and currently null).java.lang.String
getAutosizing()
Returns the autosizing settings as a string with hyphens for struts and tilde for springs (horiz,vert).java.lang.String
getAutosizingDefault()
Returns the autosizing default.double
getBestHeight()
Returns the best height for current width.double
getBestHeight(double aValue)
Returns the best height for current width.double
getBestWidth()
Returns the best width for current height.double
getBestWidth(double aValue)
Returns the best width for current height.Binding
getBinding(int anIndex)
Returns the individual binding at the given index.Binding
getBinding(java.lang.String aPropertyName)
Returns the individual binding with the given property name.int
getBindingCount()
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.RMRect
getBounds()
Returns the X, Y, width and height of the shape as a rect (use getFrame if shape has roll/scale/skew).RMRect
getBoundsInside()
Returns the bounds of the shape in the shape's own coords.RMRect
getBoundsMarked()
Returns the bounds of the path associated with this shape in local coords, adjusted to account for stroke width.RMRect
getBoundsMarkedDeep()
Returns the marked bounds of this shape and its children.RMShape
getChild(int anIndex)
Returns the child at given index.RMAnimator
getChildAnimator()
Returns the animator that this shape's children use.RMAnimator
getChildAnimator(boolean create)
Returns the animator that this shape's children use (creating, if requested and currently null).java.awt.Shape
getChildClipShape()
Returns clip shape to be used for children.int
getChildCount()
Returns the child count.java.util.List<RMShape>
getChildren()
Returns the children list.java.awt.Shape
getClipShape()
Returns clip shape for shape.RMColor
getColor()
Returns the color of the shape.java.lang.String
getDashArrayString()
Returns the dash array for this stroke as a string.float
getDashPhase()
Returns the dash phase.Entity
getDatasetEntity()
Returns the entity this shape should show in keys browser.java.lang.String
getDatasetKey()
Returns the dataset key associated with this shape.RMFill
getDisplayedFill()
RMStroke
getDisplayedStroke()
RMDocument
getDocument()
Returns the RMDocument ancestor of this shape (or null if not there).RMEffect
getEffect()
Returns the effect for this shape.RMShapeEventAdapter
getEventAdapter(boolean doCreate)
Returns the ShapeEventAdapter for this shape.RMFill
getFill()
Returns the fill for this shape.RMFont
getFont()
Returns the font for the shape (defaults to parent font).RMFormat
getFormat()
Returns the format for the shape.RMRect
getFrame()
Returns the rect in parent coords that fully encloses the shape.double
getFrameHeight()
Returns the height of the rect that fully encloses the shape in parent coords.double
getFrameMaxX()
Returns the max X of the shape's frame.double
getFrameMaxY()
Returns the max Y of the shape's frame.double
getFrameWidth()
Returns the width of the rect that fully encloses the shape in parent coords.double
getFrameX()
Returns the X of the rect that fully encloses the shape in parent coords.RMPoint
getFrameXY()
Returns the origin of the shape's bounds rect in parent coords.double
getFrameY()
Returns the Y of the rect that fully encloses the shape in parent coords.double
getHeight()
Returns the height of the shape.java.lang.String
getHover()
Sets the Hover string for the shape.java.lang.Object
getLayoutInfo()
Returns an object describing layout paramaters of this shape in its parent's layout.RMPath
getMaskPath()
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
getMinHeight()
Returns the shape minimum height.double
getMinHeight(double aValue)
Returns the shape minimum height.double
getMinWidth()
Returns the shape minimum width.double
getMinWidth(double aValue)
Returns the shape minimum width.java.lang.String
getName()
Returns the name for the shape.float
getOpacity()
Returns the opacity of the shape (1 for opaque, 0 for transparent).float
getOpacityDeep()
Returns the combined opacity of this shape and its parent.RMXString.Outline
getOutline()
Returns the outline for the shape.int
getPageBreak()
Returns the "PageBreak" for this shape as defined by shapes that define a page break (currently only RMTable).int
getPageBreakMax()
Returns the "PageBreakMax" for this shape as defined by shapes that define a page break (currently only RMTable).int
getPageBreakPage()
Returns the "PageBreakPage" for this shape, or the page number relative to the last page break, as defined by shapes that define explicit page breaks (currently only RMTable).int
getPageBreakPageMax()
Returns the "PageBreakPageMax" for this shape, or the max page number relative to the last and next page breaks, as defined by shapes that define explicit page breaks (currently only RMTable).RMParentShape
getPageShape()
Returns the RMPage ancestor of this shape (or null if not there).RMParentShape
getParent()
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.RMPath
getPath()
Returns the shape's path.RMPath
getPathInBounds()
Returns the shape's path scaled to the shape's current bounds.double
getPrefHeight()
Returns the shape preferred height.double
getPrefHeight(double aValue)
Returns the shape preferred height.double
getPrefWidth()
Returns the shape preferred width.double
getPrefWidth(double aValue)
Returns the shape preferred width.java.lang.String
getPropertyNameMapped(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 void
getPropertyNames(java.util.List<java.lang.String> aList)
Returns the property names for RMShape.double
getRoll()
Returns the roll of the shape.RMShape
getRootShape()
Returns the top level shape (usually an RMDocument).protected RMShapeRSS
getRSS()
Returns the roll scale skew object.double
getScaleX()
Returns the scale of the X axis of the shape.double
getScaleY()
Returns the scale of the Y axis of the shape.java.util.List<RMShape>
getShapesToAncestor(RMShape aShape)
Returns a list of shapes from this shape to a given ancestor, inclusive.java.util.List<RMShape>
getShapesToDescendant(RMShape aShape)
Returns a list of shape's from this shape to given descendant, inclusive.java.util.List<RMShape>
getShapesToShape(RMShape aShape)
Returns a list of shapes from this shape to given shape.RMSize
getSize()
Returns the size of the shape.double
getSkewX()
Returns the skew of the X axis of the shape.double
getSkewY()
Returns the skew of the Y axis of the shape.RMStroke
getStroke()
Returns the stroke for this shape.RMColor
getStrokeColor()
Returns the stroke color of the shape.boolean
getStrokeOnTop()
Returns whether to stroke on top.int
getStrokeStyle()
float
getStrokeWidth()
Returns the stroke width of the shape's stroke in printer points.RMColor
getTextColor()
Returns the text color for the shape.RMTimeline
getTimeline()
Returns the timeline for animating shape property changes.RMTimeline
getTimeline(boolean create)
Returns the timeline for animating shape property changes, with an option to create if absent.RMTransform
getTransform()
Returns the transform to this shape from its parent.RMTransform
getTransformFromShape(RMShape aShape)
Returns the transform from the given shape to this shape.RMTransform
getTransformInverse()
Returns the transform from this shape to its parent.RMTransform
getTransformToShape(RMShape aShape)
Returns the transform from this shape to the given shape.RMUndoer
getUndoer()
Returns the undoer for this shape (or null if not there).java.lang.String
getURL()
Sets the URL for the shape.java.awt.Shape
getVisbileBounds()
Returns the visible bounds in shape coords, by intersecting this shape's bounds with ancester clip and child clip.java.awt.Shape
getVisibleBounds(RMRect aRect)
Returns the visible bounds of given rect in shape coords, by intersecting rect with ancester clip and child clip.java.awt.Shape
getVisibleBounds(RMRect aRect, RMShape anAncestor)
Returns the visible bounds of given rect in given ancestor coords, by intersecting the rect with ancester clip and child clip.java.awt.Shape
getVisibleBounds(RMShape anAncestor)
Returns the visible bounds in given ancestor coords, by intersecting this shape's bounds with ancester clip and child clip.double
getWidth()
Returns the width of the shape.double
getX()
Returns the X location of the shape.RMPoint
getXY()
Returns the XY location of the shape as a point.RMPoint
getXYP()
Returns the origin point of the shape in parent's coords.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(java.lang.String aPropertyName)
Returns whether given property name is anim property.boolean
isDeletable()
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
isEditing()
Returns whether this shape is being edited in an editor.boolean
isEnabled(UIEvent.Type aType)
Returns whether given event is enabled.boolean
isFontSet()
Returns whether font has been set.boolean
isHittable()
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
isMinHeightSet()
Returns whether shape minimum height is set.boolean
isMinWidthSet()
Returns whether shape minimum width is set.boolean
isPrefHeightSet()
Returns whether shape preferred height is set.boolean
isPrefWidthSet()
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
isShowing()
Returns whether this shape is visible in its parent.boolean
isUnderlined()
Returns whether the shape is underlined.boolean
isUseFill()
boolean
isUseStroke()
boolean
isViewing()
Returns whether this shape is being viewed in a viewer.boolean
isVisible()
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(java.beans.PropertyChangeEvent anEvent)
Property change listener implementation.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.Binding
removeBinding(int anIndex)
Removes the binding at the given index from shape's bindings list.boolean
removeBinding(java.lang.String aPropertyName)
Removes the binding with given property name.void
removeDeepChangeListener(DeepChangeListener aLstnr)
Removes a deep change listener from shape.void
removeFromParent()
Removes this shape from its parent.void
removeMouseListener(RMShapeMouseListener aLsnr)
Remove mouse listener.void
repaint()
Visual change notification - call before making changes that will require repaint.protected void
repaint(RMShape aShape)
Visual change notification - call before making changes that will require repaint.protected void
resolvePageReferences(ReportOwner aRptOwner, java.lang.Object userInfo)
Replaces all @Page@ style keys with their actual values for this shape and its children.RMShape
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(java.lang.String aValue)
Sets the autosizing settings as a string with hyphens for struts and tilde for sprints (horiz,vert).void
setBestHeight()
Sets the shape to its best height (which is just the current height for most shapes).void
setBestSize()
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(java.awt.geom.Rectangle2D aRect)
Sets X, Y, width and height of shape to dimensions in given rect.void
setColor(RMColor aColor)
Sets the color of the shape.void
setDashArrayString(java.lang.String aString)
Sets the dash array for this stroke from a string.void
setDashPhase(float dashPhase)
void
setEffect(RMEffect anEffect)
Sets the effect for this shape.void
setEnabled(UIEvent.Type aType, boolean aValue)
Sets whether given event is enabled.void
setFill(RMFill aFill)
Sets the fill for this shape.void
setFont(RMFont aFont)
Sets the font for the shape.void
setFormat(RMFormat aFormat)
Sets the format for the shape.void
setFrame(double 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(java.awt.geom.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
setHover(java.lang.String aString)
Returns the URL for the shape.void
setLayoutInfo(java.lang.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
setName(java.lang.String aName)
Sets the name for the shape.void
setOpacity(float aValue)
Sets the opacity of the shape (1 for opaque, 0 for transparent).void
setOutline(RMXString.Outline anOutline)
Sets the outline for the shape.void
setParent(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
setSize(RMSize aSize)
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
setStroke(RMStroke aStroke)
Sets the stroke for this shape, with an option to turn on drawsStroke.void
setStrokeColor(RMColor aColor)
Sets the stroke color of the shape.void
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
setURL(java.lang.String aURL)
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
setXY(java.awt.geom.Point2D aPoint)
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
shapeHidden()
Notifies shape that it or one of its ancestors was made non-visible or removed from hierarchy.protected void
shapeShown()
Notifies shape that it or one of its ancestors was made visible.boolean
superSelectable()
Editor method - indicates whether this shape can be super selected.java.lang.String
toString()
Standard to string implementation (prints class name and shape bounds).RXElement
toXML(RXArchiver anArchiver)
XML Archival.void
undoerDisable()
Undoer convenience - disable the undoer.void
undoerEnable()
Undoer convenience - enables the undoer.void
undoerSetUndoTitle(java.lang.String aTitle)
Undoer convenience - sets title of next registered undo.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 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:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
deepChange
public void deepChange(java.beans.PropertyChangeListener aListener, java.beans.PropertyChangeEvent anEvent)
Deep property change listener implementation.- Specified by:
deepChange
in 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:
clone
in 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:
animUpdate
in 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:
toXML
in interfaceArchivable
-
fromXML
public java.lang.Object fromXML(RXArchiver anArchiver, RXElement anElement)
XML unarchival.- Specified by:
fromXML
in interfaceArchivable
-
-