Package org.jfree.layouting.layouter.style.values

Examples of org.jfree.layouting.layouter.style.values.CSSResourceValue


      throw new FunctionEvaluationException();
    }
    final CSSValue value = FunctionUtilities.resolveParameter(layoutProcess, element, params[0]);
    if (value instanceof CSSResourceValue)
    {
      final CSSResourceValue cssResourceValue =
              (CSSResourceValue) value;
      final Resource resource = cssResourceValue.getValue();
      return new ResourceContentToken(resource);
    }
    if (value instanceof CSSStringValue == false)
    {
      throw new FunctionEvaluationException
              ("Not even remotely an URI: " + value);
    }
    final CSSStringValue strval = (CSSStringValue) value;
    final CSSResourceValue cssResourceValue =
            FunctionUtilities.loadResource(layoutProcess, strval.getValue());
    final Resource resource = cssResourceValue.getValue();
    return new ResourceContentToken(resource);
  }
View Full Code Here


    {
      return FunctionUtilities.loadResource(layoutProcess, value);
    }
    else if (value instanceof Resource)
    {
      return new CSSResourceValue((Resource) value);
    }
    else if (value instanceof ResourceKey)
    {
      return FunctionUtilities.loadResource(layoutProcess, value);
    }
View Full Code Here

        throw new FunctionEvaluationException
                ("Failed to create URI: Resource loading failed: Key not derivable");
      }

      final Resource res = manager.create(key, baseKey, type);
      return new CSSResourceValue(res);
    }
    catch (Exception e)
    {
      throw new FunctionEvaluationException
              ("Failed to create URI: Resource loading failed: " + e.getMessage(), e);
View Full Code Here

                FunctionUtilities.parseNumberValue(strVal);
        return new StaticTextToken (cssNumericValue.getCSSText());
      }
      else if ("url".equals(type))
      {
        final CSSResourceValue cssResourceValue =
                FunctionUtilities.loadResource(layoutProcess, strVal);
        final Resource resource = cssResourceValue.getValue();
        return new ResourceContentToken(resource);
      }
      else if ("color".equals(type))
      {
        final CSSValue colorValue = ColorUtil.parseColor(strVal);
        if (colorValue == null)
        {
          throw new FunctionEvaluationException();
        }
        return new StaticTextToken (colorValue.getCSSText());
      }
      else
      {
        // auto-mode. We check for URLs, as this is required for images
        final CSSValue cssValue =
                FunctionUtilities.parseValue(layoutProcess, strVal);
        if (cssValue instanceof CSSResourceValue)
        {
          final CSSResourceValue cssResourceValue =
                  (CSSResourceValue) cssValue;
          final Resource resource = cssResourceValue.getValue();
          return new ResourceContentToken(resource);
        }
        else if (cssValue instanceof CSSStringValue)
        {
          final CSSStringValue sval = (CSSStringValue) cssValue;
          return new StaticTextToken (sval.getValue());
        }
        else
        {
          return new StaticTextToken (cssValue.getCSSText());
        }
      }
    }
    else if (value instanceof URL)
    {
      final CSSResourceValue cssResourceValue =
              FunctionUtilities.loadResource(layoutProcess, value);
      final Resource resource = cssResourceValue.getValue();
      return new ResourceContentToken(resource);
    }
    else if (value instanceof Resource)
    {
      return new ResourceContentToken((Resource) value);
    }
    else if (value instanceof ResourceKey)
    {
      final CSSResourceValue cssResourceValue =
              FunctionUtilities.loadResource(layoutProcess, value);
      final Resource resource = cssResourceValue.getValue();
      return new ResourceContentToken(resource);
    }
    else if (value instanceof Date)
    {
      return new StaticTextToken (String.valueOf(value));
View Full Code Here

    try
    {
      final CSSValue value = styleFunction.evaluate(process, element, function);
      if (value instanceof CSSResourceValue)
      {
        final CSSResourceValue refValue = (CSSResourceValue) value;
        return new ResourceContentToken(refValue.getValue());
      }
      else if (value instanceof CSSStringValue)
      {
        final CSSStringValue strval = (CSSStringValue) value;
        return new StaticTextToken(strval.getValue());
View Full Code Here

    try
    {
      final CSSValue value = styleFunction.evaluate(process, element, function);
      if (value instanceof CSSResourceValue)
      {
        final CSSResourceValue refValue = (CSSResourceValue) value;
        return new ResourceContentToken(refValue.getValue());
      }
      else if (value instanceof CSSStringValue)
      {
        final CSSStringValue strval = (CSSStringValue) value;
        return new StaticTextToken(strval.getValue());
View Full Code Here

        throw new FunctionEvaluationException
                ("Failed to create URI: Resource loading failed: Key not derivable");
      }

      final Resource res = manager.create(key, baseKey, type);
      return new CSSResourceValue(res);
    }
    catch (Exception e)
    {
      throw new FunctionEvaluationException
              ("Failed to create URI: Resource loading failed: " + e.getMessage(), e);
View Full Code Here

    {
      return FunctionUtilities.loadResource(layoutProcess, value);
    }
    else if (value instanceof Resource)
    {
      return new CSSResourceValue((Resource) value);
    }
    else if (value instanceof ResourceKey)
    {
      return FunctionUtilities.loadResource(layoutProcess, value);
    }
View Full Code Here

                FunctionUtilities.parseNumberValue(strVal);
        return new StaticTextToken (cssNumericValue.getCSSText());
      }
      else if ("url".equals(type))
      {
        final CSSResourceValue cssResourceValue =
                FunctionUtilities.loadResource(layoutProcess, strVal);
        final Resource resource = cssResourceValue.getValue();
        return new ResourceContentToken(resource);
      }
      else if ("color".equals(type))
      {
        final CSSValue colorValue = ColorUtil.parseColor(strVal);
        if (colorValue == null)
        {
          throw new FunctionEvaluationException();
        }
        return new StaticTextToken (colorValue.getCSSText());
      }
      else
      {
        // auto-mode. We check for URLs, as this is required for images
        final CSSValue cssValue =
                FunctionUtilities.parseValue(layoutProcess, strVal);
        if (cssValue instanceof CSSResourceValue)
        {
          final CSSResourceValue cssResourceValue =
                  (CSSResourceValue) cssValue;
          final Resource resource = cssResourceValue.getValue();
          return new ResourceContentToken(resource);
        }
        else if (cssValue instanceof CSSStringValue)
        {
          final CSSStringValue sval = (CSSStringValue) cssValue;
          return new StaticTextToken (sval.getValue());
        }
        else
        {
          return new StaticTextToken (cssValue.getCSSText());
        }
      }
    }
    else if (value instanceof URL)
    {
      final CSSResourceValue cssResourceValue =
              FunctionUtilities.loadResource(layoutProcess, value);
      final Resource resource = cssResourceValue.getValue();
      return new ResourceContentToken(resource);
    }
    else if (value instanceof Resource)
    {
      return new ResourceContentToken((Resource) value);
    }
    else if (value instanceof ResourceKey)
    {
      final CSSResourceValue cssResourceValue =
              FunctionUtilities.loadResource(layoutProcess, value);
      final Resource resource = cssResourceValue.getValue();
      return new ResourceContentToken(resource);
    }
    else if (value instanceof Date)
    {
      return new StaticTextToken (String.valueOf(value));
View Full Code Here

      throw new FunctionEvaluationException();
    }
    final CSSValue value = FunctionUtilities.resolveParameter(layoutProcess, element, params[0]);
    if (value instanceof CSSResourceValue)
    {
      final CSSResourceValue cssResourceValue =
              (CSSResourceValue) value;
      final Resource resource = cssResourceValue.getValue();
      return new ResourceContentToken(resource);
    }
    if (value instanceof CSSStringValue == false)
    {
      throw new FunctionEvaluationException
              ("Not even remotely an URI: " + value);
    }
    final CSSStringValue strval = (CSSStringValue) value;
    final CSSResourceValue cssResourceValue =
            FunctionUtilities.loadResource(layoutProcess, strval.getValue());
    final Resource resource = cssResourceValue.getValue();
    return new ResourceContentToken(resource);
  }
View Full Code Here

TOP

Related Classes of org.jfree.layouting.layouter.style.values.CSSResourceValue

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.