|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.jdesktop.swingx.table.ColumnHeaderRenderer
public class ColumnHeaderRenderer
Header renderer class which renders column sort feedback (arrows).
Additionally, it allows to customize renderer properties like Font,
Alignment and similar. This part needs to go somewhere else
when we switch to Mustang.
Note: #169-jdnc, #193-swingx - Header doesn't look right in winXP/mac seem - to be fixed, but could be brittle. Won't do more about it, Mustang will take care once SwingLabs is switched over to 1.6.
| Nested 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.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
DOWN_ICON_KEY
|
static String |
METAL_BORDER_HACK
|
static String |
UP_ICON_KEY
|
static String |
VISTA_BORDER_HACK
|
| 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 | |
|---|---|
ColumnHeaderRenderer()
|
|
ColumnHeaderRenderer(JTableHeader header)
|
|
| Method Summary | |
|---|---|
protected void |
adjustComponentOrientation(Component stamp)
Adjusts the Component's orientation to JXTable's CO if appropriate. |
static ColumnHeaderRenderer |
createColumnHeaderRenderer()
|
boolean |
getAntiAliasedText()
|
Color |
getBackground()
Gets the background color of this component. |
TableCellRenderer |
getDelegateRenderer()
|
Icon |
getDownIcon()
|
Font |
getFont()
Gets the font of this component. |
Color |
getForeground()
Gets the foreground color of this component. |
int |
getHorizontalAlignment()
|
int |
getHorizontalTextPosition()
|
Icon |
getIcon()
|
int |
getIconTextGap()
|
static TableCellRenderer |
getSharedInstance()
Returns the shared ColumnHeaderRenderer. |
Component |
getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int rowIndex,
int columnIndex)
Returns the component used for drawing the cell. |
Icon |
getUpIcon()
|
int |
getVerticalAlignment()
|
int |
getVerticalTextPosition()
|
void |
setAntiAliasedText(boolean antiAlias)
|
void |
setBackground(Color background)
Sets the background color of this component. |
void |
setDownIcon(Icon icon)
|
void |
setFont(Font font)
Sets the font for this component. |
void |
setForeground(Color foreground)
Sets the foreground color of this component. |
void |
setHorizontalAlignment(int alignment)
|
void |
setHorizontalTextPosition(int textPosition)
|
void |
setIcon(Icon icon)
|
void |
setIconTextGap(int iconTextGap)
|
void |
setUpIcon(Icon icon)
|
void |
setVerticalAlignment(int alignment)
|
void |
setVerticalTextPosition(int textPosition)
|
void |
updateUI()
Resets the UI property to a value from the current look and feel. |
void |
updateUI(JTableHeader header)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String UP_ICON_KEY
public static final String DOWN_ICON_KEY
public static final String VISTA_BORDER_HACK
public static final String METAL_BORDER_HACK
| Constructor Detail |
|---|
public ColumnHeaderRenderer()
public ColumnHeaderRenderer(JTableHeader header)
| Method Detail |
|---|
public static TableCellRenderer getSharedInstance()
public static ColumnHeaderRenderer createColumnHeaderRenderer()
ColumnHeaderRenderer
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int rowIndex,
int columnIndex)
javax.swing.table.TableCellRenderer
getTableCellRendererComponent in interface TableCellRenderertable - the JTable that is asking the
renderer to draw; can be nullvalue - the value of the cell to be rendered. It is
up to the specific renderer to interpret
and draw the value. For example, if
value
is the string "true", it could be rendered as a
string or it could be rendered as a check
box that is checked. null is a
valid valueisSelected - true if the cell is to be rendered with the
selection highlighted; otherwise falsehasFocus - if true, render cell appropriately. For
example, put a special border on the cell, if
the cell can be edited, render in the color used
to indicate editingrowIndex - the row index of the cell being drawn. When
drawing the header, the value of
row is -1columnIndex - the column index of the cell being drawnprotected void adjustComponentOrientation(Component stamp)
stamp - the component to adjust.public void setAntiAliasedText(boolean antiAlias)
public boolean getAntiAliasedText()
public void setBackground(Color background)
javax.swing.JComponent
setBackground in class JComponentbackground - the desired background ColorComponent.getBackground()public Color getBackground()
java.awt.Component
getBackground in class ComponentComponent.setBackground(java.awt.Color)public void setForeground(Color foreground)
javax.swing.JComponent
setForeground in class JComponentforeground - the desired foreground ColorComponent.getForeground()public Color getForeground()
java.awt.Component
getForeground in class ComponentComponent.setForeground(java.awt.Color)public void setFont(Font font)
javax.swing.JComponent
setFont in class JComponentfont - the desired Font for this componentComponent.getFont()public Font getFont()
java.awt.Component
getFont in interface MenuContainergetFont in class ComponentComponent.setFont(java.awt.Font)public void setDownIcon(Icon icon)
public Icon getDownIcon()
public void setUpIcon(Icon icon)
public Icon getUpIcon()
public void setHorizontalAlignment(int alignment)
public int getHorizontalAlignment()
public void setHorizontalTextPosition(int textPosition)
public int getHorizontalTextPosition()
public void setIcon(Icon icon)
public Icon getIcon()
public void setIconTextGap(int iconTextGap)
public int getIconTextGap()
public void setVerticalAlignment(int alignment)
public int getVerticalAlignment()
public void setVerticalTextPosition(int textPosition)
public int getVerticalTextPosition()
public TableCellRenderer getDelegateRenderer()
public void updateUI()
javax.swing.JComponentJComponent subclasses must override this method
like this:
public void updateUI() {
setUI((SliderUI)UIManager.getUI(this);
}
updateUI in class JComponentJComponent.setUI(javax.swing.plaf.ComponentUI),
UIManager.getLookAndFeel(),
UIManager.getUI(javax.swing.JComponent)public void updateUI(JTableHeader header)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||