|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jcreme.swing.table.colormodel.AbstractValueIndexedTableColorModel
The purpose of this class is to have a specific background color for the lines that have a given reference column above a given Threshold value. (the value of a specified column is at a specified value).
Constructor Summary | |
AbstractValueIndexedTableColorModel()
Creates new ValueIndexedTableColorModel |
Method Summary | |
void |
addTableColorModelListener(TableColorModelListener l)
Registers a new listener for the modifications of the color scheme. |
void |
fireTableColorModelChanged(TableColorModelEvent e)
Fires a TableColorModelEvent telling registered listeners that the color scheme has changed. |
java.awt.Color |
getBackgroundColor()
|
java.awt.Color |
getBackgroundColor(int row,
int column,
boolean selected,
java.awt.Component renderer)
Gets the current background color that the cell described by the params should have. |
java.awt.Color |
getForegroundColor()
|
java.awt.Color |
getForegroundColor(int row,
int column,
boolean selected,
java.awt.Component renderer)
Gets the current foreground color that the cell described by the params should have. |
java.util.EventListener[] |
getListeners(java.lang.Class listenerType)
Gets the list of the listeners registered for the modifications of the color scheme. |
protected int |
getReferenceColumn()
|
java.awt.Color |
getSelectedBackgroundColor()
|
java.awt.Color |
getSelectedForegroundColor()
|
java.awt.Color |
getSelectedThresholdColor()
|
javax.swing.table.TableModel |
getTableModel()
Gives access to the TableModel colored by this TableColorModel. |
java.awt.Color |
getThresholdColor()
|
void |
removeTableColorModelListener(TableColorModelListener l)
Unregisters the given listener ffor the modifications of the color scheme. |
void |
setBackgroundColor(java.awt.Color backgroundColor)
|
void |
setForegroundColor(java.awt.Color foregroundColor)
|
void |
setReferenceColumn(int column)
Sets the reference column whose value is monitored to determine the rows' states. |
void |
setSelectedBackgroundColor(java.awt.Color selectedBackgroundColor)
|
void |
setSelectedForegroundColor(java.awt.Color selectedForegroundColor)
|
void |
setSelectedThresholdColor(java.awt.Color selectedThresholdColor)
|
void |
setTableModel(javax.swing.table.TableModel model)
Sets the model that will be colored by this TableColorModel. |
void |
setThresholdColor(java.awt.Color thresholdColor)
|
protected abstract boolean |
testThreshold(java.lang.Object value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractValueIndexedTableColorModel()
Method Detail |
protected abstract boolean testThreshold(java.lang.Object value)
protected int getReferenceColumn()
public javax.swing.table.TableModel getTableModel()
TableColorModel
getTableModel
in interface TableColorModel
public void setReferenceColumn(int column)
column
- The index of the column to be used as a reference.public java.awt.Color getBackgroundColor(int row, int column, boolean selected, java.awt.Component renderer)
getBackgroundColor
in interface TableColorModel
row
- The row index of the cell.column
- The column index of the cell.selected
- Boolean telling whether the cell is selected.renderer
- the renderer that renders the cell.
public java.awt.Color getForegroundColor(int row, int column, boolean selected, java.awt.Component renderer)
getForegroundColor
in interface TableColorModel
row
- The row index of the cell.column
- The column index of the cell.selected
- Boolean telling whether the cell is selected.renderer
- the renderer that renders the cell.
public void addTableColorModelListener(TableColorModelListener l)
addTableColorModelListener
in interface TableColorModel
l
- The listener to be added to the list.public void removeTableColorModelListener(TableColorModelListener l)
removeTableColorModelListener
in interface TableColorModel
l
- The listener to be removed from the list.public void fireTableColorModelChanged(TableColorModelEvent e)
e
- The event describing the changes.public java.util.EventListener[] getListeners(java.lang.Class listenerType)
getListeners
in interface TableColorModel
listenerType
- The class of listeners to retrieve.
public void setTableModel(javax.swing.table.TableModel model)
TableColorModel
setTableModel
in interface TableColorModel
model
- the data to be colored by this model.TableColorModel.setTableModel(javax.swing.table.TableModel)
public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color backgroundColor)
backgroundColor
- The backgroundColor to set.public java.awt.Color getForegroundColor()
public void setForegroundColor(java.awt.Color foregroundColor)
foregroundColor
- The foregroundColor to set.public java.awt.Color getSelectedBackgroundColor()
public void setSelectedBackgroundColor(java.awt.Color selectedBackgroundColor)
selectedBackgroundColor
- The selectedBackgroundColor to set.public java.awt.Color getSelectedForegroundColor()
public void setSelectedForegroundColor(java.awt.Color selectedForegroundColor)
selectedForegroundColor
- The selectedForegroundColor to set.public java.awt.Color getSelectedThresholdColor()
public void setSelectedThresholdColor(java.awt.Color selectedThresholdColor)
selectedThresholdColor
- The selectedThresholdColor to set.public java.awt.Color getThresholdColor()
public void setThresholdColor(java.awt.Color thresholdColor)
thresholdColor
- The thresholdColor to set.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |