Package org.jfree.layouting.input.style.values

Examples of org.jfree.layouting.input.style.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


          (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

          (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

  {
    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

    return RenderLength.EMPTY;
  }

  public CSSColorValue getColor()
  {
    return new CSSColorValue(0,0,0,255);
  }
View Full Code Here

    {
      // This should not happen ..
      return color.getCSSText();
    }

    final CSSColorValue colorValue = (CSSColorValue) color;
    if (colorValue.getAlpha() == 0)
    {
      return null;
    }

    try
    {
      final Field[] fields = HtmlColors.class.getFields();
      for (int i = 0; i < fields.length; i++)
      {
        final Field f = fields[i];
        if (Modifier.isPublic(f.getModifiers())
            && Modifier.isFinal(f.getModifiers())
            && Modifier.isStatic(f.getModifiers()))
        {
          final String name = f.getName();
          final Object oColor = f.get(null);
          if (oColor instanceof Color)
          {
            if (color.equals(oColor))
            {
              return name.toLowerCase();
            }
          }
        }
      }
    }
    catch (Exception e)
    {
      //
    }

    return colorValue.getCSSText();
  }
View Full Code Here

      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

          (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

          (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

    if (fontSpecification.isItalic() || fontSpecification.isOblique())
    {
      style |= Font.ITALIC;
    }

    final CSSColorValue cssColor = (CSSColorValue)
            layoutContext.getValue(ColorStyleKeys.COLOR);

    g2.setColor(cssColor);
    g2.setFont(new Font(fontSpecification.getFontFamily(), style, (int) fontSpecification.getFontSize()));
View Full Code Here

TOP

Related Classes of org.jfree.layouting.input.style.values.CSSColorValue

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.