jet.report.xls
Class FontInfo

java.lang.Object
  extended by jet.report.xls.FontInfo

public class FontInfo
extends java.lang.Object

Information of the text font.


Field Summary
static short BOLD
          Specifies that the font is bold.
static byte BOTTOM
          Represents bottom text alignment.
static byte CENTER
          Represents center text alignment.
static int ITALIC
          Specifies whether the font is italic.
static byte LEFT
          Represents left text alignment.
static short NOBOLD
          Specifies that the font is not bold.
static int OUTLINE
          Specifies whether the font has applied an outline effect.
static byte RIGHT
          Represents right text alignment.
static int SHADOW
          Specifies whether the font has applied a shadow effect.
static short SS_NONE
          Indicates that the font is neither superscript nor subscript.
static short SS_SUB
          Indicates that the font is subscript.
static short SS_SUPER
          Indicates that the font is superscript.
static int STRIKEOUT
          Specifies whether the font has applied strikethrough formatting.
static byte TOP
          Represents top text alignment.
static byte U_DOUBLE
          Represents double underline.
static byte U_NONE
          Represents no underline.
static byte U_SINGLE
          Represents single underline.
 
Constructor Summary
FontInfo()
          Constructs a FontInfo object with the default value.
FontInfo(short size, short grbit, short bold, short effect, byte underline, int rgb, java.lang.String name, GlobalWorksheet gws)
          Constructs a FontInfo object with these parameters:
 
Method Summary
 boolean getBoldStyle()
          Gets the flag whether it is in bold style or not.
 int getColor()
          Gets the font's color.
 short getEffect()
          Gets the type of superscript or subscript for the font.
 short getFontHeight()
          Gets the height of font in the unit of 1/20 of a point.
 java.lang.String getFontName()
          Gets the name of the font.
 short getGrbit()
          Get the font attributes.
 byte getHAlignment()
          Gets the horizontal alignment of the text.
 boolean getItalic()
          Gets whether the font is italic.
 boolean getOutline()
          Gets if the font is in outline style (Macintosh only).
 short getRotation()
          Gets text rotation.
 boolean getShadow()
          Gets if the font is in shadow style.
 boolean getStrickout()
          Gets whether the font is strikethrough.
 byte getUnderline()
          Gets the type of underlining for the font.
 byte getVAlignment()
          Gets the vertical alignment of the text.
 void setBoldStyle(boolean bs)
          Specifies whether it is in bold style or not.
 void setColor(int color, GlobalWorksheet gws)
          set the font's color.
 void setEffect(short effect)
          Sets the type of superscript or subscript for the font.
 void setFontHeight(short height)
          Sets the height of font in the unit of 1/20 of a point.
 void setFontName(java.lang.String name)
          Sets the name of the font.
 void setHAlignment(byte ha)
          Sets the horizontal alignment of the text.
 void setItalic(boolean fItalic)
          Sets whether the font is italic.
 void setOutline(boolean fOutline)
          Sets if the font is in outline style (Macintosh only).
 void setRotation(short rot)
          Sets text rotation.
 void setShadow(boolean fShadow)
          Sets if the font is in shadow style.
 void setStrickout(boolean fStrickout)
          Sets whether the font is strikethrough.
 void setUnderline(byte u)
          Sets the type of underlining for the font.
 void setVAlignment(byte va)
          Sets the vertical alignment of the text.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ITALIC

public static final int ITALIC
Specifies whether the font is italic.

See Also:
Constant Field Values

STRIKEOUT

public static final int STRIKEOUT
Specifies whether the font has applied strikethrough formatting.

See Also:
Constant Field Values

OUTLINE

public static final int OUTLINE
Specifies whether the font has applied an outline effect.

See Also:
Constant Field Values

SHADOW

public static final int SHADOW
Specifies whether the font has applied a shadow effect.

See Also:
Constant Field Values

SS_NONE

public static final short SS_NONE
Indicates that the font is neither superscript nor subscript.

See Also:
Constant Field Values

SS_SUPER

public static final short SS_SUPER
Indicates that the font is superscript.

See Also:
Constant Field Values

SS_SUB

public static final short SS_SUB
Indicates that the font is subscript.

See Also:
Constant Field Values

U_NONE

public static final byte U_NONE
Represents no underline.

See Also:
Constant Field Values

U_SINGLE

public static final byte U_SINGLE
Represents single underline.

See Also:
Constant Field Values

U_DOUBLE

public static final byte U_DOUBLE
Represents double underline.

See Also:
Constant Field Values

BOLD

public static final short BOLD
Specifies that the font is bold.

See Also:
Constant Field Values

NOBOLD

public static final short NOBOLD
Specifies that the font is not bold.

See Also:
Constant Field Values

LEFT

public static final byte LEFT
Represents left text alignment.

See Also:
Constant Field Values

CENTER

public static final byte CENTER
Represents center text alignment.

See Also:
Constant Field Values

RIGHT

public static final byte RIGHT
Represents right text alignment.

See Also:
Constant Field Values

TOP

public static final byte TOP
Represents top text alignment.

See Also:
Constant Field Values

BOTTOM

public static final byte BOTTOM
Represents bottom text alignment.

See Also:
Constant Field Values
Constructor Detail

FontInfo

public FontInfo()
Constructs a FontInfo object with the default value.


FontInfo

public FontInfo(short size,
                short grbit,
                short bold,
                short effect,
                byte underline,
                int rgb,
                java.lang.String name,
                GlobalWorksheet gws)
Constructs a FontInfo object with these parameters:

Parameters:
size - height of the font(in the unit of 1/20 of a point)
grbit - font attributes, which can be the combined value of ITALIC, STRIKEOUT, OUTLINE, and SHADOW.
bold - bold style, which can be BOLD or NOBOLD
effect - superscript/subscript, which can be either SS_NONE, SS_SUPER or SS_SUB.
underline - underline style, which can be either U_DOUBLE, U_NONE or U_SINGLE
rgb - font color
name - font name
Method Detail

setFontHeight

public void setFontHeight(short height)
Sets the height of font in the unit of 1/20 of a point.

Parameters:
height - the height of font (in points/20)

getFontHeight

public short getFontHeight()
Gets the height of font in the unit of 1/20 of a point.

Returns:
the height of font(in points/20)

setItalic

public void setItalic(boolean fItalic)
Sets whether the font is italic.

Parameters:
fItalic - whether the font is italic

setStrickout

public void setStrickout(boolean fStrickout)
Sets whether the font is strikethrough.

Parameters:
fStrickout - whether the font is strikethrough

setOutline

public void setOutline(boolean fOutline)
Sets if the font is in outline style (Macintosh only).

Parameters:
fOutline - whether the font is in outline style

setShadow

public void setShadow(boolean fShadow)
Sets if the font is in shadow style.

Parameters:
fShadow - if the font is in shadow style or not

getItalic

public boolean getItalic()
Gets whether the font is italic.

Returns:
whether the font is italic

getStrickout

public boolean getStrickout()
Gets whether the font is strikethrough.

Returns:
the font is strikethrough or not

getOutline

public boolean getOutline()
Gets if the font is in outline style (Macintosh only).

Returns:
the font is in outline style or not

getShadow

public boolean getShadow()
Gets if the font is in shadow style.

Returns:
the font is in shadow style or not

getGrbit

public short getGrbit()
Get the font attributes.

Returns:
font attributes

setColor

public void setColor(int color,
                     GlobalWorksheet gws)
set the font's color.

Parameters:
color - font's color rgb

getColor

public int getColor()
Gets the font's color.

Returns:
font's color rgb

setBoldStyle

public void setBoldStyle(boolean bs)
Specifies whether it is in bold style or not.

Parameters:
bs - true is in bold style

getBoldStyle

public boolean getBoldStyle()
Gets the flag whether it is in bold style or not.

Returns:
true is in bold style

setEffect

public void setEffect(short effect)
Sets the type of superscript or subscript for the font.

Parameters:
effect - superscript or subscript option
See Also:
SS_NONE, SS_SUPER, SS_SUB

getEffect

public short getEffect()
Gets the type of superscript or subscript for the font.

Returns:
superscript or subscript option
See Also:
SS_NONE, SS_SUPER, SS_SUB

setUnderline

public void setUnderline(byte u)
Sets the type of underlining for the font.

Parameters:
u - underlining option
See Also:
U_NONE, U_SINGLE, U_DOUBLE

getUnderline

public byte getUnderline()
Gets the type of underlining for the font.

Returns:
underlining option
See Also:
U_NONE, U_SINGLE, U_DOUBLE

setFontName

public void setFontName(java.lang.String name)
Sets the name of the font.

Parameters:
name - name of the font (i.e. "Arial")

getFontName

public java.lang.String getFontName()
Gets the name of the font.

Returns:
name of the font (i.e. "Arial")

setRotation

public void setRotation(short rot)
Sets text rotation.

Parameters:
rot - text rotation

getRotation

public short getRotation()
Gets text rotation.

Returns:
text rotation

setHAlignment

public void setHAlignment(byte ha)
Sets the horizontal alignment of the text.

Parameters:
ha - horizontal alignment of the text
See Also:
LEFT, RIGHT, CENTER

getHAlignment

public byte getHAlignment()
Gets the horizontal alignment of the text.

Returns:
horizontal alignment of the text
See Also:
LEFT, RIGHT, CENTER

setVAlignment

public void setVAlignment(byte va)
Sets the vertical alignment of the text.

Parameters:
va - vertical alignment of the text
See Also:
TOP, BOTTOM, CENTER

getVAlignment

public byte getVAlignment()
Gets the vertical alignment of the text.

Returns:
vertical alignment of the text
See Also:
TOP, BOTTOM, CENTER