Interface TableGrid

All Superinterfaces:
TableObject
All Known Implementing Classes:
TableGridImpl

public interface TableGrid extends TableObject
Represents a table grid which is a rectangular array of cells. All rows and all columns are the same length.
Since:
Epic 4.3
  • Method Details

    • cell

      TableCell cell(int colIndex, int rowIndex) throws TableException
      Returns the cell at the specified coordinates. The upper left cell is (1,1).
      Parameters:
      colIndex - The column of the cell.
      rowIndex - The row of the cell.
      Returns:
      The cell or null if no such sell exists.
      Throws:
      TableException - INVALID_INDEX_ERR: Raised if colIndex and rowIndex do not specify a cell in this grid.
    • rule

      TableRule rule(int startCol, int startRow, int endCol, int endRow) throws TableException
      Returns the rule at a specified location in the grid. Rules are addressed using cell coordinates (with (1,1) being the upper left cell). For cell (m,n), (m,n) is actually the cell's upper left corner.
      Parameters:
      startCol - The starting column of the rule.
      startRow - The ending column of the rule. It must be startCol (for a vertical rule) or startCol + 1 (for a horizontal rule).
      endCol - The starting row of the rule.
      endRow - The ending row of the rule. It must be startRow (for a horizontal rule) or starRow + 1 (for a vertical rule).
      Returns:
      The rule at the indicated location.
      Throws:
      TableException - INVALID_INDEX_ERR: Raised if the indexes given do not specify a rule in this grid.
    • row

      TableRow row(int rowIndex) throws TableException
      Returns a row given its index. The first row is row 1.
      Parameters:
      rowIndex - The index of the row.
      Returns:
      The indicated TableRow
      Throws:
      TableException - INVALID_INDEX_ERR: Raised if rowIndex does not specify a row in this grid.
    • column

      TableColumn column(int columnIndex) throws TableException
      Returns the column given its index. The first column is column 1.
      Parameters:
      columnIndex - The index of the column.
      Returns:
      The indicated TableColumn.
      Throws:
      TableException - INVALID_INDEX_ERR: Raised if columnIndex does not specify a column in this grid.
    • getIndex

      int getIndex()
      The index of this table in the TableSet it is part of.
    • getColumnCount

      int getColumnCount()
      The number of columns in the grid
    • getRowCount

      int getRowCount()
      The number of rows in the grid
    • getRows

      TableObjectStore getRows()
      A TableObjectStore containing all the rows in the grid. This is a static store; if rows are added or removed it is not updated.
    • getColumns

      TableObjectStore getColumns()
      A TableObjectStore containing all the columns in the grid. This is a static store; if columns are added or removed it is not updated.
    • getCells

      TableObjectStore getCells()
      A TableObjectStore containing all the cells in the grid. This is a static store; if cells are added to or removed from the grid (by adding or deleting rows or columns) it is not updated.
    • insertRows

      void insertRows(TableRectangle contents, TableRow refRow) throws TableException
      Insert one or more rows into the grid.
      Parameters:
      contents - The contents of this rectangle is copied into the new rows. This rectangle must be as wide as the grid. Its height determines the number of rows inserted.
      refRow - The row before which the new rows are to be inserted. If null the new rows are inserted as the last rows in the grid.
      Throws:
      TableException - INVALID_PARAMETER_ERR: Raised if the refRow is not in this grid or if the table model doesn't allow rows to be inserted.
    • insertRows

      void insertRows(TableRectangle contents) throws TableException
      Method overload which omits the last parameter.
      Throws:
      TableException
    • insertColumns

      void insertColumns(TableRectangle contents, TableColumn refColumn) throws TableException
      Insert one or more columns into the grid.
      Parameters:
      contents - The contents of this rectangle is copied into the new columns. This rectangle must be as high as the grid. Its width determines the number of columns inserted.
      refColumn - The column before which the new columns are to be inserted. If null the new columns are inserted as the last columns in the grid.
      Throws:
      TableException - INVALID_PARAMETER_ERR: Raised if the refColumn is not in this grid or if the table model doesn't allow a column to be inserted.
    • insertColumns

      void insertColumns(TableRectangle contents) throws TableException
      Method overload which omits the last parameter.
      Throws:
      TableException
    • addRow

      TableRow addRow(TableRow refRow, boolean addBefore) throws TableException
      Add an empty row to the grid.
      Parameters:
      refRow - The row before or after which the new row is to be inserted. If null the new row is inserted as the last row in the grid. Some attributes of the new row are set from refRow.
      addBefore - If omitted or false, the new row is added after refRow, if true it is added before it.
      Returns:
      The TableRow that was inserted.
      Throws:
      TableException - INVALID_PARAMETER_ERR: Raised if the refRow is not in this grid or if the table model doesn't allow rows to be inserted.
    • addRow

      TableRow addRow(TableRow refRow) throws TableException
      Method overload which omits the last parameter.
      Throws:
      TableException
    • addRow

      TableRow addRow() throws TableException
      Method overload which omits the last 2 parameters.
      Throws:
      TableException
    • addColumn

      TableColumn addColumn(TableColumn refColumn, boolean addBefore) throws TableException
      Add an empty column to the grid.
      Parameters:
      refColumn - The column before or after which the new column is to be inserted. If null the new column is inserted as the last column in the grid. Some attributes of the new column are set from refColumn.
      addBefore - If omitted or false, the new column is added after refColumn, if true it is added before it.
      Returns:
      The TableColumn that was inserted.
      Throws:
      TableException - INVALID_PARAMETER_ERR: Raised if the refColumn is not in this grid or if the table model doesn't allow columns to be inserted.
    • addColumn

      TableColumn addColumn(TableColumn refColumn) throws TableException
      Method overload which omits the last parameter.
      Throws:
      TableException
    • addColumn

      TableColumn addColumn() throws TableException
      Method overload which omits the last 2 parameters.
      Throws:
      TableException
    • deleteRow

      void deleteRow(TableRow row) throws TableException
      Delete a row from the grid.
      Parameters:
      row - The row to be deleted.
      Throws:
      TableException - INVALID_PARAMETER_ERR: Raised if the row is not in this grid or if the table model does not allow it to be deleted.
    • deleteColumn

      void deleteColumn(TableColumn column) throws TableException
      Delete a column from the grid.
      Parameters:
      column - The column to be deleted.
      Throws:
      TableException - INVALID_PARAMETER_ERR: Raised if the column is not in this grid or if the table model does not allow it to be deleted.
    • getFirstGalleyCell

      TableCell getFirstGalleyCell()
      The first cell in the grid in galley order.
    • getLastGalleyCell

      TableCell getLastGalleyCell()
      The last cell in the grid in galley order.
    • getGridAbove

      TableGrid getGridAbove()
      The grid above this one in the table set, if any.
    • getGridBelow

      TableGrid getGridBelow()
      The grid below this one in the table set, if any.
    • getRules

      TableObjectStore getRules()
      A TableObjectStore containing all the rules in the grid sorted in row major order.
    • split

      TableGrid split(TableRow topRow) throws TableException
      Splits the grid at the row indicated. That row will be the top row in a new grid inserted after this one.
      Parameters:
      topRow - The row that should be the top row in the new grid.
      Returns:
      The new grid that was inserted after this grid.
      Throws:
      TableException - OPERATION_FAILED_ERR: Raised if the grid can not be split because the table model does not allow multiple grids or one of the resulting grids would be invalid in some way.
    • hlineRuleList

      TableObjectStore hlineRuleList(int y, int startX, int endX)
      Returns a table object store containing all the TableRules in a specified horizontal line.
      Parameters:
      y - The vertical coordinate of the horizontal line to be returned
      startX - The horizontal coordinate of the left end of the rules to be returned.
      endX - The horizontal coordinate of the right end of the rules to be returned
      Returns:
      A store containing all the rules at vertical coordinate x between startX and endX.
    • vlineRuleList

      TableObjectStore vlineRuleList(int x, int startY, int endY)
      Returns a table object store containing all the TableRules in a specified vertical line.
      Parameters:
      x - The horizontal coordinate of the vertical line to be returned
      startY - The vertical coordinate of the top end of the rules to be returned.
      endY - The vertical coordinate of the bottom end of the rules to be returned
      Returns:
      A store containing all the rules at horizontal coordinate x between startY and endY.