Package com.inductiveautomation.rm.shape
Class RMPage
java.lang.Object
com.inductiveautomation.rm.base.RMListenerList
com.inductiveautomation.rm.base.RMObject
com.inductiveautomation.rm.shape.RMShape
com.inductiveautomation.rm.shape.RMParentShape
com.inductiveautomation.rm.shape.RMPage
- All Implemented Interfaces:
Archivable
,DeepChangeListener
,RMPropertyChanger
,RMTypes
,PropertyChangeListener
,Cloneable
,EventListener
The RMPage class represents an individual page in an RMDocument. For the most part, it's like every other RMShape,
except that it has the ability to break children into "layers" for more convenient editing. Layers are sub-ranges of
children that can be set to be invisible or locked. An RMPage also has its own child animator.
It's not common for developers to use much or RMPage's unique functionality programmatically, however, you might use it briefly when dissecting a template like this:
RMDocument template = new RMDocument(aSource); RMPage page = template.getPage(0); RMTable table = page.getChildWithName("MyTable"); ...
Or you might use it briefly when adding pages to a document (which comes with one by default):
RMDocument template = new RMDocument(612, 792); template.getPage(0).addChild(new RMText(new RXString("Hello Page 1!", RMFont("Arial", 100)))); template.addPage(new RMPage()); template.getPage(1).addChild(new RMText(new RXString("Hello Page 2!", RMFont("Arial", 100))));
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.inductiveautomation.rm.base.RMTypes
RMTypes.Align, RMTypes.AlignX, RMTypes.AlignY
-
Field Summary
Fields inherited from class com.inductiveautomation.rm.shape.RMShape
BINDING_PROP_NAME, STROKE_BORDER, STROKE_DOUBLE, STROKE_HIDDEN, STROKE_SHAPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Editor method - indicates that page supports added children.void
Add the given child at the given index (over-rides RMShape version to propogate to RMPageLayer).void
addLayer
(RMPageLayer aLayer) Adds a layer to page.void
addLayer
(RMPageLayer aLayer, int anIndex) Adds a layer to page.void
addLayerNamed
(String aString) Creates a new layer with the given name and adds it to this page's layer list.void
bringShapesToFront
(List shapes) Overrides shape implementation to keep shapes in their proper layers.clone()
Standard clone method.protected void
fromXMLChildren
(RXArchiver anArchiver, RXElement anElement) XML unarchival for shape children.protected void
fromXMLShape
(RXArchiver anArchiver, RXElement anElement) XML unarchival.getChildAnimator
(boolean doCreate) Returns the child animator associated with this page, creating one if it doesn't exist (if requested).getChildLayer
(RMShape aChild) Returns the layer for a given child.Returns the dataset key associated with the table.getLayer
(int anIndex) Returns the layer at the given index.Returns the layer with the given name.int
Returns the number of layers associated with this page.Returns the list of page layers.Overrides shape implementation to return this page, since it is the page shape.boolean
Returns whether to paint white background even if not explicitly defined and drop shadow.Returns the page plexing (whether it prints to one page, page back & front, or back & front with tumble).Returns the selected layer.int
Returns the index of the selected layer.boolean
Override this for shapes (like a table row) that don't don't make sense to delete by themselves.boolean
isHittable
(RMShape aChild) Override so page layers can make children unhittable.protected boolean
Override so page layers can make children not visible.void
moveLayer
(int fromIndex, int toIndex) Moves the layer at fromIndex to toIndex.void
moveToNewLayer
(List shapes) Creates a new layer and adds the shapes in the given list to it.int
page()
Returns the "Page" number of this page (used to resolve @Page@ key references).int
pageMax()
Returns the "PageMax" of the document associated with this page (used to resolve @PageMax@ key references).void
paintShape
(RMShapePainter aPntr) Top-level generic shape painting (sets transform, recurses to children, paints this).removeChild
(int anIndex) Removes the child at the given index (over-rides RMShape version to propogate to RMPageLayer).removeLayer
(int anIndex) Removes the layer at given index (and its children).int
removeLayer
(RMPageLayer aLayer) Removes the given layer.void
Resets this page's list of layers to a single, selectable layer named "Layer 1".rpgAll
(ReportOwner anRptOwner, RMShape aParent) Returns a report page.protected RMShape
rpgChildren
(ReportOwner anRptOwner, RMParentShape aParent) Override to handle pagination.void
selectLayer
(RMPageLayer aLayer) Selects the given layer.void
selectLayer
(String aString) Selects the layer with the given name.void
sendShapesToBack
(List shapes) Overrides shape implementation to keep shapes in their proper layers.protected void
setChildAnimator
(RMAnimator anAnimator) Sets the child animator associated with this page.void
setDatasetKey
(String aKeyPath) Sets the dataset key associated with the table.void
setPaintBackground
(boolean aValue) Sets whether to paint white background even if not explicitly defined and drop shadow.void
setPlexing
(RMPage.Plexing aPlexing) Sets the page plexing (whether it prints to one page, page back & front, or back & front with tumble).boolean
Editor method - indicates that pages can be super-selected.protected void
toXMLChildren
(RXArchiver anArchiver, RXElement anElement) XML archival of children.protected RXElement
toXMLShape
(RXArchiver anArchiver) XML archival.Methods inherited from class com.inductiveautomation.rm.shape.RMParentShape
addChild, addChild, addChild, addLayoutChild, cloneDeep, computePrefHeight, computePrefWidth, divideShapeFromTop, fromXML, getBoundsOfChildren, getChild, getChildArray, getChildContaining, getChildCount, getChildLast, getChildren, getChildrenIntersecting, getChildrenWithClass, getChildrenWithClass, getChildWithClass, getChildWithName, getLayout, getNeedsLayout, getSourceURL, indexOfChild, isSourceURLSet, layout, layoutChildren, relayout, removeChild, removeChildren, removeLayoutChild, setHeight, setLayout, setNeedsLayout, setSourceURL, setWidth, toXML
Methods inherited from class com.inductiveautomation.rm.shape.RMShape
acceptsMouse, addBinding, addBinding, addDeepChangeListener, addMouseListener, animUpdate, bounds, childrenSuperSelectImmediately, contains, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, createDivideShapeRemainder, deepChange, divideShapeFromEdge, get, get, getAlignment, getAlignmentX, getAlignmentY, getAncestor, getAncestorCount, getAncestorInCommon, getAnimator, getAnimator, getAutosizing, getAutosizingDefault, getBestHeight, getBestHeight, getBestWidth, getBestWidth, getBinding, getBinding, getBindingCount, getBindings, getBounds, getBoundsInside, getBoundsMarked, getBoundsMarkedDeep, getChildAnimator, getChildClipShape, getClipShape, getColor, getDashArrayString, getDashPhase, getDatasetEntity, getDisplayedFill, getDisplayedStroke, getDocument, getEffect, getEventAdapter, getFill, getFont, getFormat, getFrame, getFrameHeight, getFrameMaxX, getFrameMaxY, getFrameWidth, getFrameX, getFrameXY, getFrameY, getHeight, getHover, getLayoutInfo, getMaskPath, getMaxX, getMaxY, getMinHeight, getMinHeight, getMinWidth, getMinWidth, getName, getOpacity, getOpacityDeep, getOutline, getPageBreak, getPageBreakMax, getPageBreakPage, getPageBreakPageMax, getParent, getParent, getPath, getPathInBounds, getPrefHeight, getPrefHeight, getPrefWidth, getPrefWidth, getPropertyNameMapped, getPropertyNames, getPropertyNames, getRoll, getRootShape, getRSS, getScaleX, getScaleY, getShapesToAncestor, getShapesToDescendant, getShapesToShape, getSize, getSkewX, getSkewY, getStroke, getStrokeColor, getStrokeOnTop, getStrokeStyle, getStrokeWidth, getTextColor, getTimeline, getTimeline, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getURL, getVisbileBounds, getVisibleBounds, getVisibleBounds, getVisibleBounds, getWidth, getX, getXY, getXYP, getY, height, indexOf, intersects, isAncestor, isAnimProperty, isDescendant, isEditing, isEnabled, isFontSet, isHittable, isLocked, isMinHeightSet, isMinWidthSet, isPrefHeightSet, isPrefWidthSet, isRoot, isRSS, isShowing, isUnderlined, isUseFill, isUseStroke, isViewing, isVisible, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, offsetXY, paint, paintShapeAll, paintShapeChildren, paintShapeOver, propertyChange, put, removeBinding, removeBinding, removeDeepChangeListener, removeFromParent, removeMouseListener, repaint, repaint, resolvePageReferences, rpgBindings, rpgShape, setAlignment, setAlignmentX, setAlignmentY, setAutosizing, setBestHeight, setBestSize, setBounds, setBounds, setColor, setDashArrayString, setDashPhase, setEffect, setEnabled, setFill, setFont, setFormat, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHover, setLayoutInfo, setLocked, setMinHeight, setMinSize, setMinWidth, setName, setOpacity, setOutline, setParent, setPrefHeight, setPrefWidth, setRoll, setScaleX, setScaleXY, setScaleY, setShowing, setSize, setSize, setSkewX, setSkewXY, setSkewY, setStroke, setStrokeColor, setStrokeStyle, setStrokeWidth, setTextColor, setTime, setTimeline, setUnderlined, setURL, setUseFill, setUseStroke, setVisible, setX, setXY, setXY, setXYP, setY, shapeHidden, shapeShown, toString, undoerDisable, undoerEnable, undoerSetUndoTitle, width, x, y
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
-
Constructor Details
-
RMPage
public RMPage()Creates a plain empty page.
-
-
Method Details
-
getDatasetKey
Returns the dataset key associated with the table.- Overrides:
getDatasetKey
in classRMShape
-
setDatasetKey
Sets the dataset key associated with the table. -
getPaintBackground
public boolean getPaintBackground()Returns whether to paint white background even if not explicitly defined and drop shadow. -
setPaintBackground
public void setPaintBackground(boolean aValue) Sets whether to paint white background even if not explicitly defined and drop shadow. -
getLayerCount
public int getLayerCount()Returns the number of layers associated with this page. -
getLayer
Returns the layer at the given index. -
getLayers
Returns the list of page layers. -
addLayer
Adds a layer to page. -
addLayer
Adds a layer to page. -
removeLayer
Removes the layer at given index (and its children). -
removeLayer
Removes the given layer. -
getLayer
Returns the layer with the given name. -
addLayerNamed
Creates a new layer with the given name and adds it to this page's layer list. -
moveLayer
public void moveLayer(int fromIndex, int toIndex) Moves the layer at fromIndex to toIndex. -
getChildLayer
Returns the layer for a given child. -
getSelectedLayerIndex
public int getSelectedLayerIndex()Returns the index of the selected layer. -
getSelectedLayer
Returns the selected layer. -
selectLayer
Selects the given layer. -
selectLayer
Selects the layer with the given name. -
resetLayers
public void resetLayers()Resets this page's list of layers to a single, selectable layer named "Layer 1". -
getPlexing
Returns the page plexing (whether it prints to one page, page back & front, or back & front with tumble). -
setPlexing
Sets the page plexing (whether it prints to one page, page back & front, or back & front with tumble). -
addChild
Add the given child at the given index (over-rides RMShape version to propogate to RMPageLayer).- Overrides:
addChild
in classRMParentShape
-
removeChild
Removes the child at the given index (over-rides RMShape version to propogate to RMPageLayer).- Overrides:
removeChild
in classRMParentShape
-
bringShapesToFront
Overrides shape implementation to keep shapes in their proper layers.- Overrides:
bringShapesToFront
in classRMParentShape
-
sendShapesToBack
Overrides shape implementation to keep shapes in their proper layers.- Overrides:
sendShapesToBack
in classRMParentShape
-
moveToNewLayer
Creates a new layer and adds the shapes in the given list to it. -
isShowing
Override so page layers can make children not visible.- Overrides:
isShowing
in classRMParentShape
-
isHittable
Override so page layers can make children unhittable.- Overrides:
isHittable
in classRMParentShape
-
getPageShape
Overrides shape implementation to return this page, since it is the page shape.- Overrides:
getPageShape
in classRMShape
-
getChildAnimator
Returns the child animator associated with this page, creating one if it doesn't exist (if requested).- Overrides:
getChildAnimator
in classRMShape
-
setChildAnimator
Sets the child animator associated with this page. -
page
public int page()Returns the "Page" number of this page (used to resolve @Page@ key references). -
pageMax
public int pageMax()Returns the "PageMax" of the document associated with this page (used to resolve @PageMax@ key references). -
isDeletable
public boolean isDeletable()Description copied from class:RMShape
Override this for shapes (like a table row) that don't don't make sense to delete by themselves.- Overrides:
isDeletable
in classRMShape
-
paintShape
Top-level generic shape painting (sets transform, recurses to children, paints this).- Overrides:
paintShape
in classRMShape
-
rpgAll
Returns a report page.- Overrides:
rpgAll
in classRMParentShape
-
rpgChildren
Override to handle pagination.- Overrides:
rpgChildren
in classRMParentShape
-
clone
Standard clone method.- Overrides:
clone
in classRMParentShape
-
toXMLShape
XML archival.- Overrides:
toXMLShape
in classRMParentShape
-
toXMLChildren
XML archival of children.- Overrides:
toXMLChildren
in classRMParentShape
-
fromXMLShape
XML unarchival.- Overrides:
fromXMLShape
in classRMParentShape
-
fromXMLChildren
XML unarchival for shape children.- Overrides:
fromXMLChildren
in classRMParentShape
-
acceptsChildren
public boolean acceptsChildren()Editor method - indicates that page supports added children.- Overrides:
acceptsChildren
in classRMShape
-
superSelectable
public boolean superSelectable()Editor method - indicates that pages can be super-selected.- Overrides:
superSelectable
in classRMShape
-