LibreOffice Module xmerge (master)  1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.openoffice.xmerge.converter.xml.ParaStyle Class Reference

This class represents a paragraph. More...

Inheritance diagram for org.openoffice.xmerge.converter.xml.ParaStyle:
[legend]
Collaboration diagram for org.openoffice.xmerge.converter.xml.ParaStyle:
[legend]

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. More...
 
void dumpCSV ()
 Dump this. More...
 
Node createNode (org.w3c.dom.Document parentDoc, String name)
 Create the. More...
 
boolean isSubset (Style style)
 Return. 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. More...
 
String getName ()
 Returns the name of this. More...
 
void setName (String newName)
 Sets the name of this. More...
 
String getFamily ()
 Return the family of this. More...
 
String getParent ()
 Return the name of the parent of this. More...
 
Style getResolved ()
 Return a. More...
 
Node createNode (org.w3c.dom.Document parentDoc, String name)
 Write a. More...
 
boolean isSubset (Style style)
 Return. 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. More...
 
void setAttribute (int attr, String value)
 Set an attribute for this paragraph. More...
 
void writeAttributes (Element node)
 Add. 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. More...
 
int value [] = new int[NR_PROPERTIES]
 Array of attribute values for this paragraph. More...
 
final String attrName []
 Array of attribute names for this paragraph. More...
 
final Class<?> algor []
 Array of attribute structures for this paragraph. 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. More...
 
String family = null
 Family of the. More...
 
String parent = null
 Parent of the. More...
 
StyleCatalog sc
 A reference to the. More...
 

Detailed Description

This class represents a paragraph.

.

Table with all paragraph style attributes and their values
AttributeValue
MARGIN_LEFTmm * 100
MARGIN_RIGHTmm * 100
MARGIN_TOPmm * 100 (space on top of paragraph)
MARGIN_BOTTOMmm * 100
TEXT_INDENTmm * 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.

Constructor & Destructor Documentation

org.openoffice.xmerge.converter.xml.ParaStyle.ParaStyle ( Node  node,
StyleCatalog  sc 
)
inline

Constructor for use when going from DOM to client device format.

Parameters
nodeA style:style which, which is assumed to have family attribute of paragraph.
scThe
StyleCatalog
, which is used for looking up ancestor 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().

org.openoffice.xmerge.converter.xml.ParaStyle.ParaStyle ( String  name,
String  familyName,
String  parentName,
String  attribs[],
String  values[],
StyleCatalog  sc 
)
inline

Constructor for use when going from client device format to DOM.

Parameters
nameName of the . Can be
null
.
familyNameFamily of the { -} usually paragraph, text, etc. Can be
null
.
parentNameName of the parent , or
null
if none.
attribsArray of attributes to set.
valuesArray of values to set.
scThe
StyleCatalog
, which is used for looking up ancestor objects.

Definition at line 256 of file ParaStyle.java.

References i, and org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute().

org.openoffice.xmerge.converter.xml.ParaStyle.ParaStyle ( String  name,
String  familyName,
String  parentName,
int  attribs[],
String  values[],
StyleCatalog  lookup 
)
inline

Alternate constructor for use when going from client device format to DOM.

Parameters
nameName of the . Can be
null
.
familyNameFamily of the { -} usually paragraph, text, etc. Can be
null
.
parentNameName of the parent , or null if none.
attribsArray of attributes indices to set.
valuesArray of values to set.
lookupThe
StyleCatalog
, which is used for looking up ancestor objects.

Definition at line 276 of file ParaStyle.java.

References i, and org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute().

Member Function Documentation

Node org.openoffice.xmerge.converter.xml.ParaStyle.createNode ( org.w3c.dom.Document  parentDoc,
String  name 
)
inline

Create the.

with the specified elements.

Parameters
parentDocParent of the to create.
nameName of the .
Returns
The created .

Definition at line 442 of file ParaStyle.java.

References org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().

void org.openoffice.xmerge.converter.xml.ParaStyle.dumpCSV ( )
inline
static void org.openoffice.xmerge.converter.xml.ParaStyle.dumpHdr ( )
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().

Style org.openoffice.xmerge.converter.xml.ParaStyle.getResolved ( )
inline
boolean org.openoffice.xmerge.converter.xml.ParaStyle.isIgnored ( String  attribute)
inlineprivate

This code checks whether an attribute is one that we intentionally ignore.

Parameters
attributeThe attribute to check.
Returns
true
if attribute can be ignored,
false
otherwise.

Definition at line 291 of file ParaStyle.java.

References equals(), and i.

Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute().

boolean org.openoffice.xmerge.converter.xml.ParaStyle.isSubset ( Style  style)
inline
void org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute ( String  attr,
String  value 
)
inlineprivate

Set an attribute for this paragraph.

.

Parameters
attrThe attribute to set.
valueThe attribute value to set.

Definition at line 305 of file ParaStyle.java.

References i, org.openoffice.xmerge.util.Debug.INFO, org.openoffice.xmerge.converter.xml.ParaStyle.isIgnored(), org.openoffice.xmerge.util.Debug.log(), and org.openoffice.xmerge.converter.xml.ParaStyle.NR_PROPERTIES.

Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.ParaStyle().

void org.openoffice.xmerge.converter.xml.ParaStyle.setAttribute ( int  attr,
String  value 
)
inlineprivate

Set an attribute for this paragraph.

.

Parameters
attrThe attribute index to set.
valueThe attribute value to set.

Definition at line 322 of file ParaStyle.java.

References org.openoffice.xmerge.util.Debug.ERROR, Exception, and org.openoffice.xmerge.util.Debug.log().

static String org.openoffice.xmerge.converter.xml.ParaStyle.toCSV ( String  value)
inlinestaticprivate

Private function to return the value as an element in a Comma Separated Value (CSV) format.

Parameters
valueThe value to format.
Returns
The formatted value.

Definition at line 385 of file ParaStyle.java.

References String.

Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.dumpCSV(), and org.openoffice.xmerge.converter.xml.ParaStyle.dumpHdr().

static String org.openoffice.xmerge.converter.xml.ParaStyle.toLastCSV ( String  value)
inlinestaticprivate

Private function to return the value as a last element in a Comma Separated Value (CSV) format.

Parameters
valueThe value to format.
Returns
The formatted value.

Definition at line 400 of file ParaStyle.java.

References String.

Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.dumpCSV(), and org.openoffice.xmerge.converter.xml.ParaStyle.dumpHdr().

void org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes ( Element  node)
inlineprivate

Add.

attributes to the given

.

This may involve writing child

objects as well.

Parameters
nodeThe to add attributes.

Definition at line 496 of file ParaStyle.java.

References Double, i, Integer, org.openoffice.xmerge.converter.xml.ParaStyle.LH_VALUEMASK, org.openoffice.xmerge.converter.xml.ParaStyle.LINE_HEIGHT, String, and org.openoffice.xmerge.converter.xml.ParaStyle.TEXT_INDENT.

Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.createNode().

Member Data Documentation

final Class<?> org.openoffice.xmerge.converter.xml.ParaStyle.algor[]
private
Initial value:
= {
horizSize.class,
horizSize.class,
horizSize.class,
horizSize.class,
horizSize.class,
lineHeight.class,
alignment.class
}

Array of attribute structures for this paragraph.

.

Definition at line 170 of file ParaStyle.java.

final int org.openoffice.xmerge.converter.xml.ParaStyle.ALIGN_CENTER = 2
static

Align center.

Definition at line 183 of file ParaStyle.java.

final int org.openoffice.xmerge.converter.xml.ParaStyle.ALIGN_JUST = 3
static

Align justified.

Definition at line 185 of file ParaStyle.java.

final int org.openoffice.xmerge.converter.xml.ParaStyle.ALIGN_LEFT = 4
static

Align left.

Definition at line 187 of file ParaStyle.java.

final int org.openoffice.xmerge.converter.xml.ParaStyle.ALIGN_RIGHT = 1
static

Align right.

Definition at line 181 of file ParaStyle.java.

final String org.openoffice.xmerge.converter.xml.ParaStyle.attrName[]
private
Initial value:
= {
"fo:margin-left",
"fo:margin-right",
"fo:margin-top",
"fo:margin-bottom",
"fo:text-indent",
"fo:line-height",
"fo:text-align"
}

Array of attribute names for this paragraph.

.

Definition at line 159 of file ParaStyle.java.

String [] org.openoffice.xmerge.converter.xml.ParaStyle.ignored
staticprivate
Initial value:
= {
"style:font-name", "fo:font-size", "fo:font-weight", "fo:color",
"fo:language", "fo:country", "style:font-name-asian",
"style:font-size-asian", "style:language-asian",
"style:country-asian", "style:font-name-complex",
"style:font-size-complex", "style:language-complex",
"style:country-complex", "style:text-autospace", "style:punctuation-wrap",
"style:line-break", "fo:keep-with-next", "fo:font-style",
"text:number-lines", "text:line-number"
}

Ignored tags.

Definition at line 196 of file ParaStyle.java.

boolean org.openoffice.xmerge.converter.xml.ParaStyle.isSet[] = new boolean[NR_PROPERTIES]
private

Array of flags indicating which attributes are set for this paragraph.

.

Definition at line 155 of file ParaStyle.java.

Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.getResolved(), and org.openoffice.xmerge.converter.xml.ParaStyle.isSubset().

final int org.openoffice.xmerge.converter.xml.ParaStyle.LH_PCT = 0x40000000
static

Line height percentage.

Definition at line 190 of file ParaStyle.java.

final int org.openoffice.xmerge.converter.xml.ParaStyle.LH_VALUEMASK = 0x00FFFFFF
staticprivate

Line height mask.

Definition at line 193 of file ParaStyle.java.

Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().

final int org.openoffice.xmerge.converter.xml.ParaStyle.LINE_HEIGHT = 5
staticprivate

Indent right property.

Definition at line 144 of file ParaStyle.java.

Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().

final int org.openoffice.xmerge.converter.xml.ParaStyle.NR_PROPERTIES = 7
staticprivate
final int org.openoffice.xmerge.converter.xml.ParaStyle.TEXT_ALIGN = 6
staticprivate

Align text property.

Definition at line 146 of file ParaStyle.java.

final int org.openoffice.xmerge.converter.xml.ParaStyle.TEXT_INDENT = 4
staticprivate

Indent left property.

Definition at line 142 of file ParaStyle.java.

Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.writeAttributes().

int org.openoffice.xmerge.converter.xml.ParaStyle.value[] = new int[NR_PROPERTIES]
private

Array of attribute values for this paragraph.

.

Definition at line 157 of file ParaStyle.java.

Referenced by org.openoffice.xmerge.converter.xml.ParaStyle.getResolved(), and org.openoffice.xmerge.converter.xml.ParaStyle.isSubset().


The documentation for this class was generated from the following file: