com.rubecula.spreadsheet
Class Column

java.lang.Object
  |
  +--javax.swing.table.TableColumn
        |
        +--com.rubecula.spreadsheet.Column
All Implemented Interfaces:
java.io.Serializable

public class Column
extends javax.swing.table.TableColumn

Table column class for Spreadsheet. Extends Swing TableColumn by the addition of an attribute map, the reference to which is immutable, although the map itself can be updated as we go.

Version:
$Revision: 1.2 $
Author:
Robin Hillyard
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
Column()
          Cover method, using a default model index of 0, default width of 75, a null renderer and a null editor.
Column(int modelIndex)
          Cover method, using a default width of 75, a null renderer and a null editor.
Column(int modelIndex, int width)
          Cover method, using a null renderer and a null editor.
Column(int modelIndex, int width, javax.swing.table.TableCellRenderer cellRenderer, javax.swing.table.TableCellEditor cellEditor)
          Creates and initializes an instance of TableColumn with modelIndex.
 
Method Summary
 AttrMap getAttributes()
           
 
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

Column

public Column()
Cover method, using a default model index of 0, default width of 75, a null renderer and a null editor. This method is intended for serialization.

See Also:
#TableColumn(int, int, TableCellRenderer, TableCellEditor)

Column

public Column(int modelIndex)
Cover method, using a default width of 75, a null renderer and a null editor.

Parameters:
modelIndex - the column index.
See Also:
#TableColumn(int, int, TableCellRenderer, TableCellEditor)

Column

public Column(int modelIndex,
              int width)
Cover method, using a null renderer and a null editor.

Parameters:
modelIndex - the column index.
width - the width.
See Also:
#TableColumn(int, int, TableCellRenderer, TableCellEditor)

Column

public Column(int modelIndex,
              int width,
              javax.swing.table.TableCellRenderer cellRenderer,
              javax.swing.table.TableCellEditor cellEditor)
Creates and initializes an instance of TableColumn with modelIndex. All TableColumn constructors delegate to this one. The modelIndex is the index of the column in the model which will supply the data for this column in the table. The modelIndex does not change as the columns are reordered in the view. The width parameter is used to set both the preferredWidth for this column and the initial width. The renderer and editor are the objects used respectively to render and edit values in this column. When these are null, default values, provided by the getDefaultRenderer and getDefaultEditor methods in the JTable class are used to provide defaults based on the type of the data in this column. This column-centric rendering strategy can be circumvented by overriding the getCellRenderer methods in the JTable.

Parameters:
modelIndex - the column index.
width - the width.
cellRenderer - the cell renderer.
cellEditor - the cell editor.
See Also:
JTable#getDefaultRenderer(Class), JTable#getDefaultEditor(Class), JTable#getCellRenderer(int, int), JTable#getCellEditor(int, int)
Method Detail

getAttributes

public AttrMap getAttributes()