LibreOffice Module xmerge (master) 1
|
This class represents a paragraph Style
.
More...
Public Member Functions | |
ParaStyle (Node node, StyleCatalog sc) | |
Constructor for use when going from DOM to client device format. More... | |
ParaStyle (String name, String familyName, String parentName, String attribs[], String values[], StyleCatalog sc) | |
Constructor for use when going from client device format to DOM. More... | |
ParaStyle (String name, String familyName, String parentName, int attribs[], String values[], StyleCatalog lookup) | |
Alternate constructor for use when going from client device format to DOM. More... | |
Style | getResolved () |
Return the Style in use. More... | |
void | dumpCSV () |
Dump this Style as a Comma Separated Value (CSV) line. More... | |
Node | createNode (org.w3c.dom.Document parentDoc, String name) |
Create the Node with the specified elements. More... | |
boolean | isSubset (Style style) |
Return true if style is a subset of the Style . More... | |
Public Member Functions inherited from org.openoffice.xmerge.converter.xml.Style | |
Style (Node node, StyleCatalog sc) | |
Constructor for use when going from DOM to client device format. More... | |
Style (String name, String family, String parent, StyleCatalog sc) | |
Constructor for use when going from client device format to DOM. More... | |
void | setCatalog (StyleCatalog sc) |
Set the StyleCatalog to be used when looking up the Style parent. More... | |
String | getName () |
Returns the name of this Style . More... | |
void | setName (String newName) |
Sets the name of this Style . More... | |
String | getFamily () |
Return the family of this Style . More... | |
String | getParent () |
Return the name of the parent of this Style . More... | |
Style | getResolved () |
Return a Style object corresponding to this one, but with all of the inherited information from parent Style objects filled in. More... | |
Node | createNode (org.w3c.dom.Document parentDoc, String name) |
Write a Node in parentDoc representing this Style . More... | |
boolean | isSubset (Style style) |
Return true if Style is a subset of this one. More... | |
Static Public Member Functions | |
static void | dumpHdr () |
Print a Comma Separated Value (CSV) header line for the spreadsheet dump. More... | |
Static Public Attributes | |
static final int | ALIGN_RIGHT = 1 |
Align right. More... | |
static final int | ALIGN_CENTER = 2 |
Align center. More... | |
static final int | ALIGN_JUST = 3 |
Align justified. More... | |
static final int | ALIGN_LEFT = 4 |
Align left. More... | |
static final int | LH_PCT = 0x40000000 |
Line height percentage. More... | |
Private Member Functions | |
boolean | isIgnored (String attribute) |
This code checks whether an attribute is one that we intentionally ignore. More... | |
void | setAttribute (String attr, String value) |
Set an attribute for this paragraph Style . More... | |
void | setAttribute (int attr, String value) |
Set an attribute for this paragraph Style . More... | |
void | writeAttributes (Element node) |
Add Style attributes to the given Node . More... | |
Static Private Member Functions | |
static String | toCSV (String value) |
Private function to return the value as an element in a Comma Separated Value (CSV) format. More... | |
static String | toLastCSV (String value) |
Private function to return the value as a last element in a Comma Separated Value (CSV) format. More... | |
Private Attributes | |
boolean | isSet [] = new boolean[NR_PROPERTIES] |
Array of flags indicating which attributes are set for this paragraph Style . More... | |
int | value [] = new int[NR_PROPERTIES] |
Array of attribute values for this paragraph Style . More... | |
final String | attrName [] |
Array of attribute names for this paragraph Style . More... | |
final Class<?> | algor [] |
Array of attribute structures for this paragraph Style . More... | |
Static Private Attributes | |
static final int | TEXT_INDENT = 4 |
Indent left property. More... | |
static final int | LINE_HEIGHT = 5 |
Indent right property. More... | |
static final int | TEXT_ALIGN = 6 |
Align text property. More... | |
static final int | NR_PROPERTIES = 7 |
Total number of properties. More... | |
static final int | LH_VALUEMASK = 0x00FFFFFF |
Line height mask. More... | |
static String[] | ignored |
Ignored tags. More... | |
Additional Inherited Members | |
Protected Attributes inherited from org.openoffice.xmerge.converter.xml.Style | |
String | name = null |
Name of the Style . More... | |
String | family = null |
Family of the Style . More... | |
String | parent = null |
Parent of the Style . More... | |
StyleCatalog | sc |
A reference to the StyleCatalog to be used for looking up ancestor Style objects. More... | |
This class represents a paragraph Style
.
Table with all paragraph style attributes and their values 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
Definition at line 139 of file ParaStyle.java.
|
inline |
Constructor for use when going from DOM to client device format.
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. |
Definition at line 215 of file ParaStyle.java.
References i, org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute(), and String.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.getResolved(), and org.openoffice.xmerge.converter.xml.ParaStyle.isSubset().
|
inline |
Constructor for use when going from client device format to DOM.
name | Name of the Style . Can be null . |
familyName | Family of the Style - usually paragraph, text, etc. Can be null . |
parentName | 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. |
Definition at line 256 of file ParaStyle.java.
References i, org.openoffice.xmerge.converter.xml.Style.name, org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute(), and values.
|
inline |
Alternate constructor for use when going from client device format to DOM.
name | Name of the Style . Can be null . |
familyName | Family of the Style - usually paragraph, text, etc. Can be null . |
parentName | Name of the parent Style , or null if none. |
attribs | Array of attributes indices to set. |
values | Array of values to set. |
lookup | The StyleCatalog , which is used for looking up ancestor Style objects. |
Definition at line 276 of file ParaStyle.java.
References i, org.openoffice.xmerge.converter.xml.Style.name, org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute(), and values.
|
inline |
Create the Node
with the specified elements.
parentDoc | Parent Document of the Node to create. |
name | Name of the Node . |
Node
. Reimplemented from org.openoffice.xmerge.converter.xml.Style.
Definition at line 442 of file ParaStyle.java.
References org.openoffice.xmerge.converter.xml.Style.name, and org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().
|
inline |
Dump this Style
as a Comma Separated Value (CSV) line.
Definition at line 420 of file ParaStyle.java.
References org.openoffice.xmerge.converter.xml.Style.family, index, org.openoffice.xmerge.converter.xml.ParaStyle.isSet, org.openoffice.xmerge.converter.xml.Style.name, org.openoffice.xmerge.converter.xml.Style.parent, String, System, org.openoffice.xmerge.converter.xml.ParaStyle.toCSV(), org.openoffice.xmerge.converter.xml.ParaStyle.toLastCSV(), and org.openoffice.xmerge.converter.xml.ParaStyle.value.
|
inlinestatic |
Print a Comma Separated Value (CSV) header line for the spreadsheet dump.
Definition at line 410 of file ParaStyle.java.
References System, org.openoffice.xmerge.converter.xml.ParaStyle.toCSV(), and org.openoffice.xmerge.converter.xml.ParaStyle.toLastCSV().
|
inline |
Return the Style
in use.
Style
in use. Reimplemented from org.openoffice.xmerge.converter.xml.Style.
Definition at line 337 of file ParaStyle.java.
References clone(), org.openoffice.xmerge.util.Debug.ERROR, Exception, org.openoffice.xmerge.converter.xml.Style.family, org.openoffice.xmerge.converter.xml.ParaStyle.getResolved(), i, org.openoffice.xmerge.converter.xml.ParaStyle.isSet, org.openoffice.xmerge.util.Debug.log(), org.openoffice.xmerge.converter.xml.Style.name, org.openoffice.xmerge.converter.xml.ParaStyle.NR_PROPERTIES, org.openoffice.xmerge.converter.xml.ParaStyle.ParaStyle(), org.openoffice.xmerge.converter.xml.Style.parent, and org.openoffice.xmerge.converter.xml.ParaStyle.value.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.getResolved().
|
inlineprivate |
This code checks whether an attribute is one that we intentionally ignore.
attribute | The attribute to check. |
true
if attribute can be ignored, false
otherwise. Definition at line 291 of file ParaStyle.java.
References attribute, i, and org.openoffice.xmerge.converter.xml.ParaStyle.ignored.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute().
|
inline |
Return true
if style
is a subset of the Style
.
style | Style to check. |
true
if style
is a subset, false
otherwise. Reimplemented from org.openoffice.xmerge.converter.xml.Style.
Definition at line 457 of file ParaStyle.java.
References getClass(), i, isAssignableFrom(), org.openoffice.xmerge.converter.xml.ParaStyle.isSet, org.openoffice.xmerge.converter.xml.ParaStyle.NR_PROPERTIES, org.openoffice.xmerge.converter.xml.ParaStyle.ParaStyle(), org.openoffice.xmerge.converter.xml.ParaStyle.TEXT_ALIGN, and org.openoffice.xmerge.converter.xml.ParaStyle.value.
|
inlineprivate |
Set an attribute for this paragraph Style
.
attr | The attribute index to set. |
value | The attribute value to set. |
Definition at line 322 of file ParaStyle.java.
References org.openoffice.xmerge.converter.xml.ParaStyle.algor, org.openoffice.xmerge.util.Debug.ERROR, Exception, I, org.openoffice.xmerge.converter.xml.ParaStyle.isSet, org.openoffice.xmerge.util.Debug.log(), and org.openoffice.xmerge.converter.xml.ParaStyle.value.
|
inlineprivate |
Set an attribute for this paragraph Style
.
attr | The attribute to set. |
value | The attribute value to set. |
Definition at line 305 of file ParaStyle.java.
References org.openoffice.xmerge.converter.xml.ParaStyle.attrName, i, org.openoffice.xmerge.util.Debug.INFO, org.openoffice.xmerge.converter.xml.ParaStyle.isIgnored(), org.openoffice.xmerge.util.Debug.log(), org.openoffice.xmerge.converter.xml.ParaStyle.NR_PROPERTIES, org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute(), and org.openoffice.xmerge.converter.xml.ParaStyle.value.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.ParaStyle(), and org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute().
|
inlinestaticprivate |
Private function to return the value as an element in a Comma Separated Value (CSV) format.
value | The value to format. |
Definition at line 385 of file ParaStyle.java.
References String, and org.openoffice.xmerge.converter.xml.ParaStyle.value.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.dumpCSV(), and org.openoffice.xmerge.converter.xml.ParaStyle.dumpHdr().
|
inlinestaticprivate |
Private function to return the value as a last element in a Comma Separated Value (CSV) format.
value | The value to format. |
Definition at line 400 of file ParaStyle.java.
References String, and org.openoffice.xmerge.converter.xml.ParaStyle.value.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.dumpCSV(), and org.openoffice.xmerge.converter.xml.ParaStyle.dumpHdr().
|
inlineprivate |
Add Style
attributes to the given Node
.
This may involve writing child Node
objects as well.
node | The Node to add Style attributes. |
Definition at line 496 of file ParaStyle.java.
References org.openoffice.xmerge.converter.xml.ParaStyle.ALIGN_CENTER, org.openoffice.xmerge.converter.xml.ParaStyle.ALIGN_JUST, org.openoffice.xmerge.converter.xml.ParaStyle.ALIGN_LEFT, org.openoffice.xmerge.converter.xml.ParaStyle.ALIGN_RIGHT, org.openoffice.xmerge.converter.xml.ParaStyle.attrName, Double, i, Integer, org.openoffice.xmerge.converter.xml.ParaStyle.isSet, org.openoffice.xmerge.converter.xml.ParaStyle.LH_PCT, org.openoffice.xmerge.converter.xml.ParaStyle.LH_VALUEMASK, org.openoffice.xmerge.converter.xml.ParaStyle.LINE_HEIGHT, String, org.openoffice.xmerge.converter.xml.ParaStyle.TEXT_ALIGN, org.openoffice.xmerge.converter.xml.ParaStyle.TEXT_INDENT, and org.openoffice.xmerge.converter.xml.ParaStyle.value.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.createNode().
|
private |
Array of attribute structures for this paragraph Style
.
Definition at line 170 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute().
|
static |
Align center.
Definition at line 183 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().
|
static |
Align justified.
Definition at line 185 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().
|
static |
Align left.
Definition at line 187 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().
|
static |
Align right.
Definition at line 181 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().
|
private |
Array of attribute names for this paragraph Style
.
Definition at line 159 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute(), and org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().
|
staticprivate |
Ignored tags.
Definition at line 196 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.isIgnored().
|
private |
Array of flags indicating which attributes are set for this paragraph Style
.
Definition at line 155 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.dumpCSV(), org.openoffice.xmerge.converter.xml.ParaStyle.getResolved(), org.openoffice.xmerge.converter.xml.ParaStyle.isSubset(), org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute(), and org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().
|
static |
Line height percentage.
Definition at line 190 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().
|
staticprivate |
Line height mask.
Definition at line 193 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().
|
staticprivate |
Indent right property.
Definition at line 144 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().
|
staticprivate |
Total number of properties.
Definition at line 149 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.getResolved(), org.openoffice.xmerge.converter.xml.ParaStyle.isSubset(), and org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute().
|
staticprivate |
Align text property.
Definition at line 146 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.isSubset(), and org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().
|
staticprivate |
Indent left property.
Definition at line 142 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().
|
private |
Array of attribute values for this paragraph Style
.
Definition at line 157 of file ParaStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.dumpCSV(), org.openoffice.xmerge.converter.xml.ParaStyle.getResolved(), org.openoffice.xmerge.converter.xml.ParaStyle.isSubset(), org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute(), org.openoffice.xmerge.converter.xml.ParaStyle.toCSV(), org.openoffice.xmerge.converter.xml.ParaStyle.toLastCSV(), and org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().