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

Represents a text Style in an OpenOffice document. More...

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

Public Member Functions

 CellStyle (Node node, StyleCatalog sc)
 Constructor for use when going from DOM to client device format. More...
 
 CellStyle (String name, String family, String parent, Format fmt, StyleCatalog sc)
 Constructor for use when going from client device format to DOM. More...
 
Format getFormat ()
 Returns the Format object for this particular 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)
 Create a new Node in the Document, and write this Style to it. More...
 
boolean isSubset (Style style)
 Return true if style specifies as much or less than this Style, and nothing it specifies contradicts this 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...
 

Private Member Functions

Color parseColorString (String value)
 Parse a color specification of the form #rrggbb. More...
 
void handleAttribute (String attr, String value)
 Set an attribute. More...
 
void writeAttributes (Element node)
 Write this Style object's attributes to a Node in the Document. More...
 
String buildColorString (Color c)
 Given a Color, return a string of the form #rrggbb. More...
 
boolean isIgnored (String attribute)
 This code checks whether an attribute is one that we intentionally ignore. More...
 

Private Attributes

Format fmt = new Format()
 

Static Private Attributes

static String[] ignored
 

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

Represents a text Style in an OpenOffice document.

Definition at line 35 of file CellStyle.java.

Constructor & Destructor Documentation

◆ CellStyle() [1/2]

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

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

Parameters
nodeThe style:style Node containing the Style. (This Node is assumed have a family attribute of text).
scThe StyleCatalog, which is used for looking up ancestor Style objects.

Definition at line 48 of file CellStyle.java.

References org.openoffice.xmerge.converter.xml.sxc.CellStyle.handleAttribute(), i, and String.

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

◆ CellStyle() [2/2]

org.openoffice.xmerge.converter.xml.sxc.CellStyle.CellStyle ( String  name,
String  family,
String  parent,
Format  fmt,
StyleCatalog  sc 
)
inline

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

Parameters
nameName of cell Style. Can be null.
familyFamily of text Style (usually text). Can be null.
parentName of parent text Style, or null for none.
fmtsize in points.
scThe StyleCatalog, which is used for looking up ancestor Style objects.

Definition at line 98 of file CellStyle.java.

References org.openoffice.xmerge.converter.xml.Style.family, org.openoffice.xmerge.converter.xml.sxc.CellStyle.fmt, org.openoffice.xmerge.converter.xml.Style.name, and org.openoffice.xmerge.converter.xml.Style.parent.

Member Function Documentation

◆ buildColorString()

String org.openoffice.xmerge.converter.xml.sxc.CellStyle.buildColorString ( Color  c)
inlineprivate

Given a Color, return a string of the form #rrggbb.

Parameters
cThe Color value.
Returns
The Color value in the form #rrggbb.

Definition at line 439 of file CellStyle.java.

References String.

Referenced by org.openoffice.xmerge.converter.xml.sxc.CellStyle.writeAttributes().

◆ createNode()

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

Create a new Node in the Document, and write this Style to it.

Parameters
parentDocParent Document of the Node to create.
nameName to use for the new Node (e.g. style:style)
Returns
Created Node.

Definition at line 331 of file CellStyle.java.

References org.openoffice.xmerge.converter.xml.Style.name, and org.openoffice.xmerge.converter.xml.sxc.CellStyle.writeAttributes().

◆ getFormat()

Format org.openoffice.xmerge.converter.xml.sxc.CellStyle.getFormat ( )
inline

◆ getResolved()

Style org.openoffice.xmerge.converter.xml.sxc.CellStyle.getResolved ( )
inline

Return a 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.

Returns
The StyleCatalog in which to look up ancestors.

Reimplemented from org.openoffice.xmerge.converter.xml.Style.

Definition at line 263 of file CellStyle.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.BOLD, org.openoffice.xmerge.converter.xml.sxc.Format.BOTTOM_ALIGN, org.openoffice.xmerge.converter.xml.sxc.CellStyle.CellStyle(), clone(), org.openoffice.xmerge.util.Debug.ERROR, Exception, org.openoffice.xmerge.converter.xml.Style.family, org.openoffice.xmerge.converter.xml.sxc.CellStyle.fmt, org.openoffice.xmerge.converter.xml.sxc.Format.getAlign(), org.openoffice.xmerge.converter.xml.sxc.Format.getAttribute(), org.openoffice.xmerge.converter.xml.sxc.Format.getBackground(), org.openoffice.xmerge.converter.xml.sxc.Format.getFontName(), org.openoffice.xmerge.converter.xml.sxc.Format.getFontSize(), org.openoffice.xmerge.converter.xml.sxc.Format.getForeground(), org.openoffice.xmerge.converter.xml.sxc.CellStyle.getFormat(), org.openoffice.xmerge.converter.xml.sxc.CellStyle.getResolved(), org.openoffice.xmerge.converter.xml.sxc.Format.getVertAlign(), org.openoffice.xmerge.converter.xml.sxc.Format.LEFT_ALIGN, org.openoffice.xmerge.util.Debug.log(), m, org.openoffice.xmerge.converter.xml.Style.name, org.openoffice.xmerge.converter.xml.Style.parent, org.openoffice.xmerge.converter.xml.sxc.Format.setAlign(), org.openoffice.xmerge.converter.xml.sxc.Format.setAttribute(), org.openoffice.xmerge.converter.xml.sxc.Format.setBackground(), org.openoffice.xmerge.converter.xml.sxc.Format.setFontName(), org.openoffice.xmerge.converter.xml.sxc.Format.setFontSize(), org.openoffice.xmerge.converter.xml.sxc.Format.setForeground(), org.openoffice.xmerge.converter.xml.sxc.Format.setVertAlign(), and org.openoffice.xmerge.converter.xml.sxc.Format.SUBSCRIPT.

Referenced by org.openoffice.xmerge.converter.xml.sxc.CellStyle.getResolved().

◆ handleAttribute()

void org.openoffice.xmerge.converter.xml.sxc.CellStyle.handleAttribute ( String  attr,
String  value 
)
inlineprivate

Set an attribute.

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

Definition at line 143 of file CellStyle.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.BOLD, org.openoffice.xmerge.converter.xml.sxc.Format.BOTTOM_ALIGN, org.openoffice.xmerge.converter.xml.sxc.Format.BOTTOM_BORDER, org.openoffice.xmerge.converter.xml.sxc.Format.CENTER_ALIGN, org.openoffice.xmerge.util.Debug.ERROR, org.openoffice.xmerge.converter.xml.sxc.CellStyle.fmt, org.openoffice.xmerge.util.Debug.INFO, Integer, org.openoffice.xmerge.converter.xml.sxc.CellStyle.isIgnored(), org.openoffice.xmerge.converter.xml.sxc.Format.ITALIC, org.openoffice.xmerge.converter.xml.sxc.Format.LEFT_ALIGN, org.openoffice.xmerge.converter.xml.sxc.Format.LEFT_BORDER, org.openoffice.xmerge.util.Debug.log(), org.openoffice.xmerge.converter.xml.sxc.Format.MIDDLE_ALIGN, org.openoffice.xmerge.converter.xml.sxc.CellStyle.parseColorString(), org.openoffice.xmerge.converter.xml.sxc.Format.RIGHT_ALIGN, org.openoffice.xmerge.converter.xml.sxc.Format.RIGHT_BORDER, org.openoffice.xmerge.converter.xml.sxc.Format.setAlign(), org.openoffice.xmerge.converter.xml.sxc.Format.setAttribute(), org.openoffice.xmerge.converter.xml.sxc.Format.setBackground(), org.openoffice.xmerge.converter.xml.sxc.Format.setFontName(), org.openoffice.xmerge.converter.xml.sxc.Format.setFontSize(), org.openoffice.xmerge.converter.xml.sxc.Format.setForeground(), org.openoffice.xmerge.converter.xml.sxc.Format.setVertAlign(), org.openoffice.xmerge.converter.xml.sxc.Format.STRIKETHRU, String, org.openoffice.xmerge.converter.xml.sxc.Format.SUBSCRIPT, org.openoffice.xmerge.converter.xml.sxc.Format.SUPERSCRIPT, org.openoffice.xmerge.converter.xml.sxc.Format.TOP_ALIGN, org.openoffice.xmerge.converter.xml.sxc.Format.TOP_BORDER, org.openoffice.xmerge.converter.xml.sxc.Format.UNDERLINE, value, and org.openoffice.xmerge.converter.xml.sxc.Format.WORD_WRAP.

Referenced by org.openoffice.xmerge.converter.xml.sxc.CellStyle.CellStyle().

◆ isIgnored()

boolean org.openoffice.xmerge.converter.xml.sxc.CellStyle.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, otherwise false.

Definition at line 464 of file CellStyle.java.

References attribute, i, and org.openoffice.xmerge.converter.xml.sxc.CellStyle.ignored.

Referenced by org.openoffice.xmerge.converter.xml.sxc.CellStyle.handleAttribute().

◆ isSubset()

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

Return true if style specifies as much or less than this Style, and nothing it specifies contradicts this Style.

Parameters
styleThe Style to check.
Returns
true if style is a subset, false otherwise.

Reimplemented from org.openoffice.xmerge.converter.xml.Style.

Definition at line 347 of file CellStyle.java.

References org.openoffice.xmerge.converter.xml.sxc.CellStyle.CellStyle(), org.openoffice.xmerge.converter.xml.sxc.CellStyle.fmt, org.openoffice.xmerge.converter.xml.sxc.CellStyle.getFormat(), and org.openoffice.xmerge.converter.xml.sxc.Format.isSubset().

◆ parseColorString()

Color org.openoffice.xmerge.converter.xml.sxc.CellStyle.parseColorString ( String  value)
inlineprivate

Parse a color specification of the form #rrggbb.

Parameters
valueColor specification to parse.
Returns
The Color associated the value.

Definition at line 120 of file CellStyle.java.

References Color, org.openoffice.xmerge.util.Debug.ERROR, Integer, org.openoffice.xmerge.util.Debug.log(), and value.

Referenced by org.openoffice.xmerge.converter.xml.sxc.CellStyle.handleAttribute().

◆ writeAttributes()

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

Write this Style object's attributes to a Node in the Document.

Parameters
nodeThe Node to add Style attributes.

Definition at line 363 of file CellStyle.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.BOLD, org.openoffice.xmerge.converter.xml.sxc.Format.BOTTOM_ALIGN, org.openoffice.xmerge.converter.xml.sxc.Format.BOTTOM_BORDER, org.openoffice.xmerge.converter.xml.sxc.CellStyle.buildColorString(), org.openoffice.xmerge.converter.xml.sxc.Format.CENTER_ALIGN, org.openoffice.xmerge.converter.xml.sxc.CellStyle.fmt, org.openoffice.xmerge.converter.xml.sxc.Format.getAlign(), org.openoffice.xmerge.converter.xml.sxc.Format.getAttribute(), org.openoffice.xmerge.converter.xml.sxc.Format.getBackground(), org.openoffice.xmerge.converter.xml.sxc.Format.getFontName(), org.openoffice.xmerge.converter.xml.sxc.Format.getFontSize(), org.openoffice.xmerge.converter.xml.sxc.Format.getForeground(), org.openoffice.xmerge.converter.xml.sxc.Format.getVertAlign(), Integer, org.openoffice.xmerge.converter.xml.sxc.Format.ITALIC, org.openoffice.xmerge.converter.xml.sxc.Format.LEFT_ALIGN, org.openoffice.xmerge.converter.xml.sxc.Format.LEFT_BORDER, org.openoffice.xmerge.converter.xml.sxc.Format.MIDDLE_ALIGN, org.openoffice.xmerge.converter.xml.sxc.Format.RIGHT_ALIGN, org.openoffice.xmerge.converter.xml.sxc.Format.RIGHT_BORDER, org.openoffice.xmerge.converter.xml.sxc.Format.STRIKETHRU, org.openoffice.xmerge.converter.xml.sxc.Format.SUBSCRIPT, org.openoffice.xmerge.converter.xml.sxc.Format.SUPERSCRIPT, org.openoffice.xmerge.converter.xml.sxc.Format.TOP_ALIGN, org.openoffice.xmerge.converter.xml.sxc.Format.TOP_BORDER, org.openoffice.xmerge.converter.xml.sxc.Format.UNDERLINE, and org.openoffice.xmerge.converter.xml.sxc.Format.WORD_WRAP.

Referenced by org.openoffice.xmerge.converter.xml.sxc.CellStyle.createNode().

Member Data Documentation

◆ fmt

Format org.openoffice.xmerge.converter.xml.sxc.CellStyle.fmt = new Format()
private

◆ ignored

String [] org.openoffice.xmerge.converter.xml.sxc.CellStyle.ignored
staticprivate
Initial value:
= {
"style:text-autospace", "style:text-underline-color",
"fo:margin-left", "fo:margin-right", "fo:text-indent",
"fo:margin-top", "fo:margin-bottom", "text:line-number",
"text:number-lines", "style:country-asian",
"style:font-size-asian", "style:font-name-complex",
"style:language-complex", "style:country-complex",
"style:font-size-complex", "style:punctuation-wrap",
"fo:language", "fo:country",
"style:font-name-asian", "style:language-asian",
"style:line-break", "fo:keep-with-next"
}

Definition at line 443 of file CellStyle.java.

Referenced by org.openoffice.xmerge.converter.xml.sxc.CellStyle.isIgnored().


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