class org.aswing.table.DefaultTableColumnModel
Interfaces | |||
TableColumnModel |
|
The standard column-handler for a JTable
.
Instance Fields
function addColumn(aColumn:TableColumn): Void
Appends aColumn
to the end of the
tableColumns
array.
This method also posts the columnAdded
event to its listeners.
aColumn | the |
See Also
- this.removeColumn()
function getColumn(columnIndex:Int): TableColumn
Returns the TableColumn
object for the column
at columnIndex
.
columnIndex | the index of the column desired |
returns | the |
function getColumnCount(): Int
Returns the number of columns in the tableColumns
array.
returns | the number of columns in the |
See Also
- this.getColumns()
function getColumnIndex(identifier:Dynamic): Int
Returns the index of the first column in the tableColumns
array whose identifier is equal to identifier
,
when compared using equals
.
identifier | the identifier object |
returns | the index of the first column in the
|
See Also
- this.getColumn()
function getColumnIndexAtX(x:Int): Int
Returns the index of the column that lies at position x
,
or -1 if no column covers this point.
In keeping with Swing's separable model architecture, a
TableColumnModel does not know how the table columns actually appear on
screen. The visual presentation of the columns is the responsibility
of the view/controller object using this model (typically JTable). The
view/controller need not display the columns sequentially from left to
right. For example, columns could be displayed from right to left to
accomodate a locale preference or some columns might be hidden at the
request of the user. Because the model does not know how the columns
are laid out on screen, the given xPosition
should not be
considered to be a coordinate in 2D graphics space. Instead, it should
be considered to be a width from the start of the first column in the
model. If the column index for a given X coordinate in 2D space is
required, JTable.columnAtPoint
can be used instead.
x | the horizontal location of interest |
returns | the index of the column or -1 if no column is found |
See Also
- org.aswing.JTable.columnAtPoint()
function getColumnMargin(): Int
Returns the width margin for TableColumn
.
The default columnMargin
is 1.
returns | the maximum width for the |
See Also
- this.setColumnMargin()
function getColumnSelectionAllowed(): Bool
Returns true if column selection is allowed, otherwise false. The default is false.
returns | the |
function getColumns(): Array<Dynamic>
function getSelectedColumnCount(): Int
Returns the number of columns selected.
returns | the number of columns selected |
function getSelectedColumns(): Array<Dynamic>
function getSelectionModel(): ListSelectionModel
Returns the ListSelectionModel
that is used to
maintain column selection state.
returns | the object that provides column selection state. Or
|
See Also
- this.setSelectionModel()
function getTotalColumnWidth(): Int
Returns the total combined width of all columns.
returns | the |
function moveColumn(columnIndex:Int, newIndex:Int): Void
Moves the column and heading at columnIndex
to
newIndex
. The old column at columnIndex
will now be found at newIndex
. The column
that used to be at newIndex
is shifted
left or right to make room. This will not move any columns if
columnIndex
equals newIndex
. This method
also posts a columnMoved
event to its listeners.
columnIndex | the index of column to be moved |
newIndex | new index to move the column |
function removeColumn(column:TableColumn): Void
Deletes the column
from the
tableColumns
array. This method will do nothing if
column
is not in the table's columns list.
tile
is called
to resize both the header and table views.
This method also posts a columnRemoved
event to its listeners.
column | the |
See Also
- this.addColumn()
function setColumnMargin(newMargin:Int): Void
Sets the column margin to newMargin
. This method
also posts a columnMarginChanged
event to its
listeners.
newMargin | the new margin width, in pixels |
See Also
- this.getColumnMargin()
- this.getTotalColumnWidth()
function setColumnSelectionAllowed(flag:Bool): Void
Sets whether column selection is allowed. The default is false.
flag | true if column selection will be allowed, false otherwise |
function setSelectionModel(newModel:ListSelectionModel): Void
Sets the selection model for this TableColumnModel
to newModel
and registers for listener notifications from the new selection
model. If newModel
is null
,
nothing will be changed.
newModel | the new selection model |
See Also
- this.getSelectionModel()