Examples of StaticTextToken


Examples of org.jfree.layouting.layouter.content.statics.StaticTextToken

      final String strVal = (String) value;
      if ("length".equals(type))
      {
        final CSSNumericValue cssNumericValue =
                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));
    }
    else if (value instanceof Number)
    {
      return new StaticTextToken (String.valueOf(value));
    }
    else
    {
      return new ExternalContentToken (value);
    }
View Full Code Here

Examples of org.jfree.layouting.layouter.content.statics.StaticTextToken

        final CSSNumericValue nval = FunctionUtilities.parseNumberValue(strVal.getValue());
        number = nval.getValue();
      }
      catch(FunctionEvaluationException fee)
      {
        return new StaticTextToken (strVal.getValue());
      }
    }
    else if (rawValue instanceof CSSNumericValue)
    {
      final CSSNumericValue nval = (CSSNumericValue) rawValue;
View Full Code Here

Examples of org.jfree.layouting.layouter.content.statics.StaticTextToken

        CSSNumericValue nval = FunctionUtilities.parseNumberValue(strVal.getValue());
        number = nval.getValue();
      }
      catch(FunctionEvaluationException fee)
      {
        return new StaticTextToken (strVal.getValue());
      }
    }
    else if (rawValue instanceof CSSNumericValue)
    {
      CSSNumericValue nval = (CSSNumericValue) rawValue;
View Full Code Here

Examples of org.jfree.layouting.layouter.content.statics.StaticTextToken

      }
      return;
    }

    //Log.debug ("Adding: " + text);
    modelBuilder.addContent(new StaticTextToken(text));
  }
View Full Code Here

Examples of org.jfree.layouting.layouter.content.statics.StaticTextToken

      final String strVal = (String) value;
      if ("length".equals(type))
      {
        final CSSNumericValue cssNumericValue =
                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))
      {
        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));
    }
    else if (value instanceof Number)
    {
      return new StaticTextToken (String.valueOf(value));
    }
    else
    {
      return new ExternalContentToken (value);
    }
View Full Code Here

Examples of org.jfree.layouting.layouter.content.statics.StaticTextToken

      if (CSSStringType.STRING.equals(sval.getType()))

      {

        return new StaticTextToken(sval.getValue());

      }

      else

      {

        // this is an external URL, so try to load it.

        CSSFunctionValue function = new CSSFunctionValue

                ("url", new CSSValue[]{sval});

        return evaluateFunction(function, process, element);

      }

    }



    if (content instanceof CSSFunctionValue)

    {

      return evaluateFunction((CSSFunctionValue) content, process, element);

    }



    if (content instanceof CSSConstant)

    {

      if (ContentValues.DOCUMENT_URL.equals(content))

      {

        Object docUrl = process.getDocumentContext().getMetaAttribute

                ("document-url");

        if (docUrl != null)

        {

          return new StaticTextToken(String.valueOf(docUrl));

        }



        final ResourceKey baseKey =

            DocumentContextUtility.getBaseResource(process.getDocumentContext());

        final ResourceManager resourceManager =

            DocumentContextUtility.getResourceManager(process.getDocumentContext());

        final URL url = resourceManager.toURL(baseKey);

        if (url != null)

        {

          return new StaticTextToken(url.toExternalForm());

        }

        return null;
View Full Code Here

Examples of org.jfree.layouting.layouter.content.statics.StaticTextToken

      {

        CSSStringValue strval = (CSSStringValue) value;

        return new StaticTextToken(strval.getValue());

      }

      else if (value instanceof CSSRawValue)

      {

        CSSRawValue rawValue = (CSSRawValue) value;

        return new ExternalContentToken(rawValue.getValue());

      }

      return new StaticTextToken(value.getCSSText());

    }

    catch (FunctionEvaluationException e)
View Full Code Here

Examples of org.jfree.layouting.layouter.content.statics.StaticTextToken

      {

        contentSpecification.setContents

            (new ContentToken[]{ counterToken, new StaticTextToken(suffix)});

      }

    }
View Full Code Here

Examples of org.jfree.layouting.layouter.content.statics.StaticTextToken

        if (CSSStringType.STRING.equals(sval.getType()))

        {

          return new StaticTextToken(sval.getValue());

        }

        else

        {

          // this is an external URL, so try to load it.

          CSSFunctionValue function = new CSSFunctionValue

              ("url", new CSSValue[]{sval});

          return evaluateFunction(function, process, element);

        }

      }



      if (content instanceof CSSConstant)

      {

        if (ContentValues.DOCUMENT_URL.equals(content))

        {

          Object docUrl = process.getDocumentContext().getMetaAttribute

              ("document-url");

          if (docUrl != null)

          {

            return new StaticTextToken(String.valueOf(docUrl));

          }



          final ResourceKey baseKey =

              DocumentContextUtility.getBaseResource(process.getDocumentContext());

          final ResourceManager resourceManager =

              DocumentContextUtility.getResourceManager(process.getDocumentContext());

          final URL url = resourceManager.toURL(baseKey);

          if (url != null)

          {

            return new StaticTextToken(url.toExternalForm());

          }

          return null;
View Full Code Here

Examples of org.jfree.layouting.layouter.content.statics.StaticTextToken

      if (CSSStringType.STRING.equals(sval.getType()))

      {

        return new StaticTextToken(sval.getValue());

      }

      else

      {

        // this is an external URL, so try to load it.

        CSSFunctionValue function = new CSSFunctionValue

                ("url", new CSSValue[]{sval});

        return evaluateFunction(function, process, element);

      }

    }



    if (content instanceof CSSFunctionValue)

    {

      return evaluateFunction((CSSFunctionValue) content, process, element);

    }



    if (content instanceof CSSConstant)

    {

      if (ContentValues.DOCUMENT_URL.equals(content))

      {

        Object docUrl = process.getDocumentContext().getMetaAttribute

                ("document-url");

        if (docUrl != null)

        {

          return new StaticTextToken(String.valueOf(docUrl));

        }



        final ResourceKey baseKey =

            DocumentContextUtility.getBaseResource(process.getDocumentContext());

        final ResourceManager resourceManager =

            DocumentContextUtility.getResourceManager(process.getDocumentContext());

        final URL url = resourceManager.toURL(baseKey);

        if (url != null)

        {

          return new StaticTextToken(url.toExternalForm());

        }

        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.