Class DynamicTableModel

  • All Implemented Interfaces:

    
    public class DynamicTableModel
    extends TableModel
                        

    Encapsulates the visual aspects of a table; number of rows and columns and the height and width in pixels of each element within the table. There is no support (yet) for variable size cells within a table; all cells within a table share the same dimensions. The DynamicTableModel provides an Iterator implementation which returns a RectF of each subsequent cell, based on the order of the plot. Tables with an order of COLUMN_MAJOR are traversed left to right column by column until the end of the row is reached, then proceeding to the next row. Tables with an order of ROW_MAJOR are traversed top to bottom row by row until the end of the row is reached, then proceeding to the next column.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      int getNumRows()
      void setNumRows(int numRows)
      int getNumColumns()
      void setNumColumns(int numColumns)
      DynamicTableModel.TableModelIterator getIterator(@NonNull() RectF tableRect, int totalElements)
      RectF getCellRect(@NonNull() RectF tableRect, int numElements) Calculates the dimensions of a single element of this table with tableRect representing the overall dimensions of the table.
      • Methods inherited from class com.androidplot.ui.TableModel

        getOrder, setOrder
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DynamicTableModel

        DynamicTableModel(int numColumns, int numRows)

        Convenience method. Sets order to ROW_MAJOR.

      • DynamicTableModel

        DynamicTableModel(int numColumns, int numRows, TableOrder order)
    • Method Detail

      • getCellRect

        @NonNull() RectF getCellRect(@NonNull() RectF tableRect, int numElements)

        Calculates the dimensions of a single element of this table with tableRect representing the overall dimensions of the table.

        Parameters:
        tableRect - Dimensions/position of the table
        Returns:

        a RectF representing the first (top-left) element in the tableRect passed in.