OpenOffice.org
XMerge API

org.openoffice.xmerge.converter.xml.sxc
Class Format

java.lang.Object
  |
  +--org.openoffice.xmerge.converter.xml.sxc.Format
All Implemented Interfaces:
java.lang.Cloneable

public class Format
extends java.lang.Object
implements java.lang.Cloneable

This class specifies the format for a given spreadsheet cell.


Constructor Summary
Format()
          Constructor for creating a new Format.
Format(Format fmt)
          Constructor for creating a new Format object based on an existing one.
 
Method Summary
 void clearFormatting()
          Reset this Format description.
 java.awt.Color getBackground()
          Get the Foreground Color for this cell
 java.lang.String getCategory()
          Return the formatting category of the object.
 int getDecimalPlaces()
          Get the number of decimal places displayed.
 java.lang.String getFont()
          Get the font used for this cell.
 java.awt.Color getForeground()
          Get the Foreground Color for this cell.
 java.lang.String getFormatSpecifier()
          Get the Format specifier for this category.
 boolean isBold()
          Get the object's bold flag.
 boolean isItalic()
          Get the object's italic flag.
 boolean isUnderline()
          Get the object's underline flag.
 void setBackground(java.awt.Color color)
          Set the Background Color for this cell
 void setBold(boolean value)
          Set the object's bold flag.
 void setCategory(java.lang.String newCategory)
          Set the formatting category of this object, i.e.
 void setDecimalPlaces(int precision)
          Set the precision of the number to be displayed.
 void setFont(java.lang.String fontName)
          Set the font used for this cell.
 void setForeground(java.awt.Color color)
          Set the Foreground Color for this cell.
 void setFormatSpecifier(java.lang.String formatString)
          Set the Format specifier for this category.
 void setItalic(boolean value)
          Set the object's italic flag.
 void setUnderline(boolean value)
          Set the object's underline flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Format

public Format()
Constructor for creating a new Format.

Format

public Format(Format fmt)
Constructor for creating a new Format object based on an existing one.
Parameters:
fmt - Format to copy.
Method Detail

clearFormatting

public void clearFormatting()
Reset this Format description.

getBackground

public java.awt.Color getBackground()
Get the Foreground Color for this cell
Returns:
Background Color value

getCategory

public java.lang.String getCategory()
Return the formatting category of the object.
Returns:
The formatting category of the object.
See Also:
OfficeConstants

getDecimalPlaces

public int getDecimalPlaces()
Get the number of decimal places displayed.
Returns:
Number of decimal places.

getFont

public java.lang.String getFont()
Get the font used for this cell.
Returns:
The font name.

getForeground

public java.awt.Color getForeground()
Get the Foreground Color for this cell.
Returns:
Foreground Color value.

getFormatSpecifier

public java.lang.String getFormatSpecifier()
Get the Format specifier for this category.
Returns:
Format specifier for this category.

isBold

public boolean isBold()
Get the object's bold flag.
Returns:
true if bold flag is on, false otherwise.

isItalic

public boolean isItalic()
Get the object's italic flag.
Returns:
True if italic flag is on, false otherwise.

isUnderline

public boolean isUnderline()
Get the object's underline flag.
Returns:
true if underline flag is on, false otherwise.

setBackground

public void setBackground(java.awt.Color color)
Set the Background Color for this cell
Parameters:
color - A Color object representing the background color.

setBold

public void setBold(boolean value)
Set the object's bold flag.
Parameters:
value - The value of the bold flag. true is bold, false is not bold.

setCategory

public void setCategory(java.lang.String newCategory)
Set the formatting category of this object, i.e. number, date, currency. The OfficeConstants class contains string constants for the category types.
Parameters:
newCategory - The name of the category to be set.
See Also:
OfficeConstants

setDecimalPlaces

public void setDecimalPlaces(int precision)
Set the precision of the number to be displayed.
Parameters:
precision - The number of decimal places to display.

setFont

public void setFont(java.lang.String fontName)
Set the font used for this cell.
Parameters:
fontName - The name of the font.

setForeground

public void setForeground(java.awt.Color color)
Set the Foreground Color for this cell.
Parameters:
color - A Color object representing the foreground color.

setFormatSpecifier

public void setFormatSpecifier(java.lang.String formatString)
Set the Format specifier for this category.
Parameters:
formatString - The new Format specifier.

setItalic

public void setItalic(boolean value)
Set the object's italic flag.
Parameters:
value - The value of the italic flag. true is italic, false is not italic.

setUnderline

public void setUnderline(boolean value)
Set the object's underline flag.
Parameters:
value - The value of the underline flag. true is underlined, false is not underlined.

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org