org.jfree.workbook
Class ColorStyleModifier

java.lang.Object
  |
  +--org.jfree.workbook.ColorStyleModifier
All Implemented Interfaces:
StyleModifier

public class ColorStyleModifier
extends java.lang.Object
implements StyleModifier

A style modifier that changes the foreground, background or pattern color for a style, but leaves all other settings unchanged.


Field Summary
protected  Color color
          The new color.
protected  int which
          Foreground, background or pattern color.
 
Constructor Summary
ColorStyleModifier(int which, Color color)
          Standard constructor.
 
Method Summary
 Style getModifiedStyle(Style style)
          Returns a new style with the same settings as the style passed in, except with a different foreground, background or pattern color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

which

protected int which
Foreground, background or pattern color.


color

protected Color color
The new color.

Constructor Detail

ColorStyleModifier

public ColorStyleModifier(int which,
                          Color color)
Standard constructor.

Parameters:
which - indicates which color to change (use constants BACKGROUND_COLOR, FOREGROUND_COLOR and PATTERN_COLOR in the StyleColor class).
color - the new color.
Method Detail

getModifiedStyle

public Style getModifiedStyle(Style style)
Returns a new style with the same settings as the style passed in, except with a different foreground, background or pattern color.

Specified by:
getModifiedStyle in interface StyleModifier
Parameters:
style - the style to be modified.
Returns:
A new style with the same settings as the style passed in, except with a different foreground, background or pattern color.