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 Format. More...
 
 Format (int attributes, int fontSize, String fontName)
 Constructor that creates a new Format object by setting all the format attributes. More...
 
 Format (Format fmt)
 Constructor for creating a new Format object based on an existing one. More...
 
void clearFormatting ()
 Reset this Format description. More...
 
void setAttribute (int flags, boolean toggle)
 Set one or more text attributes. More...
 
boolean getAttribute (int attribute)
 Return true if the attribute is set to on. 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 Format specifier for this category. 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 Color for this cell. More...
 
Color getForeground ()
 Get the Foreground Color for this cell. More...
 
void setBackground (Color c)
 Set the Background Color for this cell. More...
 
Color getBackground ()
 Get the Background Color for this cell. More...
 
String toString ()
 Get a String representation of this Format. More...
 
boolean isDefault ()
 Tests if the current Format object has default attribute values. More...
 
boolean isSubset (Format rhs)
 Return true if passed Format specifies as much or less than this Format, and nothing it specifies contradicts this Format. 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 Format specifier for this category. 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
 
Color background
 
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

◆ Format() [1/3]

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

Constructor for creating a new Format.

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

◆ Format() [2/3]

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

Constructor that creates a new Format 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, org.openoffice.xmerge.converter.xml.sxc.Format.fontName, and org.openoffice.xmerge.converter.xml.sxc.Format.sizeInPoints.

◆ Format() [3/3]

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

Member Function Documentation

◆ clearFormatting()

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

◆ getAlign()

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

◆ getAttribute()

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

Return true if the attribute is set to on.

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

Definition at line 164 of file Format.java.

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

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

◆ getBackground()

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

◆ getCategory()

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

◆ getDecimalPlaces()

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

◆ getFontName()

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

◆ getFontSize()

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

◆ getForeground()

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

◆ getFormatSpecifier()

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

Get the Format specifier for this category.

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

◆ getValue()

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

◆ getVertAlign()

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

◆ isDefault()

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

◆ isSubset()

boolean org.openoffice.xmerge.converter.xml.sxc.Format.isSubset ( Format  rhs)
inline

◆ setAlign()

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

◆ setAttribute()

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.
toggletrue to set flags, false to clear them.

Definition at line 146 of file Format.java.

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

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

◆ setBackground()

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

Set the Background Color for this cell.

Parameters
cA Color object representing the background color.

Definition at line 346 of file Format.java.

References org.openoffice.xmerge.converter.xml.sxc.Format.background, and Color.

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

◆ setCategory()

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.

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

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

◆ setDecimalPlaces()

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.

References org.openoffice.xmerge.converter.xml.sxc.Format.decimalPlaces, and precision.

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

◆ setFontName()

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

◆ setFontSize()

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.

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

◆ setForeground()

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

Set the Foreground Color for this cell.

Parameters
cA Color object representing the foreground color.

Definition at line 327 of file Format.java.

References Color, and org.openoffice.xmerge.converter.xml.sxc.Format.foreground.

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

◆ setFormatSpecifier()

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

Set the Format specifier for this category.

Parameters
formatStringThe new Format specifier.

Definition at line 219 of file Format.java.

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

◆ setValue()

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.

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

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

◆ setVertAlign()

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

◆ toString()

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

Get a String representation of this Format.

Returns
A String 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

◆ align

int org.openoffice.xmerge.converter.xml.sxc.Format.align
private

◆ attributes

int org.openoffice.xmerge.converter.xml.sxc.Format.attributes = 0
private

◆ background

Color org.openoffice.xmerge.converter.xml.sxc.Format.background
private

◆ BOLD

final static int org.openoffice.xmerge.converter.xml.sxc.Format.BOLD = 0x01
static

◆ BOTTOM_ALIGN

final static int org.openoffice.xmerge.converter.xml.sxc.Format.BOTTOM_ALIGN = 0x03
static

◆ BOTTOM_BORDER

final static int org.openoffice.xmerge.converter.xml.sxc.Format.BOTTOM_BORDER = 0x200
static

◆ category

String org.openoffice.xmerge.converter.xml.sxc.Format.category
private

◆ CENTER_ALIGN

final static int org.openoffice.xmerge.converter.xml.sxc.Format.CENTER_ALIGN = 0x02
static

◆ decimalPlaces

int org.openoffice.xmerge.converter.xml.sxc.Format.decimalPlaces
private

◆ fontName

String org.openoffice.xmerge.converter.xml.sxc.Format.fontName
private

◆ foreground

Color org.openoffice.xmerge.converter.xml.sxc.Format.foreground
private

◆ formatSpecifier

String org.openoffice.xmerge.converter.xml.sxc.Format.formatSpecifier
private

◆ ITALIC

final static int org.openoffice.xmerge.converter.xml.sxc.Format.ITALIC = 0x02
static

◆ LEFT_ALIGN

final static int org.openoffice.xmerge.converter.xml.sxc.Format.LEFT_ALIGN = 0x03
static

◆ LEFT_BORDER

final static int org.openoffice.xmerge.converter.xml.sxc.Format.LEFT_BORDER = 0x40
static

◆ mask

int org.openoffice.xmerge.converter.xml.sxc.Format.mask = 0
private

◆ MIDDLE_ALIGN

final static int org.openoffice.xmerge.converter.xml.sxc.Format.MIDDLE_ALIGN = 0x02
static

◆ RIGHT_ALIGN

final static int org.openoffice.xmerge.converter.xml.sxc.Format.RIGHT_ALIGN = 0x01
static

◆ RIGHT_BORDER

final static int org.openoffice.xmerge.converter.xml.sxc.Format.RIGHT_BORDER = 0x80
static

◆ sizeInPoints

int org.openoffice.xmerge.converter.xml.sxc.Format.sizeInPoints
private

◆ STRIKETHRU

final static int org.openoffice.xmerge.converter.xml.sxc.Format.STRIKETHRU = 0x08
static

◆ SUBSCRIPT

final static int org.openoffice.xmerge.converter.xml.sxc.Format.SUBSCRIPT = 0x20
static

◆ SUPERSCRIPT

final static int org.openoffice.xmerge.converter.xml.sxc.Format.SUPERSCRIPT = 0x10
static

◆ TOP_ALIGN

final static int org.openoffice.xmerge.converter.xml.sxc.Format.TOP_ALIGN = 0x01
static

◆ TOP_BORDER

final static int org.openoffice.xmerge.converter.xml.sxc.Format.TOP_BORDER = 0x100
static

◆ UNDERLINE

final static int org.openoffice.xmerge.converter.xml.sxc.Format.UNDERLINE = 0x04
static

◆ value

String org.openoffice.xmerge.converter.xml.sxc.Format.value
private

◆ vertAlign

int org.openoffice.xmerge.converter.xml.sxc.Format.vertAlign
private

◆ WORD_WRAP

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: