org.jcreme.swing.table.colormodel
Class BaseCyclingColorModel

java.lang.Object
  extended byorg.jcreme.swing.table.colormodel.DefaultTableColorModel
      extended byorg.jcreme.swing.table.colormodel.BaseCyclingColorModel
All Implemented Interfaces:
TableColorModel
Direct Known Subclasses:
ColumnCyclingColorModel, CyclingColorModel

public abstract class BaseCyclingColorModel
extends DefaultTableColorModel
implements TableColorModel

The base class for Cycle based color models.

Version:
$Revision: 1.1 $
Author:
$Author: dbregeon $

Field Summary
 
Fields inherited from class org.jcreme.swing.table.colormodel.DefaultTableColorModel
MINIMUM_COLOR_DISTANCE
 
Constructor Summary
BaseCyclingColorModel(java.awt.Color[] bgColors, java.awt.Color[] fgColors, java.awt.Color bgSelectedColor, java.awt.Color fgSelectedColor, int cycleLength)
          Creates new BaseCyclingColorModel
 
Method Summary
 java.awt.Color[] getBackgroundColors()
          This is an information method that enables to query the background color cycle in use.
 java.awt.Color getBackgroundSelectedColor()
          This is an information method that enables to query the background color when a cell is selected.
 int getCycleLength()
          This is an information method that gives access to the cycle length.
 java.awt.Color[] getForegroundColors()
          This is an information method that enables to query the foreground color cycle in use.
 java.awt.Color getForegroundSelectedColor()
          This is an information method that enables to query the foreground color when a cell is selected.
 void setBackgroundColors(java.awt.Color[] bgColors)
          This method enables to change the colors used in the background cycle.
 void setBackgroundSelectedColor(java.awt.Color bgSelectedColor)
          This method enables to change the color used as background for selected cells.
 void setCycleLength(int length)
          This method enables to change the length of the color cycle.
 void setForegroundColors(java.awt.Color[] fgColors)
          This method enables to change the colors used in the foreground cycle.
 void setForegroundSelectedColor(java.awt.Color fgSelectedColor)
          This method enables to change the color used as foreground for selected cells.
 
Methods inherited from class org.jcreme.swing.table.colormodel.DefaultTableColorModel
addTableColorModelListener, ensureMinimumDistance, fireTableColorModelChanged, getBackgroundColor, getDistance, getForegroundColor, 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, getBackgroundColor, getForegroundColor, getListeners, getTableModel, removeTableColorModelListener, setTableModel
 

Constructor Detail

BaseCyclingColorModel

public BaseCyclingColorModel(java.awt.Color[] bgColors,
                             java.awt.Color[] fgColors,
                             java.awt.Color bgSelectedColor,
                             java.awt.Color fgSelectedColor,
                             int cycleLength)
Creates new BaseCyclingColorModel

Parameters:
bgColors - the backgroud colors of the cycle.
fgColors - the foreground colors of the cycle.
bgSelectedColor - the background color for selected rows.
fgSelectedColor - the foreground color for selected rows.
cycleLength - the number of reps of the same color in the cycle.
Method Detail

getBackgroundColors

public java.awt.Color[] getBackgroundColors()
This is an information method that enables to query the background color cycle in use.

Returns:
the background colors used in the cycle.

getForegroundColors

public java.awt.Color[] getForegroundColors()
This is an information method that enables to query the foreground color cycle in use.

Returns:
the foreground colors used in the cycle.

getBackgroundSelectedColor

public java.awt.Color getBackgroundSelectedColor()
This is an information method that enables to query the background color when a cell is selected.

Returns:
the background color used for selected cells.

getForegroundSelectedColor

public java.awt.Color getForegroundSelectedColor()
This is an information method that enables to query the foreground color when a cell is selected.

Returns:
the foreground color used for selected cells.

getCycleLength

public int getCycleLength()
This is an information method that gives access to the cycle length.

Returns:
the color cycle length.

setBackgroundColors

public void setBackgroundColors(java.awt.Color[] bgColors)
This method enables to change the colors used in the background cycle.

Parameters:
bgColors - the new background cycle colors.

setForegroundColors

public void setForegroundColors(java.awt.Color[] fgColors)
This method enables to change the colors used in the foreground cycle.

Parameters:
fgColors - the new foreground cycle colors.

setBackgroundSelectedColor

public void setBackgroundSelectedColor(java.awt.Color bgSelectedColor)
This method enables to change the color used as background for selected cells.

Parameters:
bgSelectedColor - the new background for selected cells.

setForegroundSelectedColor

public void setForegroundSelectedColor(java.awt.Color fgSelectedColor)
This method enables to change the color used as foreground for selected cells.

Parameters:
fgSelectedColor - the new foreground for selected cells.

setCycleLength

public void setCycleLength(int length)
This method enables to change the length of the color cycle.

Parameters:
length - the length of the cycle.


Copyright 2006 null. All Rights Reserved.