uk.ac.starlink.table.gui
Class StarTableColumn

java.lang.Object
  extended by javax.swing.table.TableColumn
      extended by uk.ac.starlink.table.gui.StarTableColumn
All Implemented Interfaces:
java.io.Serializable

public class StarTableColumn
extends javax.swing.table.TableColumn

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.

See Also:
Serialized Form

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
StarTableColumn(ColumnInfo colinfo)
          Constructs a StarTableColumn from a ColumnInfo object using a default model index of 0.
StarTableColumn(ColumnInfo colinfo, int modelIndex)
          Constructs a StarTableColumn from a ColumnInfo object with a given model index.
 
Method Summary
static javax.swing.table.TableCellEditor createCellEditor(ValueInfo info)
          Utility method to create a table cell editor suitable for a given value info.
static javax.swing.table.TableCellRenderer createCellRenderer(ValueInfo info)
          Utility method to create a table cell renderer suitable for a given value info.
 ColumnInfo getColumnInfo()
          Returns the ColumnInfo object 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StarTableColumn

public StarTableColumn(ColumnInfo colinfo,
                       int modelIndex)
Constructs a StarTableColumn from a ColumnInfo object with a given model index.

Parameters:
colinfo - the ColumnInfo object which supplies the characteristics of this column
modelIndex - the index of the column in the TableModel which will be displayed by this column

StarTableColumn

public StarTableColumn(ColumnInfo colinfo)
Constructs a StarTableColumn from a ColumnInfo object using a default model index of 0.

Parameters:
colinfo - the ColumnInfo object which supplies the characteristics of this column
Method Detail

getColumnInfo

public ColumnInfo getColumnInfo()
Returns the ColumnInfo object associated with this column.

Returns:
the metadata for this column

createCellRenderer

public static javax.swing.table.TableCellRenderer createCellRenderer(ValueInfo info)
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

public static javax.swing.table.TableCellEditor createCellEditor(ValueInfo info)
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

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.