|
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.ParaStyle
This class represents a paragraph Style
.
Attribute | Value |
MARGIN_LEFT | mm * 100 |
MARGIN_RIGHT | mm * 100 |
MARGIN_TOP | mm * 100 (space on top of paragraph) |
MARGIN_BOTTOM | mm * 100 |
TEXT_INDENT | mm * 100 (first line indent) |
LINE_HEIGHT | mm * 100, unless or'ed with LH_PCT, in which case it is a percentage (e.g. 200% for double spacing) Can also be or'ed with LH_ATLEAST. Value is stored in bits indicated by LH_VALUEMASK. |
TEXT_ALIGN | ALIGN_RIGHT, ALIGN_CENTER, ALIGN_JUST, ALIGN_LEFT |
Field Summary | |
protected java.lang.Class[] |
algor
Array of attribute structures for this paragraph Style . |
static int |
ALIGN_CENTER
Align center. |
static int |
ALIGN_JUST
Align justified. |
static int |
ALIGN_LEFT
Align left. |
static int |
ALIGN_RIGHT
Align right. |
protected java.lang.String[] |
attrName
Array of attribute names for this paragraph Style . |
protected boolean[] |
isSet
Array of flags indicating which attributes are set for this paragraph Style . |
static int |
LH_ATLEAST
Line height minimum value. |
static int |
LH_PCT
Line height percentage. |
static int |
LH_VALUEMASK
Line height mask. |
static int |
LINE_HEIGHT
Indent right property. |
static int |
MARGIN_BOTTOM
The bottom margin property. |
static int |
MARGIN_LEFT
The left margin property. |
static int |
MARGIN_RIGHT
The right margin property. |
static int |
MARGIN_TOP
The top margin property. |
protected static int |
NR_PROPERTIES
Total number of properties. |
static int |
TEXT_ALIGN
Align text property. |
static int |
TEXT_INDENT
Indent left property. |
protected int[] |
value
Array of attribute values for this paragraph tyle . |
Fields inherited from class org.openoffice.xmerge.converter.xml.Style |
family, name, parent, sc |
Constructor Summary | |
ParaStyle(org.w3c.dom.Node node,
StyleCatalog sc)
Constructor for use when going from DOM to client device format. |
|
ParaStyle(java.lang.String name,
java.lang.String familyName,
java.lang.String parentName,
int[] attribs,
java.lang.String[] values,
StyleCatalog lookup)
Alternate constructor for use when going from client device format to DOM. |
|
ParaStyle(java.lang.String name,
java.lang.String familyName,
java.lang.String parentName,
java.lang.String[] attribs,
java.lang.String[] values,
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 the Node with the specified elements. |
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. |
int |
getAttribute(int attrIndex)
Get the value of an integer attribute. |
Style |
getResolved()
Return the Style in use. |
boolean |
isAttributeSet(int attrIndex)
Check whether an attribute is set in this Style . |
boolean |
isSubset(Style style)
Return true if style is a subset of the
Style . |
void |
setAttribute(int attr,
java.lang.String value)
Set an attribute for this paragraph Style . |
void |
setAttribute(java.lang.String attr,
java.lang.String value)
Set an attribute for this paragraph Style . |
void |
writeAttributes(org.w3c.dom.Element node)
Add Style attributes to the given
Node . |
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.lang.Class[] algor
Style
.public static final int ALIGN_CENTER
public static final int ALIGN_JUST
public static final int ALIGN_LEFT
public static final int ALIGN_RIGHT
protected java.lang.String[] attrName
Style
.protected boolean[] isSet
Style
.public static final int LH_ATLEAST
public static final int LH_PCT
public static final int LH_VALUEMASK
public static final int LINE_HEIGHT
public static final int MARGIN_BOTTOM
public static final int MARGIN_LEFT
public static final int MARGIN_RIGHT
public static final int MARGIN_TOP
protected static final int NR_PROPERTIES
public static final int TEXT_ALIGN
public static final int TEXT_INDENT
protected int[] value
tyle
.Constructor Detail |
public ParaStyle(org.w3c.dom.Node node, StyleCatalog sc)
node
- A style:style Node
which, which
is assumed to have family attribute of
paragraph.sc
- The StyleCatalog
, which is used for
looking up ancestor Style
objects.public ParaStyle(java.lang.String name, java.lang.String familyName, java.lang.String parentName, int[] attribs, java.lang.String[] values, StyleCatalog lookup)
name
- Name of the Style
. Can be null.family
- Family of the Style
- usually
paragraph, text, etc. Can be null.parent
- Name of the parent Style
, or
null if none.attribs
- Array of attributes indices to set.values
- Array of values to set.sc
- The StyleCatalog
, which is used for
looking up ancestor Style
objects.public ParaStyle(java.lang.String name, java.lang.String familyName, java.lang.String parentName, java.lang.String[] attribs, java.lang.String[] values, StyleCatalog sc)
name
- Name of the Style
. Can be null.family
- Family of the Style
- usually
paragraph, text, etc. Can be null.parent
- Name of the parent Style
, or null
if none.attribs
- Array of attributes to set.values
- Array of values to set.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
with the specified elements.createNode
in class Style
name
- Name of the Node
.Node
.public void dumpCSV()
Style
as a Comma Separated Value (CSV)
line.public static void dumpHdr()
public int getAttribute(int attrIndex)
attrIndex
- Index of the attribute.public Style getResolved()
Style
in use.getResolved
in class Style
Style
in use.public boolean isAttributeSet(int attrIndex)
Style
.attrIndex
- The attribute index to check.public boolean isSubset(Style style)
style
is a subset of the
Style
.isSubset
in class Style
style
- Style
to check.style
is a subset, false
otherwise.public void setAttribute(int attr, java.lang.String value)
Style
.attr
- The attribute index to set.public void setAttribute(java.lang.String attr, java.lang.String value)
Style
.attr
- The attribute to set.value
- The attribute value to set.public void writeAttributes(org.w3c.dom.Element node)
Style
attributes to the given
Node
. This may involve writing child
Node
objects as well.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 |