Package java.awt

Examples of java.awt.Color


        new FontDefinition("Arial", 12),
        "Label1");

    report.getReportHeader().addElement(label1);

    label1.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(255, 127, 127, 120));

    Element label2 = LabelElementFactory.createLabelElement("Label2",
        new Rectangle2D.Double(0, 110, 200, 100),
        Color.RED,
        ElementAlignment.LEFT,
        new FontDefinition("Arial", 12),
        "Label2");

    report.getReportHeader().addElement(label2);

    label2.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(255, 127, 127, 120));
    label2.getStyle().setStyleProperty(ElementStyleKeys.PADDING_TOP, new Float(10));
    label2.getStyle().setStyleProperty(ElementStyleKeys.PADDING_LEFT, new Float(10));
    label2.getStyle().setStyleProperty(ElementStyleKeys.PADDING_RIGHT, new Float(10));
    label2.getStyle().setStyleProperty(ElementStyleKeys.PADDING_BOTTOM, new Float(10));


    Element label3 = LabelElementFactory.createLabelElement("Label3",
        new Rectangle2D.Double(210, 0, 200, 100),
        Color.RED,
        ElementAlignment.LEFT,
        new FontDefinition("Arial", 12),
        "Label3");

    report.getReportHeader().addElement(label3);

    label3.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(255, 127, 127, 120));
    label3.getStyle().setStyleProperty(ElementStyleKeys.PADDING_TOP, new Float(10));
    label3.getStyle().setStyleProperty(ElementStyleKeys.PADDING_LEFT, new Float(10));
    label3.getStyle().setStyleProperty(ElementStyleKeys.PADDING_RIGHT, new Float(10));
    label3.getStyle().setStyleProperty(ElementStyleKeys.PADDING_BOTTOM, new Float(10));
    return report;
View Full Code Here


   */
  public void setStyleSheet(final StyleSheet style)
  {
    if (style != null)
    {
      final Color backgroundColor = (Color) style.getStyleProperty(ElementStyleKeys.BACKGROUND_COLOR);
      if (backgroundColor != null)
      {
        getPieGraphDrawable().setBackground(backgroundColor);
      }
      final Color color = (Color) style.getStyleProperty(ElementStyleKeys.PAINT);
      if (color != null)
      {
        getPieGraphDrawable().setColor(color);
      }
      final Color lowColor = (Color) style.getStyleProperty(SparklineStyleKeys.LOW_COLOR);
      if (lowColor != null)
      {
        getPieGraphDrawable().setLowColor(lowColor);
      }
      final Color mediumColor = (Color) style.getStyleProperty(SparklineStyleKeys.MEDIUM_COLOR);
      if (mediumColor != null)
      {
        getPieGraphDrawable().setMediumColor(mediumColor);
      }
      final Color highColor = (Color) style.getStyleProperty(SparklineStyleKeys.HIGH_COLOR);
      if (highColor != null)
      {
        getPieGraphDrawable().setHighColor(highColor);
      }
    }
View Full Code Here

    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_STYLE, BorderStyle.SOLID);

    //TODO Zum Testen mit halbtransparenter Farbe.
    //TODO Ein Rechteck wird hinter dem Text mit der originalgr?sse des Textes gezeichnet, und nicht mit der Elementgr?sse, auch wenn OVEFRFLOW_X nicht auf true gesetzt ist.
    //TODO Wird Transparenz bei Farben unterst?tzt?
    element.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(255, 127, 127, 120));

    //TODO padding-left wird auch als padding-top verwendet. Vermutlich verursacht durch den Fehler im ElementStyleKeys (siehe Mail)
    element.getStyle().setStyleProperty(ElementStyleKeys.PADDING_LEFT, new Float(5));
    //element.getStyle().setStyleProperty(ElementStyleKeys.PADDING_TOP, new Float(5));
View Full Code Here

  {
    if (style != null)
    {
      sparkline.setBackground((Color) style.getStyleProperty(ElementStyleKeys.BACKGROUND_COLOR));
      sparkline.setColor((Color) style.getStyleProperty(ElementStyleKeys.PAINT));
      final Color lastColor = (Color) style.getStyleProperty(SparklineStyleKeys.LAST_COLOR);
      if (lastColor != null)
      {
        sparkline.setLastColor(lastColor);
      }
    }
View Full Code Here

  {
    if (chosenDateButtonColor == null)
    {
      throw new NullPointerException("UIColor must not be null.");
    }
    final Color oldValue = this.chosenDateButtonColor;
    this.chosenDateButtonColor = chosenDateButtonColor;
    refreshButtons();
    firePropertyChange("chosenDateButtonColor", oldValue, chosenDateButtonColor); //$NON-NLS-1$
  }
View Full Code Here

  {
    if (chosenMonthButtonColor == null)
    {
      throw new NullPointerException("UIColor must not be null.");
    }
    final Color oldValue = this.chosenMonthButtonColor;
    this.chosenMonthButtonColor = chosenMonthButtonColor;
    refreshButtons();
    firePropertyChange("chosenMonthButtonColor", oldValue, chosenMonthButtonColor); //$NON-NLS-1$
  }
View Full Code Here

  {
    if (chosenOtherButtonColor == null)
    {
      throw new NullPointerException("UIColor must not be null.");
    }
    final Color oldValue = this.chosenOtherButtonColor;
    this.chosenOtherButtonColor = chosenOtherButtonColor;
    refreshButtons();
    firePropertyChange("chosenOtherButtonColor", oldValue, chosenOtherButtonColor); //$NON-NLS-1$
  }
View Full Code Here

    {
      final String fontName = (String) style.getStyleProperty(TextStyleKeys.FONT);
      final int fontSize = style.getIntStyleProperty(TextStyleKeys.FONTSIZE, 0);
      final boolean bold = style.getBooleanStyleProperty(TextStyleKeys.BOLD);
      final boolean italics = style.getBooleanStyleProperty(TextStyleKeys.ITALIC);
      final Color foregroundColor = (Color) style.getStyleProperty(ElementStyleKeys.PAINT);
      final Color backgroundColor = (Color) style.getStyleProperty(ElementStyleKeys.BACKGROUND_COLOR);
      if (fontName != null && fontSize > 0)
      {
        int fontstyle = Font.PLAIN;
        if (bold)
        {
          fontstyle |= Font.BOLD;
        }
        if (italics)
        {
          fontstyle |= Font.ITALIC;
        }

        barcode.setFont(new Font(fontName, fontstyle, fontSize));
      }
      if (foregroundColor != null)
      {
        barcode.setForeground(foregroundColor);
      }
      if (backgroundColor != null)
      {
        barcode.setBackground(backgroundColor);
        barcode.setOpaque(backgroundColor.getAlpha() == 255);
      }
      else
      {
        barcode.setBackground(ALPHA);
        barcode.setOpaque(false);
View Full Code Here

    final Properties result1 = getResult();
    final String color = result1.getProperty("color");
    if (color != null)
    {
      final Color c = ColorConverter.getObject(color);
      element.getStyle().setStyleProperty(ElementStyleKeys.PAINT, c);
    }

    final String lineWidth = result1.getProperty("lineWidth");
    if (lineWidth != null)
View Full Code Here

    final Properties result1 = getResult();
    final String color = result1.getProperty("color");
    if (color != null)
    {
      final Color c = ColorConverter.getObject(color);
      element.getStyle().setStyleProperty(ElementStyleKeys.FILL_COLOR, c);
    }

    final String fill = result1.getProperty("fill");
    if (fill != null)
View Full Code Here

TOP

Related Classes of java.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.