Package org.zkoss.poi.ss.usermodel

Examples of org.zkoss.poi.ss.usermodel.Color


  private static Set<Ref> setBordersOutline(Worksheet sheet, int tRow, int lCol, int bRow, int rCol, short borderIndex, BorderStyle lineStyle, String color) {
    final Book book = (Book) sheet.getWorkbook();
    final int maxcol = book.getSpreadsheetVersion().getLastColumnIndex();
    final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Color bsColor = BookHelper.HTMLToColor(book, color);
    final short bsLineStyle = getBorderStyleIndex(lineStyle);
    Set<Ref> all = new HashSet<Ref>();
   
    final int lb = BookHelper.BORDER_EDGE_LEFT;// leftBorder
    final int tb = BookHelper.BORDER_EDGE_TOP;// topBorder
View Full Code Here


  }
 
  private static Set<Ref> setBordersInside(Worksheet sheet, int tRow, int lCol, int bRow, int rCol, short borderIndex, BorderStyle lineStyle, String color) {
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Color bsColor = BookHelper.HTMLToColor(book, color);
    final short bsLineStyle = getBorderStyleIndex(lineStyle);
    Set<Ref> all = new HashSet<Ref>();
   
    final int lb = BookHelper.BORDER_EDGE_LEFT;// leftBorder
    final int tb = BookHelper.BORDER_EDGE_TOP;// topBorder
View Full Code Here

  }

  private static Set<Ref> setBordersDiagonal(Worksheet sheet, int tRow, int lCol, int bRow, int rCol, short borderIndex, BorderStyle lineStyle, String color) {
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Color bsColor = BookHelper.HTMLToColor(book, color);
    final short bsLineStyle = getBorderStyleIndex(lineStyle);
    Set<Ref> all = new HashSet<Ref>();
   
    final int db = BookHelper.BORDER_DIAGONAL_DOWN;// diagonal down Border
    final int ub = BookHelper.BORDER_DIAGONAL_UP;// diagonal up Border
View Full Code Here

        String srcColor = context.getFontColor();
        if (!srcColor.equalsIgnoreCase(color)) {
          final Workbook book = sheet.getWorkbook();
          Font srcFont = context.getFont();

          Color fontColor = BookHelper.HTMLToColor(book, color);
          Font newFont = context.getOrCreateFont(srcFont.getBoldweight(), fontColor, srcFont.getFontHeight(), srcFont.getFontName(),
              srcFont.getItalic(), srcFont.getStrikeout(), srcFont.getTypeOffset(), srcFont.getUnderline());
          CellStyle newStyle = context.cloneCellStyle();
          newStyle.setFont(newFont);
          newStyle.setFontColorColor(fontColor);
View Full Code Here

   * @param rect selection range
   * @param color color to use
   */
  public static void setBackgroundColor(Worksheet sheet, Rect rect, String color) {
    final Book book  = (Book) sheet.getWorkbook();
    final Color bsColor = BookHelper.HTMLToColor(book, color);
    for (int row = rect.getTop(); row <= rect.getBottom(); row++)
      for (int col = rect.getLeft(); col <= rect.getRight(); col++) {
        Cell cell = Utils.getOrCreateCell(sheet, row, col);
        CellStyle cs = cell.getCellStyle();
        final Color srcColor = cs.getFillForegroundColorColor();
        if (Objects.equals(srcColor, bsColor)) {
          continue;
        }
        CellStyle newCellStyle = book.createCellStyle();
        newCellStyle.cloneStyleFrom(cs);
View Full Code Here

  public static void setFontColor(Worksheet sheet, int row, int col, String color){
    final Cell cell = Utils.getOrCreateCell(sheet,row,col);
    final Book book = (Book) sheet.getWorkbook();
    final short fontIdx = cell.getCellStyle().getFontIndex();
    final Font font = book.getFontAt(fontIdx);
    final Color orgColor = BookHelper.getFontColor(book, font);
    final Color newColor = BookHelper.HTMLToColor(book, color);
    if (orgColor == newColor || orgColor != null && orgColor.equals(newColor)) {
      return;
    }
    final short boldWeight = font.getBoldweight();
    final short fontHeight = font.getFontHeight();
View Full Code Here

  }
 
  public static void setFillColor(Worksheet sheet, int row, int col, String color){
    final Cell cell = Utils.getOrCreateCell(sheet,row,col);
    final Book book = (Book) sheet.getWorkbook();
    final Color orgColor = cell.getCellStyle().getFillForegroundColorColor();
    final Color newColor = BookHelper.HTMLToColor(book, color);
    if (orgColor == newColor || orgColor != null  && orgColor.equals(newColor)) { //no change, skip
      return;
    }
    final CellStyle style = cloneCellStyle(cell);
    BookHelper.setFillForegroundColor(style, newColor);
View Full Code Here

    final short orgSize = font.getFontHeight();
    if (orgSize == fontHeight) { //no change, skip
      return;
    }
    final short boldWeight = font.getBoldweight();
    final Color color = BookHelper.getFontColor(book, font);
    final String name = font.getFontName();
    final boolean italic = font.getItalic();
    final boolean strikeout = font.getStrikeout();
    final short typeOffset = font.getTypeOffset();
    final byte underline = font.getUnderline();
View Full Code Here

    final boolean orgStrikeout = font.getStrikeout();
    if (orgStrikeout == strikeout) { //no change, skip
      return;
    }
    final short boldWeight = font.getBoldweight();
    final Color color = BookHelper.getFontColor(book, font);
    final short fontHeight = font.getFontHeight();
    final String name = font.getFontName();
    final boolean italic = font.getItalic();
    final short typeOffset = font.getTypeOffset();
    final byte underline = font.getUnderline();
View Full Code Here

    final String orgName = font.getFontName();
    if (orgName.equals(name)) { //no change, skip
      return;
    }
    final short boldWeight = font.getBoldweight();
    final Color color = BookHelper.getFontColor(book, font);
    final short fontHeight = font.getFontHeight();
    final boolean italic = font.getItalic();
    final boolean strikeout = font.getStrikeout();
    final short typeOffset = font.getTypeOffset();
    final byte underline = font.getUnderline();
View Full Code Here

TOP

Related Classes of org.zkoss.poi.ss.usermodel.Color

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.