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

This class specifies the format for a given spreadsheet cell. More...

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

Public Member Functions

 Format ()
 Constructor for creating a new. More...
 
 Format (int attributes, int fontSize, String fontName)
 Constructor that creates a new. More...
 
 Format (Format fmt)
 Constructor for creating a new. More...
 
void clearFormatting ()
 Reset this. More...
 
void setAttribute (int flags, boolean toggle)
 Set one or more text attributes. More...
 
boolean getAttribute (int attribute)
 Return. More...
 
void setCategory (String newCategory)
 Set the formatting category of this object, ie number, date, currency. More...
 
void setValue (String newValue)
 In the case of formula the contents are set as the formula string and the value of the formula is a formatting attribute. More...
 
void setFormatSpecifier (String formatString)
 Set the. More...
 
void setDecimalPlaces (int precision)
 Set the precision of the number to be displayed. More...
 
void setFontName (String fontName)
 Set the font used for this cell. More...
 
String getFontName ()
 Get the font used for this cell. More...
 
void setFontSize (int fontSize)
 Set the font size (in points) used for this cell. More...
 
int getFontSize ()
 Get the font size (in points) used for this cell. More...
 
void setVertAlign (int vertAlign)
 Set the vertical alignment used for this cell. More...
 
int getVertAlign ()
 Get the vertical alignment used for this cell. More...
 
void setAlign (int align)
 Set the alignment used for this cell. More...
 
int getAlign ()
 Get the alignment used for this cell. More...
 
void setForeground (Color c)
 Set the Foreground. More...
 
Color getForeground ()
 Get the Foreground. More...
 
void setBackground (Color c)
 Set the Background. More...
 
Color getBackground ()
 Get the Background. More...
 
String toString ()
 Get a. More...
 
boolean isDefault ()
 Tests if the current. More...
 
boolean isSubset (Format rhs)
 Return true if passed. More...
 

Static Public Attributes

final static int RIGHT_ALIGN = 0x01
 Horizontal Alignment Constants. More...
 
final static int CENTER_ALIGN = 0x02
 
final static int LEFT_ALIGN = 0x03
 
final static int TOP_ALIGN = 0x01
 Vertical Alignment Constants. More...
 
final static int MIDDLE_ALIGN = 0x02
 
final static int BOTTOM_ALIGN = 0x03
 
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...
 
final static int LEFT_BORDER = 0x40
 
final static int RIGHT_BORDER = 0x80
 
final static int TOP_BORDER = 0x100
 
final static int BOTTOM_BORDER = 0x200
 
final static int WORD_WRAP = 0x400
 

Private Member Functions

String getCategory ()
 Return the formatting category of the object. More...
 
String getValue ()
 In the case of Formula returns the value of the formula. More...
 
String getFormatSpecifier ()
 Get the. More...
 
int getDecimalPlaces ()
 Get the number of decimal places displayed. More...
 

Private Attributes

int align
 
int vertAlign
 
String category
 
String value
 
String formatSpecifier
 
int decimalPlaces
 
String fontName
 Font name. More...
 
int sizeInPoints
 Font size in points. More...
 
Color foreground
 
int attributes = 0
 Values of text attributes. More...
 
int mask = 0
 Bitwise mask of text attributes. More...
 

Detailed Description

This class specifies the format for a given spreadsheet cell.

Definition at line 26 of file Format.java.

Constructor & Destructor Documentation

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

Constructor for creating a new.

.

Definition at line 80 of file Format.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.clearFormatting().

Referenced by org.openoffice.xmerge.converter.xml.sxc.Format.isDefault().

org.openoffice.xmerge.converter.xml.sxc.Format.Format ( int  attributes,
int  fontSize,
String  fontName 
)
inline

Constructor that creates a new.

object by setting all the format attributes.

Parameters
attributesAttributes flags (alignment, bold, etc.)
fontSizeSize of the font in points.
fontNameName of the font to use.

Definition at line 92 of file Format.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.attributes, and org.openoffice.xmerge.converter.xml.sxc.Format.fontName.

org.openoffice.xmerge.converter.xml.sxc.Format.Format ( Format  fmt)
inline

Member Function Documentation

void org.openoffice.xmerge.converter.xml.sxc.Format.clearFormatting ( )
inline
int org.openoffice.xmerge.converter.xml.sxc.Format.getAlign ( )
inline
boolean org.openoffice.xmerge.converter.xml.sxc.Format.getAttribute ( int  attribute)
inline

Return.

true

if the

is set to on.

Parameters
attributeAttribute to check (BOLD, ITALIC, etc.).
Returns
true
if is set to on, otherwise
false
.

Definition at line 164 of file Format.java.

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

Color org.openoffice.xmerge.converter.xml.sxc.Format.getBackground ( )
inline
String org.openoffice.xmerge.converter.xml.sxc.Format.getCategory ( )
inlineprivate

Return the formatting category of the object.

See also
org.openoffice.xmerge.converter.xml.OfficeConstants
Returns
The formatting category of the object.

Definition at line 191 of file Format.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.category, and String.

Referenced by org.openoffice.xmerge.converter.xml.sxc.Format.Format(), and org.openoffice.xmerge.converter.xml.sxc.Format.toString().

int org.openoffice.xmerge.converter.xml.sxc.Format.getDecimalPlaces ( )
inlineprivate

Get the number of decimal places displayed.

Returns
Number of decimal places.

Definition at line 246 of file Format.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.decimalPlaces.

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

String org.openoffice.xmerge.converter.xml.sxc.Format.getFontName ( )
inline
int org.openoffice.xmerge.converter.xml.sxc.Format.getFontSize ( )
inline

Get the font size (in points) used for this cell.

Returns
The font size in points.

Definition at line 282 of file Format.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.sizeInPoints.

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

Color org.openoffice.xmerge.converter.xml.sxc.Format.getForeground ( )
inline
String org.openoffice.xmerge.converter.xml.sxc.Format.getFormatSpecifier ( )
inlineprivate

Get the.

specifier for this category.

Returns
specifier for this category.

Definition at line 228 of file Format.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.formatSpecifier, and String.

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

String org.openoffice.xmerge.converter.xml.sxc.Format.getValue ( )
inlineprivate

In the case of Formula returns the value of the formula.

Returns
The value of the formula.

Definition at line 200 of file Format.java.

References String, and org.openoffice.xmerge.converter.xml.sxc.Format.value.

Referenced by org.openoffice.xmerge.converter.xml.sxc.Format.Format(), and org.openoffice.xmerge.converter.xml.sxc.Format.toString().

int org.openoffice.xmerge.converter.xml.sxc.Format.getVertAlign ( )
inline
boolean org.openoffice.xmerge.converter.xml.sxc.Format.isDefault ( )
inline
boolean org.openoffice.xmerge.converter.xml.sxc.Format.isSubset ( Format  rhs)
inline
void org.openoffice.xmerge.converter.xml.sxc.Format.setAlign ( int  align)
inline

Set the alignment used for this cell.

Parameters
alignThe alignment to use.

Definition at line 309 of file Format.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.align.

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

void org.openoffice.xmerge.converter.xml.sxc.Format.setAttribute ( int  flags,
boolean  toggle 
)
inline

Set one or more text attributes.

Parameters
flagsFlag attributes to set.
toggle

Definition at line 146 of file Format.java.

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

void org.openoffice.xmerge.converter.xml.sxc.Format.setBackground ( Color  c)
inline

Set the Background.

for this cell.

Parameters
cA object representing the background color.

Definition at line 346 of file Format.java.

References Color.

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

void org.openoffice.xmerge.converter.xml.sxc.Format.setCategory ( String  newCategory)
inline

Set the formatting category of this object, ie number, date, currency.

The OfficeConstants class contains string constants for the category types.

See also
org.openoffice.xmerge.converter.xml.OfficeConstants
Parameters
newCategoryThe name of the category to be set.

Definition at line 180 of file Format.java.

Referenced by org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseCell().

void org.openoffice.xmerge.converter.xml.sxc.Format.setDecimalPlaces ( int  precision)
inline

Set the precision of the number to be displayed.

Parameters
precisionThe number of decimal places to display.

Definition at line 237 of file Format.java.

Referenced by org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseCell().

void org.openoffice.xmerge.converter.xml.sxc.Format.setFontName ( String  fontName)
inline

Set the font used for this cell.

Parameters
fontNameThe name of the font.

Definition at line 255 of file Format.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.fontName.

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

void org.openoffice.xmerge.converter.xml.sxc.Format.setFontSize ( int  fontSize)
inline

Set the font size (in points) used for this cell.

Parameters
fontSizeThe font size in points.

Definition at line 273 of file Format.java.

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

void org.openoffice.xmerge.converter.xml.sxc.Format.setForeground ( Color  c)
inline

Set the Foreground.

for this cell.

Parameters
cA object representing the foreground color.

Definition at line 327 of file Format.java.

References Color.

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

void org.openoffice.xmerge.converter.xml.sxc.Format.setFormatSpecifier ( String  formatString)
inline

Set the.

specifier for this category.

Parameters
formatStringThe new specifier.

Definition at line 219 of file Format.java.

void org.openoffice.xmerge.converter.xml.sxc.Format.setValue ( String  newValue)
inline

In the case of formula the contents are set as the formula string and the value of the formula is a formatting attribute.

Parameters
newValuethe formula value.

Definition at line 210 of file Format.java.

Referenced by org.openoffice.xmerge.converter.xml.sxc.SxcDocumentSerializer.traverseCell().

void org.openoffice.xmerge.converter.xml.sxc.Format.setVertAlign ( int  vertAlign)
inline

Set the vertical alignment used for this cell.

Parameters
vertAlignThe vertical alignment.

Definition at line 291 of file Format.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.vertAlign.

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

String org.openoffice.xmerge.converter.xml.sxc.Format.toString ( )
inline

Get a.

representation of this

.

Returns
A indicating the value and category.

Definition at line 366 of file Format.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.getCategory(), org.openoffice.xmerge.converter.xml.sxc.Format.getValue(), and String.

Member Data Documentation

int org.openoffice.xmerge.converter.xml.sxc.Format.align
private
int org.openoffice.xmerge.converter.xml.sxc.Format.attributes = 0
private
final static int org.openoffice.xmerge.converter.xml.sxc.Format.BOLD = 0x01
static
final static int org.openoffice.xmerge.converter.xml.sxc.Format.BOTTOM_ALIGN = 0x03
static
final static int org.openoffice.xmerge.converter.xml.sxc.Format.BOTTOM_BORDER = 0x200
static
String org.openoffice.xmerge.converter.xml.sxc.Format.category
private
final static int org.openoffice.xmerge.converter.xml.sxc.Format.CENTER_ALIGN = 0x02
static
int org.openoffice.xmerge.converter.xml.sxc.Format.decimalPlaces
private
String org.openoffice.xmerge.converter.xml.sxc.Format.fontName
private
Color org.openoffice.xmerge.converter.xml.sxc.Format.foreground
private
String org.openoffice.xmerge.converter.xml.sxc.Format.formatSpecifier
private
final static int org.openoffice.xmerge.converter.xml.sxc.Format.ITALIC = 0x02
static
final static int org.openoffice.xmerge.converter.xml.sxc.Format.LEFT_ALIGN = 0x03
static
final static int org.openoffice.xmerge.converter.xml.sxc.Format.LEFT_BORDER = 0x40
static
int org.openoffice.xmerge.converter.xml.sxc.Format.mask = 0
private

Bitwise mask of text attributes.

Definition at line 75 of file Format.java.

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

final static int org.openoffice.xmerge.converter.xml.sxc.Format.MIDDLE_ALIGN = 0x02
static
final static int org.openoffice.xmerge.converter.xml.sxc.Format.RIGHT_ALIGN = 0x01
static
final static int org.openoffice.xmerge.converter.xml.sxc.Format.RIGHT_BORDER = 0x80
static
int org.openoffice.xmerge.converter.xml.sxc.Format.sizeInPoints
private
final static int org.openoffice.xmerge.converter.xml.sxc.Format.STRIKETHRU = 0x08
static
final static int org.openoffice.xmerge.converter.xml.sxc.Format.SUBSCRIPT = 0x20
static
final static int org.openoffice.xmerge.converter.xml.sxc.Format.SUPERSCRIPT = 0x10
static
final static int org.openoffice.xmerge.converter.xml.sxc.Format.TOP_ALIGN = 0x01
static
final static int org.openoffice.xmerge.converter.xml.sxc.Format.TOP_BORDER = 0x100
static
final static int org.openoffice.xmerge.converter.xml.sxc.Format.UNDERLINE = 0x04
static
String org.openoffice.xmerge.converter.xml.sxc.Format.value
private

Definition at line 61 of file Format.java.

Referenced by org.openoffice.xmerge.converter.xml.sxc.Format.getValue().

int org.openoffice.xmerge.converter.xml.sxc.Format.vertAlign
private
final static int org.openoffice.xmerge.converter.xml.sxc.Format.WORD_WRAP = 0x400
static

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