Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.table.JTableHeader
Nested Class Summary | |
protected class |
Nested classes/interfaces inherited from class javax.swing.JComponent | |
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container | |
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component | |
Component.AccessibleAWTComponent , Component.BltBufferStrategy , Component.FlipBufferStrategy |
Field Summary | |
protected TableColumnModel |
|
protected TableColumn |
|
protected int |
|
protected boolean |
|
protected boolean |
|
protected TableColumn |
|
protected JTable |
|
protected boolean |
|
Fields inherited from class javax.swing.JComponent | |
TOOL_TIP_TEXT_KEY , UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW , accessibleContext , listenerList , ui |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver | |
ABORT , ALLBITS , ERROR , FRAMEBITS , HEIGHT , PROPERTIES , SOMEBITS , WIDTH |
Constructor Summary | |
| |
|
Method Summary | |
void |
|
int |
|
void |
|
void |
|
void |
|
void |
|
protected TableColumnModel |
|
protected TableCellRenderer |
|
AccessibleContext |
|
TableColumnModel |
|
TableCellRenderer |
|
TableColumn |
|
int |
|
Rectangle |
|
boolean |
|
boolean |
|
TableColumn |
|
JTable |
|
TableHeaderUI |
|
String | |
boolean |
|
protected void |
|
boolean | |
protected String |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void | |
void | |
void |
|
void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public JTableHeader(TableColumnModel cm)
Creates a new header. Ifcm
isnull
, a new table column model is created by callingcreateDefaultColumnModel()
.
- Parameters:
cm
- the table column model (null
permitted).
public void columnAdded(TableColumnModelEvent event)
Receives notification when a column is added to the column model.
- Specified by:
- columnAdded in interface TableColumnModelListener
- Parameters:
event
- the table column model event
public int columnAtPoint(Point point)
Returns the index of the column at the specified point.
- Parameters:
point
- the point.
- Returns:
- The column index, or -1.
public void columnMarginChanged(ChangeEvent event)
Receives notification when a column margin changes in the column model.
- Specified by:
- columnMarginChanged in interface TableColumnModelListener
- Parameters:
event
- the table column model event
public void columnMoved(TableColumnModelEvent event)
Receives notification when a column is moved within the column model.
- Specified by:
- columnMoved in interface TableColumnModelListener
- Parameters:
event
- the table column model event
public void columnRemoved(TableColumnModelEvent event)
Receives notification when a column is removed from the column model.
- Specified by:
- columnRemoved in interface TableColumnModelListener
- Parameters:
event
- the table column model event
public void columnSelectionChanged(ListSelectionEvent event)
Receives notification when the column selection has changed.
- Specified by:
- columnSelectionChanged in interface TableColumnModelListener
- Parameters:
event
- the table column model event
protected TableColumnModel createDefaultColumnModel()
Creates a default table column model.
- Returns:
- A default table column model.
protected TableCellRenderer createDefaultRenderer()
Creates a default renderer.
- Returns:
- A default renderer.
public AccessibleContext getAccessibleContext()
Get the value of theJComponent.accessibleContext
property.
- Specified by:
- getAccessibleContext in interface Accessible
- Overrides:
- getAccessibleContext in interface JComponent
- Returns:
- The current value of the property
public TableColumnModel getColumnModel()
Get the value of thecolumnModel
property.
- Returns:
- The current value of the property
public TableCellRenderer getDefaultRenderer()
Returns the default table cell renderer.
- Returns:
- The default table cell renderer.
public TableColumn getDraggedColumn()
Get the column that is currently being dragged. This is used when handling the column reordering with mouse.
- Returns:
- the column being dragged, null if none.
public int getDraggedDistance()
Get the value of thedraggedDistance
property.
- Returns:
- The current value of the property
public Rectangle getHeaderRect(int column)
Get the rectangle, occupied by the header of the given column.
- Parameters:
column
- the column, for that the header area is requested.
- Returns:
- the column header area.
public boolean getReorderingAllowed()
Check if it is possible to reorder the table columns by dragging column header with mouse. The table reordering is enabled by default, but can be disabled withsetReorderingAllowed(boolean)
.
- Returns:
- true if reordering is allowed, false otherwise.
public boolean getResizingAllowed()
Check if it is possible to resize the table columns by dragging the column boundary in the table header with mouse. The resizing is enabled by default, but can be disabled withsetResizingAllowed(boolean)
.
- Returns:
- true if resizing is allowed, false otherwise.
public TableColumn getResizingColumn()
Get the column that is currently being resized. This is used when handling the column resizing with mouse.
- Returns:
- the column being currently resized, null if none.
public JTable getTable()
Get the table, having this header.
- Returns:
- the table, having this header.
public boolean getUpdateTableInRealTime()
Get the value of theupdateTableInRealTime
property.
- Returns:
- The current value of the property
protected void initializeLocalVars()
Initializes the fields and properties of this class with default values. This is called by the constructors.
public boolean isOpaque()
Get the value of theopaque
property.
- Overrides:
- isOpaque in interface JComponent
- Returns:
- The current value of the property
protected String paramString()
Returns a debugging string representing this component. The string may be empty but not null.
- Overrides:
- paramString in interface JComponent
- Returns:
- a string representing this component
public void resizeAndRepaint()
Validates the layout of this table header and repaints it. This is equivalent torevalidate()
followed byrepaint()
.
public void setColumnModel(TableColumnModel c)
Set the value of thecolumnModel
property.
- Parameters:
c
- The new value of the property
public void setDefaultRenderer(TableCellRenderer cellRenderer)
Sets the default table cell renderer.
- Parameters:
cellRenderer
- the renderer.
public void setDraggedColumn(TableColumn draggingIt)
Set the column that is currently being dragged. This is used when dragging the column with mouse. Setting to null will stop the dragging session immediately.
- Parameters:
draggingIt
- the column being currently dragged, null if none.
public void setDraggedDistance(int d)
Set the value of thedraggedDistance
property.
- Parameters:
d
- The new value of the property
public void setOpaque(boolean o)
Set the value of theopaque
property.
- Overrides:
- setOpaque in interface JComponent
- Parameters:
o
- The new value of the property
public void setReorderingAllowed(boolean allowed)
Set the table ability to reorder columns by dragging column header with mouse. The table reordering is enabled by default, but can be disabled with this method.
- Parameters:
allowed
- true if reordering is allowed, false otherwise.
public void setResizingAllowed(boolean allowed)
Set the table ability to resize columns by dragging the column boundary in the table header with mouse. The resizing is enabled by default, but can be disabled using this method.
- Parameters:
allowed
- true if resizing is allowed, false otherwise.
public void setResizingColumn(TableColumn resizingIt)
The the column that is currently being resized. This property is used when handling table resizing with mouse. Setting to null would stop the resizing session immediately.
- Parameters:
resizingIt
- the column being currently resized
public void setTable(JTable t)
Set the value of thetable
property.
- Parameters:
t
- The new value of the property
public void setUpdateTableInRealTime(boolean u)
Set the value of theupdateTableInRealTime
property.
- Parameters:
u
- The new value of the property