?? hssfcellstyle.java
字號:
public short getVerticalAlignment() { return format.getVerticalAlignment(); } /** * set the degree of rotation for the text in the cell * @param rotation degrees (between -90 and 90 degrees) */ public void setRotation(short rotation) { if ((rotation < 0)&&(rotation >= -90)) { //Take care of the funny 4th quadrant issue //The 4th quadrant (-1 to -90) is stored as (91 to 180) rotation = (short)(90 - rotation); } else if ((rotation < -90) ||(rotation > 90)) //Do not allow an incorrect rotation to be set throw new IllegalArgumentException("The rotation must be between -90 and 90 degrees"); format.setRotation(rotation); } /** * get the degree of rotation for the text in the cell * @return rotation degrees (between -90 and 90 degrees) */ public short getRotation() { short rotation = format.getRotation(); if (rotation > 90) //This is actually the 4th quadrant rotation = (short)(90-rotation); return rotation; } /** * set the number of spaces to indent the text in the cell * @param indent - number of spaces */ public void setIndention(short indent) { format.setIndent(indent); } /** * get the number of spaces to indent the text in the cell * @return indent - number of spaces */ public short getIndention() { return format.getIndent(); } /** * set the type of border to use for the left border of the cell * @param border type * @see #BORDER_NONE * @see #BORDER_THIN * @see #BORDER_MEDIUM * @see #BORDER_DASHED * @see #BORDER_DOTTED * @see #BORDER_THICK * @see #BORDER_DOUBLE * @see #BORDER_HAIR * @see #BORDER_MEDIUM_DASHED * @see #BORDER_DASH_DOT * @see #BORDER_MEDIUM_DASH_DOT * @see #BORDER_DASH_DOT_DOT * @see #BORDER_MEDIUM_DASH_DOT_DOT * @see #BORDER_SLANTED_DASH_DOT */ public void setBorderLeft(short border) { format.setIndentNotParentBorder(true); format.setBorderLeft(border); } /** * get the type of border to use for the left border of the cell * @return border type * @see #BORDER_NONE * @see #BORDER_THIN * @see #BORDER_MEDIUM * @see #BORDER_DASHED * @see #BORDER_DOTTED * @see #BORDER_THICK * @see #BORDER_DOUBLE * @see #BORDER_HAIR * @see #BORDER_MEDIUM_DASHED * @see #BORDER_DASH_DOT * @see #BORDER_MEDIUM_DASH_DOT * @see #BORDER_DASH_DOT_DOT * @see #BORDER_MEDIUM_DASH_DOT_DOT * @see #BORDER_SLANTED_DASH_DOT */ public short getBorderLeft() { return format.getBorderLeft(); } /** * set the type of border to use for the right border of the cell * @param border type * @see #BORDER_NONE * @see #BORDER_THIN * @see #BORDER_MEDIUM * @see #BORDER_DASHED * @see #BORDER_DOTTED * @see #BORDER_THICK * @see #BORDER_DOUBLE * @see #BORDER_HAIR * @see #BORDER_MEDIUM_DASHED * @see #BORDER_DASH_DOT * @see #BORDER_MEDIUM_DASH_DOT * @see #BORDER_DASH_DOT_DOT * @see #BORDER_MEDIUM_DASH_DOT_DOT * @see #BORDER_SLANTED_DASH_DOT */ public void setBorderRight(short border) { format.setIndentNotParentBorder(true); format.setBorderRight(border); } /** * get the type of border to use for the right border of the cell * @return border type * @see #BORDER_NONE * @see #BORDER_THIN * @see #BORDER_MEDIUM * @see #BORDER_DASHED * @see #BORDER_DOTTED * @see #BORDER_THICK * @see #BORDER_DOUBLE * @see #BORDER_HAIR * @see #BORDER_MEDIUM_DASHED * @see #BORDER_DASH_DOT * @see #BORDER_MEDIUM_DASH_DOT * @see #BORDER_DASH_DOT_DOT * @see #BORDER_MEDIUM_DASH_DOT_DOT * @see #BORDER_SLANTED_DASH_DOT */ public short getBorderRight() { return format.getBorderRight(); } /** * set the type of border to use for the top border of the cell * @param border type * @see #BORDER_NONE * @see #BORDER_THIN * @see #BORDER_MEDIUM * @see #BORDER_DASHED * @see #BORDER_DOTTED * @see #BORDER_THICK * @see #BORDER_DOUBLE * @see #BORDER_HAIR * @see #BORDER_MEDIUM_DASHED * @see #BORDER_DASH_DOT * @see #BORDER_MEDIUM_DASH_DOT * @see #BORDER_DASH_DOT_DOT * @see #BORDER_MEDIUM_DASH_DOT_DOT * @see #BORDER_SLANTED_DASH_DOT */ public void setBorderTop(short border) { format.setIndentNotParentBorder(true); format.setBorderTop(border); } /** * get the type of border to use for the top border of the cell * @return border type * @see #BORDER_NONE * @see #BORDER_THIN * @see #BORDER_MEDIUM * @see #BORDER_DASHED * @see #BORDER_DOTTED * @see #BORDER_THICK * @see #BORDER_DOUBLE * @see #BORDER_HAIR * @see #BORDER_MEDIUM_DASHED * @see #BORDER_DASH_DOT * @see #BORDER_MEDIUM_DASH_DOT * @see #BORDER_DASH_DOT_DOT * @see #BORDER_MEDIUM_DASH_DOT_DOT * @see #BORDER_SLANTED_DASH_DOT */ public short getBorderTop() { return format.getBorderTop(); } /** * set the type of border to use for the bottom border of the cell * @param border type * @see #BORDER_NONE * @see #BORDER_THIN * @see #BORDER_MEDIUM * @see #BORDER_DASHED * @see #BORDER_DOTTED * @see #BORDER_THICK * @see #BORDER_DOUBLE * @see #BORDER_HAIR * @see #BORDER_MEDIUM_DASHED * @see #BORDER_DASH_DOT * @see #BORDER_MEDIUM_DASH_DOT * @see #BORDER_DASH_DOT_DOT * @see #BORDER_MEDIUM_DASH_DOT_DOT * @see #BORDER_SLANTED_DASH_DOT */ public void setBorderBottom(short border) { format.setIndentNotParentBorder(true); format.setBorderBottom(border); } /** * get the type of border to use for the bottom border of the cell * @return border type * @see #BORDER_NONE * @see #BORDER_THIN * @see #BORDER_MEDIUM * @see #BORDER_DASHED * @see #BORDER_DOTTED * @see #BORDER_THICK * @see #BORDER_DOUBLE * @see #BORDER_HAIR * @see #BORDER_MEDIUM_DASHED * @see #BORDER_DASH_DOT * @see #BORDER_MEDIUM_DASH_DOT * @see #BORDER_DASH_DOT_DOT * @see #BORDER_MEDIUM_DASH_DOT_DOT * @see #BORDER_SLANTED_DASH_DOT */ public short getBorderBottom() { return format.getBorderBottom(); } /** * set the color to use for the left border * @param color */ public void setLeftBorderColor(short color) { format.setLeftBorderPaletteIdx(color); } /** * get the color to use for the left border * @return color */ public short getLeftBorderColor() { return format.getLeftBorderPaletteIdx(); } /** * set the color to use for the right border * @param color */ public void setRightBorderColor(short color) { format.setRightBorderPaletteIdx(color); } /** * get the color to use for the left border * @return color */ public short getRightBorderColor() { return format.getRightBorderPaletteIdx(); } /** * set the color to use for the top border * @param color */ public void setTopBorderColor(short color) { format.setTopBorderPaletteIdx(color); } /** * get the color to use for the top border * @return color */ public short getTopBorderColor() { return format.getTopBorderPaletteIdx(); } /** * set the color to use for the bottom border * @param color */ public void setBottomBorderColor(short color) { format.setBottomBorderPaletteIdx(color); } /** * get the color to use for the left border * @return color */ public short getBottomBorderColor() { return format.getBottomBorderPaletteIdx(); } /** * setting to one fills the cell with the foreground color... No idea about * other values * * @see #NO_FILL * @see #SOLID_FOREGROUND * @see #FINE_DOTS * @see #ALT_BARS * @see #SPARSE_DOTS * @see #THICK_HORZ_BANDS * @see #THICK_VERT_BANDS * @see #THICK_BACKWARD_DIAG * @see #THICK_FORWARD_DIAG * @see #BIG_SPOTS * @see #BRICKS * @see #THIN_HORZ_BANDS * @see #THIN_VERT_BANDS * @see #THIN_BACKWARD_DIAG * @see #THIN_FORWARD_DIAG * @see #SQUARES * @see #DIAMONDS * * @param fp fill pattern (set to 1 to fill w/foreground color) */ public void setFillPattern(short fp) { format.setAdtlFillPattern(fp); } /** * get the fill pattern (??) - set to 1 to fill with foreground color * @return fill pattern */ public short getFillPattern() { return format.getAdtlFillPattern(); } /** * set the background fill color. * <p> * For example: * <pre> * cs.setFillPattern(HSSFCellStyle.FINE_DOTS ); * cs.setFillBackgroundColor(HSSFCellStyle.RED); * </pre> * or, for the special case of SOLID_FILL: * <pre> * cs.setFillPattern(HSSFCellStyle.SOLID_FILL ); * cs.setFillForgroundColor(HSSFSeCellStyle.RED); * </pre> * It is necessary to set the fill style in order * for the color to be shown in the cell. * * @param bg color */ public void setFillBackgroundColor(short bg) { format.setFillBackground(bg); } /** * get the background fill color * @return fill color */ public short getFillBackgroundColor() { return format.getFillBackground(); } /** * set the foreground fill color * @param bg color */ public void setFillForegroundColor(short bg) { format.setFillForeground(bg); } /** * get the foreground fill color * @return fill color */ public short getFillForegroundColor() { return format.getFillForeground(); }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -