|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.jrefinery.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 StyleColor |
backgroundColor
The background color. |
protected StyleBorder |
border
The border details. |
static int |
BOTTOM
Constant for bottom vertical alignment. |
protected int |
cellIndent
The indentation for the cells. |
static int |
CENTER_ACROSS_SELECTION
Constant for centered-across-selection horizontal alignment. |
static int |
FILL
Constant for "fill" horizontal alignment. |
protected StyleFont |
font
The font details. |
protected StyleColor |
foregroundColor
The foreground color. |
protected java.lang.String |
format
The format. |
static int |
GENERAL
Constant for "general" horizontal alignment. |
static int |
HORIZONTAL_CENTER
Constant for centered horizontal alignment. |
static int |
HORIZONTAL_JUSTIFY
Constant for "justify" horizontal alignment. |
protected int |
horizontalAlignment
The horizontal alignment. |
static int |
LEFT
Constant for left horizontal alignment. |
protected int |
orientation
The orientation. |
protected StyleColor |
patternColor
The pattern color. |
static int |
RIGHT
Constant for right horizontal alignment. |
protected int |
shade
The shade. |
static int |
TOP
Constant for top vertical alignment. |
static int |
VERTICAL_CENTER
Constant for centered vertical alignment. |
static int |
VERTICAL_JUSTIFY
Constant for "justified" vertical alignment. |
protected int |
verticalAlignment
The vertical alignment. |
protected boolean |
wrapText
Wrap text (true/false). |
| Constructor Summary | |
Style()
Default constructor: constructs a new Style object with default values. |
|
Style(StyleFont font,
int horizontalAlignment,
int verticalAlignment)
Standard constructor: creates a style with a specific font and alignment. |
|
Style(StyleFont font,
StyleBorder border,
int horizontalAlignment,
int verticalAlignment,
boolean wrapText,
int orientation,
int shade,
int cellIndent,
StyleColor foregroundColor,
StyleColor backgroundColor,
StyleColor patternColor,
java.lang.String format)
Full constructor. |
|
| Method Summary | |
static Style |
applyBackgroundColor(Style style,
StyleColor backgroundColor)
Creates a new style based on the provided style, but replacing the background color as specified. |
static Style |
applyBorder(Style style,
StyleBorder border)
Creates a new style based on the provided style, but replacing the border as specified. |
static Style |
applyFont(Style style,
StyleFont font)
Creates a new style based on the provided style, but replacing the font as specified. |
static Style |
applyForegroundColor(Style style,
StyleColor foregroundColor)
Creates a new style based on the provided style, but replacing the foreground color as specified. |
static Style |
applyPatternColor(Style style,
StyleColor patternColor)
Creates a new style based on the provided style, but replacing the pattern color as specified. |
StyleColor |
getBackgroundColor()
Returns the background color. |
StyleBorder |
getBorder()
Returns the border for this style. |
int |
getCellIndent()
Returns the indentation. |
StyleFont |
getFont()
Returns the font for this style. |
StyleColor |
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. |
StyleColor |
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. |
void |
writeStyle(java.io.PrintStream out,
java.lang.String indent)
Writes a style element to the stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int GENERAL
public static final int LEFT
public static final int RIGHT
public static final int HORIZONTAL_CENTER
public static final int FILL
public static final int HORIZONTAL_JUSTIFY
public static final int CENTER_ACROSS_SELECTION
public static final int TOP
public static final int BOTTOM
public static final int VERTICAL_CENTER
public static final int VERTICAL_JUSTIFY
protected StyleFont font
protected StyleBorder border
protected int horizontalAlignment
protected int verticalAlignment
protected boolean wrapText
protected int orientation
protected int shade
protected int cellIndent
protected StyleColor foregroundColor
protected StyleColor backgroundColor
protected StyleColor patternColor
protected java.lang.String format
| Constructor Detail |
public Style()
public Style(StyleFont font,
int horizontalAlignment,
int verticalAlignment)
font - The font.horizontalAlignment - The horizontal alignment.verticalAlignment - The vertical alignment.
public Style(StyleFont font,
StyleBorder border,
int horizontalAlignment,
int verticalAlignment,
boolean wrapText,
int orientation,
int shade,
int cellIndent,
StyleColor foregroundColor,
StyleColor backgroundColor,
StyleColor 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.bacgroundColor - The bacground color.patternColor - The pattern color.format - The format string for the cell.| Method Detail |
public StyleFont getFont()
public StyleBorder getBorder()
public int getHorizontalAlignment()
public int getVerticalAlignment()
public boolean isWrapText()
public int getOrientation()
public int getShade()
public int getCellIndent()
public StyleColor getForegroundColor()
public StyleColor getBackgroundColor()
public StyleColor getPatternColor()
public java.lang.String getFormat()
public static Style applyFont(Style style,
StyleFont font)
style - The base style.font - The new font.
public static Style applyBorder(Style style,
StyleBorder border)
style - The base style.border - The new border.
public static Style applyForegroundColor(Style style,
StyleColor foregroundColor)
style - The base style.foregroundColor - The new foreground color.
public static Style applyBackgroundColor(Style style,
StyleColor 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,
StyleColor patternColor)
style - The base style.patternColor - The pattern color.
public void writeStyle(java.io.PrintStream out,
java.lang.String indent)
out - The stream.indent - The indentation.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||