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 Style. 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 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...
 

Detailed Description

This class represents a paragraph Style.

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

◆ ParaStyle() [1/3]

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 Node which, which is assumed to have family attribute of paragraph.
scThe 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().

◆ ParaStyle() [2/3]

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 Style. Can be null.
familyNameFamily of the Style - usually paragraph, text, etc. Can be null.
parentNameName of the parent Style, or null if none.
attribsArray of attributes to set.
valuesArray of values to set.
scThe 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.

◆ ParaStyle() [3/3]

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 Style. Can be null.
familyNameFamily of the Style - usually paragraph, text, etc. Can be null.
parentNameName of the parent Style, or null if none.
attribsArray of attributes indices to set.
valuesArray of values to set.
lookupThe 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.

Member Function Documentation

◆ createNode()

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

Create the Node with the specified elements.

Parameters
parentDocParent Document of the Node to create.
nameName of the Node.
Returns
The created 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().

◆ dumpCSV()

void org.openoffice.xmerge.converter.xml.ParaStyle.dumpCSV ( )
inline

◆ dumpHdr()

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().

◆ getResolved()

Style org.openoffice.xmerge.converter.xml.ParaStyle.getResolved ( )
inline

◆ isIgnored()

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 attribute, i, and org.openoffice.xmerge.converter.xml.ParaStyle.ignored.

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

◆ isSubset()

boolean org.openoffice.xmerge.converter.xml.ParaStyle.isSubset ( Style  style)
inline

◆ setAttribute() [1/2]

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

Set an attribute for this paragraph Style.

Parameters
attrThe attribute index to set.
valueThe 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.

◆ setAttribute() [2/2]

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

◆ toCSV()

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, 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().

◆ toLastCSV()

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, 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().

◆ writeAttributes()

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

Member Data Documentation

◆ algor

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 Style.

Definition at line 170 of file ParaStyle.java.

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

◆ ALIGN_CENTER

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

Align center.

Definition at line 183 of file ParaStyle.java.

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

◆ ALIGN_JUST

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

Align justified.

Definition at line 185 of file ParaStyle.java.

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

◆ ALIGN_LEFT

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

Align left.

Definition at line 187 of file ParaStyle.java.

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

◆ ALIGN_RIGHT

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

Align right.

Definition at line 181 of file ParaStyle.java.

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

◆ attrName

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 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().

◆ ignored

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.

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

◆ isSet

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

◆ LH_PCT

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

Line height percentage.


Definition at line 190 of file ParaStyle.java.

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

◆ LH_VALUEMASK

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().

◆ LINE_HEIGHT

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().

◆ NR_PROPERTIES

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

◆ TEXT_ALIGN

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

◆ TEXT_INDENT

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().

◆ value

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

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