ReportMill 8.0 API

com.reportmill.shape
Class RMPage

java.lang.Object
  extended bycom.reportmill.base.RMObject
      extended bycom.reportmill.shape.RMShape
          extended bycom.reportmill.shape.RMPage
All Implemented Interfaces:
java.lang.Cloneable, com.reportmill.base.RMArchiver.Archiving

public class RMPage
extends RMShape

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 disecting 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))));
 


Field Summary
 
Fields inherited from class com.reportmill.shape.RMShape
HandleMaxXMaxY, HandleMaxXMidY, HandleMaxXMinY, HandleMidXMaxY, HandleMidXMinY, HandleMinXMaxY, HandleMinXMidY, HandleMinXMinY, HandleWidth, WRAP_TYPE_BOTH, WRAP_TYPE_NONE
 
Constructor Summary
RMPage()
          Creates a plain empty page.
 
Method Summary
 boolean acceptsChildren()
          This RMEditor support method tells the editor that page supports added children.
 void addChild(RMShape child, int index)
          Add the given child at the given index (over-rides RMShape version to propogate to RMPageLayer).
 void addLayerNamed(java.lang.String aString)
          Creates a new layer with the given name and adds it to this page's layer list.
 void bringShapesToFront(java.util.List shapes)
          Over-rides RMShape implementation to keep shapes in their proper layers.
 java.lang.Object clone()
          Standard clone method.
 void copy(java.lang.Object anObj)
          Copies the attributes from the given object.
 boolean equals(java.lang.Object anObj)
          Standard equals method.
 java.lang.Object fromXML(com.ribs.RXArchiver anArchiver, com.ribs.RXElement anElement)
          XML unarchival.
 com.reportmill.graphics.RMAnimator getChildAnimator(boolean create)
          Returns the child animator associated with this page, creating one if it doesn't exist (if requested).
 java.util.List getChildrenWhoDraw()
          Returns a list of children which should be drawn (since page layers can be configured to prevent chilren on individual layers from being visible).
 java.util.List getChildrenWhoHitTest()
          Returns a list of children which should be checked during shape hit detection (since page layers can be configured to prevent chilren on individual layers from being selected).
 int getHandleAtPoint(RMPoint point, boolean isSuperSelected)
          This RMEditor support method tells the editor that page's resize handles don't exist.
 com.reportmill.shape.RMPageLayer getLayer(int index)
          Returns the layer at the given index.
 com.reportmill.shape.RMPageLayer getLayer(java.lang.String aString)
          Returns the layer with the given name.
 int getLayerCount()
          Returns the number of layers associated with this page.
 RMShape getPageShape()
          Returns the receiver, since it is a page (over-rides RMShape implementation).
 com.reportmill.shape.RMPageLayer getSelectedLayer()
          Returns the selected layer.
 int getSelectedLayerIndex()
          Returns the index of the selected layer.
 java.lang.Object initWithArchiver(com.reportmill.base.RMArchiver anArchiver)
          Legacy unarchival.
 void moveLayer(int fromIndex, int toIndex)
          Moves the layer at fromIndex to toIndex.
 void moveToNewLayer(java.util.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 pageBreakMax()
          Returns "PageBreakMax" (used to resolve PageBreakMax key references).
 int pageBreakPageMax()
          Returns "PageBreakPageMax" for all children on this page (used to resolve PageBreakPageMax key references).
 int pageMax()
          Returns the "PageMax" of the document associated with this page (used to resolve @PageMax@ key references).
 void removeChild(int index)
          Removes the child at the given index (over-rides RMShape version to propogate to RMPageLayer).
 void removeLayer(com.reportmill.shape.RMPageLayer aLayer)
          Removes the given layer (and dumps its children into the preceeding layer).
 void resetLayers()
          Resets this page's list of layers to a single, selecctable layer named "Layer 1".
 RMShape rpgClone(com.reportmill.base.ReportMill rm)
          A custom version of the clone method, which returns a report generated clone.
 void selectLayer(com.reportmill.shape.RMPageLayer aLayer)
          Selects the given layer.
 void selectLayer(java.lang.String aString)
          Selects the layer with the given name.
 void sendShapesToBack(java.util.List shapes)
          Over-rides the RMShape implementation to keep shapes in their proper layers.
 void setChildAnimator(com.reportmill.graphics.RMAnimator anAnimator)
          Sets the child animator associated with this page.
 boolean superSelectable()
          This RMEditor support method tells the editor that pages can be super-selected.
 com.ribs.RXElement toXML(com.ribs.RXArchiver anArchiver)
          XML archival.
 com.reportmill.base.RMObject undoClone()
          A custom version of the clone method, specific for undo tracking.
 
Methods inherited from class com.reportmill.shape.RMShape
acceptsDragKeys, acceptsEvents, acceptsFirstEvent, acceptsFormat, acceptsMouse, addChild, addChildBelowLastChild, bounds, boundsChanged, boundsChanged, canBeUngrouped, childrenHitByPath, childrenSuperSelectImmediately, cloneDeep, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedSizeFromShape, convertedSizeToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertSizeFromShape, convertSizeToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, delete, didChange, divideShapeFromEdge, divideShapeFromTop, dragExit, dragKeyAtPoint, dropKeyAtPoint, fromXMLDeep, get, getActionScript, getAnim, getAnim, getAnimator, getAnimator, getAutosizeHeight, getAutosizing, getBounds, getBoundsInside, getBoundsMarked, getBoundsOfChildren, getBoundsOfChildren, getBoundsSuperSelected, getCausesWrap, getCausesWrapType, getChild, getChildAnimator, getChildCount, getChildHitByPoint, getChildLast, getChildren, getChildrenWhoCauseWrap, getChildSortedByX, getChildWithClass, getChildWithName, getColor, getCommonAncestor, getDocument, getFill, getFill, getFill, getFillCount, getFills, getFont, getFormat, getFrame, getFrame, getFrameMaxX, getFrameMaxY, getFrameX, getFrameXY, getFrameY, getGroupShape, getHandleCount, getHandleOpposing, getHandlePoint, getHandleRect, getHeight, getHeightToFit, getImageFill, getLineWidth, getListKey, getListKeyDeep, getListKeyShape, getMaxX, getMaxY, getName, getOpacity, getOpacityDeep, getOutline, getPageCount, getParent, getParentCount, getParents, getPath, getPathInBounds, getRoll, getRootShape, getScaleX, getScaleY, getShapesToAncestor, getShapesToDescendant, getShapesToShape, getSize, getSizeP, getSkewX, getSkewY, getStroke, getStrokeColor, getTextColor, getToolClassName, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getUrl, getWidth, getWidthToFit, getX, getXY, getXYP, getY, groupShapes, hasPageBreaks, height, hitByPath, hitByPoint, indexOf, indexOf, isAncestor, isDescendant, isLocked, isRoot, isUnderlined, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, moveHandleToPoint, notRSS, offsetChildrenXY, offsetXY, put, reclaimChildren, removeChild, removeChildren, removeChildren, removeFromParent, resolvePageReferences, rpgCloneBase, rpgCloneChildren, rpgCloneConclude, rpgCloneNotification, rpgClonePrepare, rpgClonePreprocess, rpgCloneUrl, setActionScript, setAnim, setAutosizeHeight, setAutosizing, setBounds, setBounds, setCausesWrapType, setChildren, setColor, setFill, setFont, setFormat, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHeight, setHeightDeep, setHeightDeep, setHeightToFit, setLineWidth, setListKey, setLocked, setName, setNeedsRepaint, setNeedsRepaint, setOpacity, setOutline, setParent, setRoll, setScaleX, setScaleXY, setScaleY, setSize, setSize, setSizeDeep, setSizeP, setSizeToFit, setSizeToFit, setSkewX, setSkewXY, setSkewY, setStroke, setStrokeColor, setTextColor, setTime, setUnderlined, setUrl, setWidth, setWidthDeep, setWidthDeep, setWidthToFit, setX, setXY, setXY, setXYP, setY, sizesToFitChildren, superSelectImmediately, toString, undoCopy, undoEquals, undoerAddDirtyObject, undoerDisable, undoerEnable, undoerSetUndoTitle, width, willChange, willChange, x, y
 
Methods inherited from class com.reportmill.base.RMObject
didUndo, getAnimAttribute, getClassNameShort
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RMPage

public RMPage()
Creates a plain empty page.

Method Detail

getLayerCount

public int getLayerCount()
Returns the number of layers associated with this page.


getLayer

public com.reportmill.shape.RMPageLayer getLayer(int index)
Returns the layer at the given index.


getLayer

public com.reportmill.shape.RMPageLayer getLayer(java.lang.String aString)
Returns the layer with the given name.


addLayerNamed

public void addLayerNamed(java.lang.String aString)
Creates a new layer with the given name and adds it to this page's layer list.


removeLayer

public void removeLayer(com.reportmill.shape.RMPageLayer aLayer)
Removes the given layer (and dumps its children into the preceeding layer).


moveLayer

public void moveLayer(int fromIndex,
                      int toIndex)
Moves the layer at fromIndex to toIndex.


getSelectedLayerIndex

public int getSelectedLayerIndex()
Returns the index of the selected layer.


getSelectedLayer

public com.reportmill.shape.RMPageLayer getSelectedLayer()
Returns the selected layer.


selectLayer

public void selectLayer(com.reportmill.shape.RMPageLayer aLayer)
Selects the given layer.


selectLayer

public void selectLayer(java.lang.String aString)
Selects the layer with the given name.


resetLayers

public void resetLayers()
Resets this page's list of layers to a single, selecctable layer named "Layer 1".


addChild

public void addChild(RMShape child,
                     int index)
Add the given child at the given index (over-rides RMShape version to propogate to RMPageLayer).

Overrides:
addChild in class RMShape

removeChild

public void removeChild(int index)
Removes the child at the given index (over-rides RMShape version to propogate to RMPageLayer).

Overrides:
removeChild in class RMShape

bringShapesToFront

public void bringShapesToFront(java.util.List shapes)
Over-rides RMShape implementation to keep shapes in their proper layers.

Overrides:
bringShapesToFront in class RMShape

sendShapesToBack

public void sendShapesToBack(java.util.List shapes)
Over-rides the RMShape implementation to keep shapes in their proper layers.

Overrides:
sendShapesToBack in class RMShape

moveToNewLayer

public void moveToNewLayer(java.util.List shapes)
Creates a new layer and adds the shapes in the given list to it.


getChildrenWhoDraw

public java.util.List getChildrenWhoDraw()
Returns a list of children which should be drawn (since page layers can be configured to prevent chilren on individual layers from being visible).

Overrides:
getChildrenWhoDraw in class RMShape

getChildrenWhoHitTest

public java.util.List getChildrenWhoHitTest()
Returns a list of children which should be checked during shape hit detection (since page layers can be configured to prevent chilren on individual layers from being selected).

Overrides:
getChildrenWhoHitTest in class RMShape

getPageShape

public RMShape getPageShape()
Returns the receiver, since it is a page (over-rides RMShape implementation).

Overrides:
getPageShape in class RMShape

getChildAnimator

public com.reportmill.graphics.RMAnimator getChildAnimator(boolean create)
Returns the child animator associated with this page, creating one if it doesn't exist (if requested).

Overrides:
getChildAnimator in class RMShape

setChildAnimator

public void setChildAnimator(com.reportmill.graphics.RMAnimator anAnimator)
Sets the child animator associated with this page.

Overrides:
setChildAnimator in class RMShape

rpgClone

public RMShape rpgClone(com.reportmill.base.ReportMill rm)
A custom version of the clone method, which returns a report generated clone.

Overrides:
rpgClone in class RMShape

page

public int page()
Returns the "Page" number of this page (used to resolve @Page@ key references).

Overrides:
page in class RMShape

pageMax

public int pageMax()
Returns the "PageMax" of the document associated with this page (used to resolve @PageMax@ key references).

Overrides:
pageMax in class RMShape

pageBreakMax

public int pageBreakMax()
Returns "PageBreakMax" (used to resolve PageBreakMax key references).

Overrides:
pageBreakMax in class RMShape

pageBreakPageMax

public int pageBreakPageMax()
Returns "PageBreakPageMax" for all children on this page (used to resolve PageBreakPageMax key references).

Overrides:
pageBreakPageMax in class RMShape

clone

public java.lang.Object clone()
Standard clone method.

Overrides:
clone in class RMShape

undoClone

public com.reportmill.base.RMObject undoClone()
A custom version of the clone method, specific for undo tracking.

Overrides:
undoClone in class RMShape

copy

public void copy(java.lang.Object anObj)
Copies the attributes from the given object.

Overrides:
copy in class RMShape

equals

public boolean equals(java.lang.Object anObj)
Standard equals method.

Overrides:
equals in class RMShape

toXML

public com.ribs.RXElement toXML(com.ribs.RXArchiver anArchiver)
XML archival.

Overrides:
toXML in class RMShape

fromXML

public java.lang.Object fromXML(com.ribs.RXArchiver anArchiver,
                                com.ribs.RXElement anElement)
XML unarchival.

Overrides:
fromXML in class RMShape

initWithArchiver

public java.lang.Object initWithArchiver(com.reportmill.base.RMArchiver anArchiver)
Legacy unarchival.

Specified by:
initWithArchiver in interface com.reportmill.base.RMArchiver.Archiving
Overrides:
initWithArchiver in class RMShape

acceptsChildren

public boolean acceptsChildren()
This RMEditor support method tells the editor that page supports added children.

Overrides:
acceptsChildren in class RMShape

superSelectable

public boolean superSelectable()
This RMEditor support method tells the editor that pages can be super-selected.

Overrides:
superSelectable in class RMShape

getHandleAtPoint

public int getHandleAtPoint(RMPoint point,
                            boolean isSuperSelected)
This RMEditor support method tells the editor that page's resize handles don't exist.

Overrides:
getHandleAtPoint in class RMShape

ReportMill 8.0 API