org.apache.poi.hssf.usermodel
Class HSSFFontFormatting

java.lang.Object
  extended by org.apache.poi.hssf.usermodel.HSSFFontFormatting

public final class HSSFFontFormatting
extends java.lang.Object

High level representation for Font Formatting component of Conditional Formatting settings

Author:
Dmitriy Kumshayev

Field Summary
static short SS_NONE
          Escapement type - None
static short SS_SUB
          Escapement type - Subscript
static short SS_SUPER
          Escapement type - Superscript
static byte U_DOUBLE
          Underline type - Double
static byte U_DOUBLE_ACCOUNTING
          Underline type - Double Accounting
static byte U_NONE
          Underline type - None
static byte U_SINGLE
          Underline type - Single
static byte U_SINGLE_ACCOUNTING
          Underline type - Single Accounting
 
Constructor Summary
protected HSSFFontFormatting(CFRuleRecord cfRuleRecord)
           
 
Method Summary
 short getEscapementType()
          get the type of super or subscript for the font
 short getFontColorIndex()
           
protected  FontFormatting getFontFormattingBlock()
           
 int getFontHeight()
          gets the height of the font in 1/20th point units
 short getFontWeight()
          get the font weight for this font (100-1000dec or 0x64-0x3e8).
protected  byte[] getRawRecord()
           
 short getUnderlineType()
          get the type of underlining for the font
 boolean isBold()
          get whether the font weight is set to bold or not
 boolean isEscapementTypeModified()
           
 boolean isFontCancellationModified()
           
 boolean isFontOutlineModified()
           
 boolean isFontShadowModified()
           
 boolean isFontStyleModified()
           
 boolean isFontWeightModified()
           
 boolean isItalic()
           
 boolean isOutlineOn()
           
 boolean isShadowOn()
           
 boolean isStruckout()
           
 boolean isUnderlineTypeModified()
           
 void resetFontStyle()
          set font style options to default values (non-italic, non-bold)
 void setEscapementType(short escapementType)
          set the escapement type for the font
 void setEscapementTypeModified(boolean modified)
           
 void setFontCancellationModified(boolean modified)
           
 void setFontColorIndex(short fci)
           
 void setFontHeight(int height)
           
 void setFontOutlineModified(boolean modified)
           
 void setFontShadowModified(boolean modified)
           
 void setFontStyle(boolean italic, boolean bold)
          set font style options.
 void setFontStyleModified(boolean modified)
           
 void setOutline(boolean on)
           
 void setShadow(boolean on)
           
 void setStrikeout(boolean strike)
           
 void setUnderlineType(short underlineType)
          set the type of underlining type for the font
 void setUnderlineTypeModified(boolean modified)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SS_NONE

public static final short SS_NONE
Escapement type - None

See Also:
Constant Field Values

SS_SUPER

public static final short SS_SUPER
Escapement type - Superscript

See Also:
Constant Field Values

SS_SUB

public static final short SS_SUB
Escapement type - Subscript

See Also:
Constant Field Values

U_NONE

public static final byte U_NONE
Underline type - None

See Also:
Constant Field Values

U_SINGLE

public static final byte U_SINGLE
Underline type - Single

See Also:
Constant Field Values

U_DOUBLE

public static final byte U_DOUBLE
Underline type - Double

See Also:
Constant Field Values

U_SINGLE_ACCOUNTING

public static final byte U_SINGLE_ACCOUNTING
Underline type - Single Accounting

See Also:
Constant Field Values

U_DOUBLE_ACCOUNTING

public static final byte U_DOUBLE_ACCOUNTING
Underline type - Double Accounting

See Also:
Constant Field Values
Constructor Detail

HSSFFontFormatting

protected HSSFFontFormatting(CFRuleRecord cfRuleRecord)
Method Detail

getFontFormattingBlock

protected FontFormatting getFontFormattingBlock()

getEscapementType

public short getEscapementType()
get the type of super or subscript for the font

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

getFontColorIndex

public short getFontColorIndex()
Returns:
font color index

getFontHeight

public int getFontHeight()
gets the height of the font in 1/20th point units

Returns:
fontheight (in points/20); or -1 if not modified

getFontWeight

public short getFontWeight()
get the font weight for this font (100-1000dec or 0x64-0x3e8). Default is 0x190 for normal and 0x2bc for bold

Returns:
bw - a number between 100-1000 for the fonts "boldness"

getRawRecord

protected byte[] getRawRecord()
Returns:
See Also:
FontFormatting.getRawRecord()

getUnderlineType

public short getUnderlineType()
get the type of underlining for the font

Returns:
font underlining type
See Also:
U_NONE, U_SINGLE, U_DOUBLE, U_SINGLE_ACCOUNTING, U_DOUBLE_ACCOUNTING

isBold

public boolean isBold()
get whether the font weight is set to bold or not

Returns:
bold - whether the font is bold or not

isEscapementTypeModified

public boolean isEscapementTypeModified()
Returns:
true if escapement type was modified from default

isFontCancellationModified

public boolean isFontCancellationModified()
Returns:
true if font cancellation was modified from default

isFontOutlineModified

public boolean isFontOutlineModified()
Returns:
true if font outline type was modified from default

isFontShadowModified

public boolean isFontShadowModified()
Returns:
true if font shadow type was modified from default

isFontStyleModified

public boolean isFontStyleModified()
Returns:
true if font style was modified from default

isItalic

public boolean isItalic()
Returns:
true if font style was set to italic

isOutlineOn

public boolean isOutlineOn()
Returns:
true if font outline is on

isShadowOn

public boolean isShadowOn()
Returns:
true if font shadow is on

isStruckout

public boolean isStruckout()
Returns:
true if font strikeout is on

isUnderlineTypeModified

public boolean isUnderlineTypeModified()
Returns:
true if font underline type was modified from default

isFontWeightModified

public boolean isFontWeightModified()
Returns:
true if font weight was modified from default

setFontStyle

public void setFontStyle(boolean italic,
                         boolean bold)
set font style options.

Parameters:
italic - - if true, set posture style to italic, otherwise to normal
bold- - if true, set font weight to bold, otherwise to normal

resetFontStyle

public void resetFontStyle()
set font style options to default values (non-italic, non-bold)


setEscapementType

public void setEscapementType(short escapementType)
set the escapement type for the font

Parameters:
escapementType - super or subscript option
See Also:
SS_NONE, SS_SUPER, SS_SUB

setEscapementTypeModified

public void setEscapementTypeModified(boolean modified)
Parameters:
modified -
See Also:
FontFormatting.setEscapementTypeModified(boolean)

setFontCancellationModified

public void setFontCancellationModified(boolean modified)
Parameters:
modified -
See Also:
FontFormatting.setFontCancellationModified(boolean)

setFontColorIndex

public void setFontColorIndex(short fci)
Parameters:
fci -
See Also:
FontFormatting.setFontColorIndex(short)

setFontHeight

public void setFontHeight(int height)
Parameters:
height -
See Also:
org.apache.poi.hssf.record.cf.FontFormatting#setFontHeight(short)

setFontOutlineModified

public void setFontOutlineModified(boolean modified)
Parameters:
modified -
See Also:
FontFormatting.setFontOutlineModified(boolean)

setFontShadowModified

public void setFontShadowModified(boolean modified)
Parameters:
modified -
See Also:
FontFormatting.setFontShadowModified(boolean)

setFontStyleModified

public void setFontStyleModified(boolean modified)
Parameters:
modified -
See Also:
FontFormatting.setFontStyleModified(boolean)

setOutline

public void setOutline(boolean on)
Parameters:
on -
See Also:
FontFormatting.setOutline(boolean)

setShadow

public void setShadow(boolean on)
Parameters:
on -
See Also:
FontFormatting.setShadow(boolean)

setStrikeout

public void setStrikeout(boolean strike)
Parameters:
strike -
See Also:
FontFormatting.setStrikeout(boolean)

setUnderlineType

public void setUnderlineType(short underlineType)
set the type of underlining type for the font

Parameters:
u - super or subscript option
See Also:
U_NONE, U_SINGLE, U_DOUBLE, U_SINGLE_ACCOUNTING, U_DOUBLE_ACCOUNTING

setUnderlineTypeModified

public void setUnderlineTypeModified(boolean modified)
Parameters:
modified -
See Also:
FontFormatting.setUnderlineTypeModified(boolean)


Copyright 2008 The Apache Software Foundation or its licensors, as applicable.