|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.extentech.ExtenXLS.FormatHandle
public class FormatHandle
Provides methods for querying and changing cell formatting information. Cell formating includes fonts, borders, text alignment, background colors, cell protection (locking), etc.
The mutator methods of a FormatHandle object directly and immediately change
the formatting of the cell(s) to which it is applied. Under no circumstances
will a FormatHandle alter the formatting of cells to which it is not applied.
The list of cells to which a FormatHandle applies may be queried with the
getCells() method. Additional cells may be added with addCell(com.extentech.ExtenXLS.CellHandle)
and related methods.
A FormatHandle may also be obtained for a row or a column. In such a case the FormatHandle sets the default formats for the row or column. The default format for a row or column is the format which appears when no other formats for the cell are specified, such as for newly created cells.
| Field Summary | |
|---|---|
static short |
colorBACKGROUND
|
static short |
colorBORDER
|
static short |
colorFONT
Convert a converted hex string to a color int String must include beginning "#" also handle color # 9 exception |
static short |
colorFOREGROUND
|
static Map<String,String> |
currencyFormatMap
|
static Map<String,String> |
dateFormatMap
|
static Map<String,String> |
numericFormatMap
|
| Fields inherited from interface com.extentech.formats.XLS.FormatConstants |
|---|
ALIGN_CENTER, ALIGN_CENTER_ACROSS_SELECTION, ALIGN_DEFAULT, ALIGN_FILL, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_VERTICAL_BOTTOM, ALIGN_VERTICAL_CENTER, ALIGN_VERTICAL_JUSTIFY, ALIGN_VERTICAL_TOP, Aqua, Black, Blue, BlueGray, BOLD, BORDER_DASH_DOT, BORDER_DASH_DOT_DOT, BORDER_DASHED, BORDER_DOTTED, BORDER_DOUBLE, BORDER_HAIR, BORDER_MEDIUM, BORDER_MEDIUM_DASH_DOT, BORDER_MEDIUM_DASH_DOT_DOT, BORDER_MEDIUM_DASHED, BORDER_NAMES, BORDER_NAMES_HTML, BORDER_NONE, BORDER_SIZES_HTML, BORDER_SLANTED_DASH_DOT, BORDER_THICK, BORDER_THIN, BrightGreen, Brown, BUILTIN_FORMATS, BUILTIN_FORMATS_JP, BUILTIN_FORMATS_MHTML, COLOR_AQUA, COLOR_BLACK, COLOR_BLACK2, COLOR_BLACK3, COLOR_BLUE, COLOR_BLUE_GRAY, COLOR_BRIGHT_GREEN, COLOR_BROWN, COLOR_DARK_BLUE, COLOR_DARK_GREEN, COLOR_DARK_PURPLE, COLOR_DARK_RED, COLOR_DARK_TEAL, COLOR_DARK_YELLOW, COLOR_GOLD, COLOR_GRAY25, COLOR_GRAY40, COLOR_GRAY50, COLOR_GRAY80, COLOR_GREEN, COLOR_INDIGO, COLOR_LAVENDER, COLOR_LIGHT_BLUE, COLOR_LIGHT_GREEN, COLOR_LIGHT_ORANGE, COLOR_LIGHT_PURPLE, COLOR_LIGHT_TURQUOISE, COLOR_LIGHT_YELLOW, COLOR_LIME, COLOR_MEDIUM_PURPLE, COLOR_OLIVE_GREEN, COLOR_ORANGE, COLOR_PALE_BLUE, COLOR_PINK, COLOR_PLUM, COLOR_RED, COLOR_ROSE, COLOR_SALMON, COLOR_SEA_GREEN, COLOR_SKY_BLUE, COLOR_TAN, COLOR_TEAL, COLOR_TURQUOISE, COLOR_VIOLET, COLOR_WHITE, COLOR_WHITE2, COLOR_WHITE3, COLOR_YELLOW, COLORNAMES, COLORTABLE, CURRENCY_FORMATS, Dark_Blue, Dark_Green, Dark_Purple, Dark_Red, Dark_Teal, Dark_Yellow, DATE_FORMATS, DEFAULT_FONT_FACE, DEFAULT_FONT_SIZE, DEFAULT_FONT_WEIGHT, EXCEL_FORMAT_LOOKUP, FORMAT_NOSCRIPT, FORMAT_SUBSCRIPT, FORMAT_SUPERSCRIPT, Gold, Gray15, Gray25, Gray40, Gray50, Gray80, Green, HORIZONTAL_ALIGNMENTS, HTMLCOLORNAMES, Indigo, Lavender, Light_Blue, Light_Green, Light_Orange, Light_Purple, Light_Turquoise, Light_Yellow, Lime, Medium_Purple, NUMERIC_FORMATS, OliveGreen, Orange, PaleBlue, PATTERN_CHECKERBOARD1, PATTERN_CHECKERBOARD2, PATTERN_CROSSPATCH1, PATTERN_DIAG_STRIPES1, PATTERN_DIAG_STRIPES2, PATTERN_DIAG_STRIPES3, PATTERN_DIAG_STRIPES4, PATTERN_DIAG_STRIPES5, PATTERN_DIAG_STRIPES6, PATTERN_DIAG_STRIPES7, PATTERN_DIAG_STRIPES8, PATTERN_FILLED, PATTERN_GRID1, PATTERN_HOR_STRIPES1, PATTERN_HOR_STRIPES2, PATTERN_HOR_STRIPES3, PATTERN_HOR_STRIPES4, PATTERN_HVY_DOTS, PATTERN_HVY_FILL, PATTERN_LIGHT_DOTS, PATTERN_LIGHT_FILL, PATTERN_MED_DOTS, PATTERN_MED_FILL, PATTERN_NONE, PATTERN_PATCHY1, PATTERN_PATCHY2, PATTERN_PATCHY3, PATTERN_PATCHY4, PATTERN_VERT_STRIPES1, PATTERN_VERT_STRIPES2, PATTERN_VERT_STRIPES3, PATTERN_VERT_STRIPES4, patternmap, Pink, PLAIN, Plum, Red, Rose, Salmon, SeaGreen, SkyBlue, STYLE_UNDERLINE_DOUBLE, STYLE_UNDERLINE_DOUBLE_ACCTG, STYLE_UNDERLINE_NONE, STYLE_UNDERLINE_SINGLE, STYLE_UNDERLINE_SINGLE_ACCTG, SVGCOLORSTRINGS, Tan, Teal, Turquoise, VERTICAL_ALIGNMENTS, Violet, White, Yellow |
| Constructor Summary | |
|---|---|
FormatHandle()
Nullary constructor for use in bean context. |
|
FormatHandle(CellHandle c)
Creates a FormatHandle for the given cell. |
|
FormatHandle(WorkBook book)
Constructs a FormatHandle for the given WorkBook's default format. |
|
FormatHandle(com.extentech.formats.XLS.WorkBook book,
int xfnum)
Constructs a FormatHandle for the given format ID and WorkBook. |
|
FormatHandle(WorkBook workBook,
int i)
Jan 27, 2011 |
|
FormatHandle(WorkBook book,
String fontname,
int fontstyle,
int fontsize)
|
|
FormatHandle(WorkBook book,
com.extentech.formats.XLS.Xf xfr)
Constructs a FormatHandle for the given WorkBook and format record. |
|
| Method Summary | |
|---|---|
void |
addCell(CellHandle c)
add a Cell to this FormatHandle thus applying the Format to the Cell |
void |
addCellArray(CellHandle[] crcells)
Apply this Format to a Range of Cells |
void |
addCellRange(CellRange cr)
Apply this Format to a Range of Cells |
void |
addCells(List cx)
Add a List of Cells to this FormatHandle |
static int |
addFont(com.extentech.formats.XLS.Font f,
WorkBookHandle bk)
adds a font to the global font store only if exact font is not already present |
int |
addXf(com.extentech.formats.XLS.Xf sourceXf)
adds all formatting represented by the sourceXf to this workbook, if not already present This is used internally for transferring formats from one workbook to another |
static int |
BorderStringToInt(String s)
|
Object |
clone()
Create a copy of this FormatHandle with its own Xf |
static com.extentech.formats.XLS.Xf |
cloneXf(com.extentech.formats.XLS.Xf xf,
com.extentech.formats.XLS.Font f,
com.extentech.formats.XLS.WorkBook wkbook)
static version of cloneXf |
static com.extentech.formats.XLS.Xf |
cloneXf(com.extentech.formats.XLS.Xf xf,
com.extentech.formats.XLS.WorkBook wkbook)
static version of cloneXf |
static String |
colorToHexString(Color c)
Convert a java.awt.Color to a hex string. |
String |
convertFormatString(String pattern)
converts an Excel-style format string to a Java Format string. |
boolean |
equals(Object another)
overrides the equals method to perform equality based on format properties ------------------------------------------------------------ |
int[] |
getAllBorderColors()
return the 5 border line colors (l, r, t, b, diag) |
int[] |
getAllBorderLineStyles()
return the 5 border lines styles (l, r, t, b, diag) |
int |
getBackgroundColor()
get the Pattern Background Color for this Format Pattern |
boolean |
getBold()
Get if the font is bold |
Color |
getBorderBottomColor()
Get the Right border color |
Color[] |
getBorderColors()
returns Border Colors of Cell ie: top, left, bottom, right returns null or 1 color for each of 4 sides 1,1,1,1 represents a border all around the cell 1,1,0,0 represents on the top left edge of the cell |
Color |
getBorderLeftColor()
Get the Left border color |
Color |
getBorderRightColor()
Get the Right border color |
Color |
getBorderTopColor()
Get the Top border color |
int |
getBottomBorderLineStyle()
Get the border line style |
int |
getCellBackgroundColor()
get the Pattern Background Color for this Formatted Cell This method handles display of conditional formats for the cell checks for conditional format, then applies it if conditions are true. |
int |
getCellRotation()
Get the rotation of the cell. |
List |
getCells()
Get the List of Cells for this FormatHandle |
static Color |
getColor(int col)
returns the index of the Color within the Colortable |
static int |
getColorInt(Color col)
returns the index of the Color within the Colortable |
int |
getFillPattern()
get the fill pattern for this format |
com.extentech.formats.XLS.Font |
getFont()
returns the existing font record for this Format Font is an internal record and should not be accessed by end users |
Color |
getFontColor()
Get the Font foreground (text) color |
int |
getFontHeight()
Returns the Font's height in 1/20th point increment |
double |
getFontHeightInPoints()
Get the font height in points |
String |
getFontName()
Returns the Font's name |
int |
getFontWeight()
Get the font weight |
int |
getForegroundColor()
get the Background Color for this Format NOTE: Foreground color = the CELL BACKGROUND color color for all patterns and Background color= the PATTERN color for all patterns != Solid For PATTERN_SOLID, Foreground color=CELL BACKGROUND color and Background Color=64 (white). |
int |
getFormatId()
The format ID allows setting of the format for a Cell without adding it to the Format's Cell Collection. |
String |
getFormatPattern()
Gets the number format pattern for this format, if set. |
int |
getFormatPatternId()
Gets the Excel format ID for this format's number format pattern. |
int |
getHorizontalAlignment()
Returns an int representing the current horizontal alignment in this FormatHandle. |
int |
getIndent()
return indent (1 = 3 spaces) |
boolean |
getIsBold()
Get if this format is bold or not |
boolean |
getItalic()
Get if the font is italic |
String |
getJavaFormatString()
provides a mapping between Excel formats and Java formats see: http://java.sun.com/docs/books/tutorial/i18n/format/decimalFormat.html |
String |
getJSON(int XFNum)
Get a JSON representation of the format |
org.json.JSONObject |
getJSONObject(int XFNum)
Get a JSON representation of the format font height is represented as HTML pt size |
int |
getLeftBorderLineStyle()
Get the border line style |
int |
getRightBorderLineStyle()
Get the border line style |
boolean |
getStricken()
Determine if the format handle refers to a font stricken out |
int |
getTopBorderLineStyle()
Get the border line style |
int |
getTrueForegroundColor()
returns the foreground color setting regardless of format pattern (which can switch fg and bg) |
boolean |
getUnderlined()
Get if the font is underlined |
int |
getUnderlineStyle()
Return an int representing the underline style These map to the STYLE_UNDERLINE static integers * |
int |
getVerticalAlignment()
Returns an int representing the current Vertical alignment in this FormatHandle. |
com.extentech.formats.XLS.WorkBook |
getWorkBook()
|
boolean |
getWrapText()
Get the cell wrapping behavior for this FormatHandle. |
String |
getXML(int XFNum)
Returns an XML fragment representing the FormatHandle |
static Color |
HexStringToColor(String s)
convert hex string RGB to a Color |
static int |
HexStringToColorInt(String s,
short colorType)
convert hex string RGB to Excel colortable int format |
boolean |
isCurrency()
returns whether this Format is formatted as a Currency |
boolean |
isDate()
returns whether this Format is formatted as a Date |
boolean |
isFormulaHidden()
returns whether this FormatHandle is set to hide formula strings |
boolean |
isLocked()
returns whether this Format Handle specifies that cells are locked for changing |
boolean |
isRedWhenNegative()
Returns true if the value should be red due to a combination of a format pattern and a negative number |
boolean |
isStyleXf()
return truth of "this Xf rec is a style xf" |
FormatHandle |
pack()
Deprecated. |
void |
setBackgroundColor(Color colr)
set the Background Color for this Format NOTE: Foreground color = the CELL BACKGROUND color color for all patterns and Background color= the PATTERN color for all patterns != Solid For PATTERN_SOLID, Foreground color=CELL BACKGROUND color and Background Color=64 (white). |
void |
setBackgroundColor(int t)
set the background color for this Format NOTE: Foreground color = the CELL BACKGROUND color color for all patterns and Background color= the PATTERN color for all patterns != Solid For PATTERN_SOLID, Foreground color=CELL BACKGROUND color and Background Color=64 (white). |
void |
setBackgroundPattern(int t)
set the Background Pattern for this Format |
void |
setBold(boolean isBold)
Set the format handle to use standard bold text |
void |
setBorderBottomColor(Color x)
Set the top border color |
void |
setBorderBottomColor(int x)
Set the top border color |
void |
setBorderColor(Color col)
set the border color for all borders (top, left, bottom, and right) to one java.awt.Color |
void |
setBorderColor(int x)
set the border color for all borders (top, left, bottom, and right) to one color via color constant |
void |
setBorderColors(Color[] bordercolors)
sets the border color for all borders (top, left, bottom and right) from a Color array |
void |
setBorderColors(int[] bordercolors)
sets the border color for all borders (top, left, bottom and right) from an int array containing color constants |
void |
setBorderDiagonal(int x)
Set the border line style |
void |
setBorderLeftColor(Color x)
Set the top border color |
void |
setBorderLeftColor(int x)
Set the top border color |
void |
setBorderLineStyle(int x)
Sets the border line style using static BORDER_ shorts within FormatHandle |
void |
setBorderLineStyle(int[] b)
set border line styles via array of ints representing border styles order= left, right, top, bottom, [diagonal] |
void |
setBorderLineStyle(short x)
Set the border line style |
void |
setBorderRightColor(Color x)
Set the top border color |
void |
setBorderRightColor(int x)
Set the top border color |
void |
setBorderTopColor(Color x)
Set the top border color |
void |
setBorderTopColor(int x)
Set the top border color |
void |
setBottomBorderLineStyle(int x)
Set the border line style |
void |
setCellBackgroundColor(Color colr)
set the Cell Background Color for this Format NOTE: Foreground color = the CELL BACKGROUND color color for all patterns and Background color= the PATTERN color for all patterns != Solid For PATTERN_SOLID, Foreground color=CELL BACKGROUND color and Background Color=64 (white). |
void |
setCellBackgroundColor(int t)
makes the cell a solid pattern background if no pattern was already present NOTE: Foreground color = the CELL BACKGROUND color color for all patterns and Background color= the PATTERN color for all patterns != Solid For PATTERN_SOLID, Foreground color=CELL BACKGROUND color and Background Color=64 (white). |
void |
setCellRotation(int align)
Set the rotation of the cell in degrees. |
void |
setColHandle(ColHandle c)
Set a column handle on this format handle, so all changes applied to this format will be applied to the entire column |
void |
setFont(com.extentech.formats.XLS.Font f)
Set the Font for this Format. |
void |
setFont(String fn,
int stl,
double sz)
|
void |
setFontColor(Color colr)
set the Font Color for this Format |
void |
setFontColor(int t)
set the Font Color for this Format |
void |
setFontHeight(int fontHeight)
Set the Font's height in 1/20th point increment |
void |
setFontName(String fontName)
Set the Font's name To be valid, this font name must be available on the client system. |
void |
setFontWeight(int wt)
Set the font weight |
void |
setForegroundColor(Color colr)
set the foreground Color for this Format NOTE: Foreground color = the CELL BACKGROUND color color for all patterns and Background color= the PATTERN color for all patterns != Solid For PATTERN_SOLID, Foreground color=CELL BACKGROUND color and Background Color=64 (white). |
void |
setForegroundColor(int t)
set the Foreground Color for this Format NOTE: Foreground color = the CELL BACKGROUND color color for all patterns and Background color= the PATTERN color for all patterns != Solid For PATTERN_SOLID, Foreground color=CELL BACKGROUND color and Background Color=64 (white). |
void |
setFormatId(int x)
set the pointer to the XFE or Conditional format |
void |
setFormatPattern(String pat)
Sets the number format pattern for this format. |
void |
setFormatPatternId(int fmt)
Sets the number format pattern based on the format ID number. |
void |
setFormulaHidden(boolean b)
sets the cell attached to this FormatHandle to hide or show formula strings; |
void |
setHorizontalAlignment(int align)
Set the horizontal alignment for this FormatHandle |
void |
setIndent(int indent)
set indent (1= 3 spaces) |
void |
setItalic(boolean isItalic)
Set if the font is italic |
void |
setLeftBorderLineStyle(int x)
Set the border line style |
void |
setLocked(boolean locked)
Locks the cell attached to this FormatHandle for editing (makes read-only) lock cell and make read-only |
void |
setPattern(int pat)
|
void |
setRightBorderLineStyle(int x)
Set the border line style |
void |
setRowHandle(RowHandle c)
Set a row handle on this format handle, so all changes applied to this format will be applied to the entire row |
void |
setScript(int ss)
super/sub (0 = none, 1 = super, 2 = sub) |
void |
setStricken(boolean isStricken)
Set if the format handle is stricken out |
void |
setTopBorderLineStyle(int x)
Set the border line style |
void |
setUnderlined(boolean isUnderlined)
Set underline attribute on the font |
void |
setUnderlineStyle(int u)
set the underline style for this font |
void |
setVerticalAlignment(int align)
Set the Vertical alignment for this FormatHandle |
void |
setWorkBook(com.extentech.formats.XLS.WorkBook bk)
Set the workbook for this FormatHandle |
void |
setWrapText(boolean wrapit)
Set the cell wrapping behavior for this FormatHandle. |
void |
setXf(com.extentech.formats.XLS.Xf xrec)
Sets the internal format to the FormatHandle. |
void |
stamp(CellHandle cell)
Applies the format to a cell without establishing a relationship. |
void |
stamp(CellRange range)
Applies the format to a cell range without establishing a relationship. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Map<String,String> numericFormatMap
public static final Map<String,String> currencyFormatMap
public static final Map<String,String> dateFormatMap
public static short colorFONT
public static short colorBACKGROUND
public static short colorFOREGROUND
public static short colorBORDER
| Constructor Detail |
|---|
public FormatHandle()
public FormatHandle(WorkBook book,
com.extentech.formats.XLS.Xf xfr)
public FormatHandle(WorkBook book)
public FormatHandle(com.extentech.formats.XLS.WorkBook book,
int xfnum)
CellHandle cell = <get cell here>;
FormatHandle format = new FormatHandle(
cell.getWorkBook(), cell.getFormatId() );
book - the WorkBook from which the format should be retrievedxfnum - the ID of the formatpublic FormatHandle(CellHandle c)
CellHandle.getFormatHandle() instead.
public FormatHandle(WorkBook book,
String fontname,
int fontstyle,
int fontsize)
public FormatHandle(WorkBook workBook,
int i)
workBook - i - | Method Detail |
|---|
public boolean equals(Object another)
equals in class ObjectObject - another - the FormatHandle to compare with this FormatHandle
public void setLocked(boolean locked)
boolean - locked - true if cells should be locked for this FormatHandlepublic void setFormulaHidden(boolean b)
boolean - b- true if formulas should be hidden for this FormatHandlepublic boolean isFormulaHidden()
public boolean isLocked()
public String getJavaFormatString()
Note there are slight Excel-specific differences in the format strings returned. Several numeric and currency formats in excel have different formatting for postive and negative numbers. In these cases, the java format string is split by semicolons and may contain text [Red] which is to specify the negative number should be displayed in red. Remove this from the string before passing into the Format class;
G Era designator Text AD
y Year Year 1996; 96
M Month in year Month July; Jul; 07
w Week in year Number 27
W Week in month Number 2
D Day in year Number 189
d Day in month Number 10
F Day of week in month Number 2
E Day in week Text Tuesday; Tue
a Am/pm marker Text PM
H Hour in day (0-23) Number 0
k Hour in day (1-24) Number 24
K Hour in am/pm (0-11) Number 0
h Hour in am/pm (1-12) Number 12
m Minute in hour Number 30
s Second in minute Number 55
S Millisecond Number 978
z Time zone General time zone Pacific Standard Time; PST; GMT-08:00
Z Time zone RFC 822 time zone -0800
public String convertFormatString(String pattern)
String - pattern - Excel Format String
getJavaFormatStringpublic void setBorderColors(Color[] bordercolors)
NOTE: this setting will affect every cell which refers to this FormatHandle
java.awt.Color - array - 4-element array of desired border colors [T, L, B, R]public void setBorderColors(int[] bordercolors)
NOTE: this setting will affect every cell which refers to this FormatHandle
int[] - bordercolors - 4-element array of desired border color constants [T, L, B, R]constantspublic void setBorderColor(int x)
NOTE: this setting will affect every cell which refers to this FormatHandle
int - x - color constant which represents the color to set all border sidesconstantspublic void setBorderColor(Color col)
NOTE: this setting will affect every cell which refers to this FormatHandle
Color - col - color to set all border sidespublic void setBorderRightColor(int x)
color - constantpublic void setBorderRightColor(Color x)
color - constantpublic Color getBorderRightColor()
public void setBorderLeftColor(int x)
color - constantpublic void setBorderLeftColor(Color x)
color - constantpublic Color[] getBorderColors()
public Color getBorderLeftColor()
public void setBorderTopColor(int x)
color - constantpublic Color getBorderTopColor()
public void setBorderTopColor(Color x)
color - constantpublic void setBorderBottomColor(int x)
color - constantpublic void setBorderBottomColor(Color x)
color - constantpublic boolean isRedWhenNegative()
public Color getBorderBottomColor()
public void setTopBorderLineStyle(int x)
line - style constantpublic int getTopBorderLineStyle()
public void setBottomBorderLineStyle(int x)
line - style constantpublic int getBottomBorderLineStyle()
public void setLeftBorderLineStyle(int x)
line - style constantpublic int getLeftBorderLineStyle()
public void setRightBorderLineStyle(int x)
line - style constantpublic int getRightBorderLineStyle()
public void setBorderLineStyle(int x)
line - style constantpublic void setBorderLineStyle(int[] b)
b - int[]public void setBorderLineStyle(short x)
line - style constantpublic int[] getAllBorderLineStyles()
public int[] getAllBorderColors()
public void setBorderDiagonal(int x)
line - style constantpublic void setColHandle(ColHandle c)
c - public void setRowHandle(RowHandle c)
c - public Object clone()
clone in class Objectpublic String toString()
toString in class Objectpublic void setFontWeight(int wt)
wt - public int getFontWeight()
public void setFont(com.extentech.formats.XLS.Font f)
String - font nameint - font styleint - font size
public void setFont(String fn,
int stl,
double sz)
public static int addFont(com.extentech.formats.XLS.Font f,
WorkBookHandle bk)
f - Fontbk - WorkBookHandlepublic void addCellRange(CellRange cr)
CellRange - to apply the format topublic void addCellArray(CellHandle[] crcells)
CellHandle - array to apply the format topublic void addCell(CellHandle c)
CellHandle - to apply the format topublic void addCells(List cx)
cx - public List getCells()
public void stamp(CellHandle cell)
FormatHandle will be applied
to the cell but it will not be updated with any future changes. If you
want that behavior use addCell instead.
public void stamp(CellRange range)
FormatHandle will be applied
to the cells but they will not be updated with any future changes. If
you want that behavior use addCell instead.
public void setBackgroundPattern(int t)
int - Excel color constantpublic boolean isDate()
public boolean isCurrency()
public void setUnderlineStyle(int u)
int - u underline style one of the Font.STYLE_UNDERLINE constantspublic void setScript(int ss)
int - script type for Format Fontpublic void setFontColor(int t)
int - Excel color constantpublic void setFontColor(Color colr)
AWT - Color color constantpublic void setForegroundColor(int t)
int - Excel color constantpublic void setForegroundColor(Color colr)
AWT - Color constantpublic void setBackgroundColor(int t)
int - Excel color constantpublic void setCellBackgroundColor(Color colr)
awt - Color color constantpublic void setCellBackgroundColor(int t)
int - Excel color constantpublic int getBackgroundColor()
public int getTrueForegroundColor()
public int getCellBackgroundColor()
public int getForegroundColor()
public void setBackgroundColor(Color colr)
awt - Color color constantpublic void setBold(boolean isBold)
boolean - isBoldpublic boolean getIsBold()
public int getUnderlineStyle()
public double getFontHeightInPoints()
public int getFontHeight()
public void setFontHeight(int fontHeight)
new - font heightpublic String getFontName()
public void setFontName(String fontName)
font - namepublic boolean getStricken()
public void setStricken(boolean isStricken)
isStricken - boolean representing if the formatted cell should be stricken out.public boolean getItalic()
public void setItalic(boolean isItalic)
isItalic - boolean representing if the formatted cell should be italic.public boolean getUnderlined()
public void setUnderlined(boolean isUnderlined)
isUnderlined - boolean representing if the formatted cell should be underlinedpublic boolean getBold()
public com.extentech.formats.XLS.Font getFont()
public void setFormatPattern(String pat)
CellHandle.getFormattedStringVal())
but they will be written correctly to the output file. For more
information on number format patterns see
Microsoft KB264372.
pat - the Excel number format pattern to applyFormatConstantsImpl.getBuiltinFormats()public void setPattern(int pat)
public int getFormatId()
public String getFormatPattern()
null if none is appliedpublic int getFillPattern()
public static Color getColor(int col)
the - index of the color in the colortable
public static int getColorInt(Color col)
col - the color
public void setXf(com.extentech.formats.XLS.Xf xrec)
public void setHorizontalAlignment(int align)
align - -
an int representing the alignment. Please review the
FormatHandle.ALIGN*** static int'spublic int getHorizontalAlignment()
public void setIndent(int indent)
indent - public int getIndent()
public void setVerticalAlignment(int align)
align - -
an int representing the alignment. Please review the
FormatHandle.ALIGN*** static int'spublic int getVerticalAlignment()
public FormatHandle pack()
public void setWorkBook(com.extentech.formats.XLS.WorkBook bk)
bk - public void setWrapText(boolean wrapit)
public boolean getWrapText()
public Color getFontColor()
public void setCellRotation(int align)
align - -
an int representing the rotation.public int getCellRotation()
public String getJSON(int XFNum)
cr -
public org.json.JSONObject getJSONObject(int XFNum)
cr -
public String getXML(int XFNum)
public int getFormatPatternId()
public void setFormatPatternId(int fmt)
setFormatPattern(String) instead.
fmt - the format ID number for the desired number format patternpublic static String colorToHexString(Color c)
public static int HexStringToColorInt(String s,
short colorType)
s - colorType -
public static Color HexStringToColor(String s)
s - colorType -
Colorpublic static int BorderStringToInt(String s)
public com.extentech.formats.XLS.WorkBook getWorkBook()
public boolean isStyleXf()
public int addXf(com.extentech.formats.XLS.Xf sourceXf)
xf - - sourceXf
public static com.extentech.formats.XLS.Xf cloneXf(com.extentech.formats.XLS.Xf xf,
com.extentech.formats.XLS.WorkBook wkbook)
xf - wkbook -
public static com.extentech.formats.XLS.Xf cloneXf(com.extentech.formats.XLS.Xf xf,
com.extentech.formats.XLS.Font f,
com.extentech.formats.XLS.WorkBook wkbook)
xf - wkbook -
public void setFormatId(int x)
xfe -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||