Class RMTable

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

public class RMTable extends RMParentShape implements RMShapeSelfInit
This RMShape subclass provides functionality to graphically represent a list of data in a ReportMill report. It also supports data manipulation such as grouping and sorting.
  • Field Details

  • Constructor Details

    • RMTable

      public RMTable()
      Creates a plain table.
    • RMTable

      public RMTable(String aDatasetKey)
      Creates a table with given dataset key (and corresponding default grouping and details row).
  • Method Details

    • selfInit

      public void selfInit()
      Specified by:
      selfInit in interface RMShapeSelfInit
    • 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.
    • getFilterKey

      public String getFilterKey()
      Returns the optional key chain expression string used to prune the table list derived from dataset key.
    • setFilterKey

      public void setFilterKey(String aKeyExpr)
      Sets the optional key chain expression string used to prune the table list derived from dataset key.
    • getGrouper

      public RMGrouper getGrouper()
      Returns the grouper associated with the table.
    • setGrouper

      public void setGrouper(RMGrouper aGrouper)
      Sets the grouper associated with the table.
    • getGroupingCount

      public int getGroupingCount()
      Returns the number of groups in this table.
    • getGrouping

      public RMGrouping getGrouping(int anIndex)
      Returns the individual grouping at the given index.
    • getGrouping

      public RMGrouping getGrouping(String aKey)
      Returns the individual grouping that has the same key as the one given.
    • getGrouping

      public RMGrouping getGrouping(String aKey, boolean doCreate, int anIndex)
      Returns the individual grouping that has the same key as the one given, with option to create at index if missing.
    • addGroupingKey

      public void addGroupingKey(String aKey, int anIndex)
      Adds a grouping to the table for the given key string at the given grouping index.
    • addGrouping

      public void addGrouping(RMGrouping aGrouping, int anIndex)
      Adds a given grouping to the table at the given grouping index.
    • removeGrouping

      public void removeGrouping(RMGrouping aGrouping)
      Removes the given grouping.
    • moveGrouping

      public void moveGrouping(int fromIndex, int toIndex)
      Moves the grouping at the first index so that it resides at the second index.
    • addHeader

      public RMTableRow addHeader(String aKey)
      Convenience to add header for grouping key.
    • addDetails

      public RMTableRow addDetails(String aKey)
      Convenience to add details for grouping key.
    • addSummary

      public RMTableRow addSummary(String aKey)
      Convenience to add summary for grouping key.
    • propertyChange

      public void propertyChange(PropertyChangeEvent anEvent)
      Override to update rows when grouper changes and revalidate when child height changes.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Overrides:
      propertyChange in class RMShape
    • grouperChanged

      protected void grouperChanged()
      Called when there is a grouper change to ensure that table rows match groupings.
    • getPageBreakGroupIndex

      public int getPageBreakGroupIndex()
      Returns the index of the grouping in the grouper at which an explicit.
    • setPageBreakGroupIndex

      public void setPageBreakGroupIndex(int aValue)
      Returns the index of the grouping in the grouper at which an explicit.
    • getStartingPageBreak

      public boolean getStartingPageBreak()
      Returns whether this table should always start on a new page (if in table group).
    • getStartingRowPageBreak

      public boolean getStartingRowPageBreak()
      Returns whether each row should always start on a new page (if in a table group).
    • setStartingPageBreak

      public void setStartingPageBreak(boolean aFlag)
      Sets whether this table should always start on a new page (if in table group).
    • setStartingRowPageBreak

      public void setStartingRowPageBreak(boolean aFlag)
      Sets whether this table's rows should always start on a new page (if in table group).
    • getColumnCount

      public int getColumnCount()
      Returns the number of columns that this table should be repeated over on the same page before paginating.
    • setColumnCount

      public void setColumnCount(int aValue)
      Sets the number of columns that this table should be repeated over on the same page before paginating.
    • getColumnSpacing

      public double getColumnSpacing()
      Returns the space between a table that has more than one column (int printer points).
    • setColumnSpacing

      public void setColumnSpacing(double aValue)
      Sets the space between a table that has more than one column (int printer points).
    • getRow

      public RMTableRow getRow(int anIndex)
      Returns the specific table row at the given index.
    • getRow

      public RMTableRow getRow(String aName)
      Returns the specific table row with the given name.
    • getChildWithTitle

      public RMShape getChildWithTitle(String aTitle)
      Returns a specific child with the given name.
    • setTitleForChild

      public void setTitleForChild(String aNm1, String aNm2)
      Sets title for child of given name to new name.
    • addChildWithTitle

      public void addChildWithTitle(RMTableRow aChild, int anIndex, String aTitle)
      Convenience to set a child title and add to the table.
    • getResizeBarBounds

      public RMRect getResizeBarBounds(int anIndex)
      Returns the bounds rect of the resize bar for the child at the given index.
    • getResizeBarAtPoint

      public int getResizeBarAtPoint(RMPoint aPoint)
      Returns the index of the resize bar that is hit by the given point.
    • childrenSuperSelectImmediately

      public boolean childrenSuperSelectImmediately()
      Editor method - indicates that children should super select immediately when split shape is super selected.
      Overrides:
      childrenSuperSelectImmediately in class RMShape
    • layoutChildren

      protected void layoutChildren()
      Performs layout.
      Overrides:
      layoutChildren in class RMParentShape
    • rpgAll

      public RMShape rpgAll(ReportOwner anOwner, RMShape aParent)
      Report generation for table.
      Overrides:
      rpgAll in class RMParentShape
    • paintShape

      public void paintShape(RMShapePainter aPntr)
      Paints a table shape.
      Overrides:
      paintShape in class RMShape
    • paintShapeOver

      public void paintShapeOver(RMShapePainter aPntr)
      Paints stroke around table after all children have drawn.
      Overrides:
      paintShapeOver in class RMShape
    • getStrokeOnTop

      public boolean getStrokeOnTop()
      Override to paint table stroke on top.
      Overrides:
      getStrokeOnTop in class RMShape
    • clone

      @Nullable public RMTable clone()
      Standard clone implementation.
      Overrides:
      clone in class RMParentShape
    • toXMLShape

      protected RXElement toXMLShape(RXArchiver anArchiver)
      XML archival.
      Overrides:
      toXMLShape 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
    • toString

      public String toString()
      Standard to string implementation (prints class name and shape bounds).
      Overrides:
      toString in class RMShape