int wholeWidth=getWholeWidth(columns, i, cellInfo.getColSpan()); int wholeHeight=getWholeHeight(rows, rowIndex, cellInfo.getRowSpan()); HorizontalAlignment align=style.getAlignmentEnum(); if(align.equals(HorizontalAlignment.CENTER)){ leftMargin=(wholeWidth-width)/2; int wholeWidth=getWholeWidth(columns, i, cellInfo.getColSpan()); int wholeHeight=getWholeHeight(rows, rowIndex, cellInfo.getRowSpan()); HorizontalAlignment align=style.getAlignmentEnum(); if(align.equals(HorizontalAlignment.CENTER)){ leftMargin=(wholeWidth-width)/2;
int wholeWidth=getWholeWidth(columns, i, cellInfo.getColSpan()); int wholeHeight=getWholeHeight(rows, rowNumber, cellInfo.getRowSpan()); HorizontalAlignment align=style.getAlignmentEnum(); if(align.equals(HorizontalAlignment.CENTER)){ leftMargin=(wholeWidth-width)/2; int wholeWidth=getWholeWidth(columns, i, cellInfo.getColSpan()); int wholeHeight=getWholeHeight(rows, rowNumber, cellInfo.getRowSpan()); HorizontalAlignment align=style.getAlignmentEnum(); if(align.equals(HorizontalAlignment.CENTER)){ leftMargin=(wholeWidth-width)/2;
/** * Get the type of horizontal alignment for the cell * * @return short - the type of alignment * @see org.apache.poi.ss.usermodel.CellStyle#ALIGN_GENERAL * @see org.apache.poi.ss.usermodel.CellStyle#ALIGN_LEFT * @see org.apache.poi.ss.usermodel.CellStyle#ALIGN_CENTER * @see org.apache.poi.ss.usermodel.CellStyle#ALIGN_RIGHT * @see org.apache.poi.ss.usermodel.CellStyle#ALIGN_FILL * @see org.apache.poi.ss.usermodel.CellStyle#ALIGN_JUSTIFY * @see org.apache.poi.ss.usermodel.CellStyle#ALIGN_CENTER_SELECTION */ public short getAlignment() { return (short)(getAlignmentEnum().ordinal()); }
int wholeWidth=getWholeWidth(columns, i, cellInfo.getColSpan()); int wholeHeight=getWholeHeight(rows, rowIndex, cellInfo.getRowSpan()); HorizontalAlignment align=style.getAlignmentEnum(); if(align.equals(HorizontalAlignment.CENTER)){ leftMargin=(wholeWidth-width)/2; int wholeWidth=getWholeWidth(columns, i, cellInfo.getColSpan()); int wholeHeight=getWholeHeight(rows, rowIndex, cellInfo.getRowSpan()); HorizontalAlignment align=style.getAlignmentEnum(); if(align.equals(HorizontalAlignment.CENTER)){ leftMargin=(wholeWidth-width)/2;
int wholeWidth=getWholeWidth(columns, i, cellInfo.getColSpan()); int wholeHeight=getWholeHeight(rows, rowNumber, cellInfo.getRowSpan()); HorizontalAlignment align=style.getAlignmentEnum(); if(align.equals(HorizontalAlignment.CENTER)){ leftMargin=(wholeWidth-width)/2; int wholeWidth=getWholeWidth(columns, i, cellInfo.getColSpan()); int wholeHeight=getWholeHeight(rows, rowNumber, cellInfo.getRowSpan()); HorizontalAlignment align=style.getAlignmentEnum(); if(align.equals(HorizontalAlignment.CENTER)){ leftMargin=(wholeWidth-width)/2;
switch (style.getAlignmentEnum()) { case LEFT: _style.leftAligned();
switch (style.getAlignmentEnum()) { case LEFT: _style.leftAligned();
switch (style.getAlignmentEnum()) { case LEFT: _style.leftAligned();
protected HSSFCellStyleKey( final XSSFCellStyle style ) { this.color = style.getFillForegroundColor(); this.colorTop = style.getTopBorderColor(); this.colorLeft = style.getLeftBorderColor(); this.colorBottom = style.getBottomBorderColor(); this.colorRight = style.getRightBorderColor(); this.xColor = createColor( style.getFillBackgroundXSSFColor() ); this.xColorTop = createColor( style.getTopBorderXSSFColor() ); this.xColorLeft = createColor( style.getLeftBorderXSSFColor() ); this.xColorBottom = createColor( style.getBottomBorderXSSFColor() ); this.xColorRight = createColor( style.getRightBorderXSSFColor() ); this.borderStrokeTop = style.getBorderTopEnum(); this.borderStrokeLeft = style.getBorderLeftEnum(); this.borderStrokeBottom = style.getBorderBottomEnum(); this.borderStrokeRight = style.getBorderRightEnum(); this.dataStyle = style.getDataFormat(); this.font = style.getFontIndex(); this.horizontalAlignment = style.getAlignmentEnum(); this.verticalAlignment = style.getVerticalAlignmentEnum(); this.wrapText = style.getWrapText(); this.textRotation = TextRotation.getInstance( style.getRotation() ); }
private CellStyle buildCellStyle(XSSFCell cell,XSSFWorkbook book){ CellStyle style=new CellStyle(); XSSFCellStyle cellStyle=cell.getCellStyle(); HorizontalAlignment align=cellStyle.getAlignmentEnum(); if(align.equals(HorizontalAlignment.CENTER)){ style.setAlign(Alignment.center);