All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.table.JTableHeader

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.table.JTableHeader

public class JTableHeader
extends JComponent
implements TableColumnModelListener

Variable Index

 o columnModel
The TableColumnModel of the table header
 o draggedColumn
The index of the column being dragged.
 o draggedDistance
The distance from its original position the column has been dragged
 o reorderingAllowed
Reordering of columns are allowed by the user
 o resizingAllowed
Resizing of columns are allowed by the user
 o resizingColumn
The index of the column being resized.
 o table
 o updateTableInRealTime
If this flag is true, then the header will repaint the table as a column is dragged or resized.

Constructor Index

 o JTableHeader(TableColumnModel)

Method Index

 o columnAdded(TableColumnModelEvent)
 o columnMarginChanged(ChangeEvent)
 o columnMoved(TableColumnModelEvent)
 o columnRemoved(TableColumnModelEvent)
 o columnSelectionChanged(ListSelectionEvent)
 o getColumnModel()
 o getDraggedColumn()
Returns the index of the dragged column, if and only if a drag is in process.
 o getDraggedDistance()
Returns the column's horizontal distance from its original position, if and only if a drag is in process.
 o getReorderingAllowed()
Returns true if the receiver allows the user to rearrange columns by dragging their headers, false otherwise.
 o getResizingAllowed()
Returns true if the receiver allows the user to resize columns by dragging between their headers, false otherwise.
 o getResizingColumn()
Returns the index of the resizing column.
 o getTable()
 o getUI()
 o getUpdateTableInRealTime()
Returns true if the receiver updates the body of the table view in real time when a column is resized or dragged.
 o resizeAndRepaint()
Properly sizes the receiver and its header view, and marks it as needing display.
 o setColumnModel(TableColumnModel)
Sets the column model for this table to newModel and registers with for listner notifications from the new column model.
 o setDraggedColumn(int)
Sets the header's draggedColumn to columnIndex
 o setDraggedDistance(int)
Sets the header's draggedDistance to distance
 o setReorderingAllowed(boolean)
Sets whether the user can drag column headers to reorder columns.
 o setResizingAllowed(boolean)
Sets whether the user can resize columns by dragging between headers.
 o setResizingColumn(int)
Sets the header's resizingColumn to columnIndex
 o setUI(TableHeaderUI)
 o setUpdateTableInRealTime(boolean)
Sets whether the body of the table updates in real time when a column is resized or dragged.
 o updateUI()
Notification from the UIFactory that the L&F has changed.

Variables

 o table
 protected JTable table
 o columnModel
 protected TableColumnModel columnModel
The TableColumnModel of the table header

 o reorderingAllowed
 protected boolean reorderingAllowed
Reordering of columns are allowed by the user

 o resizingAllowed
 protected boolean resizingAllowed
Resizing of columns are allowed by the user

 o resizingColumn
 protected int resizingColumn
The index of the column being resized. 0 if not resizing

 o draggedColumn
 protected int draggedColumn
The index of the column being dragged. 0 if not dragging

 o draggedDistance
 protected int draggedDistance
The distance from its original position the column has been dragged

 o updateTableInRealTime
 protected boolean updateTableInRealTime
If this flag is true, then the header will repaint the table as a column is dragged or resized.

Constructors

 o JTableHeader
 public JTableHeader(TableColumnModel cm)

Methods

 o getTable
 public JTable getTable()
 o setReorderingAllowed
 public void setReorderingAllowed(boolean b)
Sets whether the user can drag column headers to reorder columns.

Parameters:
flag - true if the table view should allow reordering
See Also:
getReorderingAllowed
 o getReorderingAllowed
 public boolean getReorderingAllowed()
Returns true if the receiver allows the user to rearrange columns by dragging their headers, false otherwise. The default is true. You can rearrange columns programmatically regardless of this setting.

Returns:
true if the receiver allows the user to rearrange columns by dragging their headers, false otherwise
See Also:
setReorderingAllowed
 o setResizingAllowed
 public void setResizingAllowed(boolean b)
Sets whether the user can resize columns by dragging between headers.

Parameters:
flag - true if table view should allow resizing
See Also:
getResizingAllowed
 o getResizingAllowed
 public boolean getResizingAllowed()
Returns true if the receiver allows the user to resize columns by dragging between their headers, false otherwise. The default is true. You can resize columns programmatically regardless of this setting.

Returns:
true if the receiver allows the user to resize columns by dragging between their headers, false otherwise.
See Also:
setResizingAllowed
 o getDraggedColumn
 public int getDraggedColumn()
Returns the index of the dragged column, if and only if a drag is in process.

Returns:
the index of the dragged column, if and only if a drag is in process, otherwise returns -1
See Also:
getDraggedDistance
 o getDraggedDistance
 public int getDraggedDistance()
Returns the column's horizontal distance from its original position, if and only if a drag is in process. Otherwise, the the return value is meaningless.

Returns:
the column's horizontal distance from its original position, if and only if a drag is in process
See Also:
getDraggedColumn
 o getResizingColumn
 public int getResizingColumn()
Returns the index of the resizing column. If no column is being resized this method returns -1.

Returns:
the index of the resizing column
 o setUpdateTableInRealTime
 public void setUpdateTableInRealTime(boolean flag)
Sets whether the body of the table updates in real time when a column is resized or dragged.

Parameters:
flag - true if tableView should update the body of the table in real time
See Also:
getUpdateTableInRealTime
 o getUpdateTableInRealTime
 public boolean getUpdateTableInRealTime()
Returns true if the receiver updates the body of the table view in real time when a column is resized or dragged. User can set this flag to false to speed up the table's response to user resize or drag actions. The default is true.

Returns:
true if the table updates in real time
See Also:
setUpdateTableInRealTime
 o getUI
 public TableHeaderUI getUI()
 o setUI
 public void setUI(TableHeaderUI ui)
 o updateUI
 public void updateUI()
Notification from the UIFactory that the L&F has changed.

Overrides:
updateUI in class JComponent
 o setColumnModel
 public void setColumnModel(TableColumnModel newModel)
Sets the column model for this table to newModel and registers with for listner notifications from the new column model.

Parameters:
newModel - the new data source for this table
Throws: IllegalArgumentException
if newModel is null
See Also:
getColumnModel
 o getColumnModel
 public TableColumnModel getColumnModel()
 o columnAdded
 public void columnAdded(TableColumnModelEvent e)
 o columnRemoved
 public void columnRemoved(TableColumnModelEvent e)
 o columnMoved
 public void columnMoved(TableColumnModelEvent e)
 o columnMarginChanged
 public void columnMarginChanged(ChangeEvent e)
 o columnSelectionChanged
 public void columnSelectionChanged(ListSelectionEvent e)
 o resizeAndRepaint
 public void resizeAndRepaint()
Properly sizes the receiver and its header view, and marks it as needing display. Also resets cursor rectangles for the header view and line scroll amounts for the JScrollPane.

 o setDraggedColumn
 public void setDraggedColumn(int columnIndex)
Sets the header's draggedColumn to columnIndex

 o setDraggedDistance
 public void setDraggedDistance(int distance)
Sets the header's draggedDistance to distance

 o setResizingColumn
 public void setResizingColumn(int columnIndex)
Sets the header's resizingColumn to columnIndex


All Packages  Class Hierarchy  This Package  Previous  Next  Index