|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jcreme.swing.table.colormodel.DefaultTableColorModel
org.jcreme.swing.table.colormodel.LineTitlesColorModel
This class enables to give cycling colors to a Table. The cycle can have any length desired and can contain any number of colors. An obvious use of this ColorModel is to have a different color for every two or three lines to ease the reading of the Table. This ColorModel implementation acts on lines rather than on cells.
| Field Summary |
| Fields inherited from class org.jcreme.swing.table.colormodel.DefaultTableColorModel |
MINIMUM_COLOR_DISTANCE |
| Constructor Summary | |
LineTitlesColorModel(java.awt.Color bgColor,
java.awt.Color fgColor,
java.awt.Color bgSelectedColor,
java.awt.Color fgSelectedColor,
int numberOfColumnsInTitle)
Creates new LineTitlesColorModel |
|
| Method Summary | |
java.awt.Color |
getBackgroundColor()
Gives access to the color to apply to the background to mark title columns. |
java.awt.Color |
getBackgroundColor(int row,
int column,
boolean selected,
java.awt.Component renderer)
Gives access to the background color of a cell. |
java.awt.Color |
getBackgroundSelectedColor()
Gives access to the color to apply to the background to mark title columns when the row is selected. |
java.awt.Color |
getForegroundColor()
Gives access to the color to apply to the foreground to mark title columns. |
java.awt.Color |
getForegroundColor(int row,
int column,
boolean selected,
java.awt.Component renderer)
Gives access to the foreground color of a cell. |
java.awt.Color |
getForegroundSelectedColor()
Gives access to the color to apply to the foreground to mark title columns when the row is selected. |
int |
getNumberOfColumnsInTitle()
Gives access to the number of columns to include in the title. |
void |
setBackgroundColor(java.awt.Color bgColor)
Enables to change the background color for title columns. |
void |
setBackgroundSelectedColor(java.awt.Color bgSelectedColor)
This method enables to change the color used as background for selected cells. |
void |
setForegroundColor(java.awt.Color fgColor)
Enables to change the foreground color for title columns. |
void |
setForegroundSelectedColor(java.awt.Color fgSelectedColor)
This method enables to change the color used as foreground for selected cells. |
void |
setNumberOfColumnsInTitle(int titleSize)
Enables to change the number of columns to be included as title. |
| Methods inherited from class org.jcreme.swing.table.colormodel.DefaultTableColorModel |
addTableColorModelListener, ensureMinimumDistance, fireTableColorModelChanged, getDistance, getListeners, getTableModel, mixColors, removeTableColorModelListener, setTableModel |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jcreme.swing.table.TableColorModel |
addTableColorModelListener, getListeners, getTableModel, removeTableColorModelListener, setTableModel |
| Constructor Detail |
public LineTitlesColorModel(java.awt.Color bgColor,
java.awt.Color fgColor,
java.awt.Color bgSelectedColor,
java.awt.Color fgSelectedColor,
int numberOfColumnsInTitle)
bgColor - the backgroud colors of the cycle.fgColor - the foreground colors of the cycle.bgSelectedColor - the background color for selected rows.fgSelectedColor - the foreground color for selected rows.numberOfColumnsInTitle - the number of columns that are part of a line's title.| Method Detail |
public java.awt.Color getBackgroundColor(int row,
int column,
boolean selected,
java.awt.Component renderer)
getBackgroundColor in interface TableColorModelgetBackgroundColor in class DefaultTableColorModelrow - the cell's row.column - the cell's column.selected - whether the cell is currently selected or not.renderer - the renderer used to display the cell.
public java.awt.Color getForegroundColor(int row,
int column,
boolean selected,
java.awt.Component renderer)
getForegroundColor in interface TableColorModelgetForegroundColor in class DefaultTableColorModelrow - the cell's row.column - the cell's column.selected - whether the cell is currently selected or not.renderer - the renderer used to display the cell.
public java.awt.Color getForegroundColor()
public java.awt.Color getForegroundSelectedColor()
public java.awt.Color getBackgroundColor()
public java.awt.Color getBackgroundSelectedColor()
public int getNumberOfColumnsInTitle()
public void setNumberOfColumnsInTitle(int titleSize)
titleSize - the new number of columns to be included as titles.public void setBackgroundColor(java.awt.Color bgColor)
bgColor - the new background title color.public void setForegroundColor(java.awt.Color fgColor)
fgColor - the new foreground title color.public void setBackgroundSelectedColor(java.awt.Color bgSelectedColor)
bgSelectedColor - the new background for selected cells.public void setForegroundSelectedColor(java.awt.Color fgSelectedColor)
fgSelectedColor - the new foreground for selected cells.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||