Package org.jfree.layouting.layouter.context

Examples of org.jfree.layouting.layouter.context.ContentSpecification


  }

  protected boolean generateContentBefore(LayoutElement element)
      throws IOException, NormalizationException
  {
    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)
      {
View Full Code Here


  }

  protected void generateContentAfter(LayoutElement element)
      throws IOException, NormalizationException
  {
    final ContentSpecification cspec =
        element.getLayoutContext().getContentSpecification();
    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];
View Full Code Here


  protected void generateStrings(LayoutElement element)
      throws IOException, NormalizationException
  {
    final ContentSpecification cspec =
        element.getLayoutContext().getContentSpecification();
    final ContentToken[] tokens = cspec.getContents();
    int posContent = 0;
    boolean contentGiven = false;
    // first skip everything up to the first 'contents' token.
    for (; posContent < tokens.length; posContent++)
    {
View Full Code Here

    return null;
  }

  private QuotesPair getQuotesPair()
  {
    final ContentSpecification cspec =
        currentElement.getLayoutContext().getContentSpecification();
    QuotesPair[] qps = cspec.getQuotes();
    final int maxQuote = Math.min(qps.length - 1, quoteLevel);
    if (maxQuote == -1)
    {
      return null;
    }
View Full Code Here

    }

    if (ignoreContext == 1)
    {
      LayoutContext layoutContext = currentElement.getLayoutContext();
      final ContentSpecification contentSpec =
          layoutContext.getContentSpecification();

      // replace the contents token of the string-keystyle with the
      // extracted content.
      generateStrings(currentElement);
      if (contentSpec.isAllowContentProcessing() == false)
      {
        if (!contentSpec.isInhibitContent() ||
            !layoutContext.isPseudoElement())
        {
          // clean up (2): The element generated some stuff..
          generateAfterPseudoElements(currentElement);
        }
View Full Code Here

  {

    final LayoutContext layoutContext = element.getLayoutContext();

    final ContentSpecification contentSpecification =

        layoutContext.getContentSpecification();

    final ContentToken[] contents = contentSpecification.getContents();

    for (int i = 0; i < contents.length; i++)

    {
View Full Code Here

  {

    final LayoutContext layoutContext = element.getLayoutContext();

    final ContentSpecification contentSpecification =

            layoutContext.getContentSpecification();

    final CSSValue value = layoutContext.getValue(key);

    if (value instanceof CSSConstant)

    {

      if (ContentValues.NONE.equals(value))

      {

        contentSpecification.setStrings(DEFAULT_CONTENT);

        return;

      }

    }



    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;

        }

        tokens.add(token);

      }

    }



    final ContentToken[] contents = (ContentToken[]) tokens.toArray

            (new ContentToken[tokens.size()]);

    contentSpecification.setStrings(contents);

  }
View Full Code Here

  {

    final LayoutContext layoutContext = element.getLayoutContext();

    final ContentSpecification contentSpecification =

        layoutContext.getContentSpecification();



    final CSSValue value = layoutContext.getValue(key);

    if (value instanceof CSSConstant)

    {

      if (ContentValues.NONE.equals(value))

      {

        contentSpecification.setAllowContentProcessing(false);

        contentSpecification.setInhibitContent(false);

        contentSpecification.setContents(PSEUDO_CONTENT);

        return;

      }

      else if (ContentValues.INHIBIT.equals(value))

      {

        contentSpecification.setAllowContentProcessing(false);

        contentSpecification.setInhibitContent(true);

        contentSpecification.setContents(PSEUDO_CONTENT);

        return;

      }

      else if (ContentValues.NORMAL.equals(value))

      {

        if (layoutContext.isPseudoElement())

        {

          if (isListMarker(element))

          {

            processListItem(process, element, contentSpecification);

            return;

          }

          else

          {

            // a pseudo-element does not have content by default.

            contentSpecification.setAllowContentProcessing(false);

            contentSpecification.setInhibitContent(true);

            contentSpecification.setContents(PSEUDO_CONTENT);

            return;

          }

        }

      }

    }



    contentSpecification.setInhibitContent(false);

    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;

        }

        tokens.add(token);

      }

      if (tokens.isEmpty() == false)

      {

        final ContentToken[] contents = (ContentToken[]) tokens.toArray

            (new ContentToken[tokens.size()]);

        contentSpecification.setContents(contents);

        return;

      }
View Full Code Here

  {

    final LayoutContext layoutContext = element.getLayoutContext();

    final ContentSpecification contentSpecification =

            layoutContext.getContentSpecification();

    final CSSValue value = layoutContext.getValue(key);

    if (value instanceof CSSConstant)

    {

      if (ContentValues.NONE.equals(value))

      {

        contentSpecification.setStrings(XAlternateTextResolveHandler.DEFAULT_CONTENT);

        return;

      }

    }



    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;

        }

        tokens.add(token);

      }

    }



    final ContentToken[] contents = (ContentToken[]) tokens.toArray

            (new ContentToken[tokens.size()]);

    contentSpecification.setStrings(contents);

  }
View Full Code Here

  public void resolve (final LayoutProcess process,
                       final LayoutElement element,
                       final StyleKey key)
  {
    final LayoutContext layoutContext = element.getLayoutContext();
    final ContentSpecification contentSpecification =
            layoutContext.getContentSpecification();
    final CSSValue value = layoutContext.getValue(key);
    if (value instanceof CSSConstant)
    {
      if (ContentValues.NONE.equals(value))
      {
        contentSpecification.setStrings(DEFAULT_CONTENT);
        return;
      }
    }

    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;
        }
        tokens.add(token);
      }
    }

    final ContentToken[] contents = (ContentToken[]) tokens.toArray
            (new ContentToken[tokens.size()]);
    contentSpecification.setStrings(contents);
  }
View Full Code Here

TOP

Related Classes of org.jfree.layouting.layouter.context.ContentSpecification

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.