|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
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
javax.swing.JLabel
javax.swing.table.DefaultTableCellRenderer
com.citra.renderers.DefaultRenderer
com.citra.renderers.DefaultTreeTableRenderer
public class DefaultTreeTableRenderer
DefaultTreeTableRenderer is the default renderer for the aggregate rows of
a TreeTable
.
This class wraps around a DefaultRenderer object passed as an argument in the constructor,
by having the getTableCellRendererComponent method return this renderer.
This class affects only FooterRow objects. In fact, if a cell is part of a footer row, it's text is changed to BOLD and its background and foreground color are set by calling the getLevelBackGround and getLevelForeground method respectively.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.table.DefaultTableCellRenderer |
---|
DefaultTableCellRenderer.UIResource |
Nested classes/interfaces inherited from class javax.swing.JLabel |
---|
JLabel.AccessibleJLabel |
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 Color |
defaultLevelBackground
the default background color for aggregate rows |
protected Color |
defaultLevelForeground
the default foreground color for aggregate rows |
protected DefaultRenderer |
defaultRenderer
the renderer contained in this DefaultAggregateRenderer |
Fields inherited from class com.citra.renderers.DefaultRenderer |
---|
evenColor, oddColor, space, spacing |
Fields inherited from class javax.swing.table.DefaultTableCellRenderer |
---|
noFocusBorder |
Fields inherited from class javax.swing.JLabel |
---|
labelFor |
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 javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DefaultTreeTableRenderer(DefaultRenderer defaultRenderer)
Constructs a DefaultAggregateRenderer. |
Method Summary | |
---|---|
Color |
getDefaultLevelBackground()
Return the default background color for aggregate rows |
Color |
getDefaultLevelForeground()
Return the default foreground color for aggregate rows |
DefaultRenderer |
getDefaultRenderer()
Return the renderer this DefaultAggregateRenderer instance is associated with. |
Color |
getLevelBackGround(int groupLevel,
int row,
int column)
Returns a color to be set as the background color of the cell at (row, column), depending on the level of the TreeTableRow . |
Color |
getLevelForeground(int groupLevel,
int row,
int column)
Returns a color to be set as the foreground color of the cell at (row, column), depending on the level of the TreeTableRow . |
Component |
getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
Returns the component used for drawing the cell. |
void |
setDefaultLevelBackground(Color newDefaultLevelBackground)
Sets the default background color for aggregate rows. |
void |
setDefaultLevelForeground(Color newDefaultLevelForeground)
Sets the default foreground color for aggregate rows. |
void |
setDefaultRenderer(DefaultRenderer newDefaultRenderer)
Sets a new DefaultRenderer object. |
void |
setEvenColor(Color evenColor)
Sets the color for painting the even rows of the table. |
void |
setOddColor(Color oddColor)
Sets the color for painting the odd rows of the table. |
void |
setSpaces(int numSpaces)
Sets the number of spaces to add at the end of each cell. |
void |
setSpacing(boolean spacing)
Tells the renderer whether to add spaces at the end of each cell. |
Methods inherited from class com.citra.renderers.DefaultRenderer |
---|
getEvenColor, getOddColor, getSpacing, setText |
Methods inherited from class javax.swing.table.DefaultTableCellRenderer |
---|
firePropertyChange, firePropertyChange, isOpaque, repaint, repaint, revalidate, setBackground, setForeground, setValue, updateUI, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected DefaultRenderer defaultRenderer
protected Color defaultLevelBackground
protected Color defaultLevelForeground
Constructor Detail |
---|
public DefaultTreeTableRenderer(DefaultRenderer defaultRenderer)
Method Detail |
---|
public Color getDefaultLevelBackground()
public Color getDefaultLevelForeground()
public DefaultRenderer getDefaultRenderer()
public Color getLevelBackGround(int groupLevel, int row, int column)
TreeTableRow
. By default, this method calls getDefaultLevelBackground(). Override it to implement a different behaviour.
groupLevel
- the level of the TreeTableRowrow
- the current rowcolumn
- the current column
public Color getLevelForeground(int groupLevel, int row, int column)
TreeTableRow
. By default, this method calls getDefaultLevelForeground(). Override it to implement a different behaviour.
groupLevel
- the level of the TreeTableRowrow
- the current rowcolumn
- the current column
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
getTableCellRendererComponent
in interface TableCellRenderer
getTableCellRendererComponent
in class DefaultRenderer
table
- the JTable
value
- the value to assign to the cell at
[row, column]
isSelected
- true if cell is selectedhasFocus
- true if cell has focusrow
- the row of the cell to rendercolumn
- the column of the cell to render
public void setDefaultLevelBackground(Color newDefaultLevelBackground)
newDefaultLevelBackground
- the new background colorpublic void setDefaultLevelForeground(Color newDefaultLevelForeground)
newDefaultLevelForeground
- the new foreground colorpublic void setDefaultRenderer(DefaultRenderer newDefaultRenderer)
newDefaultRenderer
- the renderer to setpublic void setEvenColor(Color evenColor)
setEvenColor
in class DefaultRenderer
evenColor
- the even row colorpublic void setOddColor(Color oddColor)
setOddColor
in class DefaultRenderer
oddColor
- the odd row colorpublic void setSpaces(int numSpaces)
setSpaces
in class DefaultRenderer
numSpaces
- the number of spaces.public void setSpacing(boolean spacing)
setSpacing
in class DefaultRenderer
spacing
- true if spacing is used
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |