public class HSSFNamedStyle extends Object implements NamedStyle
ALIGN_CENTER, ALIGN_CENTER_SELECTION, ALIGN_FILL, ALIGN_GENERAL, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_RIGHT, ALT_BARS, BIG_SPOTS, 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_NONE, BORDER_SLANTED_DASH_DOT, BORDER_THICK, BORDER_THIN, BRICKS, DIAMONDS, FINE_DOTS, LEAST_DOTS, LESS_DOTS, NO_FILL, SOLID_FOREGROUND, SPARSE_DOTS, SQUARES, THICK_BACKWARD_DIAG, THICK_FORWARD_DIAG, THICK_HORZ_BANDS, THICK_VERT_BANDS, THIN_BACKWARD_DIAG, THIN_FORWARD_DIAG, THIN_HORZ_BANDS, THIN_VERT_BANDS, VERTICAL_BOTTOM, VERTICAL_CENTER, VERTICAL_JUSTIFY, VERTICAL_TOP| Constructor and Description |
|---|
HSSFNamedStyle(StyleRecord rec,
StyleExtRecord rec2,
CellStyle inner) |
| Modifier and Type | Method and Description |
|---|---|
void |
cloneStyleFrom(CellStyle source)
Clones all the style information from another
CellStyle, onto this one.
|
short |
getAlignment()
get the type of horizontal alignment for the cell
|
short |
getBorderBottom()
get the type of border to use for the bottom border of the cell
|
short |
getBorderDiagonal()
get the type of border to use for the diagonal border of the cell
|
short |
getBorderLeft()
get the type of border to use for the left border of the cell
|
short |
getBorderRight()
get the type of border to use for the right border of the cell
|
short |
getBorderTop()
get the type of border to use for the top border of the cell
|
short |
getBottomBorderColor()
get the color to use for the left border
|
Color |
getBottomBorderColorColor() |
int |
getBuiltinId() |
short |
getDataFormat()
get the index of the format
|
String |
getDataFormatString()
Get the format string
|
short |
getDiagonalBorderColor()
get the color to use for the diagonal border
|
Color |
getDiagonalBorderColorColor() |
short |
getFillBackgroundColor()
get the background fill color, if the fill
is defined with an indexed color.
|
Color |
getFillBackgroundColorColor()
Gets the color object representing the current
background fill, resolving indexes using
the supplied workbook.
|
short |
getFillForegroundColor()
get the foreground fill color, if the fill
is defined with an indexed color.
|
Color |
getFillForegroundColorColor()
Gets the color object representing the current
foreground fill, resolving indexes using
the supplied workbook.
|
short |
getFillPattern()
get the fill pattern (??) - set to 1 to fill with foreground color
|
short |
getFontIndex()
gets the index of the font for this style
|
boolean |
getHidden()
get whether the cell's using this style are to be hidden
|
short |
getIndention()
get the number of spaces to indent the text in the cell
|
int |
getIndex()
get the index within the Workbook (sequence within the collection of ExtnededFormat objects)
Note since 3.9.9 we have changed the return value type from short to int because the limit of
distinct cell styles in Excel 2007 and beyond is 64000 while that of Excel 97-2003 is 4000
only; have to extend it to accommodate the capacity.
|
short |
getLeftBorderColor()
get the color to use for the left border
|
Color |
getLeftBorderColorColor() |
boolean |
getLocked()
get whether the cell's using this style are to be locked
|
String |
getName() |
String |
getRawDataFormatString()
Get the raw data format string that are not transfered by ZSS Context Locale
|
short |
getRightBorderColor()
get the color to use for the left border
|
Color |
getRightBorderColorColor() |
short |
getRotation()
get the degree of rotation for the text in the cell
|
short |
getTopBorderColor()
get the color to use for the top border
|
Color |
getTopBorderColorColor() |
short |
getVerticalAlignment()
get the type of vertical alignment for the cell
|
boolean |
getWrapText()
get whether the text should be wrapped
|
boolean |
isBuiltinDataFormat()
Check if the data format is build in format
|
boolean |
isCustomBuiltin() |
boolean |
isShowDiagonalDownBorder()
Whether show diagonalDown diagonal border
|
boolean |
isShowDiagonalUpBorder()
Whether show diagonalUp diagonal border
|
void |
setAlignment(short align)
set the type of horizontal alignment for the cell
|
void |
setBorder(short left,
Color leftColor,
short top,
Color topColor,
short right,
Color rightColor,
short bottom,
Color bottomColor) |
void |
setBorder(short left,
Color leftColor,
short top,
Color topColor,
short right,
Color rightColor,
short bottom,
Color bottomColor,
short diagonal,
Color diagonalColor,
short horizontal,
Color horizontalColor,
short vertical,
Color verticalColor,
boolean diaUp,
boolean diaDown) |
void |
setBorderBottom(short border)
set the type of border to use for the bottom border of the cell
|
void |
setBorderDiagonal(short border)
set the type of border to use for the diagonal border of the cell
|
void |
setBorderLeft(short border)
set the type of border to use for the left border of the cell
|
void |
setBorderRight(short border)
set the type of border to use for the right border of the cell
|
void |
setBorderTop(short border)
set the type of border to use for the top border of the cell
|
void |
setBottomBorderColor(short color)
set the color to use for the bottom border
|
void |
setCellAlignment(short hAlign,
short vAlign,
boolean wrapText)
Deprecated.
|
void |
setCellAlignment(short hAlign,
short vAlign,
boolean wrapText,
short rotation) |
void |
setDataFormat(short fmt)
set the data format (must be a valid format)
|
void |
setDiagonalBorderColor(short color)
set the color to use for the diagonal border
|
void |
setFill(Color fillColor,
Color backColor,
short pattern) |
void |
setFillBackgroundColor(short bg)
set the background fill color.
|
void |
setFillForegroundColor(short bg)
set the foreground fill color
Note: Ensure Foreground color is set prior to background color.
|
void |
setFillPattern(short fp)
setting to one fills the cell with the foreground color...
|
void |
setFont(Font font)
set the font for this style
|
void |
setFontColorColor(Color fontColor) |
void |
setHidden(boolean hidden)
set the cell's using this style to be hidden
|
void |
setIndention(short indent)
set the number of spaces to indent the text in the cell
|
void |
setLeftBorderColor(short color)
set the color to use for the left border
|
void |
setLocked(boolean locked)
set the cell's using this style to be locked
|
void |
setProtection(boolean locked,
boolean hidden) |
void |
setRightBorderColor(short color)
set the color to use for the right border
|
void |
setRotation(short rotation)
set the degree of rotation for the text in the cell
|
void |
setShowDiagonalDownBorder(boolean down)
Whether show diagonalDown diagonal border
|
void |
setShowDiagonalUpBorder(boolean up)
Whether show diagonalUp diagonal border
|
void |
setTopBorderColor(short color)
set the color to use for the top border
|
void |
setVerticalAlignment(short align)
set the type of vertical alignment for the cell
|
void |
setWrapText(boolean wrapped)
Set whether the text should be wrapped.
|
public HSSFNamedStyle(StyleRecord rec, StyleExtRecord rec2, CellStyle inner)
public int getIndex()
CellStylepublic void setDataFormat(short fmt)
CellStylesetDataFormat in interface CellStyleDataFormatpublic short getDataFormat()
CellStylegetDataFormat in interface CellStyleDataFormatpublic String getDataFormatString()
CellStylegetDataFormatString in interface CellStylepublic String getRawDataFormatString()
CellStylegetRawDataFormatString in interface CellStylepublic boolean isBuiltinDataFormat()
CellStyleisBuiltinDataFormat in interface CellStylepublic void setFont(Font font)
CellStylesetFont in interface CellStylefont - a font object created or retreived from the Workbook objectWorkbook.createFont(),
Workbook.getFontAt(short)public short getFontIndex()
CellStylegetFontIndex in interface CellStyleWorkbook.getFontAt(short)public void setHidden(boolean hidden)
CellStylepublic boolean getHidden()
CellStylepublic void setLocked(boolean locked)
CellStylepublic boolean getLocked()
CellStylepublic void setAlignment(short align)
CellStylesetAlignment in interface CellStylealign - - the type of alignmentCellStyle.ALIGN_GENERAL,
CellStyle.ALIGN_LEFT,
CellStyle.ALIGN_CENTER,
CellStyle.ALIGN_RIGHT,
CellStyle.ALIGN_FILL,
CellStyle.ALIGN_JUSTIFY,
CellStyle.ALIGN_CENTER_SELECTIONpublic short getAlignment()
CellStylegetAlignment in interface CellStyleCellStyle.ALIGN_GENERAL,
CellStyle.ALIGN_LEFT,
CellStyle.ALIGN_CENTER,
CellStyle.ALIGN_RIGHT,
CellStyle.ALIGN_FILL,
CellStyle.ALIGN_JUSTIFY,
CellStyle.ALIGN_CENTER_SELECTIONpublic void setWrapText(boolean wrapped)
CellStyletrue make all content visible
whithin a cell by displaying it on multiple linessetWrapText in interface CellStylewrapped - wrap text or notpublic boolean getWrapText()
CellStylegetWrapText in interface CellStylepublic void setVerticalAlignment(short align)
CellStylesetVerticalAlignment in interface CellStylealign - the type of alignmentCellStyle.VERTICAL_TOP,
CellStyle.VERTICAL_CENTER,
CellStyle.VERTICAL_BOTTOM,
CellStyle.VERTICAL_JUSTIFYpublic short getVerticalAlignment()
CellStylegetVerticalAlignment in interface CellStyleCellStyle.VERTICAL_TOP,
CellStyle.VERTICAL_CENTER,
CellStyle.VERTICAL_BOTTOM,
CellStyle.VERTICAL_JUSTIFYpublic void setRotation(short rotation)
CellStylesetRotation in interface CellStylerotation - degrees (between -90 and 90 degrees)public short getRotation()
CellStylegetRotation in interface CellStylepublic void setIndention(short indent)
CellStylesetIndention in interface CellStyleindent - - number of spacespublic short getIndention()
CellStylegetIndention in interface CellStylepublic void setBorderLeft(short border)
CellStylesetBorderLeft in interface CellStyleborder - typeCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic short getBorderLeft()
CellStylegetBorderLeft in interface CellStyleCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic void setBorderRight(short border)
CellStylesetBorderRight in interface CellStyleborder - typeCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic short getBorderRight()
CellStylegetBorderRight in interface CellStyleCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic void setBorderTop(short border)
CellStylesetBorderTop in interface CellStyleborder - typeCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic short getBorderTop()
CellStylegetBorderTop in interface CellStyleCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic void setBorderBottom(short border)
CellStylesetBorderBottom in interface CellStyleborder - typeCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic short getBorderBottom()
CellStylegetBorderBottom in interface CellStyleCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic void setLeftBorderColor(short color)
CellStylesetLeftBorderColor in interface CellStylecolor - The index of the color definitionpublic short getLeftBorderColor()
CellStylegetLeftBorderColor in interface CellStylepublic void setRightBorderColor(short color)
CellStylesetRightBorderColor in interface CellStylecolor - The index of the color definitionpublic short getRightBorderColor()
CellStylegetRightBorderColor in interface CellStylepublic void setTopBorderColor(short color)
CellStylesetTopBorderColor in interface CellStylecolor - The index of the color definitionpublic short getTopBorderColor()
CellStylegetTopBorderColor in interface CellStylepublic void setBottomBorderColor(short color)
CellStylesetBottomBorderColor in interface CellStylecolor - The index of the color definitionpublic short getBottomBorderColor()
CellStylegetBottomBorderColor in interface CellStylepublic void setFillPattern(short fp)
CellStylesetFillPattern in interface CellStylefp - fill pattern (set to 1 to fill w/foreground color)CellStyle.NO_FILL,
CellStyle.SOLID_FOREGROUND,
CellStyle.FINE_DOTS,
CellStyle.ALT_BARS,
CellStyle.SPARSE_DOTS,
CellStyle.THICK_HORZ_BANDS,
CellStyle.THICK_VERT_BANDS,
CellStyle.THICK_BACKWARD_DIAG,
CellStyle.THICK_FORWARD_DIAG,
CellStyle.BIG_SPOTS,
CellStyle.BRICKS,
CellStyle.THIN_HORZ_BANDS,
CellStyle.THIN_VERT_BANDS,
CellStyle.THIN_BACKWARD_DIAG,
CellStyle.THIN_FORWARD_DIAG,
CellStyle.SQUARES,
CellStyle.DIAMONDSpublic short getFillPattern()
CellStylegetFillPattern in interface CellStylepublic void setFillBackgroundColor(short bg)
CellStylesetFillBackgroundColor in interface CellStylebg - colorpublic short getFillBackgroundColor()
CellStylegetFillBackgroundColor in interface CellStylepublic Color getFillBackgroundColorColor()
CellStylegetFillBackgroundColorColor in interface CellStylepublic void setFillForegroundColor(short bg)
CellStylesetFillForegroundColor in interface CellStylebg - colorpublic short getFillForegroundColor()
CellStylegetFillForegroundColor in interface CellStylepublic Color getFillForegroundColorColor()
CellStylegetFillForegroundColorColor in interface CellStylepublic void cloneStyleFrom(CellStyle source)
CellStylecloneStyleFrom in interface CellStylepublic Color getTopBorderColorColor()
getTopBorderColorColor in interface CellStylepublic Color getBottomBorderColorColor()
getBottomBorderColorColor in interface CellStylepublic Color getRightBorderColorColor()
getRightBorderColorColor in interface CellStylepublic Color getLeftBorderColorColor()
getLeftBorderColorColor in interface CellStylepublic void setFontColorColor(Color fontColor)
setFontColorColor in interface CellStylepublic void setBorder(short left,
Color leftColor,
short top,
Color topColor,
short right,
Color rightColor,
short bottom,
Color bottomColor)
public void setBorder(short left,
Color leftColor,
short top,
Color topColor,
short right,
Color rightColor,
short bottom,
Color bottomColor,
short diagonal,
Color diagonalColor,
short horizontal,
Color horizontalColor,
short vertical,
Color verticalColor,
boolean diaUp,
boolean diaDown)
@Deprecated public void setCellAlignment(short hAlign, short vAlign, boolean wrapText)
setCellAlignment in interface CellStylepublic void setProtection(boolean locked,
boolean hidden)
setProtection in interface CellStylepublic void setBorderDiagonal(short border)
CellStylesetBorderDiagonal in interface CellStyleborder - typeCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic short getBorderDiagonal()
CellStylegetBorderDiagonal in interface CellStyleCellStyle.BORDER_NONE,
CellStyle.BORDER_THIN,
CellStyle.BORDER_MEDIUM,
CellStyle.BORDER_DASHED,
CellStyle.BORDER_DOTTED,
CellStyle.BORDER_THICK,
CellStyle.BORDER_DOUBLE,
CellStyle.BORDER_HAIR,
CellStyle.BORDER_MEDIUM_DASHED,
CellStyle.BORDER_DASH_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT,
CellStyle.BORDER_DASH_DOT_DOT,
CellStyle.BORDER_MEDIUM_DASH_DOT_DOT,
CellStyle.BORDER_SLANTED_DASH_DOTpublic Color getDiagonalBorderColorColor()
getDiagonalBorderColorColor in interface CellStylepublic void setDiagonalBorderColor(short color)
CellStylesetDiagonalBorderColor in interface CellStylecolor - The index of the color definitionpublic short getDiagonalBorderColor()
CellStylegetDiagonalBorderColor in interface CellStylepublic boolean isShowDiagonalUpBorder()
CellStyleisShowDiagonalUpBorder in interface CellStylepublic void setShowDiagonalUpBorder(boolean up)
CellStylesetShowDiagonalUpBorder in interface CellStylepublic boolean isShowDiagonalDownBorder()
CellStyleisShowDiagonalDownBorder in interface CellStylepublic void setShowDiagonalDownBorder(boolean down)
CellStylesetShowDiagonalDownBorder in interface CellStylepublic String getName()
getName in interface NamedStylepublic boolean isCustomBuiltin()
isCustomBuiltin in interface NamedStylepublic int getBuiltinId()
getBuiltinId in interface NamedStylepublic void setCellAlignment(short hAlign,
short vAlign,
boolean wrapText,
short rotation)
setCellAlignment in interface CellStyleCopyright © 2020. All rights reserved.