public class Xf extends XLSRecord
BiffRec XF Record
offset Bits MASK name contents
---
0 15-0 0xFFFF ifnt Index to the FONT record.
2 15-0 0xFFFF ifmt Index to the FORMAT record.
4 0 0x0001 fLocked =1 if the cell is locked.
1 0x0002 fHidden =1 if the cell formula is hidden (value still shown)
2 0x0004 fStyle =0 for cell XF.
=1 for style XF.
~~~ additional option flags omitted ~~~
SST,
LABELSST,
EXTSST,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
Fill |
fill
OOXML fill, if any
|
static int |
NDEFAULTXFS |
static int |
PATTERN_SOLID
PATTERN_SOLID is a special case where icvFore= the background color and icvBack=64.
|
col, continues, DEBUGLEVEL, hyperlink, idx, isBlank, isBoolean, isContinueMerged, isString, lastidx, myxf, offset, rw, streamer, wkbook, worksheetAI, ALLOWDUPES, ALRUNS, AREA, AREAFORMAT, ARRAY, ATTACHEDLABEL, AUTOFILTER, AXCENT, AXESUSED, AXIS, AXISLINEFORMAT, AXISPARENT, BACKUP, BAR, BEGIN, BLANK, BOF, BOOKBOOL, BOOLERR, BOPPOP, BOPPOPCUSTOM, BOTTOM_MARGIN, BOTTOMMARGIN, BOUNDSHEET, CALC_MODE_PROP, CALCCOUNT, CALCMODE, CALCULATE_ALWAYS, CALCULATE_AUTO, CALCULATE_EXPLICIT, CATLAB, CATSERRANGE, CF, CF12, CHART, CHART3DBARSHAPE, CHARTFORMAT, CHARTFORMATLINK, CHARTFRTINFO, CHARTLINE, CODENAME, COLINFO, CONDFMT, CONDFMT12, CONTINUE, COUNTRY, CRN, CRTLAYOUT12, CRTLAYOUT12A, DAT, DATAFORMAT, DATALABEXT, DATALABEXTCONTENTS, DATE1904, DBCELL, DCON, DCONBIN, DCONNAME, DCONREF, DEBUG_HIGH, DEBUG_LOW, DEBUG_MEDIUM, DEFAULTENCODING, DEFAULTROWHEIGHT, DEFAULTTEXT, DEFCOLWIDTH, DELTA, DIMENSIONS, DROPBAR, DSF, DV, DVAL, END, ENDBLOCK, ENDEXTSST, ENDOBJECT, EOF, EXCEL2K, EXTERNCOUNT, EXTERNNAME, EXTERNSHEET, EXTSST, FBI, FEATHEADR, FILE_LOCK, FILEPASS, FONT, FONTBASIS, FONTX, FOOTERREC, FORMAT, FORMULA, FRAME, FRTFONTLIST, FRTWRAPPER, GARBAGE, GELFRAME, GUTS, HCENTER, HEADERREC, HLINK, HORIZONTAL_PAGE_BREAKS, IFMT, INDEX, INTERFACE_HDR, ITERATION, LABEL, LABELSST, LEFT_MARGIN, LEFTMARGIN, LEGEND, LEGENDXN, LINE, LINEFORMAT, MARKERFORMAT, MAXCOLS, MAXCOLS_BIFF8, MAXRECLEN, MAXROWS, MAXROWS_BIFF8, MERGEDCELLS, MSODRAWING, MSODRAWINGGROUP, MSODRAWINGSELECTION, MULBLANK, MULRK, NAME, NOTE, NUMBER, OBJ, OBJECTLINK, OBJPROTECT, OBPROJ, PALETTE, PANE, PASSWORD, PHONETIC, PICF, PIE, PIEFORMAT, PIVOTCHARTBITS, PIVOTCHARTLINK, PLOTAREA, PLOTGROWTH, PLS, PLV, POS, PRECISION, PRINT_GRIDLINES, PRINT_ROW_HEADERS, PRINTGRID, PRINTROWCOL, PROT4REV, PROTECT, QSISXTAG, RADAR, RADARAREA, RANGEPROTECTION, REFMODE, REFTRACK_PROP, RIGHT_MARGIN, RIGHTMARGIN, RK, ROW, RRD_HEAD, RRD_INFO, RSTRING, RTENTEXU, RTMERGECELLS, SBASEREF, SCATTER, SCENPROTECT, SCL, SELECTION, SERAUXERRBAR, SERAUXTREND, SERFMT, SERIES, SERIESLIST, SERIESTEXT, SERPARENT, SERTOCRT, SETUP, SHAREDUPES, SHEETLAYOUT, SHEETPROTECTION, SHRFMLA, SHTPROPS, SIIINDEX, SST, STARTBLOCK, STARTOBJECT, STRING_ENCODING_AUTO, STRING_ENCODING_COMPRESSED, STRING_ENCODING_UNICODE, STRINGREC, STYLE, SUPBOOK, SURFACE, SXADDL, SXBOOL, SXDB, SXDBB, SXDBEX, SXDI, SXEX, SXFDB, SXFDBTYPE, SXFORMAT, SXIVD, SXLI, SXNUM, SXPI, SXSTREAMID, SXSTRING, SXVD, SXVDEX, SXVI, SXVIEW, SXVIEWEX9, SXVIEWLINK, SXVS, TABID, TABLE, TABLESTYLES, TEXTDISP, THREED, TICK, TOP_MARGIN, TOPMARGIN, TXO, TYPE_BLANK, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_FORMULA, TYPE_FP, TYPE_INT, TYPE_STRING, UNICODEENCODING, UNITS, USERBVIEW, USERSVIEWBEGIN, USERSVIEWEND, USETEMPFILE_PROP, USR_EXCL, VALIDATEWORKBOOK, VALUERANGE, VB_MODULE, VCENTER, VERTICAL_PAGE_BREAKS, WINDOW_PROTECT, WINDOW1, WINDOW2, WK_CHART, WK_FILE, WK_GLOBALS, WK_MACROSHEET, WK_WORKSHEET, WSBOOL, XCT, XF, XLS_MAX_COLS, YMULT| Constructor and Description |
|---|
Xf() |
Xf(Font f,
WorkBook wkbook)
constructor which takes a Font object + a workbook
useful for cloning xf's from other workbooks
|
Xf(int f)
create a new Xf with pointer to its font
|
Xf(int f,
WorkBook wkbook)
create a new Xf with pointer to its font and workbook set
|
| Modifier and Type | Method and Description |
|---|---|
static short |
addFormatPattern(WorkBook book,
String pattern)
Ensures that the given format pattern exists on the given workbook.
|
void |
close()
clear out object references in prep for closing workbook
|
void |
decUseCoount()
dec # records using this xf
|
short |
getBackgroundColor()
get the background Color index for this Cell
|
String |
getBackgroundColorHEX()
get the background Color for this Cell as a Hex Color String
|
boolean |
getBold() |
int |
getBottomBorderColor() |
short |
getBottomBorderLineStyle() |
short |
getDiagBorderColor()
get the diagonal border color
|
short |
getDiagBorderLineStyle() |
Fill |
getFill()
return the OOXML fill for this xf, if any
|
int |
getFillPattern()
get the format pattern for this particular XF
|
Font |
getFont()
returns the associated Font record for this XF
|
short |
getForegroundColor()
get the Pattern Color index for this Cell if Solid Fill, or the Foreground color if no Solid Pattern
|
String |
getForegroundColorHEX()
get the Pattern Color for this Cell if Solid Fill, or the Foreground color if no Solid Pattern, as a Hex Color String
|
Format |
getFormat() |
String |
getFormatPattern()
get the Formatting for this BiffRec from the pattern
match.
|
int |
getHorizontalAlignment() |
int |
getIdx() |
short |
getIfmt() |
short |
getIfnt() |
int |
getIndent()
return the indent setting (1=3 spaces)
|
boolean |
getItalic() |
int |
getLeftBorderColor() |
short |
getLeftBorderLineStyle() |
boolean |
getMerged() |
short |
getRightBorderColor() |
short |
getRightBorderLineStyle() |
int |
getRightToLeftReadingOrder()
returns true if this style is set to Right-to-Left text direction (reading order)
|
int |
getRotation() |
boolean |
getStricken() |
int |
getTopBorderColor() |
short |
getTopBorderLineStyle() |
boolean |
getUnderlined() |
short |
getUseCount()
return # records using this xf
|
int |
getVerticalAlignment() |
boolean |
getWrapText() |
String |
getXML()
Returns an XML fragment representing the XF backing the format Handle.
|
void |
incUseCount()
inc # records using this xf
|
void |
init()
The XF record can either be a style XF or a Cell XF.
|
boolean |
isBackgroundSolid() |
boolean |
isCurrencyPattern()
returns whether this Format is a Currency
|
boolean |
isDatePattern()
returns whether this Format is a Date
Needs to be revisited.
|
static boolean |
isDatePattern(String myfmt) |
boolean |
isFormulaHidden()
get whether this cell formula is hidden
|
boolean |
isLocked()
get whether this is a locked Cell
|
boolean |
isShrinkToFit()
return whether this cell is set to "shrink to fit"
|
boolean |
isStyleXf()
return truth of "this Xf rec is a style xf"
|
protected void |
populateForTransfer()
Populates the myFont and myFormat variables to be held onto
when the xf record is serialized for boundsheet transfer
|
void |
removeBorders()
removes all borders for the style
|
void |
setAllBorderColors(int[] b)
set all border colors via an array of ints representing border color ints
order= top, left, bottom, right, [diagonal]
|
void |
setAllBorderLineStyles(int[] b)
set border line styles via array of ints representing border styles
order= top, left, bottom, right [diagonal]
|
void |
setBackColor(int t,
Color clr)
set the Background Color for this Format (when PATTERN - fls != PATTERN_SOLID)
When PATTERN is PATTERN_SOLID, == 64
|
void |
setBackgroundSolid()
Sets the fill pattern to solid, which renders the background to 64=="the default fg color"
"If the fill style is solid: When solid is specified, the
foreground color (fgColor) is the only color rendered,
even when a background color (bgColor) is also
specified"
|
void |
setBold(boolean b) |
void |
setBorderDiag(int t)
set the diagonal border for this Format
|
void |
setBorderLineStyle(short t)
set the border line style for this Format
|
void |
setBottomBorderColor(int t)
set the Bottom Border Color for this Format
|
void |
setBottomBorderLineStyle(short t) |
void |
setDiagBorderColor(int t)
set the diagonal Border Color for this Format
|
void |
setFill(Fill f)
set the OOXML fill for this xf
|
void |
setFont(int ifn)
set the pointer to the XF's Font in the WorkBook
|
void |
setForeColor(int t,
Color clr)
set the Foreground Color for this Format
THIS SETS THE BACKGROUND COLOR when PATTERN (fls) = PATTERN_SOLID
THIS SETS THE PATTERN COLOR when PATTERN (fls) > PATTERN_SOLID
"If the fill style is solid: When solid is specified, the foreground color (fgColor) is the only color rendered, even when a background color (bgColor) is also specified" icvFore==Pattern Background Color |
void |
setFormat(Format myFormat) |
void |
setFormat(short ifm)
set the pointer to the XF's Format in the WorkBook
|
void |
setFormatPattern(String pattern)
Sets the number format pattern for this format.
|
void |
setFormulaHidden(boolean hd)
sets the cell formula as hidden
|
void |
setHorizontalAlignment(int hAlign) |
void |
setIfnt(short ifnt) |
void |
setIndent(int indent)
set the indent (1=3 spaces)
|
void |
setItalic(boolean b) |
void |
setLeftBorderColor(int t)
set the Left Border Color for this Format
|
void |
setLeftBorderColor(short t)
set the Left Border Color for this Format
|
void |
setLeftBorderLineStyle(short t) |
void |
setLocked(boolean lk)
sets the cell as locked
|
void |
setMerged(boolean mgd) |
void |
setMyFont(Font f)
Set myFont in XF to the same as Workbook's
|
void |
setPattern(int t)
set the Fill Pattern for this Format
|
void |
setRightBorderColor(int t)
set the Right Border Color for this Format
|
void |
setRightBorderLineStyle(short t) |
void |
setRightToLeftReadingOrder(int rtl)
sets the Right to Left Text Direction or reading order of this style
|
void |
setRotation(int rot) |
void |
setShrinkToFit(boolean b) |
void |
setStricken(boolean b) |
void |
setToCellXF()
Switch the record to a cell XF record
|
void |
setTopBorderColor(int t)
set the Top Border Color for this Format
|
void |
setTopBorderLineStyle(short t) |
void |
setUnderlined(boolean b) |
void |
setVerticalAlignment(int vAlign) |
void |
setWorkBook(WorkBook b)
Set the workbook for this XF
This can get called multiple times.
|
void |
setWrapText(boolean wraptext) |
String |
toString()
Create a string representation of the Xf
|
static String |
unescapeFormatPattern(String xmlFormatPattern)
Parses an escaped xml format pattern (from ooxml) and returns an io.starter.OpenXLS compatible
pattern.
|
void |
updateBorderColors() |
void |
updateBorders() |
void |
updatePattern() |
static Xf |
updateXf(Xf xf,
int fontIdx,
WorkBook wkbook)
if xf parameter doesn't exist, create; if it does, create a new xf based on it
|
addContinue, clone, copyFormat, getBooleanVal, getByteAt, getByteReader, getBytes, getBytesAt, getCellAddress, getCellAddressWithSheet, getCellType, getColNumber, getColorTable, getContinueVect, getData, getDataType, getDblVal, getDefaultVal, getEncryptedByteReader, getFirstBlock, getFloatVal, getFormulaRec, getHyperlink, getInternalVal, getIntLocation, getIntVal, getIxfe, getLastBlock, getLength, getMergeRange, getOffset, getOpcode, getPrototype, getRealRecordIndex, getRecDesc, getRecordIndex, getRow, getRowNumber, getSheet, getStreamer, getStringVal, getStringVal, getWorkBook, getXfRec, hasContinues, initRowCol, isFormula, isNumber, isReadOnly, isValueForCell, mergeContinues, postStream, preStream, remove, removeContinues, resetCacheBytes, setBooleanVal, setByteReader, setCol, setData, setDebugLevel, setDoubleVal, setEncryptedByteReader, setFirstBlock, setFloatVal, setHyperlink, setIndex, setIntVal, setIsValueForCell, setIxfe, setLastBlock, setLength, setMergeRange, setOffset, setOpcode, setRow, setRowCol, setRowNumber, setSheet, setStreamer, setStringVal, setValueForCell, setXFRecord, setXFRecord, shouldEncrypt, toHexDumppublic static final int NDEFAULTXFS
public Fill fill
public static final int PATTERN_SOLID
public Xf()
public Xf(int f)
public Xf(int f,
WorkBook wkbook)
public void setWorkBook(WorkBook b)
setWorkBook in interface BiffRecsetWorkBook in class XLSRecordpublic String toString()
public void incUseCount()
public void decUseCoount()
public short getUseCount()
protected void populateForTransfer()
public boolean getMerged()
public void setMerged(boolean mgd)
public void init()
public Font getFont()
public boolean isDatePattern()
public static boolean isDatePattern(String myfmt)
public static String unescapeFormatPattern(String xmlFormatPattern)
xmlFormatPattern - public boolean isCurrencyPattern()
public short getForegroundColor()
public String getForegroundColorHEX()
public String getBackgroundColorHEX()
public short getBackgroundColor()
public String getFormatPattern()
getFormatPattern in interface BiffRecgetFormatPattern in class XLSRecordpublic void setFormatPattern(String pattern)
public static short addFormatPattern(WorkBook book, String pattern)
book - the workbook to which the pattern should belongpattern - the number format pattern to ensure existspublic void setFormat(short ifm)
public void setFont(int ifn)
public void setMyFont(Font f)
public void setPattern(int t)
public int getFillPattern()
public short getBottomBorderLineStyle()
public short getTopBorderLineStyle()
public short getLeftBorderLineStyle()
public short getRightBorderLineStyle()
public short getDiagBorderLineStyle()
public void setTopBorderColor(int t)
public int getTopBorderColor()
public void setBottomBorderColor(int t)
public int getBottomBorderColor()
public void setLeftBorderColor(int t)
public int getLeftBorderColor()
public void setRightBorderColor(int t)
public short getRightBorderColor()
public void setDiagBorderColor(int t)
public short getDiagBorderColor()
public void setLeftBorderColor(short t)
public void setBorderDiag(int t)
public void setBorderLineStyle(short t)
public void setAllBorderLineStyles(int[] b)
b - int[]public void setAllBorderColors(int[] b)
b - int[]public void setTopBorderLineStyle(short t)
public void setBottomBorderLineStyle(short t)
public void setLeftBorderLineStyle(short t)
public void setRightBorderLineStyle(short t)
public void updateBorders()
public void removeBorders()
public void updateBorderColors()
public void updatePattern()
public void setForeColor(int t,
Color clr)
t - best match index into 2003-style Color tabeclr - java.awt.Color or null if use standard Excel 2003 Color Tablepublic void setBackColor(int t,
Color clr)
t - best-match index into 2003-style Color tableclr - java.awt.Color or null if use standard Excel 2003 Color Tablepublic void setBackgroundSolid()
public boolean isBackgroundSolid()
public void setToCellXF()
public short getIfnt()
public void setIfnt(short ifnt)
ifnt - The ifnt to set.public short getIfmt()
public void setHorizontalAlignment(int hAlign)
public void setIndent(int indent)
indent - public int getIndent()
public void setRightToLeftReadingOrder(int rtl)
rtl - possible values:
public int getRightToLeftReadingOrder()
public int getHorizontalAlignment()
public void setWrapText(boolean wraptext)
public boolean getWrapText()
public void setVerticalAlignment(int vAlign)
public int getVerticalAlignment()
public void setRotation(int rot)
public int getRotation()
public String getXML()
public Format getFormat()
public void setFormat(Format myFormat)
myFormat - The myFormat to set.public boolean isFormulaHidden()
public void setFormulaHidden(boolean hd)
hd - public boolean isLocked()
public boolean isShrinkToFit()
public void setShrinkToFit(boolean b)
public void setLocked(boolean lk)
lk - public boolean getStricken()
public void setStricken(boolean b)
public boolean getItalic()
public void setItalic(boolean b)
public boolean getUnderlined()
public void setUnderlined(boolean b)
public boolean getBold()
public void setBold(boolean b)
public int getIdx()
public boolean isStyleXf()
public static Xf updateXf(Xf xf, int fontIdx, WorkBook wkbook)
xf - original xffontIdx - font to link xf towkbook - public void setFill(Fill f)
f - public Fill getFill()
Copyright © 2002–2019 Starter Inc.. All rights reserved.