Package org.jfree.layouting.layouter.context

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



  protected void generateAfterPseudoElements(final LayoutElement element)
      throws IOException, NormalizationException
  {
    final LayoutContext layoutContext = element.getLayoutContext();
    // it might be against the standard, but we do not accept the
    // contents-token here.
    if (styleResolver.isPseudoElementStyleResolvable(element, "after"))
    {
      startElementInternal(layoutContext.getNamespace(),
          layoutContext.getTagName(), "after",
          layoutContext.getAttributes());
      endElement();
    }

  }
View Full Code Here


    }

    if (ignoreContext == 1)
    {
      // check, what caused the trouble ..
      final LayoutContext layoutContext = currentElement.getLayoutContext();
      final CSSValue displayRole = layoutContext.getValue(BoxStyleKeys.DISPLAY_ROLE);
      if (DisplayRole.NONE.equals(displayRole))
      {
        // ok, no need to clean up.
        currentSilbling = currentElement;
        currentElement = currentElement.getParent();
        ignoreContext = 0;
        recordingContentNormalizer = null;
        return;
      }
    }

    if (currentElement.isAlternateOpen())
    {
      endElement();
    }

    if (ignoreContext == 1)
    {
      final 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

        // Stupid user gave us something else instead, so we have to autogenerate
        // a row and a cell..
        // Autogenerate the table-row ..
        final StyleResolver styleResolver = layoutProcess.getStyleResolver();
        final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);
        final LayoutContext rowContext =
            styleResolver.createAnonymousContext(id, layoutContext);
        fc.addElement(MODEL_TABLE_ROW, FLAG_AUTOGENERATED | TYPE_TABLE_ROW, rowContext);
        contentGenerator.startedTableRow(rowContext);

        final LayoutContext cellContext =
            styleResolver.createAnonymousContext(id, rowContext);
        fc.addElement(MODEL_BLOCK_INSIDE, FLAG_AUTOGENERATED | TYPE_TABLE_CELL, cellContext);
        contentGenerator.startedTableCell(cellContext);
        addToBlockLevelBox(layoutContext);
        return;
      }
      case MODEL_TABLE_ROW:
      {
        final StyleResolver styleResolver = layoutProcess.getStyleResolver();
        final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);

        final LayoutContext cellContext =
            styleResolver.createAnonymousContext(id, layoutContext);
        fc.addElement(MODEL_BLOCK_INSIDE, FLAG_AUTOGENERATED | TYPE_TABLE_CELL, cellContext);
        contentGenerator.startedTableCell(cellContext);
        addToBlockLevelBox(layoutContext);
        return;
View Full Code Here

    {
      // Autogenerate the table ..
      final StyleResolver styleResolver = layoutProcess.getStyleResolver();
      final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);

      final LayoutContext tableContext =
          styleResolver.createAnonymousContext(id, context);
      fc.addElement(MODEL_TABLE, FLAG_AUTOGENERATED | TYPE_TABLE, tableContext);
      contentGenerator.startedTable(tableContext);
    }
View Full Code Here

    final Glyph[] gs = renderableText.getGlyphs();
    final long posX = renderableText.getX();
    final long posY = renderableText.getY();
    long runningPos = posX;

    final LayoutContext layoutContext = renderableText.getLayoutContext();
    final FontSpecification fontSpecification =
            layoutContext.getFontSpecification();

    int style = Font.PLAIN;
    if (fontSpecification.getFontWeight() > 400)
    {
      style |= Font.BOLD;
    }
    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()));

    final int length = renderableText.getOffset() + renderableText.getLength();
View Full Code Here

    {
      // Autogenerate the table ..
      final StyleResolver styleResolver = layoutProcess.getStyleResolver();
      final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);

      final LayoutContext tableContext =
          styleResolver.createAnonymousContext(id, context);
      fc.addElement(MODEL_TABLE, FLAG_AUTOGENERATED | TYPE_TABLE, tableContext);
      contentGenerator.startedTable(tableContext);
    }
View Full Code Here

      // Autogenerate the table ..
      final StyleResolver styleResolver = layoutProcess.getStyleResolver();
      final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);

      suspendNonBlockElements();
      final LayoutContext tableContext =
          styleResolver.createAnonymousContext(id, context);
      fc.addElement(MODEL_TABLE, FLAG_AUTOGENERATED | TYPE_TABLE, tableContext);
      contentGenerator.startedTable(tableContext);
    }
View Full Code Here

      // the table is a block level element here, so we have to close any open
      // paragraphs before proceeding ..
      suspendNonBlockElements();

      final LayoutContext tableContext =
          styleResolver.createAnonymousContext(id, context);
      fc.addElement(MODEL_TABLE, FLAG_AUTOGENERATED | TYPE_TABLE, tableContext);
      contentGenerator.startedTable(tableContext);
    }
View Full Code Here

      if (currentDisplayModel != MODEL_TABLE)
      {
        // there is not even a table .. generate it
        // Autogenerate the table ..
        final LayoutContext tableContext =
            styleResolver.createAnonymousContext(id, context);

        suspendNonBlockElements();
        fc.addElement(MODEL_TABLE, FLAG_AUTOGENERATED | TYPE_TABLE, tableContext);
        contentGenerator.startedTable(tableContext);
      }

      // OK, finally add the table section ..
      final LayoutContext sectionContext =
          styleResolver.createAnonymousContext(id, context);
      fc.addElement(MODEL_TABLE_SECTION, FLAG_AUTOGENERATED | TYPE_TABLE_SECTION, sectionContext);
      contentGenerator.startedTableSection(sectionContext);
    }
View Full Code Here

          currentDisplayModel != MODEL_TABLE_SECTION)
      {
        // generate the table ..
        suspendNonBlockElements();

        final LayoutContext tableContext =
            styleResolver.createAnonymousContext(id, context);
        fc.addElement(MODEL_TABLE, FLAG_AUTOGENERATED | TYPE_TABLE, tableContext);
        contentGenerator.startedTable(tableContext);
        currentDisplayModel = MODEL_TABLE;
      }

      if (currentDisplayModel != MODEL_TABLE_SECTION)
      {
        // OK, generate the table section ..
        final LayoutContext sectionContext =
            styleResolver.createAnonymousContext(id, context);
        fc.addElement(MODEL_TABLE_SECTION, FLAG_AUTOGENERATED | TYPE_TABLE_SECTION, sectionContext);
        contentGenerator.startedTableSection(sectionContext);
      }

      // Autogenerate the table-row ..
      final LayoutContext rowContext =
          styleResolver.createAnonymousContext(id, context);
      fc.addElement(MODEL_TABLE_ROW, FLAG_AUTOGENERATED | TYPE_TABLE_ROW, rowContext);
      contentGenerator.startedTableRow(rowContext);
    }
View Full Code Here

TOP

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

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.