|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.odftoolkit.simple.style.TextProperties
public class TextProperties
This class represents text style settings.
In Open Document Format, there can be different font settings for different script types.
This class provides methods to access font style, font size, font name and etc for different script types.
Further functions will be provided, such as underline, shadow, background color and etc.
This class is a corresponded high level class for element "style:text-properties". It provides methods to access the attributes and children of "style:text-properties".
Constructor Summary | |
---|---|
protected |
TextProperties()
Create an instance of TextProperties |
protected |
TextProperties(StyleTextPropertiesElement textProperties)
Create an instance of TextProperties from an element |
Method Summary | |
---|---|
String |
getCountry()
Return the country information for western characters. |
String |
getCountry(Document.ScriptType type)
Return the country information for a specific script type |
Font |
getFont()
Return the font definition for western characters. |
Font |
getFont(Document.ScriptType type)
Return the font definition for a specific script type |
Color |
getFontColor()
Return the font color. |
String |
getFontFamilyName(Document.ScriptType type)
Return the font family name for a specific script type |
String |
getFontName()
Return the font name for western characters. |
String |
getFontName(Document.ScriptType type)
Return the font name for a specific script type |
double |
getFontSizeInPoint()
Return the font size definition in measurement point(PT) for western characters. |
double |
getFontSizeInPoint(Document.ScriptType type)
Return the font size definition in measurement point(PT) for a specific script type. |
StyleTypeDefinitions.FontStyle |
getFontStyle()
Return the font style for western characters |
StyleTypeDefinitions.FontStyle |
getFontStyle(Document.ScriptType type)
Return the font style for a specific script type |
String |
getLanguage()
Return the language information for western characters. |
String |
getLanguage(Document.ScriptType type)
Return the language information for a specific script type |
static TextProperties |
getOrCreateTextProperties(OdfStyleBase style)
Return an instance of TextProperties |
StyleTypeDefinitions.TextLinePosition |
getTextLineStyle()
Return the font text line style |
static TextProperties |
getTextProperties(OdfStyleBase style)
Return an instance of TextProperties |
void |
setCountry(String country)
Set the country information for western character. |
void |
setCountry(String country,
Document.ScriptType type)
Set the country information for a specific script type. |
void |
setFont(Font font)
Set the font definition for western character. |
void |
setFont(Font font,
Locale language)
Set the font definition. |
void |
setFontColor(Color fontColor)
Set the font color. |
void |
setFontName(String fontName)
Set the font name for western characters. |
void |
setFontName(String fontName,
Document.ScriptType type)
Set the font name for a specific script type |
void |
setFontSizeInPoint(double size)
Set the font size in measurement point(PT) for western characters. |
void |
setFontSizeInPoint(double size,
Document.ScriptType type)
Set the font size in measurement point(PT) for a specific script type. |
void |
setFontStyle(StyleTypeDefinitions.FontStyle style)
Set the font style for western characters |
void |
setFontStyle(StyleTypeDefinitions.FontStyle style,
Document.ScriptType type)
Set the font style for a specific script type |
void |
setLanguage(String language)
Set the language information for western characters. |
void |
setLanguage(String language,
Document.ScriptType type)
Set the language information for a specific script type |
void |
setTextLineStyle(StyleTypeDefinitions.TextLinePosition style)
Set the font text line style for characters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected TextProperties()
protected TextProperties(StyleTextPropertiesElement textProperties)
textProperties
- - the element of style:text-propertiesMethod Detail |
---|
public StyleTypeDefinitions.FontStyle getFontStyle()
Null will be returned if there is no font style setting for western characters
public StyleTypeDefinitions.TextLinePosition getTextLineStyle()
TextLineStyle.REGULAR will be returned if there is no text line style setting
public StyleTypeDefinitions.FontStyle getFontStyle(Document.ScriptType type)
REGULAR will be returned if there is no font style setting for this script type.
type
- - script type
public void setFontStyle(StyleTypeDefinitions.FontStyle style)
If the parameter style
is REGULAR, the font style setting
for western characters will be removed.
style
- - the font stylepublic void setTextLineStyle(StyleTypeDefinitions.TextLinePosition style)
If the parameter style
is REGULAR, the font text line style
setting for characters will be removed.
style
- - the font text line stylepublic void setFontStyle(StyleTypeDefinitions.FontStyle style, Document.ScriptType type)
If the parameter style
is REGULAR, the font style setting
for this script type will be removed.
style
- - font styletype
- - script typepublic double getFontSizeInPoint()
Zero will be returned if there is no font size definition for western characters.
Zero will be returned if the line measurement is not point(PT).
public double getFontSizeInPoint(Document.ScriptType type)
Zero will be returned if there is no font size definition for this script type.
Zero will be returned if the line measurement is not point(PT).
type
- - script type
public void setFontSizeInPoint(double size)
If the font size is less than zero, the font size definition for western characters will be removed.
size
- - font sizepublic void setFontSizeInPoint(double size, Document.ScriptType type)
If the font size is less than zero, the font size definition for this script type will be removed.
size
- - font sizetype
- - script typepublic String getLanguage()
Null will be returned if there is no language information for western characters.
public String getLanguage(Document.ScriptType type)
Null will be returned if there is no language information for this script type.
type
- - script type
public void setLanguage(String language)
If the parameter language
is null, the language information
for western characters will be removed.
language
- - the language informationpublic void setLanguage(String language, Document.ScriptType type)
The consistency between country and script type is not verified.
If the parameter language
is null, the language information
for this script type will be removed.
language
- - the language informationtype
- - script typepublic String getCountry()
Null will be returned if there is no country information for western characters.
public String getCountry(Document.ScriptType type)
Null will be returned if there is no country information for this script type.
type
- - script type
public void setCountry(String country)
If the parameter country
is null, the country information
for western character will be removed.
country
- - the country informationpublic void setCountry(String country, Document.ScriptType type)
The consistency between country and script type is not verified.
If the parameter country
is null, the country information
for this script type will be removed.
country
- - the country informationtype
- - script typepublic Color getFontColor()
Null will be returned if there is no font color setting.
public void setFontColor(Color fontColor)
If the parameter fontColor
is null, the font color
definition will be removed.
fontColor
- - the font colorpublic String getFontName()
Null will be returned if there is no font name setting for western characters.
public String getFontName(Document.ScriptType type)
Null will be returned if there is no font name setting for this script type.
type
- - script type
public void setFontName(String fontName)
If the parameter fontName
is null, the font name for western
characters will be removed.
fontName
- - font namepublic void setFontName(String fontName, Document.ScriptType type)
If the parameter fontName
is null, the font name for this
script type will be removed.
fontName
- - font nametype
- - script typepublic Font getFont()
Null will be returned if there is no font definition for western characters.
public Font getFont(Document.ScriptType type)
Null will be returned if there is no font definition for this script type.
type
- - script type
public void setFont(Font font)
If the parameter font
is null, nothing will be happened.
font
- - font definitionpublic void setFont(Font font, Locale language)
This method can be used to set font for different script type, such as western characters, CJK characters, and CTL characters. The second parameter will be used to determine the script type.
If the parameter font
is null, nothing will be happened.
font
- - font definitionlanguage
- - the languageDocument.ScriptType
public String getFontFamilyName(Document.ScriptType type)
Null will be returned if there is no font family name definition for this script type.
type
- - script type
public static TextProperties getOrCreateTextProperties(OdfStyleBase style)
TextProperties to represent the "style:text-properties" in a style element.
If there is no "style:text-properties" defined in the style element, a new "style:text-properties" element will be created.
- Parameters:
style
- - a style element
- Returns:
- an instance of
TextProperties
public static TextProperties getTextProperties(OdfStyleBase style)
TextProperties to represent the "style:text-properties" in a style element.
If there is no "style:text-properties" defined in the style element, null will be returned.
- Parameters:
style
- - a style element
- Returns:
- an instance of
TextProperties;Null if there is no
"style:text-properties" defined
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |