Package org.jfree.layouting.layouter.content

Examples of org.jfree.layouting.layouter.content.ContentToken


    final ContentSpecification cspec =
        element.getLayoutContext().getContentSpecification();
    final ContentToken[] tokens = cspec.getContents();
    for (int i = 0; i < tokens.length; i++)
    {
      final ContentToken token = tokens[i];
      if (token instanceof ContentsToken)
      {
        element.setContentsConsumed(true);
        return true;
      }
      if (token instanceof ComputedToken)
      {
        final ContentToken resolved = computeToken(token, cspec);
        if (resolved != null)
        {
          addContent(resolved);
        }
      }
View Full Code Here


    final ContentToken[] tokens = cspec.getContents();
    int posContent = 0;
    // first skip everything up to the first 'contents' token.
    for (; posContent < tokens.length; posContent++)
    {
      final ContentToken token = tokens[posContent];
      if (token instanceof ContentsToken)
      {
        break;
      }
    }
    posContent += 1;
    for (; posContent < tokens.length; posContent++)
    {
      final ContentToken token = tokens[posContent];
      // subsequent contents tokens are ignored ..
      if (token instanceof ContentsToken)
      {
        continue;
      }

      if (token instanceof ComputedToken)
      {
        final ContentToken resolved = computeToken(token, cspec);
        if (resolved != null)
        {
          addContent(resolved);
        }
      }
View Full Code Here

    int posContent = 0;
    boolean contentGiven = false;
    // first skip everything up to the first 'contents' token.
    for (; posContent < tokens.length; posContent++)
    {
      final ContentToken token = tokens[posContent];
      if (token instanceof ContentsToken)
      {
        if (contentGiven == false)
        {
          // content is given more than once, then ignore it
          final String text = recordingContentNormalizer.getText();
          addContent(new ResolvedStringToken((ComputedToken) token, text));
          contentGiven = true;
        }
      }
      else if (token instanceof ComputedToken)
      {
        final ContentToken resolved = computeToken(token, cspec);
        if (resolved != null)
        {
          addContent(resolved);
        }
      }
View Full Code Here

    }

    contentSpecification.setStrings(XAlternateTextResolveHandler.DEFAULT_CONTENT);
    if (value instanceof CSSAttrFunction)
    {
      final ContentToken token =
              evaluateFunction((CSSFunctionValue) value, process, element);
      if (token == null)
      {
        return;
      }
      contentSpecification.setStrings(new ContentToken[]{token});
    }

    if (value instanceof CSSValueList == false)
    {
      return; // cant handle that one
    }

    final ArrayList tokens = new ArrayList();
    final CSSValueList list = (CSSValueList) value;
    final int size = list.getLength();
    for (int i = 0; i < size; i++)
    {
      final CSSValueList sequence = (CSSValueList) list.getItem(i);
      for (int j = 0; j < sequence.getLength(); j++)
      {
        final CSSValue content = sequence.getItem(j);
        final ContentToken token = createToken(process, element, content);
        if (token == null)
        {
          // ok, a failure. Skip to the next content spec ...
          tokens.clear();
          break;
View Full Code Here

    }

    contentSpecification.setStrings(DEFAULT_CONTENT);
    if (value instanceof CSSAttrFunction)
    {
      final ContentToken token =
              evaluateFunction((CSSFunctionValue) value, process, element);
      if (token == null)
      {
        return;
      }
      contentSpecification.setStrings(new ContentToken[]{token});
    }

    if (value instanceof CSSValueList == false)
    {
      return; // cant handle that one
    }

    final ArrayList tokens = new ArrayList();
    final CSSValueList list = (CSSValueList) value;
    final int size = list.getLength();
    for (int i = 0; i < size; i++)
    {
      final CSSValueList sequence = (CSSValueList) list.getItem(i);
      for (int j = 0; j < sequence.getLength(); j++)
      {
        final CSSValue content = sequence.getItem(j);
        final ContentToken token = createToken(process, element, content);
        if (token == null)
        {
          // ok, a failure. Skip to the next content spec ...
          tokens.clear();
          break;
View Full Code Here

          return new StaticTextToken(url.toExternalForm());
        }
        return null;
      }

      final ContentToken token = (ContentToken) tokenMapping.get(content);
      if (token != null)
      {
        return token;
      }
View Full Code Here

    contentSpecification.setAllowContentProcessing(true);
    contentSpecification.setContents(DEFAULT_CONTENT);

    if (value instanceof CSSAttrFunction)
    {
      final ContentToken token =
          evaluateFunction((CSSFunctionValue) value, process, element);
      if (token == null)
      {
        return;
      }
      contentSpecification.setContents(new ContentToken[]{token});
    }

    if (value instanceof CSSValueList == false)
    {
      return; // cant handle that one
    }

    final ArrayList tokens = new ArrayList();
    final CSSValueList list = (CSSValueList) value;
    final int size = list.getLength();
    for (int i = 0; i < size; i++)
    {
      final CSSValueList sequence = (CSSValueList) list.getItem(i);
      for (int j = 0; j < sequence.getLength(); j++)
      {
        final CSSValue content = sequence.getItem(j);
        final ContentToken token = createToken(process, element, content);
        if (token == null)
        {
          // ok, a failure. Skip to the next content spec ...
          tokens.clear();
          break;
View Full Code Here

    final LayoutContext layoutContext = element.getLayoutContext();
    final CSSValue value =
        layoutContext.getValue(ListStyleKeys.LIST_STYLE_IMAGE);
    if (value != null)
    {
      final ContentToken token = createToken(process, element, value);
      if (token != null)
      {
        contentSpecification.setContents(new ContentToken[]{ token });
        return;
      }
    }

    final ContentToken token = createToken
        (process, element, listCounter);
    if (token instanceof CounterToken)
    {
      final CounterToken counterToken = (CounterToken) token;
      final CounterStyle style = counterToken.getStyle();
View Full Code Here

            return new StaticTextToken(url.toExternalForm());
          }
          return null;
        }

        final ContentToken token = (ContentToken) tokenMapping.get(content);
        if (token != null)
        {
          return token;
        }
View Full Code Here

    final ContentSpecification contentSpecification =
        layoutContext.getContentSpecification();
    final ContentToken[] contents = contentSpecification.getContents();
    for (int i = 0; i < contents.length; i++)
    {
      ContentToken content = contents[i];
      if (content instanceof ResolvedCounterToken)
      {
        // this should not happen, as the resolving of content-tokens happens
        // after the style resolving process ..
        final ResolvedCounterToken computedToken = (ResolvedCounterToken) content;
View Full Code Here

TOP

Related Classes of org.jfree.layouting.layouter.content.ContentToken

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.