|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jfree.workbook.Style
Represents a style that (when incorporated within a StyleRegion object) applies to a range of cells in a worksheet.
This class should be immutable so we can use it in multiple places without risking it being changed.
Field Summary | |
protected Color |
backgroundColor
The background color. |
protected Border |
border
The border details. |
protected int |
cellIndent
The indentation for the cells. |
protected FontStyle |
font
The font details. |
protected Color |
foregroundColor
The foreground color. |
protected java.lang.String |
format
The format. |
protected int |
horizontalAlignment
The horizontal alignment. |
protected int |
orientation
The orientation. |
protected Color |
patternColor
The pattern color. |
protected int |
shade
The shade. |
protected int |
verticalAlignment
The vertical alignment. |
protected boolean |
wrapText
Wrap text (true/false). |
Fields inherited from interface org.jfree.workbook.StyleConstants |
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_CENTER_ACROSS_SELECTION, ALIGN_FILL, ALIGN_GENERAL, ALIGN_JUSTIFY_HORIZONTAL, ALIGN_JUSTIFY_VERTICAL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP |
Constructor Summary | |
Style()
Constructs a new Style object with default values. |
|
Style(FontStyle font,
Border border,
int horizontalAlignment,
int verticalAlignment,
boolean wrapText,
int orientation,
int shade,
int cellIndent,
Color foregroundColor,
Color backgroundColor,
Color patternColor,
java.lang.String format)
Full constructor. |
|
Style(FontStyle font,
int horizontalAlignment,
int verticalAlignment)
Constructs a style with a specific font and alignment. |
Method Summary | |
static Style |
applyBackgroundColor(Style style,
Color backgroundColor)
Creates a new style based on the provided style, but replacing the background color as specified. |
static Style |
applyBorder(Style base,
Border border)
Creates a new style based on the provided style, but replacing the border as specified. |
static Style |
applyFont(Style style,
FontStyle font)
Creates a new style based on the provided style, but replacing the font as specified. |
static Style |
applyForegroundColor(Style style,
Color foregroundColor)
Creates a new style based on the provided style, but replacing the foreground color as specified. |
static Style |
applyPatternColor(Style style,
Color patternColor)
Creates a new style based on the provided style, but replacing the pattern color as specified. |
Color |
getBackgroundColor()
Returns the background color. |
Border |
getBorder()
Returns the border for this style. |
int |
getCellIndent()
Returns the indentation. |
FontStyle |
getFont()
Returns the font for this style. |
Color |
getForegroundColor()
Returns the foreground color. |
java.lang.String |
getFormat()
Returns the format string for the cell. |
int |
getHorizontalAlignment()
Returns the horizontal alignment for this style. |
int |
getOrientation()
Returns the text orientation. |
Color |
getPatternColor()
Returns the pattern color. |
int |
getShade()
Returns the shade. |
int |
getVerticalAlignment()
Returns the vertical alignment for this style. |
boolean |
isWrapText()
Returns a flag indicating whether or not the text is wrapped. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected FontStyle font
protected Border border
protected int horizontalAlignment
protected int verticalAlignment
protected boolean wrapText
protected int orientation
protected int shade
protected int cellIndent
protected Color foregroundColor
protected Color backgroundColor
protected Color patternColor
protected java.lang.String format
Constructor Detail |
public Style()
public Style(FontStyle font, int horizontalAlignment, int verticalAlignment)
font
- the font.horizontalAlignment
- the horizontal alignment.verticalAlignment
- the vertical alignment.public Style(FontStyle font, Border border, int horizontalAlignment, int verticalAlignment, boolean wrapText, int orientation, int shade, int cellIndent, Color foregroundColor, Color backgroundColor, Color patternColor, java.lang.String format)
font
- the font.border
- the border.horizontalAlignment
- the horizontal alignment.verticalAlignment
- the vertical alignment.wrapText
- wrap text (true/false).orientation
- the text orientation.shade
- ??cellIndent
- cell indentation.foregroundColor
- the foreground color.backgroundColor
- the bacground color.patternColor
- the pattern color.format
- the format string for the cell.Method Detail |
public FontStyle getFont()
public Border getBorder()
public int getHorizontalAlignment()
public int getVerticalAlignment()
public boolean isWrapText()
public int getOrientation()
public int getShade()
public int getCellIndent()
public Color getForegroundColor()
public Color getBackgroundColor()
public Color getPatternColor()
public java.lang.String getFormat()
public static Style applyFont(Style style, FontStyle font)
style
- the base style.font
- the new font.
public static Style applyBorder(Style base, Border border)
base
- the base style.border
- the new border.
public static Style applyForegroundColor(Style style, Color foregroundColor)
style
- the base style.foregroundColor
- the new foreground color.
public static Style applyBackgroundColor(Style style, Color backgroundColor)
We set the shade value to 1, since it looks as though this is required by the Gnumeric file format...will try to find out more about this.
style
- the base style.backgroundColor
- the new background color.
public static Style applyPatternColor(Style style, Color patternColor)
style
- t base style.patternColor
- the pattern color.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |