Package org.apache.metamodel.data.Style

Examples of org.apache.metamodel.data.Style.Color


            if (sizeUnit == SizeUnit.PERCENT) {
              fontSize = convertFontPercentageToPt(fontSize);
            }
            font.get().setFontHeightInPoints(fontSize.shortValue());
          }
          Color foregroundColor = style.getForegroundColor();
          if (foregroundColor != null) {
            short index = getUpdateCallback().getColorIndex(
                foregroundColor);
            font.get().setColor(index);
          }
          if (font.isFetched()) {
            cellStyle.get().setFont(font.get());
          }
          if (style.getAlignment() != null) {
            cellStyle.get().setAlignment(
                getAlignment(style.getAlignment()));
          }

          final Color backgroundColor = style.getBackgroundColor();
          if (backgroundColor != null) {
            cellStyle.get().setFillPattern(
                CellStyle.SOLID_FOREGROUND);
            cellStyle.get().setFillForegroundColor(
                getUpdateCallback().getColorIndex(
View Full Code Here


    assertEquals(Style.NO_STYLE, style);
    assertSame(Style.NO_STYLE, style);
  }

  public void testCreateColor() throws Exception {
    Color col1 = StyleBuilder.createColor("eeEE00");
    assertEquals("Color[238,238,0]", col1.toString());

    Color col2 = StyleBuilder.createColor(238, 238, 0);

    // cache should ensure that these two colors are not only equal, but
    // also the same!
    assertEquals(col1, col2);
    assertSame(col1, col2);
View Full Code Here

   * @param b
   * @return a color representing the RGB code
   */
  public static Color createColor(short r, short g, short b) {
    String cacheId = r + "," + g + "," + b;
    Color color = _colorCache.get(cacheId);
    if (color == null) {
      color = new ColorImpl(r, g, b);
      _colorCache.put(cacheId, color);
    }
    return color;
View Full Code Here

TOP

Related Classes of org.apache.metamodel.data.Style.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.