|
OpenOffice.org XMerge API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openoffice.xmerge.converter.xml.Style | +--org.openoffice.xmerge.converter.xml.TextStyle
Represents a text Style
in an OpenOffice document.
Field Summary | |
protected java.awt.Color |
bgColor
Background Color . |
static int |
BOLD
Indicates bold text. |
protected static int |
FIRST_ATTR
|
protected java.awt.Color |
fontColor
Font Color . |
protected java.lang.String |
fontName
Font name. |
static int |
ITALIC
Indicates italic text. |
protected static int |
LAST_ATTR
Indicates the last attribute. |
protected int |
mask
Bitwise mask of text attributes. |
protected int |
sizeInPoints
Font size in points. |
static int |
STRIKETHRU
Indicates strike-through in the text. |
static int |
SUBSCRIPT
Indicates subscripted text. |
static int |
SUPERSCRIPT
Indicates superscripted text. |
static int |
UNDERLINE
Indicates underlined text. |
protected int |
values
Values of text attributes. |
Fields inherited from class org.openoffice.xmerge.converter.xml.Style |
family, name, parent, sc |
Constructor Summary | |
TextStyle(org.w3c.dom.Node node,
StyleCatalog sc)
Constructor for use when going from DOM to client device format. |
|
TextStyle(java.lang.String name,
java.lang.String family,
java.lang.String parent,
int mask,
int values,
int fontSize,
java.lang.String fontName,
StyleCatalog sc)
Constructor for use when going from client device format to DOM |
Method Summary | |
org.w3c.dom.Node |
createNode(org.w3c.dom.Document parentDoc,
java.lang.String name)
Create a new Node in the Document , and
write this Style to it. |
void |
dumpCSV()
Dump this Style as a Comma Separated Value (CSV) line. |
static void |
dumpHdr()
Print a Comma Separated Value (CSV) header line for the spreadsheet dump. |
boolean |
getAttribute(int attribute)
Return true if the attribute is set to on |
java.awt.Color |
getBackgroundColor()
Return the background Color for this
Style . |
java.awt.Color |
getFontColor()
Return the font Color for this Style . |
java.lang.String |
getFontName()
Return the name of the font for this Style . |
int |
getFontSize()
Return the font size for this Style . |
Style |
getResolved()
Return a Style object corresponding to this one,
but with all of the inherited information from parent
Style objects filled in. |
boolean |
isSet(int attribute)
Return true if text attribute is set in this
Style . |
boolean |
isSubset(Style style)
Return true if style specifies as much or less
than this Style , and nothing it specifies
contradicts this Style . |
void |
setColors(java.awt.Color fontColor,
java.awt.Color backgroundColor)
Set the font and/or background Color for this
Style . |
void |
writeAttributes(org.w3c.dom.Element node)
Write this Style object's attributes to a
Node in the Document . |
Methods inherited from class org.openoffice.xmerge.converter.xml.Style |
getFamily, getName, getParent, setCatalog, setName, writeAttributes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.awt.Color bgColor
Color
.public static final int BOLD
protected static final int FIRST_ATTR
protected java.awt.Color fontColor
Color
.protected java.lang.String fontName
public static final int ITALIC
protected static final int LAST_ATTR
protected int mask
protected int sizeInPoints
public static final int STRIKETHRU
public static final int SUBSCRIPT
public static final int SUPERSCRIPT
public static final int UNDERLINE
protected int values
Constructor Detail |
public TextStyle(org.w3c.dom.Node node, StyleCatalog sc)
Node
- The style:style Node
containing
the Style
. (This Node
is
assumed have a family attribute of text).sc
- The StyleCatalog
, which is used for
looking up ancestor Style
objects.public TextStyle(java.lang.String name, java.lang.String family, java.lang.String parent, int mask, int values, int fontSize, java.lang.String fontName, StyleCatalog sc)
name
- Name of text Style
. Can be null.family
- Family of text Style
(usually
text). Can be null.parent
- Name of parent text Style
, or null
for none.mask
- Bitwise mask of text attributes that this text
Style
will specify. Can be any
combination of the following, or'ed together:
BOLD
, ITALIC
, UNDERLINE
,
STRIKETHRU
, SUPERSCRIPT
,
SUBSCRIPT
. This parameter determines what
attributes this Style
will specify.
When an attribute is specified in a
Style
, its value can be either
on or off. The on/off value for
each attribute is controlled by the
values
parameter.values
- Values of text attributes that this text
Style
will be setting. Any of the
attributes (BOLD
, etc) listed for
mask
can be used for this.fontSize
- Font size in points.fontName
- Name of font.sc
- The StyleCatalog
, which is used for
looking up ancestor Style
objects.Method Detail |
public org.w3c.dom.Node createNode(org.w3c.dom.Document parentDoc, java.lang.String name)
Node
in the Document
, and
write this Style
to it.createNode
in class Style
parentDoc
- Parent Document
of the
Node
to create.name
- Name to use for the new Node
(e.g.
style:style)Node
.public void dumpCSV()
Style
as a Comma Separated Value (CSV) line.public static void dumpHdr()
public boolean getAttribute(int attribute)
attribute
is set to onattribute
- Attribute to check (BOLD
,
ITALIC
, etc.)attribute
is set to on,
otherwise false.public java.awt.Color getBackgroundColor()
Color
for this
Style
. Can be null if none was specified.Color
value for this
Style
. Can be null.public java.awt.Color getFontColor()
Color
for this Style
.
Can be null if none was specified.Color
value for this Style
.
Can be null.public java.lang.String getFontName()
Style
.Style
.public int getFontSize()
Style
.public Style getResolved()
Style
object corresponding to this one,
but with all of the inherited information from parent
Style
objects filled in. The object returned will
be a new object, not a reference to this object, even if it does
not need any information added.getResolved
in class Style
StyleCatalog
in which to look up
ancestors.public boolean isSet(int attribute)
attribute
is set in this
Style
. An attribute that is set may have a
value of on or off.attribute
- The attribute to check (BOLD
,
ITALIC
, etc.).attribute
is set in this
Style
, false otherwise.public boolean isSubset(Style style)
style
specifies as much or less
than this Style
, and nothing it specifies
contradicts this Style
.isSubset
in class Style
style
- The Style
to check.style
is a subset, false
otherwise.public void setColors(java.awt.Color fontColor, java.awt.Color backgroundColor)
Color
for this
Style
.fontColor
- The font Color
to set.backgroundColor
- The background Color
to set.public void writeAttributes(org.w3c.dom.Element node)
Style
object's attributes to a
Node
in the Document
.node
- The Node
to add Style
attributes.
|
OpenOffice.org XMerge API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |