Class marimba.gui.SparseTableWidget
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class marimba.gui.SparseTableWidget

java.lang.Object
   |
   +----marimba.gui.Widget
           |
           +----marimba.gui.ContainerWidget
                   |
                   +----marimba.gui.ScrollingContainerWidget
                           |
                           +----marimba.gui.TableWidget
                                   |
                                   +----marimba.gui.SparseTableWidget

public class SparseTableWidget
extends TableWidget
Sparse multi-column table widget. This means that the content does not draw the data that is not visible. This is done by using the method getData. This method returns the rows and columns that the content asks for. IMPORTANT: to make this possible every row has the same height! You can also use this sparse table for displaying your own data without using widgets all the time, by setting the number of rows and columns manually and overriding getData in your subclass.
Version:
1.20, 01/13/97
Author:
Klaas Waslander
See Also:
getData, SparseTableContent

Variable Index

 o rowHeight
The height of every row.

Constructor Index

 o SparseTableWidget()

Method Index

 o flush()
Flush the cache which stores the last data and view.
 o focusAtRow(int)
Focus the content at the row with the given actual index.
 o getData(int, int, int, int)
Get the data for the specified rows and columns, using the display index of the rows and column.
 o getProperties(PropertyList)
Get the properties of a sparse table.
 o getRowHeight()
Get the height of a row.
 o getView()
Get the current view: the currently visible rows and columns.
 o insertColumnAt(String, int, int)
When inserting an empty column flush the content if the current view is affected.
 o insertRowAt(TableRow, int)
When inserting a row flush the content if the view is affected.
 o inView(int, int)
Check whether the given cell (column/row combination) is in the current view.
 o newContent()
Allocate a sparse content container.
 o removeColumnAt(int)
When removing a column flush the content if the current view is affected.
 o removeRow(TableRow)
When removing a row flush the content if the view is affected.
 o setCell(Object, int, int)
When setting the content of a cell in the current view, flush the cache of the content, since it does not show the new content if the view does not change.
 o setProperties(PropertyList)
Set the properties of a sparse table.
 o setRowHeight(int)
Set the height of every row to the given number of pixels.
 o sortOnColumnAt(int, int)
Flush the content's cache when sorting.
 o switchColumns(int, int)
Flush the content's cache when switching columns.
 o unSort()
Flush the content's cache when unsorting.

Variables

 o rowHeight
  public int rowHeight
The height of every row.
See Also:
getRowHeight, setRowHeight

Constructors

 o SparseTableWidget
  public SparseTableWidget()

Methods

 o getProperties
  public void getProperties(PropertyList list)
Get the properties of a sparse table.
Overrides:
getProperties in class TableWidget
 o setProperties
  public void setProperties(PropertyList list)
Set the properties of a sparse table.
Overrides:
setProperties in class TableWidget
 o getRowHeight
  public int getRowHeight()
Get the height of a row.
See Also:
rowHeight
 o setRowHeight
  public void setRowHeight(int rowHeight)
Set the height of every row to the given number of pixels.
See Also:
rowHeight
 o newContent
  protected Widget newContent()
Allocate a sparse content container.
Overrides:
newContent in class TableWidget
 o getView
  public int[] getView()
Get the current view: the currently visible rows and columns.
Returns:
an array with four integers: firstrow, lastrow, firstcol, lastcol.
See Also:
getView
 o inView
  public boolean inView(int col,
                        int row)
Check whether the given cell (column/row combination) is in the current view. Remember to give the display index as cell identifiers, since that determines the view!
 o flush
  public void flush()
Flush the cache which stores the last data and view.
See Also:
flush
 o getData
  public synchronized Vector[] getData(int firstRow,
                                       int lastRow,
                                       int firstCol,
                                       int lastCol)
Get the data for the specified rows and columns, using the display index of the rows and column. Returns an array with for every row a Vector with strings or Widgets. SparseTableContent uses this method as a callback function to get the appropriate data for the current table view. If you want to return your own data in a subclass of sparse table, make sure to fill the rowMap array with the appropriate actual and display index for every row to make sorting possible.
See Also:
SparseTableContent
 o setCell
  public void setCell(Object item,
                      int colIndex,
                      int rowIndex)
When setting the content of a cell in the current view, flush the cache of the content, since it does not show the new content if the view does not change.
Overrides:
setCell in class TableWidget
 o insertColumnAt
  public void insertColumnAt(String header,
                             int index,
                             int width)
When inserting an empty column flush the content if the current view is affected.
Overrides:
insertColumnAt in class TableWidget
 o removeColumnAt
  public void removeColumnAt(int columnIndex)
When removing a column flush the content if the current view is affected.
Overrides:
removeColumnAt in class TableWidget
 o switchColumns
  public void switchColumns(int colIndex1,
                            int colIndex2)
Flush the content's cache when switching columns.
Overrides:
switchColumns in class TableWidget
 o sortOnColumnAt
  public void sortOnColumnAt(int colIndex,
                             int mode)
Flush the content's cache when sorting.
Overrides:
sortOnColumnAt in class TableWidget
 o unSort
  public void unSort()
Flush the content's cache when unsorting.
Overrides:
unSort in class TableWidget
 o insertRowAt
  public void insertRowAt(TableRow row,
                          int index)
When inserting a row flush the content if the view is affected.
Overrides:
insertRowAt in class TableWidget
 o removeRow
  public void removeRow(TableRow oldRow)
When removing a row flush the content if the view is affected.
Overrides:
removeRow in class TableWidget
 o focusAtRow
  public void focusAtRow(int rowIndex)
Focus the content at the row with the given actual index.
Overrides:
focusAtRow in class TableWidget

All Packages  Class Hierarchy  This Package  Previous  Next  Index