Class RMPage

All Implemented Interfaces:
Archivable, DeepChangeListener, RMPropertyChanger, RMTypes, PropertyChangeListener, Cloneable, EventListener

public class RMPage extends RMParentShape
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))));
 

  • Constructor Details

    • RMPage

      public RMPage()
      Creates a plain empty page.
  • Method Details

    • getDatasetKey

      public String getDatasetKey()
      Returns the dataset key associated with the table.
      Overrides:
      getDatasetKey in class RMShape
    • setDatasetKey

      public void setDatasetKey(String aKeyPath)
      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

      public RMPageLayer getLayer(int anIndex)
      Returns the layer at the given index.
    • getLayers

      public List<RMPageLayer> getLayers()
      Returns the list of page layers.
    • addLayer

      public void addLayer(RMPageLayer aLayer)
      Adds a layer to page.
    • addLayer

      public void addLayer(RMPageLayer aLayer, int anIndex)
      Adds a layer to page.
    • removeLayer

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

      public int removeLayer(RMPageLayer aLayer)
      Removes the given layer.
    • getLayer

      public RMPageLayer getLayer(String aString)
      Returns the layer with the given name.
    • addLayerNamed

      public void addLayerNamed(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 RMPageLayer getChildLayer(RMShape aChild)
      Returns the layer for a given child.
    • getSelectedLayerIndex

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

      public RMPageLayer getSelectedLayer()
      Returns the selected layer.
    • selectLayer

      public void selectLayer(RMPageLayer aLayer)
      Selects the given layer.
    • selectLayer

      public void selectLayer(String aString)
      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

      public RMPage.Plexing getPlexing()
      Returns the page plexing (whether it prints to one page, page back & front, or back & front with tumble).
    • setPlexing

      public void setPlexing(RMPage.Plexing aPlexing)
      Sets the page plexing (whether it prints to one page, page back & front, or back & front with tumble).
    • 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 RMParentShape
    • 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 RMParentShape
    • bringShapesToFront

      public void bringShapesToFront(List shapes)
      Overrides shape implementation to keep shapes in their proper layers.
      Overrides:
      bringShapesToFront in class RMParentShape
    • sendShapesToBack

      public void sendShapesToBack(List shapes)
      Overrides shape implementation to keep shapes in their proper layers.
      Overrides:
      sendShapesToBack in class RMParentShape
    • moveToNewLayer

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

      protected boolean isShowing(RMShape aChild)
      Override so page layers can make children not visible.
      Overrides:
      isShowing in class RMParentShape
    • isHittable

      public boolean isHittable(RMShape aChild)
      Override so page layers can make children unhittable.
      Overrides:
      isHittable in class RMParentShape
    • getPageShape

      public RMParentShape getPageShape()
      Overrides shape implementation to return this page, since it is the page shape.
      Overrides:
      getPageShape in class RMShape
    • getChildAnimator

      public RMAnimator getChildAnimator(boolean doCreate)
      Returns the child animator associated with this page, creating one if it doesn't exist (if requested).
      Overrides:
      getChildAnimator in class RMShape
    • setChildAnimator

      protected void setChildAnimator(RMAnimator anAnimator)
      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).
      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
    • 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 class RMShape
    • paintShape

      public void paintShape(RMShapePainter aPntr)
      Top-level generic shape painting (sets transform, recurses to children, paints this).
      Overrides:
      paintShape in class RMShape
    • rpgAll

      public RMShape rpgAll(ReportOwner anRptOwner, RMShape aParent)
      Returns a report page.
      Overrides:
      rpgAll in class RMParentShape
    • rpgChildren

      protected RMShape rpgChildren(ReportOwner anRptOwner, RMParentShape aParent)
      Override to handle pagination.
      Overrides:
      rpgChildren in class RMParentShape
    • clone

      public RMPage clone()
      Standard clone method.
      Overrides:
      clone in class RMParentShape
    • toXMLShape

      protected RXElement toXMLShape(RXArchiver anArchiver)
      XML archival.
      Overrides:
      toXMLShape in class RMParentShape
    • toXMLChildren

      protected void toXMLChildren(RXArchiver anArchiver, RXElement anElement)
      XML archival of children.
      Overrides:
      toXMLChildren in class RMParentShape
    • fromXMLShape

      protected void fromXMLShape(RXArchiver anArchiver, RXElement anElement)
      XML unarchival.
      Overrides:
      fromXMLShape in class RMParentShape
    • fromXMLChildren

      protected void fromXMLChildren(RXArchiver anArchiver, RXElement anElement)
      XML unarchival for shape children.
      Overrides:
      fromXMLChildren in class RMParentShape
    • 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