org.apache.poi.ss.usermodel.CellStyle.getFillPattern()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.apache.poi.ss.usermodel.CellStyle.getFillPattern()方法的一些代码示例,展示了CellStyle.getFillPattern()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CellStyle.getFillPattern()方法的具体详情如下:
包路径:org.apache.poi.ss.usermodel.CellStyle
类名称:CellStyle
方法名:getFillPattern

CellStyle.getFillPattern介绍

[英]Get the fill pattern
[中]获取填充模式

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

assertEquals( cellStyle.getFillPattern(), baseCellStyle.getFillPattern() );
} else {
 assertFalse( cellStyle.getFillPattern() == baseCellStyle.getFillPattern() );

代码示例来源:origin: org.apache.poi/poi

put(properties, BOTTOM_BORDER_COLOR, style.getBottomBorderColor());
put(properties, DATA_FORMAT, style.getDataFormat());
put(properties, FILL_PATTERN, style.getFillPattern());
put(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
put(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());

代码示例来源:origin: openl-tablets/openl-tablets

@Override
public FillPatternType getFillPattern() {
  return xlsStyle.getFillPattern();
}

代码示例来源:origin: org.apache.poi/poi-examples

/**
 * Checks if cell fill pattern matches.
 */
private void isCellFillPatternMatches(Locator loc1, Locator loc2) {
  // TOOO: Check for NPE
  FillPatternType fill1 = loc1.cell.getCellStyle().getFillPattern();
  FillPatternType fill2 = loc2.cell.getCellStyle().getFillPattern();
  if (fill1 != fill2) {
    addMessage(loc1, loc2,
      "Cell Fill pattern does not Match ::",
      fill1.name(),
      fill2.name()
    );
  }
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 * Returns <tt>false</tt> if cell style by itself (without text, i.e.
 * borders, fill, etc.) worth a mention, <tt>true</tt> otherwise
 * 
 * @return <tt>false</tt> if cell style by itself (without text, i.e.
 *         borders, fill, etc.) worth a mention, <tt>true</tt> otherwise
 */
protected boolean isEmptyStyle( CellStyle cellStyle )
{
  return cellStyle.getFillPattern() == 0 //
      && cellStyle.getBorderTop() == HSSFCellStyle.BORDER_NONE //
      && cellStyle.getBorderRight() == HSSFCellStyle.BORDER_NONE //
      && cellStyle.getBorderBottom() == HSSFCellStyle.BORDER_NONE //
      && cellStyle.getBorderLeft() == HSSFCellStyle.BORDER_NONE; //
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Returns <tt>false</tt> if cell style by itself (without text, i.e.
 * borders, fill, etc.) worth a mention, <tt>true</tt> otherwise
 * 
 * @return <tt>false</tt> if cell style by itself (without text, i.e.
 *         borders, fill, etc.) worth a mention, <tt>true</tt> otherwise
 */
protected boolean isEmptyStyle( CellStyle cellStyle ) {
  return cellStyle == null || (
      cellStyle.getFillPattern() == FillPatternType.NO_FILL
    && cellStyle.getBorderTop() == BorderStyle.NONE
    && cellStyle.getBorderRight() == BorderStyle.NONE
    && cellStyle.getBorderBottom() == BorderStyle.NONE
    && cellStyle.getBorderLeft() == BorderStyle.NONE
  );
}

代码示例来源:origin: openl-tablets/openl-tablets

public void setCellFillColor(int col, int row, short[] color) {
  Cell cell = PoiExcelHelper.getOrCreateCell(col, row, getSheet());
  CellStyle newStyle = PoiExcelHelper.cloneStyleFrom(cell);
  if (color != null) {
    if (newStyle.getFillPattern() == FillPatternType.NO_FILL) {
      newStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    }
    setCellFillColor(newStyle, color);
  } else {
    newStyle.setFillPattern(FillPatternType.NO_FILL);
  }
  cell.setCellStyle(newStyle);
}

代码示例来源:origin: org.eobjects.metamodel/MetaModel-excel

if (cellStyle.getFillPattern() == 1) {
  Color color = cellStyle.getFillForegroundColorColor();
  if (color instanceof HSSFColor) {

代码示例来源:origin: apache/metamodel

if (cellStyle.getFillPattern() == FillPatternType.SOLID_FOREGROUND) {
  Color color = cellStyle.getFillForegroundColorColor();
  if (color instanceof HSSFColor) {

代码示例来源:origin: openl-tablets/openl-tablets

private boolean equalsStyle(CellStyle cs1, CellStyle cs2) {
  return (cs1.getAlignment() == cs2.getAlignment() && cs1.getHidden() == cs2.getHidden() && cs1.getLocked() == cs2.getLocked() && cs1.getWrapText() == cs2.getWrapText() && cs1.getBorderBottom() == cs2.getBorderBottom() && cs1.getBorderLeft() == cs2.getBorderLeft() && cs1.getBorderRight() == cs2.getBorderRight() && cs1.getBorderTop() == cs2.getBorderTop() && cs1.getBottomBorderColor() == cs2.getBottomBorderColor() && cs1.getFillBackgroundColor() == cs2.getFillBackgroundColor() && cs1.getFillForegroundColor() == cs2.getFillForegroundColor() && cs1.getFillPattern() == cs2.getFillPattern() && cs1.getIndention() == cs2.getIndention() && cs1.getLeftBorderColor() == cs2.getLeftBorderColor() && cs1.getRightBorderColor() == cs2.getRightBorderColor() && cs1.getRotation() == cs2.getRotation() && cs1.getTopBorderColor() == cs2.getTopBorderColor() && cs1.getVerticalAlignment() == cs2.getVerticalAlignment()) && cs1.getDataFormat() == cs2.getDataFormat();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

putShort(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());
putShort(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
putShort(properties, FILL_PATTERN, style.getFillPattern());
putShort(properties, FONT, style.getFontIndex());
putBoolean(properties, HIDDEN, style.getHidden());

代码示例来源:origin: org.apache.poi/poi-contrib

putShort(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());
putShort(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
putShort(properties, FILL_PATTERN, style.getFillPattern());
putShort(properties, FONT, style.getFontIndex());
putBoolean(properties, HIDDEN, style.getHidden());

代码示例来源:origin: com.haulmont.thirdparty/poi

putShort(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());
putShort(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
putShort(properties, FILL_PATTERN, style.getFillPattern());
putShort(properties, FONT, style.getFontIndex());
putBoolean(properties, HIDDEN, style.getHidden());

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

putShort(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());
putShort(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
putShort(properties, FILL_PATTERN, style.getFillPattern());
putShort(properties, FONT, style.getFontIndex());
putBoolean(properties, HIDDEN, style.getHidden());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

put(properties, BOTTOM_BORDER_COLOR, style.getBottomBorderColor());
put(properties, DATA_FORMAT, style.getDataFormat());
put(properties, FILL_PATTERN, style.getFillPattern());
put(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
put(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());

代码示例来源:origin: com.eas.platypus/platypus-js-reports

private void copyStyle(Workbook workbook, Cell fromCell, Cell toCell) {
    CellStyle toStyle = toCell.getCellStyle();
    CellStyle fromStyle = fromCell.getCellStyle();
    CellStyle newStyle = workbook.createCellStyle();

    newStyle.setAlignment(fromStyle.getAlignment());
    newStyle.setBorderBottom(fromStyle.getBorderBottom());
    newStyle.setBorderLeft(fromStyle.getBorderLeft());
    newStyle.setBorderRight(fromStyle.getBorderRight());
    newStyle.setBorderTop(fromStyle.getBorderTop());
    newStyle.setBottomBorderColor(fromStyle.getBottomBorderColor());

    newStyle.setFillBackgroundColor(fromStyle.getFillBackgroundColor());
    newStyle.setFillForegroundColor(fromStyle.getFillForegroundColor());
    newStyle.setFillPattern(fromStyle.getFillPattern());
    newStyle.setFont(workbook.getFontAt(fromStyle.getFontIndex()));
    newStyle.setHidden(fromStyle.getHidden());
    newStyle.setIndention(fromStyle.getIndention());
    newStyle.setLeftBorderColor(fromStyle.getLeftBorderColor());
    newStyle.setLocked(fromStyle.getLocked());
    newStyle.setRightBorderColor(fromStyle.getRightBorderColor());
    newStyle.setTopBorderColor(fromStyle.getTopBorderColor());
    newStyle.setVerticalAlignment(fromStyle.getVerticalAlignment());
    newStyle.setWrapText(fromStyle.getWrapText());
    newStyle.setDataFormat(toStyle.getDataFormat());
    toCell.setCellStyle(newStyle);
  }
}

代码示例来源:origin: net.sf.jxls/jxls-core

newStyle.setFillBackgroundColor(style.getFillBackgroundColor());
newStyle.setFillForegroundColor(style.getFillForegroundColor());
newStyle.setFillPattern(style.getFillPattern());
newStyle.setFont(workbook.getFontAt(style.getFontIndex()));
newStyle.setHidden(style.getHidden());

代码示例来源:origin: SheetJS/jxls

newStyle.setFillBackgroundColor(style.getFillBackgroundColor());
newStyle.setFillForegroundColor(style.getFillForegroundColor());
newStyle.setFillPattern(style.getFillPattern());
newStyle.setFont(workbook.getFontAt(style.getFontIndex()));
newStyle.setHidden(style.getHidden());

代码示例来源:origin: SheetJS/jxls

private void copyStyle(Workbook workbook, org.apache.poi.ss.usermodel.Cell fromCell, org.apache.poi.ss.usermodel.Cell toCell){
    CellStyle toStyle = toCell.getCellStyle();
    CellStyle fromStyle = fromCell.getCellStyle();
    if( fromStyle.getDataFormat() == toStyle.getDataFormat() ){
      toCell.setCellStyle( fromStyle );
    }else{
      CellStyle newStyle = workbook.createCellStyle();
      newStyle.setAlignment( toStyle.getAlignment() );
      newStyle.setBorderBottom( toStyle.getBorderBottom() );
      newStyle.setBorderLeft( toStyle.getBorderLeft() );
      newStyle.setBorderRight( toStyle.getBorderRight() );
      newStyle.setBorderTop( toStyle.getBorderTop() );
      newStyle.setBottomBorderColor( toStyle.getBottomBorderColor() );
      newStyle.setDataFormat( toStyle.getDataFormat() );
      newStyle.setFillBackgroundColor( fromStyle.getFillBackgroundColor() );
      newStyle.setFillForegroundColor( fromStyle.getFillForegroundColor() );
      newStyle.setFillPattern( fromStyle.getFillPattern() );
      newStyle.setFont( workbook.getFontAt( fromStyle.getFontIndex() ) );
      newStyle.setHidden( toStyle.getHidden() );
      newStyle.setIndention( toStyle.getIndention() );
      newStyle.setLeftBorderColor( toStyle.getLeftBorderColor() );
      newStyle.setLocked( toStyle.getLocked() );
      newStyle.setRightBorderColor( toStyle.getRightBorderColor() );
      newStyle.setTopBorderColor( toStyle.getTopBorderColor() );
      newStyle.setVerticalAlignment( toStyle.getVerticalAlignment() );
      newStyle.setWrapText( toStyle.getWrapText() );
      toCell.setCellStyle( newStyle );
    }
  }
}

代码示例来源:origin: com.github.nic-luo/rober-office

toStyle.setFillPattern(fromStyle.getFillPattern());

相关文章

微信公众号

最新文章

更多