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

Represents a text. More...

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

Public Member Functions

 TextStyle (Node node, StyleCatalog sc)
 Constructor for use when going from DOM to client device format. More...
 
 TextStyle (String name, String family, String parent, int mask, int values, int fontSize, String fontName, StyleCatalog sc)
 Constructor for use when going from client device format to DOM. More...
 
int getFontSize ()
 Return the font size for this. More...
 
String getFontName ()
 Return the name of the font for this. More...
 
Color getFontColor ()
 Return the font. More...
 
Color getBackgroundColor ()
 Return the background. More...
 
Style getResolved ()
 Return a. More...
 
void dumpCSV ()
 Dump this. More...
 
Node createNode (org.w3c.dom.Document parentDoc, String name)
 Create a new. 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...
 

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 turnAttributesOn (int flags)
 Set one or more text attributes to on. More...
 
void turnAttributesOff (int flags)
 Set one or more text attributes to off. More...
 
void writeAttributes (Element node)
 Write this. More...
 
String buildColorString (Color c)
 Given a. More...
 
boolean isIgnored (String attribute)
 This code checks whether an attribute is one that we intentionally ignore. 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

int values = 0
 Values of text attributes. More...
 
int mask = 0
 Bitwise mask of text attributes. More...
 
int sizeInPoints = 0
 Font size in points. More...
 
String fontName = null
 Font name. More...
 
Color fontColor = null
 Font. More...
 
Color bgColor = null
 Background. More...
 

Static Private Attributes

final static int BOLD = 0x01
 Indicates bold text. More...
 
final static int ITALIC = 0x02
 Indicates italic text. More...
 
final static int UNDERLINE = 0x04
 Indicates underlined text. More...
 
final static int STRIKETHRU = 0x08
 Indicates strike-through in the text. More...
 
final static int SUPERSCRIPT = 0x10
 Indicates superscripted text. More...
 
final static int SUBSCRIPT = 0x20
 Indicates subscripted text. More...
 
static String[] ignored
 

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

Represents a text.

in an OpenOffice document.

Definition at line 35 of file TextStyle.java.

Constructor & Destructor Documentation

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

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

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

Definition at line 73 of file TextStyle.java.

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

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

org.openoffice.xmerge.converter.xml.TextStyle.TextStyle ( String  name,
String  family,
String  parent,
int  mask,
int  values,
int  fontSize,
String  fontName,
StyleCatalog  sc 
)
inline

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

Parameters
nameName of text . Can be
null
.
familyFamily of text (usually text). Can be
null
.
parentName of parent text , or
null
for none.
maskBitwise mask of text attributes that this text will specify. Can be any combination of the following, or'ed together: BOLD, ITALIC, UNDERLINE, STRIKETHRU, SUPERSCRIPT, SUBSCRIPT. This parameter determines what attributes this will specify. When an attribute is specified in a , its value can be either on or off. The on/off value for each attribute is controlled by the parameter.
valuesValues of text attributes that this text will be setting. Any of the attributes (BOLD, etc) listed for can be used for this.
fontSizeFont size in points.
fontNameName of font.
scThe
StyleCatalog
, which is used for looking up ancestor objects.

Definition at line 138 of file TextStyle.java.

References org.openoffice.xmerge.converter.xml.TextStyle.fontName, org.openoffice.xmerge.converter.xml.TextStyle.mask, and org.openoffice.xmerge.converter.xml.TextStyle.values.

Member Function Documentation

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

Given a.

, return a string of the form { #rrggbb}.

Parameters
cThe value.
Returns
The value in the form { #rrggbb}.

Definition at line 542 of file TextStyle.java.

References String.

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

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

Create a new.

in the

, and write this

to it.

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

Definition at line 443 of file TextStyle.java.

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

void org.openoffice.xmerge.converter.xml.TextStyle.dumpCSV ( )
inline
static void org.openoffice.xmerge.converter.xml.TextStyle.dumpHdr ( )
inlinestatic

Print a Comma Separated Value (CSV) header line for the spreadsheet dump.

Definition at line 408 of file TextStyle.java.

References System, org.openoffice.xmerge.converter.xml.TextStyle.toCSV(), and org.openoffice.xmerge.converter.xml.TextStyle.toLastCSV().

Color org.openoffice.xmerge.converter.xml.TextStyle.getBackgroundColor ( )
inline

Return the background.

for this

.

Can be

null

if none was specified.

Returns
Background value for this . Can be
null
.

Definition at line 289 of file TextStyle.java.

References org.openoffice.xmerge.converter.xml.TextStyle.bgColor, and Color.

Color org.openoffice.xmerge.converter.xml.TextStyle.getFontColor ( )
inline

Return the font.

for this

.

Can be

null

if none was specified.

Returns
value for this . Can be
null
.

Definition at line 277 of file TextStyle.java.

References Color, and org.openoffice.xmerge.converter.xml.TextStyle.fontColor.

String org.openoffice.xmerge.converter.xml.TextStyle.getFontName ( )
inline

Return the name of the font for this.

.

Returns
Name of font, or null if no font is specified by this .

Definition at line 266 of file TextStyle.java.

References org.openoffice.xmerge.converter.xml.TextStyle.fontName, and String.

int org.openoffice.xmerge.converter.xml.TextStyle.getFontSize ( )
inline

Return the font size for this.

.

Returns
The font size in points

Definition at line 256 of file TextStyle.java.

References org.openoffice.xmerge.converter.xml.TextStyle.sizeInPoints.

Style org.openoffice.xmerge.converter.xml.TextStyle.getResolved ( )
inline
void org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute ( String  attr,
String  value 
)
inlineprivate
boolean org.openoffice.xmerge.converter.xml.TextStyle.isIgnored ( String  attribute)
inlineprivate

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

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

Definition at line 567 of file TextStyle.java.

References String.

Referenced by org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute().

boolean org.openoffice.xmerge.converter.xml.TextStyle.isSubset ( Style  style)
inline
Color org.openoffice.xmerge.converter.xml.TextStyle.parseColorString ( String  value)
inlineprivate

Parse a color specification of the form #rrggbb

Parameters
value

Definition at line 154 of file TextStyle.java.

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

Referenced by org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute().

static String org.openoffice.xmerge.converter.xml.TextStyle.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 383 of file TextStyle.java.

References String.

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

static String org.openoffice.xmerge.converter.xml.TextStyle.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 398 of file TextStyle.java.

References String.

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

void org.openoffice.xmerge.converter.xml.TextStyle.turnAttributesOff ( int  flags)
inlineprivate

Set one or more text attributes to off.

Parameters
flagsThe flag values to set off.

Definition at line 370 of file TextStyle.java.

Referenced by org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute().

void org.openoffice.xmerge.converter.xml.TextStyle.turnAttributesOn ( int  flags)
inlineprivate

Set one or more text attributes to on.

Parameters
flagsFlag values to set on.

Definition at line 360 of file TextStyle.java.

Referenced by org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute().

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

Write this.

object's attributes to a

in the

.

Parameters
nodeThe to add attributes.

Definition at line 500 of file TextStyle.java.

References org.openoffice.xmerge.converter.xml.TextStyle.buildColorString(), and Integer.

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

Member Data Documentation

Color org.openoffice.xmerge.converter.xml.TextStyle.bgColor = null
private
final static int org.openoffice.xmerge.converter.xml.TextStyle.BOLD = 0x01
staticprivate

Indicates bold text.

Definition at line 38 of file TextStyle.java.

Color org.openoffice.xmerge.converter.xml.TextStyle.fontColor = null
private
String org.openoffice.xmerge.converter.xml.TextStyle.fontName = null
private
String [] org.openoffice.xmerge.converter.xml.TextStyle.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 546 of file TextStyle.java.

final static int org.openoffice.xmerge.converter.xml.TextStyle.ITALIC = 0x02
staticprivate

Indicates italic text.

Definition at line 40 of file TextStyle.java.

int org.openoffice.xmerge.converter.xml.TextStyle.mask = 0
private
int org.openoffice.xmerge.converter.xml.TextStyle.sizeInPoints = 0
private
final static int org.openoffice.xmerge.converter.xml.TextStyle.STRIKETHRU = 0x08
staticprivate

Indicates strike-through in the text.

Definition at line 44 of file TextStyle.java.

final static int org.openoffice.xmerge.converter.xml.TextStyle.SUBSCRIPT = 0x20
staticprivate

Indicates subscripted text.

Definition at line 48 of file TextStyle.java.

Referenced by org.openoffice.xmerge.converter.xml.TextStyle.getResolved().

final static int org.openoffice.xmerge.converter.xml.TextStyle.SUPERSCRIPT = 0x10
staticprivate

Indicates superscripted text.

Definition at line 46 of file TextStyle.java.

final static int org.openoffice.xmerge.converter.xml.TextStyle.UNDERLINE = 0x04
staticprivate

Indicates underlined text.

Definition at line 42 of file TextStyle.java.

int org.openoffice.xmerge.converter.xml.TextStyle.values = 0
private

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