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
-
rowHeight
- The height of every row.
-
SparseTableWidget()
-
-
flush()
- Flush the cache which stores the last data and view.
-
focusAtRow(int)
- Focus the content at the row with the given actual index.
-
getData(int, int, int, int)
- Get the data for the specified rows and columns, using the display
index of the rows and column.
-
getProperties(PropertyList)
- Get the properties of a sparse table.
-
getRowHeight()
- Get the height of a row.
-
getView()
- Get the current view: the currently visible rows and columns.
-
insertColumnAt(String, int, int)
- When inserting an empty column flush the content if
the current view is affected.
-
insertRowAt(TableRow, int)
- When inserting a row flush the content if the
view is affected.
-
inView(int, int)
- Check whether the given cell (column/row combination)
is in the current view.
-
newContent()
- Allocate a sparse content container.
-
removeColumnAt(int)
- When removing a column flush the content if
the current view is affected.
-
removeRow(TableRow)
- When removing a row flush the content
if the view is affected.
-
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.
-
setProperties(PropertyList)
- Set the properties of a sparse table.
-
setRowHeight(int)
- Set the height of every row to the given number of pixels.
-
sortOnColumnAt(int, int)
- Flush the content's cache when sorting.
-
switchColumns(int, int)
- Flush the content's cache when switching columns.
-
unSort()
- Flush the content's cache when unsorting.
rowHeight
public int rowHeight
- The height of every row.
- See Also:
- getRowHeight, setRowHeight
SparseTableWidget
public SparseTableWidget()
getProperties
public void getProperties(PropertyList list)
- Get the properties of a sparse table.
- Overrides:
- getProperties in class TableWidget
setProperties
public void setProperties(PropertyList list)
- Set the properties of a sparse table.
- Overrides:
- setProperties in class TableWidget
getRowHeight
public int getRowHeight()
- Get the height of a row.
- See Also:
- rowHeight
setRowHeight
public void setRowHeight(int rowHeight)
- Set the height of every row to the given number of pixels.
- See Also:
- rowHeight
newContent
protected Widget newContent()
- Allocate a sparse content container.
- Overrides:
- newContent in class TableWidget
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
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!
flush
public void flush()
- Flush the cache which stores the last data and view.
- See Also:
- flush
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
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
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
removeColumnAt
public void removeColumnAt(int columnIndex)
- When removing a column flush the content if
the current view is affected.
- Overrides:
- removeColumnAt in class TableWidget
switchColumns
public void switchColumns(int colIndex1,
int colIndex2)
- Flush the content's cache when switching columns.
- Overrides:
- switchColumns in class TableWidget
sortOnColumnAt
public void sortOnColumnAt(int colIndex,
int mode)
- Flush the content's cache when sorting.
- Overrides:
- sortOnColumnAt in class TableWidget
unSort
public void unSort()
- Flush the content's cache when unsorting.
- Overrides:
- unSort in class TableWidget
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
removeRow
public void removeRow(TableRow oldRow)
- When removing a row flush the content
if the view is affected.
- Overrides:
- removeRow in class TableWidget
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