JIDE 3.5.15

com.jidesoft.grid
Class RowStripeTableStyleProvider

java.lang.Object
  extended by com.jidesoft.grid.RowStripeTableStyleProvider
All Implemented Interfaces:
TableStyleProvider

public class RowStripeTableStyleProvider
extends Object
implements TableStyleProvider

CellStyleProvider for row stripes.


Field Summary
protected static Color DEFAULT_ROW_STRIPE_COLOR
           
 
Constructor Summary
RowStripeTableStyleProvider()
          Creates a RowStripeCellStyleProvider.
RowStripeTableStyleProvider(Color... alternativeBackground)
          Creates a RowStripeCellStyleProvider.
RowStripeTableStyleProvider(Color[] alternativeBackgroundColors, Color[] alternativeForegroundColors)
          Creates a RowStripeCellStyleProvider.
 
Method Summary
 Color[] getAlternativeBackgroundColors()
          Gets the alternative background colors.
 Color[] getAlternativeForegroundColors()
          Gets the alternative foreground colors.
 CellStyle getCellStyleAt(JTable table, int rowIndex, int columnIndex)
          Gets the cell style at the specified cell.
 void setAlternativeBackgroundColors(Color[] alternativeBackgroundColors)
          Sets alternative background colors for the rows.
 void setAlternativeForegroundColors(Color[] alternativeForegroundColors)
          Sets alternative Foreground colors for the rows.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ROW_STRIPE_COLOR

protected static final Color DEFAULT_ROW_STRIPE_COLOR
Constructor Detail

RowStripeTableStyleProvider

public RowStripeTableStyleProvider()
Creates a RowStripeCellStyleProvider. It uses WHITE and a very light yellow color as two alternative row colors.


RowStripeTableStyleProvider

public RowStripeTableStyleProvider(Color... alternativeBackground)
Creates a RowStripeCellStyleProvider. You can define the alternative colors here.

Parameters:
alternativeBackground - the alternative row background colors. The length of the array should be greater than or equal to 2. You could use an array that the length is 1 but it will not have a stripe effect but the same background for all rows.

RowStripeTableStyleProvider

public RowStripeTableStyleProvider(Color[] alternativeBackgroundColors,
                                   Color[] alternativeForegroundColors)
Creates a RowStripeCellStyleProvider. You can define the alternative colors here.

Parameters:
alternativeBackgroundColors - the alternative row background colors. The length of the array should be greater than or equal to 2. You could use an array that the length is 1 but it will not have a stripe effect but the same background for all rows.
alternativeForegroundColors - the alternative row foreground colors. The length of the array should be greater than or equal to 2. You could use an array that the lenngth is 1 but it will not have a stripe effect but the same foreground for all rows.
Method Detail

getCellStyleAt

public CellStyle getCellStyleAt(JTable table,
                                int rowIndex,
                                int columnIndex)
Description copied from interface: TableStyleProvider
Gets the cell style at the specified cell.

Specified by:
getCellStyleAt in interface TableStyleProvider
Parameters:
table - the table.
rowIndex - the row index as in the table
columnIndex - the column index as in the table
Returns:
the cell style at the specified cell.

getAlternativeBackgroundColors

public Color[] getAlternativeBackgroundColors()
Gets the alternative background colors.

Returns:
the alternative background colors.

setAlternativeBackgroundColors

public void setAlternativeBackgroundColors(Color[] alternativeBackgroundColors)
Sets alternative background colors for the rows.

Parameters:
alternativeBackgroundColors - alternative colors.

getAlternativeForegroundColors

public Color[] getAlternativeForegroundColors()
Gets the alternative foreground colors.

Returns:
the alternative foreground colors.

setAlternativeForegroundColors

public void setAlternativeForegroundColors(Color[] alternativeForegroundColors)
Sets alternative Foreground colors for the rows.

Parameters:
alternativeForegroundColors - alternative colors.

JIDE 3.5.15