Package uk.ac.starlink.table.gui
Class StarTableColumn
java.lang.Object
javax.swing.table.TableColumn
uk.ac.starlink.table.gui.StarTableColumn
- All Implemented Interfaces:
Serializable
A
TableColumn representing a column
in a StarJTable.
This simple extension to TableColumn provides a constructor
and an accessor which reference the
ColumnInfo object
associated with a table column. The renderers and column headings etc
used by this column are based by default on the characteristics of
the associated ColumnInfo.- Author:
- Mark Taylor (Starlink)
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.TableColumn
CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, COLUMN_WIDTH_PROPERTY, HEADER_RENDERER_PROPERTY, HEADER_VALUE_PROPERTY, headerRenderer, headerValue, identifier, isResizable, maxWidth, minWidth, modelIndex, resizedPostingDisableCount, width -
Constructor Summary
ConstructorsConstructorDescriptionStarTableColumn(ColumnInfo colinfo) Constructs aStarTableColumnfrom aColumnInfoobject using a default model index of 0.StarTableColumn(ColumnInfo colinfo, int modelIndex) Constructs aStarTableColumnfrom aColumnInfoobject with a given model index. -
Method Summary
Modifier and TypeMethodDescriptionstatic TableCellEditorcreateCellEditor(ValueInfo info) Utility method to create a table cell editor suitable for a given value info.static TableCellRenderercreateCellRenderer(ValueInfo info) Utility method to create a table cell renderer suitable for a given value info.Returns theColumnInfoobject associated with this column.Methods inherited from class javax.swing.table.TableColumn
addPropertyChangeListener, createDefaultHeaderRenderer, disableResizedPosting, enableResizedPosting, getCellEditor, getCellRenderer, getHeaderRenderer, getHeaderValue, getIdentifier, getMaxWidth, getMinWidth, getModelIndex, getPreferredWidth, getPropertyChangeListeners, getResizable, getWidth, removePropertyChangeListener, setCellEditor, setCellRenderer, setHeaderRenderer, setHeaderValue, setIdentifier, setMaxWidth, setMinWidth, setModelIndex, setPreferredWidth, setResizable, setWidth, sizeWidthToFit
-
Constructor Details
-
StarTableColumn
Constructs aStarTableColumnfrom aColumnInfoobject with a given model index.- Parameters:
colinfo- theColumnInfoobject which supplies the characteristics of this columnmodelIndex- the index of the column in theTableModelwhich will be displayed by this column
-
StarTableColumn
Constructs aStarTableColumnfrom aColumnInfoobject using a default model index of 0.- Parameters:
colinfo- theColumnInfoobject which supplies the characteristics of this column
-
-
Method Details
-
getColumnInfo
Returns theColumnInfoobject associated with this column.- Returns:
- the metadata for this column
-
createCellRenderer
Utility method to create a table cell renderer suitable for a given value info. This is used in StarTableColumn's constructor.- Parameters:
info- metadata describing table cell contents- Returns:
- cell renderer
-
createCellEditor
Utility method to create a table cell editor suitable for a given value info. This is used in StarTableColumn's constructor.- Parameters:
info- metadata describing table cell contents- Returns:
- cell renderer
-