public class RowStripeTableStyleProvider extends Object implements TableStyleProvider
CellStyleProvider
for row stripes.Modifier and Type | Field and Description |
---|---|
protected static Color |
DEFAULT_ROW_STRIPE_COLOR |
Constructor and Description |
---|
RowStripeTableStyleProvider()
Creates a
RowStripeCellStyleProvider . |
RowStripeTableStyleProvider(Color... alternativeBackground)
Creates a
RowStripeCellStyleProvider . |
RowStripeTableStyleProvider(Color[] alternativeBackgroundColors,
Color[] alternativeForegroundColors)
Creates a
RowStripeCellStyleProvider . |
Modifier and Type | Method and Description |
---|---|
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.
|
protected static final Color DEFAULT_ROW_STRIPE_COLOR
public RowStripeTableStyleProvider()
RowStripeCellStyleProvider
. It uses WHITE and a very light yellow color as two alternative
row colors.public RowStripeTableStyleProvider(Color... alternativeBackground)
RowStripeCellStyleProvider
. You can define the alternative colors here.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.public RowStripeTableStyleProvider(Color[] alternativeBackgroundColors, Color[] alternativeForegroundColors)
RowStripeCellStyleProvider
. You can define the alternative colors here.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.public CellStyle getCellStyleAt(JTable table, int rowIndex, int columnIndex)
TableStyleProvider
getCellStyleAt
in interface TableStyleProvider
table
- the table.rowIndex
- the row index as in the tablecolumnIndex
- the column index as in the tablepublic Color[] getAlternativeBackgroundColors()
public void setAlternativeBackgroundColors(Color[] alternativeBackgroundColors)
alternativeBackgroundColors
- alternative colors.public Color[] getAlternativeForegroundColors()
public void setAlternativeForegroundColors(Color[] alternativeForegroundColors)
alternativeForegroundColors
- alternative colors.