|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent com.levigo.util.swing.table.JTableRowHeader
public class JTableRowHeader
This is the object which manages the header of the JTable
.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.
JTable
,
Serialized FormNested Class Summary |
---|
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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected boolean |
resizingAllowed
If true, resizing of rows are allowed by the user; the default is true. |
protected JTable |
table
The table for which this object is the header; the default is null . |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
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 | |
---|---|
JTableRowHeader()
Constructs a JTableHeader with a default
TablerowModel . |
Method Summary | |
---|---|
protected TableCellRenderer |
createDefaultRenderer()
Returns a default renderer to be used when no header renderer is defined by a TableColumn . |
int |
getCellHeight()
|
TableCellRenderer |
getDefaultRenderer()
Returns the default renderer used when no headerRenderer
is defined by a TableColumn . |
Rectangle |
getHeaderRect(int row)
Returns the rectangle containing the header tile at row . |
boolean |
getResizingAllowed()
Returns true if the user is allowed to resize columns by dragging between their headers, false otherwise. |
JTable |
getTable()
Returns the table associated with this header. |
TableModel |
getTableModel()
Returns the table model associated with this header. |
String |
getToolTipText(MouseEvent event)
Allows the renderer's tips to be used if there is text set. |
TableHeaderUI |
getUI()
Returns the look and feel (L&F) object that renders this component. |
String |
getUIClassID()
Returns the suffix used to construct the name of the look and feel (L&F) class used to render this component. |
protected void |
initializeLocalVars()
Initializes the local variables and properties with default values. |
protected String |
paramString()
Returns a string representation of this JTableHeader . |
void |
resizeAndRepaint()
Sizes the header and marks it as needing display. |
int |
rowAtPoint(Point point)
Returns the index of the row that point lies in, or -1 if it
lies out of bounds. |
void |
setDefaultRenderer(TableCellRenderer defaultRenderer)
Sets the default renderer to be used when no headerRenderer
is defined by a TabelColumn . |
void |
setResizingAllowed(boolean resizingAllowed)
Sets whether the user can resize rows by dragging between headers. |
void |
setTable(JTable table)
Sets the table associated with this header. |
void |
setUI(TableHeaderUI ui)
Sets the look and feel (L&F) object that renders this component. |
void |
updateUI()
Notification from the UIManager that the look and feel (L&F) has changed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean resizingAllowed
protected JTable table
null
.
Constructor Detail |
---|
public JTableRowHeader()
JTableHeader
with a default
TablerowModel
.
Method Detail |
---|
public void setTable(JTable table)
table
- the new tablepublic TableModel getTableModel()
TableModel
propertypublic void setResizingAllowed(boolean resizingAllowed)
resizingAllowed
- true if table view should allow
resizinggetResizingAllowed()
public void setDefaultRenderer(TableCellRenderer defaultRenderer)
headerRenderer
is defined by a TabelColumn
.
defaultRenderer
- the default rendererpublic TableCellRenderer getDefaultRenderer()
headerRenderer
is defined by a TableColumn
.
public int getCellHeight()
public int rowAtPoint(Point point)
point
lies in, or -1 if it
lies out of bounds.
point
lies in, or -1 if it
lies out of boundspublic Rectangle getHeaderRect(int row)
row
.
When the row
parameter is out of bounds this method uses the
same conventions as the JTable
method getCellRect
.
row
JTable.getCellRect(int, int, boolean)
public String getToolTipText(MouseEvent event)
getToolTipText
in class JComponent
event
- the location of the event identifies the proper
renderer and, therefore, the proper tip
public TableHeaderUI getUI()
TableHeaderUI
object that renders this componentpublic void setUI(TableHeaderUI ui)
ui
- the TableHeaderUI
L&F objectUIDefaults.getUI(javax.swing.JComponent)
public void updateUI()
UIManager
that the look and feel (L&F) has changed.
Replaces the current UI object with the latest version from the UIManager
.
updateUI
in class JComponent
JComponent.updateUI()
public String getUIClassID()
getUIClassID
in class JComponent
JComponent.getUIClassID()
,
UIDefaults.getUI(javax.swing.JComponent)
protected TableCellRenderer createDefaultRenderer()
TableColumn
.
protected void initializeLocalVars()
public void resizeAndRepaint()
revalidate
followed by repaint
.
protected String paramString()
JTableHeader
. This method
is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not
be null
.
Overriding paramString
to provide information about the
specific new aspects of the JFC components.
paramString
in class JComponent
JTableHeader
public JTable getTable()
table
propertypublic boolean getResizingAllowed()
resizingAllowed
propertysetResizingAllowed(boolean)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |