Examples of CSSColorValue


Examples of org.jfree.layouting.input.style.values.CSSColorValue

                colorSpec.charAt(2) + colorSpec.charAt(2) +
                colorSpec.charAt(3) + colorSpec.charAt(3);

      }
      final Integer decoded = Integer.decode(colorSpec);
      return new CSSColorValue(decoded.intValue(), false);
    }
    catch(Exception e)
    {
      return null;
    }
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSColorValue

    if (CSSSystemColors.CURRENT_COLOR.getCSSText().equalsIgnoreCase(name))
    {
      return CSSSystemColors.CURRENT_COLOR;
    }

    CSSColorValue htmlColors = parseColorFromClass(name, HtmlColors.class);
    if (htmlColors != null)
    {
      return htmlColors;
    }
    CSSColorValue svgColors = parseColorFromClass(name, SVGColors.class);
    if (svgColors != null)
    {
      return svgColors;
    }
    CSSColorValue systemColors = parseColorFromClass(name,
            CSSSystemColors.class);
    if (systemColors != null)
    {
      return systemColors;
    }
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSColorValue

  public void updateStyle (String uri,
                           String attrName,
                           String attrValue,
                           CSSDeclarationRule targetRule)
  {
    final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue);
    if (cv != null)
    {
      targetRule.setPropertyValue(TextStyleKeys.TEXT_UNDERLINE_COLOR, cv);
    }
  }
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSColorValue

  public void updateStyle (String uri,
                           String attrName,
                           String attrValue,
                           CSSDeclarationRule targetRule)
  {
    final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue);
    if (cv != null)
    {
      targetRule.setPropertyValue(ColorStyleKeys.COLOR, cv);
    }
  }
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSColorValue

  public void updateStyle (String uri,
                           String attrName,
                           String attrValue,
                           CSSDeclarationRule targetRule)
  {
    final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue);
    if (cv != null)
    {
      targetRule.setPropertyValue(BorderStyleKeys.BACKGROUND_COLOR, cv);
    }
  }
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSColorValue

  {
    final ConverterAttributeSet attr = new ConverterAttributeSet();

    if(colorConstant == StyleConstants.Foreground)
    {
      final CSSColorValue cssColorValue = new CSSColorValue((Color) value);
      attr.addAttribute(ColorStyleKeys.COLOR.getName(), cssColorValue);
    }
    else if(colorConstant == StyleConstants.Background)
    {
      final CSSColorValue cssColorValue = new CSSColorValue((Color) value);
      attr.addAttribute(BorderStyleKeys.BACKGROUND_COLOR.getName(), cssColorValue);
    }
    else
    {
      Log.debug(new Log.SimpleMessage("Unkown type of color attribute", colorConstant));
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSColorValue

      return FunctionUtilities.parseNumberValue(value.toString(), type);
    }
    else if (value instanceof Color)
    {
      final Color color = (Color) value;
      return new CSSColorValue
              (color.getRed(), color.getGreen(),
                      color.getBlue(), color.getAlpha());
    }
    else
    {
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSColorValue

          (FunctionUtilities.resolveParameter(layoutProcess, element, values[1]));
      final float lightValue = validateOtherParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[2]));
      final float[] rgb = ColorUtil.hslToRGB
              (hueValue, saturationValue, lightValue);
      return new CSSColorValue(rgb[0], rgb[1], rgb[2]);
    }
    else if (values.length == 4)
    {
      final int hueValue = validateHueParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[0]));
      final float saturationValue = validateOtherParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[1]));
      final float lightValue = validateOtherParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[2]));
      final float alphaValue = validateOtherParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[3]));
      final float[] rgb =
              ColorUtil.hslToRGB(hueValue, saturationValue, lightValue);
      return new CSSColorValue(rgb[0], rgb[1], rgb[2], alphaValue);
    }
    else
    {
      throw new FunctionEvaluationException("Expected either three or four parameters.");
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSColorValue

          (FunctionUtilities.resolveParameter(layoutProcess, element, values[0]));
      final int greenValue = validateParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[1]));
      final int blueValue = validateParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[2]));
      return new CSSColorValue(redValue, greenValue, blueValue);
    }
    else if (values.length == 4)
    {
      final int redValue = validateParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[0]));
      final int greenValue = validateParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[1]));
      final int blueValue = validateParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[2]));
      final int alphaValue = validateParameter
          (FunctionUtilities.resolveParameter(layoutProcess, element, values[3]));
      return new CSSColorValue(redValue, greenValue, blueValue, alphaValue);
    }
    else
    {
      throw new FunctionEvaluationException("Expected either three or four parameters.");
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSColorValue

        final int blueColorValue = charToNumber(colorSpec.charAt(3));
        final int colorValue =
            redColorValue << 20 | redColorValue << 16 |
            greenColorValue << 12 | greenColorValue << 8 |
            blueColorValue << 4 | blueColorValue;
        return new CSSColorValue(colorValue, false);
      }

      final Integer decoded = Integer.decode(colorSpec);
      return new CSSColorValue(decoded.intValue(), false);
    }
    catch (Exception e)
    {
      return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.