Package org.openxmlformats.schemas.spreadsheetml.x2006.main

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill


     * Set the color to use for the bottom border
     *
     * @param color the color to use, null means no color
     */
    public void setBottomBorderColor(XSSFColor color) {
        CTBorder ct = getCTBorder();
        if(color == null && !ct.isSetBottom()) return;

        CTBorderPr pr = ct.isSetBottom() ? ct.getBottom() : ct.addNewBottom();
        if(color != nullpr.setColor(color.getCTColor());
        else pr.unsetColor();

        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct, _theme));

View Full Code Here


    /**
     * Get a <b>copy</b> of the currently used CTBorder, if none is used, return a new instance.
     */
    private CTBorder getCTBorder(){
        CTBorder ct;
        if(_cellXf.getApplyBorder()) {
            int idx = (int)_cellXf.getBorderId();
            XSSFCellBorder cf = _stylesSource.getBorderAt(idx);

            ct = (CTBorder)cf.getCTBorder().copy();
View Full Code Here

     * Set the color to use for the left border as a {@link XSSFColor} value
     *
     * @param color the color to use
     */
    public void setLeftBorderColor(XSSFColor color) {
        CTBorder ct = getCTBorder();
        if(color == null && !ct.isSetLeft()) return;

        CTBorderPr pr = ct.isSetLeft() ? ct.getLeft() : ct.addNewLeft();
        if(color != nullpr.setColor(color.getCTColor());
        else pr.unsetColor();

        int idx = _stylesSource.putBorder(new XSSFCellBorder(ct, _theme));

View Full Code Here

                for (CTFill fill : ctfills.getFillArray()) {
                    fills.add(new XSSFCellFill(fill));
                }
            }

            CTBorders ctborders = styleSheet.getBorders();
            if(ctborders != null) {
                for (CTBorder border : ctborders.getBorderArray()) {
                    borders.add(new XSSFCellBorder(border));
                }
            }

            CTCellXfs cellXfs = styleSheet.getCellXfs();
View Full Code Here

    for(XSSFCellFill f : fills) ctf[idx++] = f.getCTFill();
    ctFills.setFillArray(ctf);
    styleSheet.setFills(ctFills);

    // Borders
    CTBorders ctBorders = CTBorders.Factory.newInstance();
    ctBorders.setCount(borders.size());
    CTBorder[] ctb = new CTBorder[borders.size()];
    idx = 0;
    for(XSSFCellBorder b : borders) ctb[idx++] = b.getCTBorder();
    ctBorders.setBorderArray(ctb);
    styleSheet.setBorders(ctBorders);

    // Xfs
    if(xfs.size() > 0) {
      CTCellXfs ctXfs = CTCellXfs.Factory.newInstance();
View Full Code Here

            }

            CTCellXfs cellXfs = styleSheet.getCellXfs();
            if(cellXfs != null) xfs.addAll(Arrays.asList(cellXfs.getXfArray()));

            CTCellStyleXfs cellStyleXfs = styleSheet.getCellStyleXfs();
            if(cellStyleXfs != null) styleXfs.addAll(Arrays.asList(cellStyleXfs.getXfArray()));

            CTDxfs styleDxfs = styleSheet.getDxfs();
      if(styleDxfs != null) dxfs.addAll(Arrays.asList(styleDxfs.getDxfArray()));

    } catch (XmlException e) {
View Full Code Here

      styleSheet.setCellXfs(ctXfs);
    }

    // Style xfs
    if(styleXfs.size() > 0) {
      CTCellStyleXfs ctSXfs = CTCellStyleXfs.Factory.newInstance();
      ctSXfs.setCount(styleXfs.size());
      ctSXfs.setXfArray(
          styleXfs.toArray(new CTXf[styleXfs.size()])
      );
      styleSheet.setCellStyleXfs(ctSXfs);
    }
View Full Code Here

                for (CTBorder border : ctborders.getBorderArray()) {
                    borders.add(new XSSFCellBorder(border));
                }
            }

            CTCellXfs cellXfs = styleSheet.getCellXfs();
            if(cellXfs != null) xfs.addAll(Arrays.asList(cellXfs.getXfArray()));

            CTCellStyleXfs cellStyleXfs = styleSheet.getCellStyleXfs();
            if(cellStyleXfs != null) styleXfs.addAll(Arrays.asList(cellStyleXfs.getXfArray()));

            CTDxfs styleDxfs = styleSheet.getDxfs();
View Full Code Here

    ctBorders.setBorderArray(ctb);
    styleSheet.setBorders(ctBorders);

    // Xfs
    if(xfs.size() > 0) {
      CTCellXfs ctXfs = CTCellXfs.Factory.newInstance();
      ctXfs.setCount(xfs.size());
      ctXfs.setXfArray(
          xfs.toArray(new CTXf[xfs.size()])
      );
      styleSheet.setCellXfs(ctXfs);
    }
View Full Code Here

            if(cellXfs != null) xfs.addAll(Arrays.asList(cellXfs.getXfArray()));

            CTCellStyleXfs cellStyleXfs = styleSheet.getCellStyleXfs();
            if(cellStyleXfs != null) styleXfs.addAll(Arrays.asList(cellStyleXfs.getXfArray()));

            CTDxfs styleDxfs = styleSheet.getDxfs();
      if(styleDxfs != null) dxfs.addAll(Arrays.asList(styleDxfs.getDxfArray()));

    } catch (XmlException e) {
      throw new IOException(e.getLocalizedMessage());
    }
  }
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill

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.