Package org.apache.poi.xssf.usermodel.extensions

Examples of org.apache.poi.xssf.usermodel.extensions.XSSFCellFill


    //CTFont ctFont = createDefaultFont();
    XSSFFont xssfFont = createDefaultFont();
    fonts.add(xssfFont);

    CTFill[] ctFill = createDefaultFills();
    fills.add(new XSSFCellFill(ctFill[0]));
    fills.add(new XSSFCellFill(ctFill[1]));

    CTBorder ctBorder = createDefaultBorder();
    borders.add(new XSSFCellBorder(ctBorder));

    CTXf styleXf = createDefaultXf();
View Full Code Here


       // Look at the low level xml elements
       assertEquals(2, cs.getCoreXf().getFillId());
       assertEquals(0, cs.getCoreXf().getXfId());
       assertEquals(true, cs.getCoreXf().getApplyFill());
      
       XSSFCellFill fg = wb.getStylesSource().getFillAt(2);
       assertEquals(0, fg.getFillForegroundColor().getIndexed());
       assertEquals(0.0, fg.getFillForegroundColor().getTint());
       assertEquals("FFFF0000", fg.getFillForegroundColor().getARGBHex());
       assertEquals(64, fg.getFillBackgroundColor().getIndexed());
      
       // Now look higher up
       assertNotNull(cs.getFillForegroundXSSFColor());
       assertEquals(0, cs.getFillForegroundColor());
       assertEquals("FFFF0000", cs.getFillForegroundXSSFColor().getARGBHex());
View Full Code Here

          idx++;
        }
      }
      if(doc.getStyleSheet().getFills() != null)
      for (CTFill fill : doc.getStyleSheet().getFills().getFillArray()) {
        fills.add(new XSSFCellFill(fill));
      }
      if(doc.getStyleSheet().getBorders() != null)
      for (CTBorder border : doc.getStyleSheet().getBorders().getBorderArray()) {
        borders.add(new XSSFCellBorder(border));
      }
View Full Code Here

    //CTFont ctFont = createDefaultFont();
    XSSFFont xssfFont = createDefaultFont();
    fonts.add(xssfFont);

    CTFill[] ctFill = createDefaultFills();
    fills.add(new XSSFCellFill(ctFill[0]));
    fills.add(new XSSFCellFill(ctFill[1]));

    CTBorder ctBorder = createDefaultBorder();
    borders.add(new XSSFCellBorder(ctBorder));

    CTXf styleXf = createDefaultXf();
View Full Code Here

       // Look at the low level xml elements
       assertEquals(2, cs.getCoreXf().getFillId());
       assertEquals(0, cs.getCoreXf().getXfId());
       assertEquals(true, cs.getCoreXf().getApplyFill());
      
       XSSFCellFill fg = wb.getStylesSource().getFillAt(2);
       assertEquals(0, fg.getFillForegroundColor().getIndexed());
       assertEquals(0.0, fg.getFillForegroundColor().getTint());
       assertEquals("FFFF0000", fg.getFillForegroundColor().getARGBHex());
       assertEquals(64, fg.getFillBackgroundColor().getIndexed());
      
       // Now look higher up
       assertNotNull(cs.getFillForegroundXSSFColor());
       assertEquals(0, cs.getFillForegroundColor());
       assertEquals("FFFF0000", cs.getFillForegroundXSSFColor().getARGBHex());
View Full Code Here

   
    XSSFCellBorder borderB = new XSSFCellBorder();
    assertEquals(2, stylesTable.putBorder(borderB));
   
    ctFill = CTFill.Factory.newInstance();
    XSSFCellFill fill = new XSSFCellFill(ctFill);
    long fillId = stylesTable.putFill(fill);
    assertEquals(1, fillId);
   
    ctFont = CTFont.Factory.newInstance();
    XSSFFont font = new XSSFFont(ctFont);
View Full Code Here

  public long putBorder(XSSFCellBorder border) {
    return putBorder(border, borders);
  }

  public XSSFCellFill getFillAt(long idx) {
    return new XSSFCellFill(fills.get((int) idx));
  }
View Full Code Here

     */
    public XSSFColor getFillBackgroundXSSFColor() {
        if(!_cellXf.getApplyFill()) return null;

        int fillIndex = (int)_cellXf.getFillId();
        XSSFCellFill fg = _stylesSource.getFillAt(fillIndex);

        XSSFColor fillBackgroundColor = fg.getFillBackgroundColor();
        if (fillBackgroundColor != null && fillBackgroundColor.getCTColor().isSetTheme() && _theme != null) {
            extractColorFromTheme(fillBackgroundColor);
        }
        return fillBackgroundColor;
    }
View Full Code Here

     */
    public XSSFColor getFillForegroundXSSFColor() {
        if(!_cellXf.getApplyFill()) return null;

        int fillIndex = (int)_cellXf.getFillId();
        XSSFCellFill fg = _stylesSource.getFillAt(fillIndex);

        XSSFColor fillForegroundColor = fg.getFillForegroundColor();
        if (fillForegroundColor != null && fillForegroundColor.getCTColor().isSetTheme() && _theme != null) {
            extractColorFromTheme(fillForegroundColor);
        }
        return fillForegroundColor;
    }
View Full Code Here

     */
    public short getFillPattern() {
        if(!_cellXf.getApplyFill()) return 0;

        int fillIndex = (int)_cellXf.getFillId();
        XSSFCellFill fill = _stylesSource.getFillAt(fillIndex);

        STPatternType.Enum ptrn = fill.getPatternType();
        if(ptrn == null) return CellStyle.NO_FILL;
        return (short)(ptrn.intValue() - 1);
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.xssf.usermodel.extensions.XSSFCellFill

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.