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

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

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

CellStyle.getLeftBorderColor介绍

[英]get the color to use for the left border
[中]获取用于左边框的颜色

代码示例

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

  1. put(properties, HIDDEN, style.getHidden());
  2. put(properties, INDENTION, style.getIndention());
  3. put(properties, LEFT_BORDER_COLOR, style.getLeftBorderColor());
  4. put(properties, LOCKED, style.getLocked());
  5. put(properties, RIGHT_BORDER_COLOR, style.getRightBorderColor());

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

  1. private void initWorkbookColors() {
  2. if (!(getWorkbook() instanceof HSSFWorkbook)) {
  3. return;
  4. }
  5. Workbook workbook = getWorkbook();
  6. int numStyles = workbook.getNumCellStyles();
  7. for (int i = 0; i < numStyles; i++) {
  8. CellStyle cellStyle = workbook.getCellStyleAt(i);
  9. wbColors.add(cellStyle.getFillForegroundColor());
  10. wbColors.add(cellStyle.getFillBackgroundColor());
  11. wbColors.add(cellStyle.getTopBorderColor());
  12. wbColors.add(cellStyle.getBottomBorderColor());
  13. wbColors.add(cellStyle.getLeftBorderColor());
  14. wbColors.add(cellStyle.getRightBorderColor());
  15. }
  16. int numFonts = workbook.getNumberOfFontsAsInt();
  17. for (int i = 0; i < numFonts; i++) {
  18. Font font = workbook.getFontAt(i);
  19. wbColors.add(font.getColor());
  20. }
  21. }

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

  1. @Override
  2. public short[][] getBorderRGB() {
  3. short[][] colors = new short[4][];
  4. colors[0] = toRgb(palette, getXlsStyle().getTopBorderColor());
  5. colors[1] = toRgb(palette, getXlsStyle().getRightBorderColor());
  6. colors[2] = toRgb(palette, getXlsStyle().getBottomBorderColor());
  7. colors[3] = toRgb(palette, getXlsStyle().getLeftBorderColor());
  8. return colors;
  9. }

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

  1. protected HSSFCellStyleKey( final CellStyle style ) {
  2. this.color = style.getFillForegroundColor();
  3. this.colorTop = style.getTopBorderColor();
  4. this.colorLeft = style.getLeftBorderColor();
  5. this.colorBottom = style.getBottomBorderColor();
  6. this.colorRight = style.getRightBorderColor();
  7. this.borderStrokeTop = style.getBorderTopEnum();
  8. this.borderStrokeLeft = style.getBorderLeftEnum();
  9. this.borderStrokeBottom = style.getBorderBottomEnum();
  10. this.borderStrokeRight = style.getBorderRightEnum();
  11. this.dataStyle = style.getDataFormat();
  12. this.font = style.getFontIndex();
  13. this.horizontalAlignment = style.getAlignmentEnum();
  14. this.verticalAlignment = style.getVerticalAlignmentEnum();
  15. this.wrapText = style.getWrapText();
  16. this.textRotation = TextRotation.getInstance( style.getRotation() );
  17. }

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

  1. public static short[][] getCellBorderColors(CellStyle style, Workbook workbook) {
  2. short[][] colors = new short[4][];
  3. if (style instanceof HSSFCellStyle) {
  4. HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  5. colors[0] = toRgb(style.getTopBorderColor(), hssfWorkbook);
  6. colors[1] = toRgb(style.getRightBorderColor(), hssfWorkbook);
  7. colors[2] = toRgb(style.getBottomBorderColor(), hssfWorkbook);
  8. colors[3] = toRgb(style.getLeftBorderColor(), hssfWorkbook);
  9. } else if(style instanceof XSSFCellStyle) {
  10. XSSFCellStyle xssfStyle = (XSSFCellStyle) style;
  11. colors[0] = toRgb(xssfStyle.getTopBorderXSSFColor());
  12. colors[1] = toRgb(xssfStyle.getRightBorderXSSFColor());
  13. colors[2] = toRgb(xssfStyle.getBottomBorderXSSFColor());
  14. colors[3] = toRgb(xssfStyle.getLeftBorderXSSFColor());
  15. }
  16. return colors;
  17. }

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

  1. private boolean equalsStyle(CellStyle cs1, CellStyle cs2) {
  2. 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();
  3. }

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

  1. putBoolean(properties, HIDDEN, style.getHidden());
  2. putShort(properties, INDENTION, style.getIndention());
  3. putShort(properties, LEFT_BORDER_COLOR, style.getLeftBorderColor());
  4. putBoolean(properties, LOCKED, style.getLocked());
  5. putShort(properties, RIGHT_BORDER_COLOR, style.getRightBorderColor());

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

  1. putBoolean(properties, HIDDEN, style.getHidden());
  2. putShort(properties, INDENTION, style.getIndention());
  3. putShort(properties, LEFT_BORDER_COLOR, style.getLeftBorderColor());
  4. putBoolean(properties, LOCKED, style.getLocked());
  5. putShort(properties, RIGHT_BORDER_COLOR, style.getRightBorderColor());

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

  1. put(properties, HIDDEN, style.getHidden());
  2. put(properties, INDENTION, style.getIndention());
  3. put(properties, LEFT_BORDER_COLOR, style.getLeftBorderColor());
  4. put(properties, LOCKED, style.getLocked());
  5. put(properties, RIGHT_BORDER_COLOR, style.getRightBorderColor());

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

  1. putBoolean(properties, HIDDEN, style.getHidden());
  2. putShort(properties, INDENTION, style.getIndention());
  3. putShort(properties, LEFT_BORDER_COLOR, style.getLeftBorderColor());
  4. putBoolean(properties, LOCKED, style.getLocked());
  5. putShort(properties, RIGHT_BORDER_COLOR, style.getRightBorderColor());

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

  1. putBoolean(properties, HIDDEN, style.getHidden());
  2. putShort(properties, INDENTION, style.getIndention());
  3. putShort(properties, LEFT_BORDER_COLOR, style.getLeftBorderColor());
  4. putBoolean(properties, LOCKED, style.getLocked());
  5. putShort(properties, RIGHT_BORDER_COLOR, style.getRightBorderColor());

代码示例来源:origin: caryyu/excel2pdf

  1. cell.setBorderColorLeft(new BaseColor(POIUtil.getBorderRBG(wb, style.getLeftBorderColor())));
  2. cell.setBorderColorRight(new BaseColor(POIUtil.getBorderRBG(wb, style.getRightBorderColor())));
  3. cell.setBorderColorTop(new BaseColor(POIUtil.getBorderRBG(wb, style.getTopBorderColor())));

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

  1. newStyle.setHidden(style.getHidden());
  2. newStyle.setIndention(style.getIndention());
  3. newStyle.setLeftBorderColor(style.getLeftBorderColor());
  4. newStyle.setLocked(style.getLocked());
  5. newStyle.setRightBorderColor(style.getRightBorderColor());

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

  1. newStyle.setHidden(style.getHidden());
  2. newStyle.setIndention(style.getIndention());
  3. newStyle.setLeftBorderColor(style.getLeftBorderColor());
  4. newStyle.setLocked(style.getLocked());
  5. newStyle.setRightBorderColor(style.getRightBorderColor());

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

  1. private void copyStyle(Workbook workbook, Cell fromCell, Cell toCell) {
  2. CellStyle toStyle = toCell.getCellStyle();
  3. CellStyle fromStyle = fromCell.getCellStyle();
  4. CellStyle newStyle = workbook.createCellStyle();
  5. newStyle.setAlignment(fromStyle.getAlignment());
  6. newStyle.setBorderBottom(fromStyle.getBorderBottom());
  7. newStyle.setBorderLeft(fromStyle.getBorderLeft());
  8. newStyle.setBorderRight(fromStyle.getBorderRight());
  9. newStyle.setBorderTop(fromStyle.getBorderTop());
  10. newStyle.setBottomBorderColor(fromStyle.getBottomBorderColor());
  11. newStyle.setFillBackgroundColor(fromStyle.getFillBackgroundColor());
  12. newStyle.setFillForegroundColor(fromStyle.getFillForegroundColor());
  13. newStyle.setFillPattern(fromStyle.getFillPattern());
  14. newStyle.setFont(workbook.getFontAt(fromStyle.getFontIndex()));
  15. newStyle.setHidden(fromStyle.getHidden());
  16. newStyle.setIndention(fromStyle.getIndention());
  17. newStyle.setLeftBorderColor(fromStyle.getLeftBorderColor());
  18. newStyle.setLocked(fromStyle.getLocked());
  19. newStyle.setRightBorderColor(fromStyle.getRightBorderColor());
  20. newStyle.setTopBorderColor(fromStyle.getTopBorderColor());
  21. newStyle.setVerticalAlignment(fromStyle.getVerticalAlignment());
  22. newStyle.setWrapText(fromStyle.getWrapText());
  23. newStyle.setDataFormat(toStyle.getDataFormat());
  24. toCell.setCellStyle(newStyle);
  25. }
  26. }

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

  1. private void copyStyle(Workbook workbook, org.apache.poi.ss.usermodel.Cell fromCell, org.apache.poi.ss.usermodel.Cell toCell){
  2. CellStyle toStyle = toCell.getCellStyle();
  3. CellStyle fromStyle = fromCell.getCellStyle();
  4. if( fromStyle.getDataFormat() == toStyle.getDataFormat() ){
  5. toCell.setCellStyle( fromStyle );
  6. }else{
  7. CellStyle newStyle = workbook.createCellStyle();
  8. newStyle.setAlignment( toStyle.getAlignment() );
  9. newStyle.setBorderBottom( toStyle.getBorderBottom() );
  10. newStyle.setBorderLeft( toStyle.getBorderLeft() );
  11. newStyle.setBorderRight( toStyle.getBorderRight() );
  12. newStyle.setBorderTop( toStyle.getBorderTop() );
  13. newStyle.setBottomBorderColor( toStyle.getBottomBorderColor() );
  14. newStyle.setDataFormat( toStyle.getDataFormat() );
  15. newStyle.setFillBackgroundColor( fromStyle.getFillBackgroundColor() );
  16. newStyle.setFillForegroundColor( fromStyle.getFillForegroundColor() );
  17. newStyle.setFillPattern( fromStyle.getFillPattern() );
  18. newStyle.setFont( workbook.getFontAt( fromStyle.getFontIndex() ) );
  19. newStyle.setHidden( toStyle.getHidden() );
  20. newStyle.setIndention( toStyle.getIndention() );
  21. newStyle.setLeftBorderColor( toStyle.getLeftBorderColor() );
  22. newStyle.setLocked( toStyle.getLocked() );
  23. newStyle.setRightBorderColor( toStyle.getRightBorderColor() );
  24. newStyle.setTopBorderColor( toStyle.getTopBorderColor() );
  25. newStyle.setVerticalAlignment( toStyle.getVerticalAlignment() );
  26. newStyle.setWrapText( toStyle.getWrapText() );
  27. toCell.setCellStyle( newStyle );
  28. }
  29. }
  30. }

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

  1. toStyle.setBottomBorderColor(fromStyle.getBottomBorderColor());
  2. toStyle.setRightBorderColor(fromStyle.getRightBorderColor());
  3. toStyle.setLeftBorderColor(fromStyle.getLeftBorderColor());

相关文章