com.androidplot.ui
Class DynamicTableModel

java.lang.Object
  extended by com.androidplot.ui.TableModel
      extended by com.androidplot.ui.DynamicTableModel

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/interfaces inherited from class com.androidplot.ui.TableModel
TableModel.Axis, TableModel.CellSizingMethod
 
Constructor Summary
DynamicTableModel(int numColumns, int numRows)
          Convenience method.
DynamicTableModel(int numColumns, int numRows, TableOrder order)
           
 
Method Summary
 android.graphics.RectF getCellRect(android.graphics.RectF tableRect, int numElements)
          Calculates the dimensions of a single element of this table with tableRect representing the overall dimensions of the table.
 com.androidplot.ui.DynamicTableModel.TableModelIterator getIterator(android.graphics.RectF tableRect, int totalElements)
           
 int getNumColumns()
           
 int getNumRows()
           
 void setNumColumns(int numColumns)
           
 void setNumRows(int numRows)
           
 
Methods inherited from class com.androidplot.ui.TableModel
getOrder, setOrder
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicTableModel

public DynamicTableModel(int numColumns,
                         int numRows)
Convenience method. Sets order to ROW_MAJOR.

Parameters:
numColumns -
numRows -

DynamicTableModel

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

getIterator

public com.androidplot.ui.DynamicTableModel.TableModelIterator getIterator(android.graphics.RectF tableRect,
                                                                           int totalElements)
Specified by:
getIterator in class TableModel

getCellRect

public android.graphics.RectF getCellRect(android.graphics.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.

getNumRows

public int getNumRows()

setNumRows

public void setNumRows(int numRows)

getNumColumns

public int getNumColumns()

setNumColumns

public void setNumColumns(int numColumns)


Copyright © 2010-2013 androidplot.com. All Rights Reserved.