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

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


    for(XSSFFont f : fonts) ctfnt[idx++] = f.getCTFont();
    ctFonts.setFontArray(ctfnt);
    styleSheet.setFonts(ctFonts);

    // Fills
    CTFills ctFills = CTFills.Factory.newInstance();
    ctFills.setCount(fills.size());
    CTFill[] ctf = new CTFill[fills.size()];
    idx = 0;
    for(XSSFCellFill f : fills) ctf[idx++] = f.getCTFill();
    ctFills.setFillArray(ctf);
    styleSheet.setFills(ctFills);

    // Borders
    CTBorders ctBorders = CTBorders.Factory.newInstance();
    ctBorders.setCount(borders.size());
View Full Code Here


    ctFill[1].addNewPatternFill().setPatternType(STPatternType.DARK_GRAY);
    return ctFill;
  }

  private static XSSFFont createDefaultFont() {
    CTFont ctFont = CTFont.Factory.newInstance();
    XSSFFont xssfFont=new XSSFFont(ctFont, 0);
    xssfFont.setFontHeightInPoints(XSSFFont.DEFAULT_FONT_SIZE);
    xssfFont.setColor(XSSFFont.DEFAULT_FONT_COLOR);//setTheme
    xssfFont.setFontName(XSSFFont.DEFAULT_FONT_NAME);
    xssfFont.setFamily(FontFamily.SWISS);
View Full Code Here

                     (new XSSFDataFormat(_stylesSource)).getFormat(fmt)
               );
              
               // Copy the font
               try {
                  CTFont ctFont = CTFont.Factory.parse(
                        src.getFont().getCTFont().toString()
                  );
                  XSSFFont font = new XSSFFont(ctFont);
                  font.registerTo(_stylesSource);
                  setFont(font);
View Full Code Here

                for (CTNumFmt nfmt : ctfmts.getNumFmtArray()) {
                    numberFormats.put((int)nfmt.getNumFmtId(), nfmt.getFormatCode());
                }
            }

            CTFonts ctfonts = styleSheet.getFonts();
            if(ctfonts != null){
        int idx = 0;
        for (CTFont font : ctfonts.getFontArray()) {
           // Create the font and save it. Themes Table supplied later
          XSSFFont f = new XSSFFont(font, idx);
          fonts.add(f);
          idx++;
        }
View Full Code Here

    }
    styleSheet.setNumFmts(formats);

    int idx;
    // Fonts
    CTFonts ctFonts = CTFonts.Factory.newInstance();
    ctFonts.setCount(fonts.size());
    CTFont[] ctfnt = new CTFont[fonts.size()];
    idx = 0;
    for(XSSFFont f : fonts) ctfnt[idx++] = f.getCTFont();
    ctFonts.setFontArray(ctfnt);
    styleSheet.setFonts(ctFonts);

    // Fills
    CTFills ctFills = CTFills.Factory.newInstance();
    ctFills.setCount(fills.size());
View Full Code Here

    // Formats
    CTNumFmts formats = CTNumFmts.Factory.newInstance();
    formats.setCount(numberFormats.size());
    for (Entry<Integer, String> fmt : numberFormats.entrySet()) {
      CTNumFmt ctFmt = formats.addNewNumFmt();
      ctFmt.setNumFmtId(fmt.getKey());
      ctFmt.setFormatCode(fmt.getValue());
    }
    styleSheet.setNumFmts(formats);

    int idx;
    // Fonts
View Full Code Here

      doc = StyleSheetDocument.Factory.parse(is);

            CTStylesheet styleSheet = doc.getStyleSheet();

            // Grab all the different bits we care about
      CTNumFmts ctfmts = styleSheet.getNumFmts();
            if( ctfmts != null){
                for (CTNumFmt nfmt : ctfmts.getNumFmtArray()) {
                    numberFormats.put((int)nfmt.getNumFmtId(), nfmt.getFormatCode());
                }
            }

            CTFonts ctfonts = styleSheet.getFonts();
View Full Code Here

    // Need to do this, as we don't handle
    //  all the possible entries yet
        CTStylesheet styleSheet = doc.getStyleSheet();

    // Formats
    CTNumFmts formats = CTNumFmts.Factory.newInstance();
    formats.setCount(numberFormats.size());
    for (Entry<Integer, String> fmt : numberFormats.entrySet()) {
      CTNumFmt ctFmt = formats.addNewNumFmt();
      ctFmt.setNumFmtId(fmt.getKey());
      ctFmt.setFormatCode(fmt.getValue());
    }
    styleSheet.setNumFmts(formats);
View Full Code Here

     *
     * @param color - the color to use
     */
    public void setFillBackgroundColor(XSSFColor color) {
        CTFill ct = getCTFill();
        CTPatternFill ptrn = ct.getPatternFill();
        if(color == null) {
            if(ptrn != null) ptrn.unsetBgColor();
        } else {
            if(ptrn == null) ptrn = ct.addNewPatternFill();
            ptrn.setBgColor(color.getCTColor());
        }

        int idx = _stylesSource.putFill(new XSSFCellFill(ct));

        _cellXf.setFillId(idx);
View Full Code Here

    * @see #setFillBackgroundColor(org.apache.poi.xssf.usermodel.XSSFColor) )
    */
    public void setFillForegroundColor(XSSFColor color) {
        CTFill ct = getCTFill();

        CTPatternFill ptrn = ct.getPatternFill();
        if(color == null) {
            if(ptrn != null) ptrn.unsetFgColor();
        } else {
            if(ptrn == null) ptrn = ct.addNewPatternFill();
            ptrn.setFgColor(color.getCTColor());
        }

        int idx = _stylesSource.putFill(new XSSFCellFill(ct));

        _cellXf.setFillId(idx);
View Full Code Here

TOP

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

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.