Class marimba.gui.TableWidget
All Packages Class Hierarchy This Package Previous Next Index
Class marimba.gui.TableWidget
java.lang.Object
|
+----marimba.gui.Widget
|
+----marimba.gui.ContainerWidget
|
+----marimba.gui.ScrollingContainerWidget
|
+----marimba.gui.TableWidget
- public class TableWidget
- extends ScrollingContainerWidget
A table widget for multiple columns and rows of data.
Every cell can contain the following objects: Widget, Boolean,
Character, Double, Float, Integer, Long and String.
A Widget is placed on the correct position and its width
is adjusted to the width of the column. All other objects
are just painted at the correct location.
This TableWidget supports sorting on columns, dragging columns
around, row selections, resizing of columns and both horizontal
and vertical scrollbars of course.
- Version:
- 1.49, 01/18/97
- Author:
- Klaas Waslander
-
colHeaders
- The current option for column headers.
-
colHeadersOptions
- The possible options for the column header style,
which are none, plain, outline and raised.
-
colPadding
- The number of pixels space at the left and right
of each cell.
-
columnCount
- The number of columns.
-
columnDrag
- The columns can be moved by dragging them around.
-
columnLine
- The columns can be separated by a line.
-
columnMap
- Array for mapping column display index to a column index.
-
columnResize
- The columns can be resizable in the header area.
-
columns
- The information about the columns is stored in this array.
-
currentRowIndex
- The display index of the current row.
-
fillHeaders
- The headers can be filled or transparent.
-
hdrFont
- The font that has to be used for the header.
-
rowCount
- The number of rows.
-
rowMap
- Array for mapping row display index to an actual row index.
-
rowPadding
- The number of pixels space at the top and bottom
of each cell.
-
rows
- The information about the rows is stored in this array.
-
selectedRows
- The currently selected rows, this vector contains the
actual index of every selected row.
-
selectMode
- The type of selections that can be made:
none, exclusive or multiple selections.
-
selectModeOptions
- The possible options for selecting,
which are none, exclusive or multiple.
-
sizeToCell
- The widgets can be sized to the cell size.
-
sortIndex
- The current column index on which is being sorted, which
is the actual index and not the display index.
-
sortMethod
- The current sort method, ascending/descending/none.
-
sortMode
- The current option for sorting.
-
sortModeOptions
- The possible options for sorting,
which are none, ascending, descending, both.
-
sortSymbol
- The current sorting can be drawn in the headers using
an appropriate symbol.
-
unsort
- Determines whether the user can 'unsort' the data
by clicking the column header.
-
TableWidget()
- Constructor.
-
action()
- The user performed an action.
-
action(int, int)
- The user wants to perform an action at the given cell,
represented by the column, row number combination.
-
addColumn()
- Append an empty column without header.
-
addColumn(String)
- Append an empty column to this table.
-
addColumn(String, int)
- Append an empty column with the given width to this table.
-
addRow()
- Append an empty row to this table.
-
addRow(TableRow)
- Append a row in the form of a TableRow.
-
addRow(Vector)
- Append a row to this table.
-
changeColumnWidth(int, int)
- Change the column width of the column with the given actual index.
-
columnCount()
- Get the number of columns.
-
columnsWidth()
- Get the width of all the columns together.
-
deselectAllRows()
- Deselect all rows.
-
deselectRow(TableRow)
- Deselect the given row.
-
deselectRowAt(int)
- Deselect the row with the given (actual) index.
-
eventInHeader(Event)
- Checks whether the given event is located in the header area.
-
findColumn(int)
- Returns the display index of the column the given x-coordinate
corresponds with.
-
focusAtRow(int)
- Focus the content at the row with the given actual index.
-
focusInterest()
- The table widget supports input focus when it is not
disabled and there are rows.
-
getCell(int, int)
- Get the data in the cell that corresponds with the
given (column, row) pair.
-
getColHeaders()
- Get the current option for the colHeaders.
-
getColHeadersOptions()
- Get the possible options for the column headers.
-
getColPadding()
- Get the number of pixels at the left and
right of each cell.
-
getColumn(int)
- Get the TableColumn with info about the column
with the given index, not dealing with columns
being switched.
-
getColumnAlignAt(int)
- Get the alignment of the given column.
-
getColumnData(int)
- Get the data of the column with the given index.
-
getColumnDrag()
- Check whether the columns can be moved by dragging them around.
-
getColumnHeaders()
- Get the column headers as a string.
-
getColumnIndex(int)
- Get the index of the column that is displayed at the given
position.
-
getColumnLabelAt(int)
- Get the label of the given column.
-
getColumnLine()
- Check whether the columns are separated by a line.
-
getColumnResize()
- Check whether the columns are resizable from the header area.
-
getCurrentRow()
- Get the current row, which is the row that has the focus.
-
getCurrentRowIndex()
- Get the display index of the current row.
-
getFillHeaders()
- Check whether the headers are filled.
-
getHdrFont()
- Get the font for the header.
-
getIntegerValue()
- Get the index of the first selected row.
-
getProperties(PropertyList)
- Get the properties of this widget.
-
getRow(int)
- Get the TableRow with info about the row
with the given index, not dealing with rows
being sorted.
-
getRowData(int)
- Get the data of the row with the given index.
-
getRowIndex(int)
- Get the index of the row that is displayed at the given
position.
-
getRowPadding()
- Get the number of pixels at the top and
bottom of each cell.
-
getSelectedRowIndexes()
- Get the indexes of the currently selected rows.
-
getSelectedRows()
- Get the currently selected rows as a vector
containing TableRow objects.
-
getSelectMode()
- Check the select mode.
-
getSelectModeOptions()
- Get the possible options for the select mode.
-
getSizeToCell()
- Check whether the widgets are sized to the cell size.
-
getSortIndex()
- Get the column index on which currently is being sorted,
which is the actual index and not the display index.
-
getSortMethod()
- Get the current method of sorting, which can be
ascending, descending or none.
-
getSortMode()
- Get the current sort mode.
-
getSortModeOptions()
- Get the possible options for the sort mode.
-
getSortSymbol()
- Check whether a sort symbol is shown in a header.
-
getUnsort()
- Check whether the user can unsort the data when
clicking on a header.
-
getValue()
- Get the index of the first selected row.
-
handleEvent(Event)
- Event handler for mouse events.
-
insertColumnAt(String, int)
- Insert an empty column at the given position to this table.
-
insertColumnAt(String, int, int)
- Insert an empty column at the given position and
with the given width to this table.
-
insertRowAt(TableRow, int)
- Insert a row at the given position to this table.
-
insertRowAt(Vector, int)
- Insert a row at the given position to this table.
-
layout()
- Layout the widget, which means setting the
content height and width and laying out the content.
-
moveColumn(int, int)
- Move the 'from' column before the 'to' column.
-
newContent()
- Allocate content container.
-
newScrollbar(int)
- Create a new scrollbar with all the necessary properties.
-
paint(Graphics, int, int, int, int)
- Paint the headers of the table.
-
paintSortSymbol(Graphics, int, int, int, int)
- Paint the sort symbol at the given coordinates.
-
paramString(StringBuffer)
- Debugging.
-
removeAllColumns()
- Remove all columns with their data.
-
removeAllRows()
- Remove all the rows.
-
removeColumnAt(int)
- Remove the column at the given position, which is
the actual index and not the display index.
-
removeRow(TableRow)
- Remove the given row.
-
removeRowAt(int)
- Remove the row at the given position, which is the
actual and not the display index.
-
rowCount()
- Get the number of rows.
-
rowIsSelected(TableRow)
- Check whether the given table row is selected.
-
rowIsSelectedAt(int)
- Check whether the row with the given actual index
is selected.
-
rowsHeight()
- Get the height of all the rows together.
-
scrollContent(int, int)
- When scrolling the content to a given position
generate a repaint for the headers-area if necessary.
-
selectRow(TableRow)
- Select the given row.
-
selectRowAt(int)
- Select the row with the given (actual) index.
-
setCell(Object, int, int)
- Set the content of the cell that corresponds with
the given (column, row) pair.
-
setColHeaders(int)
- Set the colHeaders to be none, plain, outline or raised.
-
setColPadding(int)
- Set the number of pixels at the left and
right of each cell.
-
setColumnAlignAt(int, int)
- Set the alignment of the given column to right, left or center.
-
setColumnDrag(boolean)
- Set dragging of columns to true or false.
-
setColumnHeaders(String)
- Base the columns on these column headers.
-
setColumnLabelAt(String, int)
- Set the label of the given column.
-
setColumnLine(boolean)
- Show/hide the lines between columns.
-
setColumnResize(boolean)
- Disable or enable column resizing in the header area.
-
setColumnWidth(int, int)
- Set the column width of the column with the given actual index
and adjust the x positions of the other columns.
-
setCurrentRow(TableRow)
- Set the current row with the focus to the given row.
-
setCurrentRowIndex(int)
- Set the current display row index to the given (display) row index.
-
setFillHeaders(boolean)
- Fill the headers area or let the area be transparent.
-
setHdrFont(Font)
- Set the font for the header.
-
setProperties(PropertyList)
- Set the properties of this widget.
-
setRowPadding(int)
- Set the number of pixels at the top and
bottom of each cell.
-
setRows(TableRow[])
- Set the rows by supplying the array with
TableRows directly.
-
setRows(Vector[])
- Set the rows by supplying the array with
Vectors containing the data directly.
-
setSelectMode(int)
- Set the select mode to none, exclusive or multiple.
-
setSizeToCell(boolean)
- Size the widgets to the cell size automatically or not.
-
setSortMode(int)
- Set the sort mode to be none, ascending, descending or both.
-
setSortSymbol(boolean)
- Show or hide the sort symbol for showing the current
sorting column column and its way of sorting.
-
setUnsort(boolean)
- (Dis)allow unsorting the data using the headers.
-
setValue(int)
- Select a row.
-
setValue(Object)
- Select a row by specifying a Number, String or
TableRow object.
-
sortOnColumn(TableColumn, int)
- Sort on the given column.
-
sortOnColumnAt(int, int)
- Sort on the column at the given actual index,
so not a display index.
-
switchColumns(int, int)
- Switch two columns.
-
unSort()
- Unsort the data in the table.
colHeadersOptions
public static Options colHeadersOptions
- The possible options for the column header style,
which are none, plain, outline and raised.
- See Also:
- getColHeadersOptions, colHeaders
sortModeOptions
public static Options sortModeOptions
- The possible options for sorting,
which are none, ascending, descending, both.
- See Also:
- getSortModeOptions, sortMode
selectModeOptions
public static Options selectModeOptions
- The possible options for selecting,
which are none, exclusive or multiple.
- See Also:
- getSelectModeOptions, selectMode
sortMode
public int sortMode
- The current option for sorting.
- See Also:
- getSortMode, setSortMode, sortModeOptions
unsort
public boolean unsort
- Determines whether the user can 'unsort' the data
by clicking the column header.
- See Also:
- getUnsort, setUnsort
sortSymbol
public boolean sortSymbol
- The current sorting can be drawn in the headers using
an appropriate symbol.
- See Also:
- getSortSymbol, setSortSymbol
hdrFont
public Font hdrFont
- The font that has to be used for the header.
- See Also:
- getHdrFont, setHdrFont
selectMode
public int selectMode
- The type of selections that can be made:
none, exclusive or multiple selections.
- See Also:
- getSelectMode, setSelectMode, selectModeOptions
columnDrag
public boolean columnDrag
- The columns can be moved by dragging them around.
This is never possible if colHeaders is set to none.
- See Also:
- getColumnDrag, setColumnDrag
columnLine
public boolean columnLine
- The columns can be separated by a line.
- See Also:
- getColumnLine, setColumnLine
columnResize
public boolean columnResize
- The columns can be resizable in the header area.
This is never possible if colHeaders is set to none.
- See Also:
- getColumnResize, setColumnResize
colHeaders
public int colHeaders
- The current option for column headers.
- See Also:
- getColHeaders, setColHeaders, colHeaderOptions
fillHeaders
public boolean fillHeaders
- The headers can be filled or transparent.
- See Also:
- getFillHeaders, setFillHeaders
sizeToCell
public boolean sizeToCell
- The widgets can be sized to the cell size.
- See Also:
- getSizeToCell, setSizeToCell
rowPadding
public int rowPadding
- The number of pixels space at the top and bottom
of each cell.
- See Also:
- getRowPadding, setRowPadding
colPadding
public int colPadding
- The number of pixels space at the left and right
of each cell.
- See Also:
- getColPadding, setColPadding
currentRowIndex
public int currentRowIndex
- The display index of the current row.
- See Also:
- getCurrentRow, setCurrentRow, getCurrentRowIndex, setCurrentRowIndex
columns
protected TableColumn columns[]
- The information about the columns is stored in this array.
It contains a TableColumn for each column.
- See Also:
- getColumn
rows
protected TableRow rows[]
- The information about the rows is stored in this array.
It contains a TableRow for each row with the data of that row.
- See Also:
- getRow
selectedRows
protected int selectedRows[]
- The currently selected rows, this vector contains the
actual index of every selected row.
- See Also:
- getSelectedRows, getSelectedRowIndexes, rowIsSelected, rowIsSelectedAt
columnMap
protected int columnMap[]
- Array for mapping column display index to a column index.
The array index is the display index, the item is the actual column
index. Mapping the other way around can be done by asking a column
for its 'displayIndex'.
- See Also:
- getColumnIndex
rowMap
protected int rowMap[]
- Array for mapping row display index to an actual row index.
The array index is the display index, the item is the actual row
index. Mapping the other way around can be done by asking a row
for its 'displayIndex'.
- See Also:
- getRowIndex
rowCount
protected int rowCount
- The number of rows.
- See Also:
- rowCount
columnCount
protected int columnCount
- The number of columns.
- See Also:
- columnCount
sortMethod
protected int sortMethod
- The current sort method, ascending/descending/none.
- See Also:
- getSortMethod
sortIndex
protected int sortIndex
- The current column index on which is being sorted, which
is the actual index and not the display index.
- See Also:
- getSortIndex
TableWidget
public TableWidget()
- Constructor.
getProperties
public void getProperties(PropertyList list)
- Get the properties of this widget.
- Overrides:
- getProperties in class ScrollingContainerWidget
setProperties
public void setProperties(PropertyList list)
- Set the properties of this widget.
- Overrides:
- setProperties in class ScrollingContainerWidget
getColumnHeaders
public String getColumnHeaders()
- Get the column headers as a string. This is used in the
getProperties method and if you pass this string to
setColumnHeaders it will result in the correct headers.
- See Also:
- setColumnHeaders
setColumnHeaders
public synchronized void setColumnHeaders(String str)
- Base the columns on these column headers. Names are changed if
necessary and columns removed/added if appropriate.
Column names must be separated by a comma, each column name can be
given a width using a slash. For example: "one/20,two,three/50".
If you want a column name with a slash in it, you have to supply
two slashes. For example: "12//3/20, 5//2".
- See Also:
- getColumnHeaders
newContent
protected Widget newContent()
- Allocate content container.
- Overrides:
- newContent in class ScrollingContainerWidget
newScrollbar
public ScrollbarWidget newScrollbar(int orientation)
- Create a new scrollbar with all the necessary properties.
- Overrides:
- newScrollbar in class ScrollingContainerWidget
getIntegerValue
public int getIntegerValue()
- Get the index of the first selected row.
getValue
public Object getValue()
- Get the index of the first selected row.
- Overrides:
- getValue in class Widget
setValue
public void setValue(Object value)
- Select a row by specifying a Number, String or
TableRow object.
- Overrides:
- setValue in class Widget
- See Also:
- selectedRows
setValue
public void setValue(int rowIndex)
- Select a row.
- See Also:
- selectedRows
getColHeadersOptions
public Options getColHeadersOptions()
- Get the possible options for the column headers.
- See Also:
- colHeadersOptions
getSortModeOptions
public Options getSortModeOptions()
- Get the possible options for the sort mode.
- See Also:
- sortModeOptions
getSortMode
public int getSortMode()
- Get the current sort mode.
- See Also:
- sortMode
setSortMode
public void setSortMode(int sortMode)
- Set the sort mode to be none, ascending, descending or both.
- See Also:
- sortMode
getUnsort
public boolean getUnsort()
- Check whether the user can unsort the data when
clicking on a header.
- See Also:
- unsort
setUnsort
public void setUnsort(boolean unsort)
- (Dis)allow unsorting the data using the headers.
- See Also:
- unsort
getSortSymbol
public boolean getSortSymbol()
- Check whether a sort symbol is shown in a header.
- See Also:
- sortSymbol
setSortSymbol
public void setSortSymbol(boolean sortSymbol)
- Show or hide the sort symbol for showing the current
sorting column column and its way of sorting.
- See Also:
- sortSymbol
getSelectModeOptions
public Options getSelectModeOptions()
- Get the possible options for the select mode.
- See Also:
- selectModeOptions
getSelectMode
public int getSelectMode()
- Check the select mode.
- See Also:
- selectMode
setSelectMode
public void setSelectMode(int selectMode)
- Set the select mode to none, exclusive or multiple.
- See Also:
- selectMode
getHdrFont
public Font getHdrFont()
- Get the font for the header.
- See Also:
- hdrFont
setHdrFont
public void setHdrFont(Font hdrFont)
- Set the font for the header.
- See Also:
- hdrFont
getColumnDrag
public boolean getColumnDrag()
- Check whether the columns can be moved by dragging them around.
- See Also:
- columnDrag
setColumnDrag
public void setColumnDrag(boolean columnDrag)
- Set dragging of columns to true or false.
- See Also:
- columnDrag
getColumnLine
public boolean getColumnLine()
- Check whether the columns are separated by a line.
- See Also:
- columnLine
setColumnLine
public void setColumnLine(boolean columnLine)
- Show/hide the lines between columns.
- See Also:
- columnLine
getColumnResize
public boolean getColumnResize()
- Check whether the columns are resizable from the header area.
- See Also:
- columnResize
setColumnResize
public void setColumnResize(boolean columnResize)
- Disable or enable column resizing in the header area.
- See Also:
- columnResize
getColHeaders
public int getColHeaders()
- Get the current option for the colHeaders.
- See Also:
- colHeaders
setColHeaders
public void setColHeaders(int colHeaders)
- Set the colHeaders to be none, plain, outline or raised.
- See Also:
- colHeaders
getFillHeaders
public boolean getFillHeaders()
- Check whether the headers are filled.
- See Also:
- fillHeaders
setFillHeaders
public void setFillHeaders(boolean fillHeaders)
- Fill the headers area or let the area be transparent.
- See Also:
- fillHeaders
getSizeToCell
public boolean getSizeToCell()
- Check whether the widgets are sized to the cell size.
- See Also:
- sizeToCell
setSizeToCell
public void setSizeToCell(boolean sizeToCell)
- Size the widgets to the cell size automatically or not.
- See Also:
- sizeToCell
columnCount
public int columnCount()
- Get the number of columns.
- See Also:
- columnCount
rowCount
public int rowCount()
- Get the number of rows.
- See Also:
- rowCount
getRowPadding
public int getRowPadding()
- Get the number of pixels at the top and
bottom of each cell.
- See Also:
- rowPadding
setRowPadding
public void setRowPadding(int rowPadding)
- Set the number of pixels at the top and
bottom of each cell.
- See Also:
- rowPadding
getColPadding
public int getColPadding()
- Get the number of pixels at the left and
right of each cell.
- See Also:
- colPadding
setColPadding
public void setColPadding(int colPadding)
- Set the number of pixels at the left and
right of each cell.
- See Also:
- colPadding
columnsWidth
public int columnsWidth()
- Get the width of all the columns together.
rowsHeight
public int rowsHeight()
- Get the height of all the rows together.
setColumnWidth
public void setColumnWidth(int index,
int width)
- Set the column width of the column with the given actual index
and adjust the x positions of the other columns.
changeColumnWidth
public void changeColumnWidth(int index,
int widthChange)
- Change the column width of the column with the given actual index.
getColumn
public TableColumn getColumn(int columnIndex)
- Get the TableColumn with info about the column
with the given index, not dealing with columns
being switched.
getRow
public TableRow getRow(int index)
- Get the TableRow with info about the row
with the given index, not dealing with rows
being sorted.
getColumnData
public Vector getColumnData(int columnIndex)
- Get the data of the column with the given index.
It is returned in the original unsorted order.
getRowData
public Vector getRowData(int index)
- Get the data of the row with the given index.
It is returned in the original order, not the current display order.
getCell
public Object getCell(int colIndex,
int rowIndex)
- Get the data in the cell that corresponds with the
given (column, row) pair. It uses the original column and row
index, so it does not take account of row sorting and a
different display order of the columns.
- See Also:
- setCell
setCell
public void setCell(Object item,
int colIndex,
int rowIndex)
- Set the content of the cell that corresponds with
the given (column, row) pair. The old content is removed.
You can supply null to make the cell empty.
- See Also:
- getCell
getColumnLabelAt
public String getColumnLabelAt(int index)
- Get the label of the given column.
setColumnLabelAt
public void setColumnLabelAt(String newLabel,
int index)
- Set the label of the given column.
getColumnAlignAt
public int getColumnAlignAt(int index)
- Get the alignment of the given column.
setColumnAlignAt
public void setColumnAlignAt(int align,
int index)
- Set the alignment of the given column to right, left or center.
addColumn
public void addColumn()
- Append an empty column without header.
addColumn
public void addColumn(String header)
- Append an empty column to this table.
addColumn
public void addColumn(String header,
int width)
- Append an empty column with the given width to this table.
insertColumnAt
public void insertColumnAt(String header,
int index)
- Insert an empty column at the given position to this table.
insertColumnAt
public void insertColumnAt(String header,
int index,
int width)
- Insert an empty column at the given position and
with the given width to this table.
Its actual index and display index will be the same.
removeAllColumns
public void removeAllColumns()
- Remove all columns with their data.
removeColumnAt
public void removeColumnAt(int columnIndex)
- Remove the column at the given position, which is
the actual index and not the display index.
The data in that column is also removed.
getColumnIndex
public int getColumnIndex(int displayIndex)
- Get the index of the column that is displayed at the given
position. Mapping the display index to the actual index is
necessary, since you can only search using the actual index.
Mapping from actual index to display index can be done by
asking for 'displayIndex' in TableColumn.
- See Also:
- columnMap
moveColumn
public void moveColumn(int fromIndex,
int toIndex)
- Move the 'from' column before the 'to' column.
The index for both columns is the current display index,
so not the actual index.
switchColumns
public void switchColumns(int colIndex1,
int colIndex2)
- Switch two columns. The index for both columns is the current
display index, so not the original index. The display index can
be retreived from the TableColumn by asking for its 'displayIndex'.
sortOnColumn
public void sortOnColumn(TableColumn sortCol,
int mode)
- Sort on the given column.
- Parameters:
- mode - The sortmode, which means ascending or descending.
sortOnColumnAt
public void sortOnColumnAt(int colIndex,
int mode)
- Sort on the column at the given actual index,
so not a display index.
- Parameters:
- mode - The sortmode, which means ascending or descending.
unSort
public void unSort()
- Unsort the data in the table.
getSortMethod
public int getSortMethod()
- Get the current method of sorting, which can be
ascending, descending or none.
- See Also:
- sortMethod, getSortIndex
getSortIndex
public int getSortIndex()
- Get the column index on which currently is being sorted,
which is the actual index and not the display index.
- See Also:
- sortIndex, getSortMethod
setRows
public void setRows(Vector rows[])
- Set the rows by supplying the array with
Vectors containing the data directly.
- See Also:
- rows
setRows
public void setRows(TableRow rows[])
- Set the rows by supplying the array with
TableRows directly.
- See Also:
- rows
addRow
public void addRow()
- Append an empty row to this table.
addRow
public void addRow(Vector rowData)
- Append a row to this table.
You can supply null to add an empty row.
addRow
public void addRow(TableRow row)
- Append a row in the form of a TableRow.
You can supply null to add an empty row.
insertRowAt
public void insertRowAt(Vector rowData,
int index)
- Insert a row at the given position to this table.
You can supply null to add an empty row.
Its actual index and display index will be the same.
insertRowAt
public void insertRowAt(TableRow row,
int index)
- Insert a row at the given position to this table.
You can supply null to add an empty row.
Its actual index and display index will be the same.
removeAllRows
public void removeAllRows()
- Remove all the rows.
removeRow
public void removeRow(TableRow oldRow)
- Remove the given row.
removeRowAt
public void removeRowAt(int rowIndex)
- Remove the row at the given position, which is the
actual and not the display index.
getRowIndex
public int getRowIndex(int displayIndex)
- Get the index of the row that is displayed at the given
position. Mapping the display index to the actual index is
necessary, since you can only search using the actual index.
Mapping from actual index to display index can be done by
asking for 'displayIndex' in TableRow.
- See Also:
- rowMap
selectRow
public void selectRow(TableRow row)
- Select the given row. If the select mode
is exclusive it will deselect all other rows.
- See Also:
- selectedRows
selectRowAt
public void selectRowAt(int rowIndex)
- Select the row with the given (actual) index. If the select
mode is exclusive it will deselect all other rows.
- See Also:
- selectedRows
deselectRow
public void deselectRow(TableRow row)
- Deselect the given row.
- See Also:
- selectedRows
deselectRowAt
public void deselectRowAt(int rowIndex)
- Deselect the row with the given (actual) index.
- See Also:
- selectedRows
deselectAllRows
public void deselectAllRows()
- Deselect all rows.
- See Also:
- selectedRows
getSelectedRows
public Vector getSelectedRows()
- Get the currently selected rows as a vector
containing TableRow objects.
If no row is currently selected, an vector
with zero elements is returned.
- See Also:
- selectedRows
getSelectedRowIndexes
public int[] getSelectedRowIndexes()
- Get the indexes of the currently selected rows.
If no row is currently selected, an array with
zero elements is returned.
- See Also:
- selectedRows
rowIsSelected
public boolean rowIsSelected(TableRow row)
- Check whether the given table row is selected.
- See Also:
- selectedRows
rowIsSelectedAt
public boolean rowIsSelectedAt(int rowIndex)
- Check whether the row with the given actual index
is selected.
- See Also:
- selectedRows
getCurrentRow
public TableRow getCurrentRow()
- Get the current row, which is the row that has the focus.
- See Also:
- currentRowIndex
setCurrentRow
public void setCurrentRow(TableRow currentRow)
- Set the current row with the focus to the given row.
- See Also:
- currentRowIndex
getCurrentRowIndex
public int getCurrentRowIndex()
- Get the display index of the current row.
- See Also:
- currentRowIndex
setCurrentRowIndex
public void setCurrentRowIndex(int displayRowIndex)
- Set the current display row index to the given (display) row index.
- See Also:
- currentRowIndex
scrollContent
public void scrollContent(int tx,
int ty)
- When scrolling the content to a given position
generate a repaint for the headers-area if necessary.
- Overrides:
- scrollContent in class ScrollingContainerWidget
layout
public void layout()
- Layout the widget, which means setting the
content height and width and laying out the content.
- Overrides:
- layout in class ScrollingContainerWidget
focusAtRow
public void focusAtRow(int rowIndex)
- Focus the content at the row with the given actual index.
paint
public void paint(Graphics g,
int cx,
int cy,
int cw,
int ch)
- Paint the headers of the table.
- Overrides:
- paint in class Widget
paintSortSymbol
protected void paintSortSymbol(Graphics g,
int x,
int y,
int height,
int sorting)
- Paint the sort symbol at the given coordinates.
- Parameters:
- sorting - None, ascending or descending.
findColumn
protected int findColumn(int x)
- Returns the display index of the column the given x-coordinate
corresponds with. Returns the negative index of an edge if
the x-coordinate corresponds with that edge.
Returns zero if no edge or column is found.
eventInHeader
protected boolean eventInHeader(Event evt)
- Checks whether the given event is located in the header area.
handleEvent
public boolean handleEvent(Event evt)
- Event handler for mouse events.
- Overrides:
- handleEvent in class ScrollingContainerWidget
action
public void action(int column,
int row)
- The user wants to perform an action at the given cell,
represented by the column, row number combination.
action
public void action()
- The user performed an action.
- Overrides:
- action in class Widget
paramString
public void paramString(StringBuffer buf)
- Debugging.
- Overrides:
- paramString in class Widget
focusInterest
public boolean focusInterest()
- The table widget supports input focus when it is not
disabled and there are rows.
- Overrides:
- focusInterest in class Widget
All Packages Class Hierarchy This Package Previous Next Index