org.simpleods
public class TextStyle extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
STYLE_UNDERLINE_DASH |
static int |
STYLE_UNDERLINE_DOTDASH |
static int |
STYLE_UNDERLINE_DOTDOTDASH |
static int |
STYLE_UNDERLINE_DOTTED |
static int |
STYLE_UNDERLINE_LONGDASH |
static int |
STYLE_UNDERLINE_NONE |
static int |
STYLE_UNDERLINE_SOLID |
static int |
STYLE_UNDERLINE_WAVE |
Constructor and Description |
---|
TextStyle(OdsFile odsFile)
Create a new text style without a name.
|
TextStyle(java.lang.String sStyleName,
OdsFile odsFile)
Create a new text style with the name sName.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFontColor()
Get the current font color.
|
java.lang.String |
getFontSize()
Get the font size as string, e.g. '10.5pt' or '8pt'
|
java.lang.String |
getFontUnderlineColor()
Get the currently set underline color.
|
int |
getFontUnderlineStyle() |
java.lang.String |
getFontWeight()
Get the current font weight.
|
java.lang.String |
getName()
Get the name of this text style.
|
void |
setFontColor(java.lang.String sColor)
Set the font color to sColor.
|
void |
setFontName(java.lang.String fontName)
Set the font name to be used for this style.
|
void |
setFontSize(int fontSize)
Set the font size in points to the given value.
|
void |
setFontSize(java.lang.String fontSize)
Set the font size to the given value
fontSize is a length value expressed as a number followed by pt, e.g. 12pt |
boolean |
setFontStyleBold()
Deprecated.
0.5.2 Use setFontWeightBold() instead.
|
boolean |
setFontStyleItalic()
Deprecated.
0.5.2 Use setFontWeightItalic() instead.
|
boolean |
setFontStyleNormal()
Deprecated.
0.5.2 Use setFontWeightNormal() instead.
|
void |
setFontUnderlineColor(java.lang.String sColor)
Set the font underline color to sColor.
|
void |
setFontUnderlineStyle(int nStyle)
Set the style that should be used for the underline.
|
boolean |
setFontWeightBold()
Set the font weight to bold.
|
boolean |
setFontWeightItalic()
Set the font weight to italic.
|
boolean |
setFontWeightNormal()
Set the font weight to normal.
|
void |
setName(java.lang.String name)
Set the name of this style to sName.
|
public static final int STYLE_UNDERLINE_NONE
public static final int STYLE_UNDERLINE_SOLID
public static final int STYLE_UNDERLINE_DOTTED
public static final int STYLE_UNDERLINE_DASH
public static final int STYLE_UNDERLINE_LONGDASH
public static final int STYLE_UNDERLINE_DOTDASH
public static final int STYLE_UNDERLINE_DOTDOTDASH
public static final int STYLE_UNDERLINE_WAVE
public TextStyle(java.lang.String sStyleName, OdsFile odsFile)
sStyleName
- The name of the text style.odsFile
- The file to add this style topublic TextStyle(OdsFile odsFile)
odsFile
- The file to add this style topublic java.lang.String getName()
public final void setName(java.lang.String name)
name
- - The name of this stylepublic java.lang.String getFontColor()
public void setFontColor(java.lang.String sColor)
sColor
- The color to be used in format #rrggbb e.g. #ff0000 for a red
cell backgroundpublic void setFontName(java.lang.String fontName)
fontName
- The font name for this TextStylepublic boolean setFontStyleItalic()
public boolean setFontWeightItalic()
public boolean setFontStyleBold()
public boolean setFontWeightBold()
public boolean setFontStyleNormal()
public java.lang.String getFontWeight()
public boolean setFontWeightNormal()
public java.lang.String getFontSize()
public void setFontSize(java.lang.String fontSize)
fontSize
- - The font size as string, e.g. '10.5pt' or '8pt'public void setFontSize(int fontSize)
fontSize
- - The font size as int , e.g. 10 or 8public int getFontUnderlineStyle()
public void setFontUnderlineStyle(int nStyle)
nStyle
- One of the TextStyle.STYLE_UNDERLINEpublic java.lang.String getFontUnderlineColor()
public void setFontUnderlineColor(java.lang.String sColor)
sColor
- The color to be used in format #rrggbb e.g. #ff0000 for a red
cell background.