|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TableRowModel
Defines the requirements for a table row model object suitable for
use with TableView
.
DefaultTableRowModel
Method Summary | |
---|---|
void |
addRowModelListener(TableRowModelListener x)
Adds a listener for table row model events. |
void |
clearRowMoves()
This will reset the row indexes back to their original values, before any calls to moveRow were made. |
int |
convertRowIndexToModel(int viewRowIndex)
Maps the index of the row in the view at viewRowIndex to the index of the row
in the table model. |
int |
convertRowIndexToView(int modelRowIndex)
Maps the index of the row in the table model at modelRowIndex to the index of the row
in the view. |
int |
getRowCount()
Returns the number of rows in the model. |
int |
getRowMargin()
Returns the width between the cells in each row. |
boolean |
getRowSelectionAllowed()
Returns true if rows may be selected. |
int |
getSelectedRowCount()
Returns the number of selected rows. |
int[] |
getSelectedRows()
Returns an array of indicies of all selected rows. |
javax.swing.ListSelectionModel |
getSelectionModel()
Returns the current selection model. |
void |
moveRow(int rowIndex,
int newIndex)
Moves the row and its header at rowIndex to
newIndex . |
void |
removeRowModelListener(TableRowModelListener x)
Removes a listener for table row model events. |
void |
setRowMargin(int newMargin)
Sets the row margin to newMargin. |
void |
setRowSelectionAllowed(boolean flag)
Sets whether the rows in this model may be selected. |
void |
setSelectionModel(javax.swing.ListSelectionModel newModel)
Sets the selection model. |
Method Detail |
---|
void moveRow(int rowIndex, int newIndex)
rowIndex
to
newIndex
. The old row at rowIndex
will now be found at newIndex
. The row that used
to be at newIndex
is shifted up or down
to make room. This will not move any rows if
rowIndex
equals newIndex
. This method
posts a rowMoved
event to its listeners.
rowIndex
- the index of row to be movednewIndex
- index of the row's new location
java.lang.IllegalArgumentException
- if rowIndex
or
newIndex
are not in the valid rangevoid clearRowMoves()
void setRowMargin(int newMargin)
rowMarginChanged
event to its listeners.
newMargin
- the width, in pixels, of the new row marginsgetRowMargin()
int getRowMargin()
setRowMargin(int)
int getRowCount()
int convertRowIndexToModel(int viewRowIndex)
viewRowIndex
to the index of the row
in the table model. Returns the index of the corresponding
row in the model. If viewRowIndex
is less than zero, returns viewRowIndex
.
viewRowIndex
- the index of the row in the view
convertRowIndexToView(int)
int convertRowIndexToView(int modelRowIndex)
modelRowIndex
to the index of the row
in the view. Returns the index of the
corresponding row in the view; returns -1 if this row is not
being displayed. If modelRowIndex
is less than zero,
returns modelRowIndex
.
modelRowIndex
- the index of the row in the model
convertRowIndexToModel(int)
void setRowSelectionAllowed(boolean flag)
flag
- true if rows may be selected; otherwise falsegetRowSelectionAllowed()
boolean getRowSelectionAllowed()
setRowSelectionAllowed(boolean)
int[] getSelectedRows()
int getSelectedRowCount()
void setSelectionModel(javax.swing.ListSelectionModel newModel)
newModel
- a ListSelectionModel
objectgetSelectionModel()
javax.swing.ListSelectionModel getSelectionModel()
ListSelectionModel
objectsetSelectionModel(javax.swing.ListSelectionModel)
void addRowModelListener(TableRowModelListener x)
x
- a TableRowModelListener
objectvoid removeRowModelListener(TableRowModelListener x)
x
- a TableRowModelListener
object
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |