ReportMill 11 API

com.reportmill.shape
Class RMPage

java.lang.Object
  extended by com.reportmill.base.RMObject
      extended by com.reportmill.shape.RMShape
          extended by com.reportmill.shape.RMPage
All Implemented Interfaces:
com.reportmill.base.RMPropertyChanger, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener

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
WRAP_TYPE_BOTH, WRAP_TYPE_NONE
 
Constructor Summary
RMPage()
          Creates a plain empty page.
 
Method Summary
 boolean acceptsChildren()
          Editor method - indicates that page supports added children.
 void addChild(RMShape aChild, int anIndex)
          Add the given child at the given index (over-rides RMShape version to propogate to RMPageLayer).
 void addLayer(com.reportmill.shape.RMPageLayer aLayer)
          Adds a layer to page.
 void addLayer(com.reportmill.shape.RMPageLayer aLayer, int anIndex)
          Adds a layer to page.
 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)
          Overrides shape implementation to keep shapes in their proper layers.
 RMPage clone()
          Standard clone method.
 boolean equals(java.lang.Object anObj)
          Standard equals method.
 java.lang.Object fromXMLShape(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
          XML unarchival.
 void fromXMLShapeChildren(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
          XML unarchival for shape children.
 com.reportmill.graphics.RMAnimator getChildAnimator(boolean create)
          Returns the child animator associated with this page, creating one if it doesn't exist (if requested).
 int getChildCountHitable()
          Returns a count of all children in hitable layers.
 int getChildCountVisible()
          Returns a count of all children in visible layers.
 RMShape getChildHitable(int anIndex)
          Returns the hitable child at the given index.
 com.reportmill.shape.RMPageLayer getChildLayer(RMShape aChild)
          Returns the layer for a given child.
 RMShape getChildVisible(int anIndex)
          Returns the visible child at the given index.
 com.reportmill.shape.RMPageLayer getLayer(int anIndex)
          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.
 java.util.List<com.reportmill.shape.RMPageLayer> getLayers()
          Returns the list of page layers.
 RMShape getPageShape()
          Overrides shape implementation to return this page, since it is the page shape.
 boolean getPaintBackground()
          Returns whether to paint white background even if not explicitly defined and drop shadow.
 com.reportmill.shape.RMPageLayer getSelectedLayer()
          Returns the selected layer.
 int getSelectedLayerIndex()
          Returns the index of the selected layer.
 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 pageMax()
          Returns the "PageMax" of the document associated with this page (used to resolve @PageMax@ key references).
 void paintShape(com.reportmill.shape.RMShapePainter aPainter, java.awt.Graphics2D g)
          Top-level generic shape painting (sets transform, recurses to children, paints this).
 void paintShapeChildren(com.reportmill.shape.RMShapePainter aPainter, java.awt.Graphics2D g)
          Overridden to clip when viewing.
 RMShape removeChild(int anIndex)
          Removes the child at the given index (over-rides RMShape version to propogate to RMPageLayer).
 com.reportmill.shape.RMPageLayer removeLayer(int anIndex)
          Removes the layer at given index (and its children).
 int removeLayer(com.reportmill.shape.RMPageLayer aLayer)
          Removes the given layer.
 void resetLayers()
          Resets this page's list of layers to a single, selecctable layer named "Layer 1".
 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)
          Overrides shape implementation to keep shapes in their proper layers.
 void setPaintBackground(boolean aValue)
          Sets whether to paint white background even if not explicitly defined and drop shadow.
 boolean superSelectable()
          Editor method - indicates that pages can be super-selected.
 com.reportmill.archiver.RXElement toXMLShape(com.reportmill.archiver.RXArchiver anArchiver, java.lang.Object anOwner)
          XML archival.
 void toXMLShapeChildren(com.reportmill.archiver.RXArchiver anArchiver, com.reportmill.archiver.RXElement anElement, java.lang.Object anOwner)
          XML archival of children.
 
Methods inherited from class com.reportmill.shape.RMShape
acceptsMouse, addBinding, addChild, animUpdate, bounds, boundsChanged, boundsChanged, checkBindings, childrenSuperSelectImmediately, cloneDeep, contains, convertedPointFromShape, convertedPointToShape, convertedRectFromShape, convertedRectToShape, convertedSizeFromShape, convertedSizeToShape, convertedVectorFromShape, convertedVectorToShape, convertFromShape, convertPathFromShape, convertPathToShape, convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, convertSizeFromShape, convertSizeToShape, convertToShape, convertVectorFromShape, convertVectorToShape, copyShape, createDivideShapeRemainder, createLayout, createPartClone, divideShapeFromEdge, divideShapeFromTop, doLayout, firePropertyChange, fromXML, get, getAction, getAncestor, getAncestorCount, getAncestorInCommon, getAnim, getAnim, getAnimator, getAnimator, getAspectMapped, getAspects, getAutosizeHeight, getAutosizing, getBinder, getBinding, getBinding, getBindingCount, getBounds, getBoundsInside, getBoundsMarked, getBoundsMarkedDeep, getBoundsOfChildren, getCausesWrap, getCausesWrapType, getChild, getChildAnimator, getChildArray, getChildClipShape, getChildContaining, getChildCount, getChildCountLayout, getChildLast, getChildLayout, getChildren, getChildrenIntersecting, getChildrenWhoCauseWrap, getChildrenWithClass, getChildrenWithClass, getChildWithClass, getChildWithName, getClipShape, getColor, getDatasetEntity, getDatasetKey, getDocument, getEffect, getFill, getFill, getFillCount, getFont, getFormat, getFrame, getFrame, getFrameMaxX, getFrameMaxY, getFrameX, getFrameXY, getFrameY, getHeight, getHeightToFit, getImageFill, getLayout, getLineWidth, getMaskPath, getMaxX, getMaxY, getName, getOpacity, getOpacityDeep, getOriginal, getOutline, getPageBreak, getPageBreakMax, getPageBreakPage, getPageBreakPageMax, getParent, getParentWithClass, getPart, getPartCount, getPartDeep, getPartDeepCount, getPath, getPathInBounds, getReportMill, getRoll, getRootShape, getScaleX, getScaleY, getShapesToAncestor, getShapesToDescendant, getShapesToShape, getSize, getSizeP, getSkewX, getSkewY, getStroke, getStrokeColor, getTextColor, getTransform, getTransformFromShape, getTransformInverse, getTransformToShape, getUndoer, getUrl, getVisbileBounds, getVisibleBounds, getVisibleBounds, getVisibleBounds, getWidth, getWidthToFit, getX, getXY, getXYP, getY, height, indexOf, indexOfChild, intersects, isAncestor, isAnimProperty, isDescendant, isEditing, isLocked, isMouseDown, isMouseOver, isRoot, isShowing, isUnderlined, isValid, isViewing, isVisible, layoutReset, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, notRSS, offsetChildrenXY, offsetXY, paint, paintShapeAll, paintShapeOver, propertyChange, put, removeBinding, removeBinding, removeChild, removeChildren, removeFromParent, repaint, repaint, resolvePageReferences, revalidate, setAction, setAnim, setAutosizeHeight, setAutosizing, setBounds, setBounds, setCausesWrap, setCausesWrapType, setColor, setEffect, setFill, setFont, setFormat, setFrame, setFrame, setFrameSize, setFrameX, setFrameXY, setFrameXY, setFrameY, setHeight, setHeightToFit, setLayout, setLayoutEnabled, setLineWidth, setLocked, setName, setOpacity, setOutline, setParent, setReportMill, setReportMillBindings, setReportMillDeep, setRoll, setScaleX, setScaleXY, setScaleY, setSize, setSize, setSizeP, setSizeToFit, setSizeToFit, setSkewX, setSkewXY, setSkewY, setStroke, setStrokeColor, setTextColor, setTime, setUnderlined, setUrl, setVisible, setWidth, setWidthToFit, setX, setXY, setXY, setXYP, setY, shapeHidden, shapeShown, sizesToFitChildren, toString, toXML, undoerDisable, undoerEnable, undoerSetUndoTitle, validate, width, x, y
 
Methods inherited from class com.reportmill.base.RMObject
addListener, addPropertyChangeListener, firePropertyChange, getListener, getListenerCount, getListeners, isFirePropertyChangeEnabled, isUndoing, removeListener, removePropertyChangeListener, setFirePropertyChangeEnabled, setUndoing
 
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

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

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


getLayers

public java.util.List<com.reportmill.shape.RMPageLayer> getLayers()
Returns the list of page layers.


addLayer

public void addLayer(com.reportmill.shape.RMPageLayer aLayer)
Adds a layer to page.


addLayer

public void addLayer(com.reportmill.shape.RMPageLayer aLayer,
                     int anIndex)
Adds a layer to page.


removeLayer

public com.reportmill.shape.RMPageLayer removeLayer(int anIndex)
Removes the layer at given index (and its children).


removeLayer

public int removeLayer(com.reportmill.shape.RMPageLayer aLayer)
Removes the given layer.


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.


moveLayer

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


getChildLayer

public com.reportmill.shape.RMPageLayer getChildLayer(RMShape aChild)
Returns the layer for a given child.


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 aChild,
                     int anIndex)
Add the given child at the given index (over-rides RMShape version to propogate to RMPageLayer).

Overrides:
addChild in class RMShape

removeChild

public RMShape removeChild(int anIndex)
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)
Overrides shape implementation to keep shapes in their proper layers.

Overrides:
bringShapesToFront in class RMShape

sendShapesToBack

public void sendShapesToBack(java.util.List shapes)
Overrides shape 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.


getChildCountVisible

public int getChildCountVisible()
Returns a count of all children in visible layers.

Overrides:
getChildCountVisible in class RMShape

getChildVisible

public RMShape getChildVisible(int anIndex)
Returns the visible child at the given index.

Overrides:
getChildVisible in class RMShape

getChildCountHitable

public int getChildCountHitable()
Returns a count of all children in hitable layers.

Overrides:
getChildCountHitable in class RMShape

getChildHitable

public RMShape getChildHitable(int anIndex)
Returns the hitable child at the given index.

Overrides:
getChildHitable in class RMShape

getPageShape

public RMShape getPageShape()
Overrides shape implementation to return this page, since it is the page shape.

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

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

paintShape

public void paintShape(com.reportmill.shape.RMShapePainter aPainter,
                       java.awt.Graphics2D g)
Top-level generic shape painting (sets transform, recurses to children, paints this).

Overrides:
paintShape in class RMShape

paintShapeChildren

public void paintShapeChildren(com.reportmill.shape.RMShapePainter aPainter,
                               java.awt.Graphics2D g)
Overridden to clip when viewing.

Overrides:
paintShapeChildren in class RMShape

equals

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

Overrides:
equals in class RMShape

clone

public RMPage clone()
Standard clone method.

Overrides:
clone in class RMShape

toXMLShape

public com.reportmill.archiver.RXElement toXMLShape(com.reportmill.archiver.RXArchiver anArchiver,
                                                    java.lang.Object anOwner)
XML archival.

Overrides:
toXMLShape in class RMShape

toXMLShapeChildren

public void toXMLShapeChildren(com.reportmill.archiver.RXArchiver anArchiver,
                               com.reportmill.archiver.RXElement anElement,
                               java.lang.Object anOwner)
XML archival of children.

Overrides:
toXMLShapeChildren in class RMShape

fromXMLShape

public java.lang.Object fromXMLShape(com.reportmill.archiver.RXArchiver anArchiver,
                                     com.reportmill.archiver.RXElement anElement,
                                     java.lang.Object anOwner)
XML unarchival.

Overrides:
fromXMLShape in class RMShape

fromXMLShapeChildren

public void fromXMLShapeChildren(com.reportmill.archiver.RXArchiver anArchiver,
                                 com.reportmill.archiver.RXElement anElement,
                                 java.lang.Object anOwner)
XML unarchival for shape children.

Overrides:
fromXMLShapeChildren in class RMShape

acceptsChildren

public boolean acceptsChildren()
Editor method - indicates that page supports added children.

Overrides:
acceptsChildren in class RMShape

superSelectable

public boolean superSelectable()
Editor method - indicates that pages can be super-selected.

Overrides:
superSelectable in class RMShape

ReportMill 11 API