|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.hssf.record.Record org.apache.poi.hssf.record.FontRecord
public class FontRecord
Title: Font Record - descrbes a font in the workbook (index = 0-3,5-infinity - skip 4)
Description: An element in the Font Table
REFERENCE: PG 315 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
Field Summary | |
---|---|
static short |
sid
|
static short |
SS_NONE
|
static short |
SS_SUB
|
static short |
SS_SUPER
|
static byte |
U_DOUBLE
|
static byte |
U_DOUBLE_ACCOUNTING
|
static byte |
U_NONE
|
static byte |
U_SINGLE
|
static byte |
U_SINGLE_ACCOUNTING
|
Constructor Summary | |
---|---|
FontRecord()
|
|
FontRecord(RecordInputStream in)
Constructs a Font record and sets its fields appropriately. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Only returns two for the same exact object - creating a second FontRecord with the same properties won't be considered equal, as the record's position in the record stream matters. |
protected void |
fillFields(RecordInputStream in)
called by the constructor, should set class level fields. |
short |
getAttributes()
get the font attributes (see individual bit getters that reference this method) |
short |
getBoldWeight()
get the bold weight for this font (100-1000dec or 0x64-0x3e8). |
byte |
getCharset()
get the character set |
short |
getColorPaletteIndex()
get the font's color palette index |
byte |
getFamily()
get the font family (TODO) |
short |
getFontHeight()
gets the height of the font in 1/20th point units |
java.lang.String |
getFontName()
get the name of the font |
byte |
getFontNameLength()
get the length of the fontname string |
int |
getRecordSize()
gives the current serialized size of the record. |
short |
getSid()
return the non static version of the id for this record. |
short |
getSuperSubScript()
get the type of super or subscript for the font |
byte |
getUnderline()
get the type of underlining for the font |
int |
hashCode()
|
boolean |
isItalic()
get whether the font is to be italics or not |
boolean |
isMacoutlined()
whether to use the mac outline font style thing (mac only) - Some mac person should comment this instead of me doing it (since I have no idea) |
boolean |
isMacshadowed()
whether to use the mac shado font style thing (mac only) - Some mac person should comment this instead of me doing it (since I have no idea) |
boolean |
isStruckout()
get whether the font is to be stricken out or not |
int |
serialize(int offset,
byte[] data)
called by the class that is responsible for writing this sucker. |
void |
setAttributes(short attributes)
set the font attributes (see individual bit setters that reference this method) |
void |
setBoldWeight(short bw)
set the bold weight for this font (100-1000dec or 0x64-0x3e8). |
void |
setCharset(byte charset)
set the character set |
void |
setColorPaletteIndex(short cpi)
set the font's color palette index |
void |
setFamily(byte f)
set the font family (TODO) |
void |
setFontHeight(short height)
sets the height of the font in 1/20th point units |
void |
setFontName(java.lang.String fn)
set the name of the font |
void |
setFontNameLength(byte len)
set the length of the fontname string |
void |
setItalic(boolean italics)
set the font to be italics or not |
void |
setMacoutline(boolean mac)
whether to use the mac outline font style thing (mac only) - Some mac person should comment this instead of me doing it (since I have no idea) |
void |
setMacshadow(boolean mac)
whether to use the mac shado font style thing (mac only) - Some mac person should comment this instead of me doing it (since I have no idea) |
void |
setStrikeout(boolean strike)
set the font to be stricken out or not |
void |
setSuperSubScript(short sss)
set the type of super or subscript for the font |
void |
setUnderline(byte u)
set the type of underlining for the font |
java.lang.String |
toString()
get a string representation of the record (for biffview/debugging) |
protected void |
validateSid(short id)
called by constructor, should throw runtime exception in the event of a record passed with a differing ID. |
Methods inherited from class org.apache.poi.hssf.record.Record |
---|
clone, cloneViaReserialise, isInValueSection, isValue, serialize |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final short sid
public static final short SS_NONE
public static final short SS_SUPER
public static final short SS_SUB
public static final byte U_NONE
public static final byte U_SINGLE
public static final byte U_DOUBLE
public static final byte U_SINGLE_ACCOUNTING
public static final byte U_DOUBLE_ACCOUNTING
Constructor Detail |
---|
public FontRecord()
public FontRecord(RecordInputStream in)
in
- the RecordInputstream to read the record fromMethod Detail |
---|
protected void validateSid(short id)
Record
validateSid
in class Record
id
- alleged id for this recordprotected void fillFields(RecordInputStream in)
Record
fillFields
in class Record
in
- the RecordInputstream to read the record frompublic void setFontHeight(short height)
height
- fontheight (in points/20)public void setAttributes(short attributes)
attributes
- the bitmask to setpublic void setItalic(boolean italics)
italics
- - whether the font is italics or notsetAttributes(short)
public void setStrikeout(boolean strike)
strike
- - whether the font is stricken out or notsetAttributes(short)
public void setMacoutline(boolean mac)
mac
- - whether to do that mac font outline thing or notsetAttributes(short)
public void setMacshadow(boolean mac)
mac
- - whether to do that mac font shadow thing or notsetAttributes(short)
public void setColorPaletteIndex(short cpi)
cpi
- - font color indexpublic void setBoldWeight(short bw)
bw
- - a number between 100-1000 for the fonts "boldness"public void setSuperSubScript(short sss)
sss
- super or subscript optionSS_NONE
,
SS_SUPER
,
SS_SUB
public void setUnderline(byte u)
u
- super or subscript optionU_NONE
,
U_SINGLE
,
U_DOUBLE
,
U_SINGLE_ACCOUNTING
,
U_DOUBLE_ACCOUNTING
public void setFamily(byte f)
f
- familypublic void setCharset(byte charset)
charset
- - charactersetpublic void setFontNameLength(byte len)
len
- length of the font namesetFontName(String)
public void setFontName(java.lang.String fn)
fn
- - name of the font (i.e. "Arial")public short getFontHeight()
public short getAttributes()
public boolean isItalic()
getAttributes()
public boolean isStruckout()
getAttributes()
public boolean isMacoutlined()
getAttributes()
public boolean isMacshadowed()
getAttributes()
public short getColorPaletteIndex()
public short getBoldWeight()
public short getSuperSubScript()
SS_NONE
,
SS_SUPER
,
SS_SUB
public byte getUnderline()
U_NONE
,
U_SINGLE
,
U_DOUBLE
,
U_SINGLE_ACCOUNTING
,
U_DOUBLE_ACCOUNTING
public byte getFamily()
public byte getCharset()
public byte getFontNameLength()
getFontName()
public java.lang.String getFontName()
public java.lang.String toString()
Record
toString
in class Record
public int serialize(int offset, byte[] data)
Record
serialize
in class Record
offset
- to begin writing atdata
- byte array containing instance data
public int getRecordSize()
Record
getRecordSize
in class Record
public short getSid()
Record
getSid
in class Record
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |