LibreOffice Module xmerge (master) 1
|
Represents a text Style
in an OpenOffice document.
More...
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 Style . More... | |
String | getFontName () |
Return the name of the font for this Style . More... | |
Color | getFontColor () |
Return the font Color for this Style . More... | |
Color | getBackgroundColor () |
Return the background Color for 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... | |
void | dumpCSV () |
Dump this Style as a Comma Separated Value (CSV) line. 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... | |
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 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... | |
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 Color . More... | |
Color | bgColor = null |
Background Color . 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 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... | |
Represents a text Style
in an OpenOffice document.
Definition at line 35 of file TextStyle.java.
|
inline |
Constructor for use when going from DOM to client device format.
node | The style:style Node containing the Style . (This Node is assumed have a family attribute of text). |
sc | The StyleCatalog , which is used for looking up ancestor Style 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().
|
inline |
Constructor for use when going from client device format to DOM.
name | Name of text Style . Can be null . |
family | Family of text Style (usually text). Can be null . |
parent | Name of parent text Style , or null for none. |
mask | Bitwise mask of text attributes that this text Style will specify. Can be any combination of the following, or'ed together: BOLD , ITALIC , UNDERLINE , STRIKETHRU , SUPERSCRIPT , SUBSCRIPT . This parameter determines what attributes this Style will specify. When an attribute is specified in a Style , its value can be either on or off. The on/off value for each attribute is controlled by the values parameter. |
values | Values of text attributes that this text Style will be setting. Any of the attributes (BOLD , etc) listed for mask can be used for this. |
fontSize | Font size in points. |
fontName | Name of font. |
sc | The StyleCatalog , which is used for looking up ancestor Style objects. |
Definition at line 138 of file TextStyle.java.
References org.openoffice.xmerge.converter.xml.Style.family, org.openoffice.xmerge.converter.xml.TextStyle.fontName, org.openoffice.xmerge.converter.xml.TextStyle.mask, org.openoffice.xmerge.converter.xml.Style.name, org.openoffice.xmerge.converter.xml.Style.parent, and org.openoffice.xmerge.converter.xml.TextStyle.values.
|
inlineprivate |
Given a Color
, return a string of the form #rrggbb.
c | The Color value. |
Color
value in the form #rrggbb. Definition at line 542 of file TextStyle.java.
References String.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
inline |
Create a new Node
in the Document
, and write this Style
to it.
parentDoc | Parent Document of the Node to create. |
name | Name to use for the new Node (e.g. style:style) |
Node
. Reimplemented from org.openoffice.xmerge.converter.xml.Style.
Definition at line 443 of file TextStyle.java.
References org.openoffice.xmerge.converter.xml.Style.name, and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
inline |
Dump this Style
as a Comma Separated Value (CSV) line.
Definition at line 418 of file TextStyle.java.
References org.openoffice.xmerge.converter.xml.Style.family, org.openoffice.xmerge.converter.xml.TextStyle.fontName, org.openoffice.xmerge.converter.xml.TextStyle.mask, org.openoffice.xmerge.converter.xml.Style.name, org.openoffice.xmerge.converter.xml.Style.parent, org.openoffice.xmerge.converter.xml.TextStyle.sizeInPoints, System, org.openoffice.xmerge.converter.xml.TextStyle.toCSV(), org.openoffice.xmerge.converter.xml.TextStyle.toLastCSV(), and org.openoffice.xmerge.converter.xml.TextStyle.values.
|
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().
|
inline |
Return the background Color
for this Style
.
Can be null
if none was specified.
Color
value for this Style
. Can be null
. Definition at line 289 of file TextStyle.java.
References org.openoffice.xmerge.converter.xml.TextStyle.bgColor, and Color.
|
inline |
Return the font Color
for this Style
.
Can be null
if none was specified.
Color
value for this Style
. Can be null
. Definition at line 277 of file TextStyle.java.
References Color, and org.openoffice.xmerge.converter.xml.TextStyle.fontColor.
|
inline |
Return the name of the font for this Style
.
Style
. Definition at line 266 of file TextStyle.java.
References org.openoffice.xmerge.converter.xml.TextStyle.fontName, and String.
|
inline |
Return the font size for this Style
.
Definition at line 256 of file TextStyle.java.
References org.openoffice.xmerge.converter.xml.TextStyle.sizeInPoints.
|
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.
StyleCatalog
in which to look up ancestors. Reimplemented from org.openoffice.xmerge.converter.xml.Style.
Definition at line 303 of file TextStyle.java.
References org.openoffice.xmerge.converter.xml.TextStyle.bgColor, org.openoffice.xmerge.converter.xml.TextStyle.BOLD, clone(), org.openoffice.xmerge.util.Debug.ERROR, Exception, org.openoffice.xmerge.converter.xml.Style.family, org.openoffice.xmerge.converter.xml.TextStyle.fontColor, org.openoffice.xmerge.converter.xml.TextStyle.fontName, org.openoffice.xmerge.converter.xml.TextStyle.getResolved(), org.openoffice.xmerge.util.Debug.log(), m, org.openoffice.xmerge.converter.xml.TextStyle.mask, org.openoffice.xmerge.converter.xml.Style.name, org.openoffice.xmerge.converter.xml.Style.parent, org.openoffice.xmerge.converter.xml.TextStyle.sizeInPoints, org.openoffice.xmerge.converter.xml.TextStyle.SUBSCRIPT, org.openoffice.xmerge.converter.xml.TextStyle.TextStyle(), and org.openoffice.xmerge.converter.xml.TextStyle.values.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.getResolved().
|
inlineprivate |
Set an attribute.
attr | The attribute to set. |
value | The attribute value to set. |
Definition at line 177 of file TextStyle.java.
References org.openoffice.xmerge.converter.xml.TextStyle.bgColor, org.openoffice.xmerge.converter.xml.TextStyle.BOLD, org.openoffice.xmerge.util.Debug.ERROR, org.openoffice.xmerge.converter.xml.TextStyle.fontColor, org.openoffice.xmerge.converter.xml.TextStyle.fontName, org.openoffice.xmerge.util.Debug.INFO, Integer, org.openoffice.xmerge.converter.xml.TextStyle.isIgnored(), org.openoffice.xmerge.converter.xml.TextStyle.ITALIC, org.openoffice.xmerge.util.Debug.log(), org.openoffice.xmerge.converter.xml.TextStyle.parseColorString(), org.openoffice.xmerge.converter.xml.TextStyle.sizeInPoints, org.openoffice.xmerge.converter.xml.TextStyle.STRIKETHRU, String, org.openoffice.xmerge.converter.xml.TextStyle.SUBSCRIPT, org.openoffice.xmerge.converter.xml.TextStyle.SUPERSCRIPT, org.openoffice.xmerge.converter.xml.TextStyle.turnAttributesOff(), org.openoffice.xmerge.converter.xml.TextStyle.turnAttributesOn(), org.openoffice.xmerge.converter.xml.TextStyle.UNDERLINE, and value.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.TextStyle().
|
inlineprivate |
This code checks whether an attribute is one that we intentionally ignore.
attribute | The attribute to check. |
true
if attribute
can be ignored, otherwise false
. Definition at line 567 of file TextStyle.java.
References attribute, org.openoffice.xmerge.converter.xml.TextStyle.ignored, and String.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute().
|
inline |
Return true
if style
specifies as much or less than this Style
, and nothing it specifies contradicts this Style
.
style | The Style to check. |
true
if style
is a subset, false
otherwise. Reimplemented from org.openoffice.xmerge.converter.xml.Style.
Definition at line 459 of file TextStyle.java.
References org.openoffice.xmerge.converter.xml.TextStyle.bgColor, org.openoffice.xmerge.converter.xml.TextStyle.fontColor, org.openoffice.xmerge.converter.xml.TextStyle.fontName, org.openoffice.xmerge.converter.xml.TextStyle.sizeInPoints, org.openoffice.xmerge.converter.xml.TextStyle.TextStyle(), and org.openoffice.xmerge.converter.xml.TextStyle.values.
|
inlineprivate |
Parse a color specification of the form #rrggbb
value | Color specification to parse. |
Color
associated the value. Definition at line 154 of file TextStyle.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.TextStyle.handleAttribute().
|
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 383 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.dumpCSV(), and org.openoffice.xmerge.converter.xml.TextStyle.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 398 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.dumpCSV(), and org.openoffice.xmerge.converter.xml.TextStyle.dumpHdr().
|
inlineprivate |
Set one or more text attributes to off.
flags | The flag values to set off. |
Definition at line 370 of file TextStyle.java.
References org.openoffice.xmerge.converter.xml.TextStyle.mask, and org.openoffice.xmerge.converter.xml.TextStyle.values.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute().
|
inlineprivate |
Set one or more text attributes to on.
flags | Flag values to set on. |
Definition at line 360 of file TextStyle.java.
References org.openoffice.xmerge.converter.xml.TextStyle.mask, and org.openoffice.xmerge.converter.xml.TextStyle.values.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute().
|
inlineprivate |
Write this Style
object's attributes to a Node
in the Document
.
node | The Node to add Style attributes. |
Definition at line 500 of file TextStyle.java.
References org.openoffice.xmerge.converter.xml.TextStyle.bgColor, org.openoffice.xmerge.converter.xml.TextStyle.BOLD, org.openoffice.xmerge.converter.xml.TextStyle.buildColorString(), org.openoffice.xmerge.converter.xml.TextStyle.fontColor, org.openoffice.xmerge.converter.xml.TextStyle.fontName, Integer, org.openoffice.xmerge.converter.xml.TextStyle.ITALIC, org.openoffice.xmerge.converter.xml.TextStyle.mask, org.openoffice.xmerge.converter.xml.TextStyle.sizeInPoints, org.openoffice.xmerge.converter.xml.TextStyle.STRIKETHRU, org.openoffice.xmerge.converter.xml.TextStyle.SUBSCRIPT, org.openoffice.xmerge.converter.xml.TextStyle.SUPERSCRIPT, org.openoffice.xmerge.converter.xml.TextStyle.UNDERLINE, and org.openoffice.xmerge.converter.xml.TextStyle.values.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.createNode().
|
private |
Background Color
.
Definition at line 62 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.getBackgroundColor(), org.openoffice.xmerge.converter.xml.TextStyle.getResolved(), org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.TextStyle.isSubset(), and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
staticprivate |
Indicates bold text.
Definition at line 38 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.getResolved(), org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
private |
Font Color
.
Definition at line 60 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.getFontColor(), org.openoffice.xmerge.converter.xml.TextStyle.getResolved(), org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.TextStyle.isSubset(), and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
private |
Font name.
Definition at line 58 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.dumpCSV(), org.openoffice.xmerge.converter.xml.TextStyle.getFontName(), org.openoffice.xmerge.converter.xml.TextStyle.getResolved(), org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.TextStyle.isSubset(), org.openoffice.xmerge.converter.xml.TextStyle.TextStyle(), and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
staticprivate |
Definition at line 546 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.isIgnored().
|
staticprivate |
Indicates italic text.
Definition at line 40 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
private |
Bitwise mask of text attributes.
Definition at line 53 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.dumpCSV(), org.openoffice.xmerge.converter.xml.TextStyle.getResolved(), org.openoffice.xmerge.converter.xml.TextStyle.TextStyle(), org.openoffice.xmerge.converter.xml.TextStyle.turnAttributesOff(), org.openoffice.xmerge.converter.xml.TextStyle.turnAttributesOn(), and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
private |
Font size in points.
Definition at line 56 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.dumpCSV(), org.openoffice.xmerge.converter.xml.TextStyle.getFontSize(), org.openoffice.xmerge.converter.xml.TextStyle.getResolved(), org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), org.openoffice.xmerge.converter.xml.TextStyle.isSubset(), and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
staticprivate |
Indicates strike-through in the text.
Definition at line 44 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
staticprivate |
Indicates subscripted text.
Definition at line 48 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.getResolved(), org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
staticprivate |
Indicates superscripted text.
Definition at line 46 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
staticprivate |
Indicates underlined text.
Definition at line 42 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.handleAttribute(), and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().
|
private |
Values of text attributes.
Definition at line 51 of file TextStyle.java.
Referenced by org.openoffice.xmerge.converter.xml.TextStyle.dumpCSV(), org.openoffice.xmerge.converter.xml.TextStyle.getResolved(), org.openoffice.xmerge.converter.xml.TextStyle.isSubset(), org.openoffice.xmerge.converter.xml.TextStyle.TextStyle(), org.openoffice.xmerge.converter.xml.TextStyle.turnAttributesOff(), org.openoffice.xmerge.converter.xml.TextStyle.turnAttributesOn(), and org.openoffice.xmerge.converter.xml.TextStyle.writeAttributes().