Package org.zkoss.poi.xssf.usermodel

Examples of org.zkoss.poi.xssf.usermodel.XSSFColor


  /**
   * Finds a font that matches the one with the supplied attributes
   */
  public XSSFFont findFont(short boldWeight, Color color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) {
    for (XSSFFont font : getStylesSource().getFonts()) {
      final XSSFColor fontColor = font.getXSSFColor();
      if (  (font.getBoldweight() == boldWeight)
          && (color == fontColor || color != null && color.equals(fontColor))
          && font.getFontHeight() == fontHeight
          && font.getFontName().equals(name)
          && font.getItalic() == italic
View Full Code Here


  //TODO see if we can remove this function to use getFontHTMLColor(Cell, Font);
  public static String getFontHTMLColor(Book book, Font font) {
    if (font instanceof XSSFFont) {
      final XSSFFont f = (XSSFFont) font;
      final XSSFColor color = f.getXSSFColor();
      return BookHelper.colorToHTML(book, color);
    } else {
      return indexToHSSFRGB((HSSFWorkbook)book, font.getColor());
    }
  }
View Full Code Here

  }

  public static String getFontHTMLColor(Cell cell, Font font) {
    if (font instanceof XSSFFont) {
      final XSSFFont f = (XSSFFont) font;
      final XSSFColor color = f.getXSSFColor();
      return BookHelper.colorToHTML(cell.getSheet().getWorkbook(), color);
    } else {
      return getHSSFRGBString((HSSFCell)cell, font.getColor());
    }
  }
View Full Code Here

          "#"+ toHex(argb[0])+ toHex(argb[1])+ toHex(argb[2]);
      }
      if (ctcolor.isSetTheme()) {
          ThemesTable theme = book.getTheme();
          if (theme != null) {
            XSSFColor themecolor = theme.getThemeColor(color.getTheme());
            if (themecolor != null) {
              if (ctcolor.isSetTint()) {
                themecolor.setTint(ctcolor.getTint());
              }
              return XSSFColorToHTML(book, themecolor); //recursive
            }
          }
      }
View Full Code Here

    byte[] triplet = HTMLToTriplet(color);
    byte a = (byte) 0xff;
    byte r = triplet[0];
    byte g = triplet[1];
    byte b = triplet[2];
    return  new XSSFColor(new byte[] {a, r, g, b});
  }
View Full Code Here

TOP

Related Classes of org.zkoss.poi.xssf.usermodel.XSSFColor

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.