Package com.google.code.appengine.awt

Examples of com.google.code.appengine.awt.Color


        writeInt(os, (int) (borderWidth * RtfWriter.TWIPSFACTOR));
        // border color
        os.write(RtfWriter.escape);
        os.write(RtfRow.tableBorderColor);
        if (borderColor == null) {
            writeInt(os, writer.addColor(new Color(0, 0, 0)));
        } else {
            writeInt(os, writer.addColor(borderColor));
        }
        os.write((byte) '\n');
    }
View Full Code Here


            style |= Font.STRIKETHRU ;
        String value = props.getProperty("size");
        float size = 12;
        if (value != null)
            size = Float.parseFloat(value);
        Color color = Markup.decodeColor(props.getProperty("color"));
        String encoding = props.getProperty("encoding");
        if (encoding == null)
            encoding = BaseFont.WINANSI;
        return fontImp.getFont(face, encoding, true, size, style, color);
    }
View Full Code Here

                String ss = prop.getProperty(key).trim().toLowerCase();
                if (ss.equals("underline"))
                    h.put("u", null);
            }
            else if (key.equals(Markup.CSS_KEY_COLOR)) {
                Color c = Markup.decodeColor(prop.getProperty(key));
                if (c != null) {
                    int hh = c.getRGB();
                    String hs = Integer.toHexString(hh);
                    hs = "000000" + hs;
                    hs = "#" + hs.substring(hs.length() - 6);
                    h.put("color", hs);
                }
View Full Code Here

            dStyle = this.getStyle();
        } else if(font.getStyle() != Font.UNDEFINED) {
            dStyle = font.getStyle();
        }

        Color dColor = font.getColor();
        if(dColor == null) {
            dColor = this.getColor();
        }

        return new RtfFont(dFamilyname, dSize, dStyle, dColor);
View Full Code Here

    if (name.startsWith("#")) {
      if (name.length() == 4) {
        c[0] = Integer.parseInt(name.substring(1, 2), 16) * 16;
        c[1] = Integer.parseInt(name.substring(2, 3), 16) * 16;
        c[2] = Integer.parseInt(name.substring(3), 16) * 16;
        return new Color(c[0], c[1], c[2], c[3]);
      }
      if (name.length() == 7) {
        c[0] = Integer.parseInt(name.substring(1, 3), 16);
        c[1] = Integer.parseInt(name.substring(3, 5), 16);
        c[2] = Integer.parseInt(name.substring(5), 16);
        return new Color(c[0], c[1], c[2], c[3]);
      }
      throw new IllegalArgumentException(
          "Unknown color format. Must be #RGB or #RRGGBB");
    }
        else if (name.startsWith("rgb(")) {
            StringTokenizer tok = new StringTokenizer(name, "rgb(), \t\r\n\f");
            for (int k = 0; k < 3; ++k) {
                String v = tok.nextToken();
                if (v.endsWith("%"))
                    c[k] = Integer.parseInt(v.substring(0, v.length() - 1)) * 255 / 100;
                else
                    c[k] = Integer.parseInt(v);
                if (c[k] < 0)
                    c[k] = 0;
                else if (c[k] > 255)
                    c[k] = 255;
            }
            return new Color(c[0], c[1], c[2], c[3]);
        }
    name = name.toLowerCase();
    if (!NAMES.containsKey(name))
      throw new IllegalArgumentException("Color '" + name
          + "' not found.");
    c = (int[]) NAMES.get(name);
    return new Color(c[0], c[1], c[2], c[3]);
  }
View Full Code Here

   *            the green-value of the new color
   * @param blue
   *            the blue-value of the new color
   */
  public void setColor(int red, int green, int blue) {
    this.color = new Color(red, green, blue);
  }
View Full Code Here

      if (style2 == UNDEFINED)
        style2 = 0;
      dStyle = style1 | style2;
    }
    // color
    Color dColor = font.color;
    if (dColor == null) {
      dColor = this.color;
    }
    // family
    if (font.baseFont != null) {
View Full Code Here

   * @param groupLevel Unused.
   */
  public void handleText(String text, int groupLevel) {
    if(text.indexOf(';') != -1) {
      if(red != -1 && green != -1 && blue != -1) {
        this.importHeader.importColor(Integer.toString(this.colorNr), new Color(this.red, this.green, this.blue));
      }
      this.colorNr++;
    }
  }
View Full Code Here

        this.height = height;
        this.dwROP = new BlendFunction(AC_SRC_OVER, 0, 0xFF, AC_SRC_ALPHA);
        this.xSrc = 0;
        this.ySrc = 0;
        this.transform = transform;
        this.bkg = (bkg == null) ? new Color(0, 0, 0, 0) : bkg;
        this.usage = DIB_RGB_COLORS;
        this.image = image;
        this.bmi = null;
    }
View Full Code Here

    float y2 = cell.getTop() + yPos;
    float x2 = cell.getRight() + xPos;
    float y1 = y2 - maxHeight;

    // the backgroundcolor is set
    Color background = cell.getBackgroundColor();
    if (background != null) {
      backgr.setColorFill(background);
      backgr.rectangle(x1, y1, x2 - x1, y2 - y1);
      backgr.fill();
        }
    // if the element hasn't got any borders, nothing is added
    if (cell.hasBorders()) {
      if (cell.isUseVariableBorders()) {
        Rectangle borderRect = new Rectangle(cell.getLeft() + xPos, cell
            .getTop()
            - maxHeight + yPos, cell.getRight() + xPos, cell.getTop()
            + yPos);
        borderRect.cloneNonPositionParameters(cell);
                borderRect.setBackgroundColor(null);
        lines.rectangle(borderRect);
      } else {
        // the width is set to the width of the element
        if (cell.getBorderWidth() != Rectangle.UNDEFINED) {
          lines.setLineWidth(cell.getBorderWidth());
        }
        // the color is set to the color of the element
        Color color = cell.getBorderColor();
        if (color != null) {
          lines.setColorStroke(color);
        }

        // if the box is a rectangle, it is added as a rectangle
View Full Code Here

TOP

Related Classes of com.google.code.appengine.awt.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.