Package org.jfree.layouting.layouter.context

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


    final int currentDisplayModel = fc.getCurrentDisplayModel();
    if (currentDisplayModel != MODEL_TABLE)
    {
      // Autogenerate the table ..
      final StyleResolver styleResolver = layoutProcess.getStyleResolver();
      final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);

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


    // check if the parent is a table.
    final int currentDisplayModel = fc.getCurrentDisplayModel();
    if (currentDisplayModel != MODEL_TABLE_SECTION)
    {
      final StyleResolver styleResolver = layoutProcess.getStyleResolver();
      final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);

      if (currentDisplayModel != MODEL_TABLE)
      {
        // there is not even a table .. generate it
        // Autogenerate the table ..
View Full Code Here

    // check if the parent is a table.
    int currentDisplayModel = fc.getCurrentDisplayModel();
    if (currentDisplayModel != MODEL_TABLE_ROW)
    {
      final StyleResolver styleResolver = layoutProcess.getStyleResolver();
      final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);

      if (currentDisplayModel != MODEL_TABLE &&
          currentDisplayModel != MODEL_TABLE_SECTION)
      {
        // generate the table ..
View Full Code Here

      if (reactivateSuspendedInlines(fc) == false)
      {
        // todo: check for possibly suspended inlines and reactivate them

        final StyleResolver styleResolver = layoutProcess.getStyleResolver();
        final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);
        final LayoutContext paragraphContext =
            styleResolver.createAnonymousContext(id, context);
        fc.addElement(MODEL_INLINE_INSIDE, FLAG_AUTOGENERATED | TYPE_PARAGRAPH, paragraphContext);
        contentGenerator.startedRootInline(paragraphContext);
      }

      // now add the element ..
      final CSSValue displayModel = context.getValue(BoxStyleKeys.DISPLAY_MODEL);
      if (DisplayModel.TABLE.equals(displayModel))
      {
        fc.addElement(MODEL_TABLE, TYPE_INLINE, context);
        contentGenerator.startedTable(context);
      }
      else if (DisplayModel.INLINE_INSIDE.equals(displayModel))
      {
        fc.addElement(MODEL_INLINE_INSIDE, TYPE_INLINE, context);
        contentGenerator.startedInline(context);
      }
      else
      {
        fc.addElement(MODEL_BLOCK_INSIDE, TYPE_BLOCK, context);
        contentGenerator.startedBlock(context);
      }
      return;
    }

    // Todo: need to check for run-in and compact as well..
    // Everything else is considered a block-level element and treated as such..
    final CSSValue displayModel = context.getValue(BoxStyleKeys.DISPLAY_MODEL);
    if (DisplayModel.TABLE.equals(displayModel))
    {
      fc.addElement(MODEL_TABLE, TYPE_TABLE, context);
      contentGenerator.startedTable(context);
    }
    else if (DisplayModel.INLINE_INSIDE.equals(displayModel))
    {
      // A block level element that declares that all its direct childs should
      // be treated as inline-level elements. We create a paragraph box for that
      // one.
      fc.addElement(MODEL_INLINE_INSIDE, TYPE_BLOCK, context);
      contentGenerator.startedBlock(context);

      final StyleResolver styleResolver = layoutProcess.getStyleResolver();
      final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);
      final LayoutContext paragraphContext =
          styleResolver.createAnonymousContext(id, context);
      fc.addElement(MODEL_INLINE_INSIDE,
          FLAG_AUTOGENERATED | TYPE_PARAGRAPH, paragraphContext);
      contentGenerator.startedRootInline(paragraphContext);
View Full Code Here

  private void addToTableLevelBox(final LayoutContext context)
      throws NormalizationException
  {
    final StyleResolver styleResolver = layoutProcess.getStyleResolver();
    final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);

    // This is some non-table content that has been added to a table.
    // This generally means that someone messed up the layout, we have to
    // generate a default table ...
    final FlowContext fc = (FlowContext) flowContexts.peek();
View Full Code Here

      // todo: check for suspended inlines and reactivate them if needed.
      if (reactivateSuspendedInlines(fc) == false)
      {
        // generate a inline box ..
        final StyleResolver styleResolver = layoutProcess.getStyleResolver();
        final ContextId id = new ContextId(ContextId.SOURCE_DISPLAY_MODEL, -1, 0);
        final LayoutContext paragraphContext =
            styleResolver.createAnonymousContext(id, layoutContext);
        fc.addElement(MODEL_INLINE_INSIDE, FLAG_AUTOGENERATED | TYPE_PARAGRAPH, paragraphContext);
        contentGenerator.startedRootInline(paragraphContext);
        contentGenerator.addContent(paragraphContext, content);
View Full Code Here

  public static void main(String[] args)
  {
    LibLayoutBoot.getInstance().start();
    DefaultLayoutContext layoutContext =
            new DefaultLayoutContext
                    (new ContextId(0, 0,0), "Bah", "buh", null, new AttributeMap());
    layoutContext.getStyle().setValue(FontStyleKeys.FONT_FAMILY, new CSSConstant("helvetica"));
    final FontSpecification fontSpecification = layoutContext.getFontSpecification();
    fontSpecification.setFontFamily("Arial");
    fontSpecification.setFontSize(12);
View Full Code Here

  public void testMarginCreation()
  {
    DefaultElementContext elementContext = new DefaultElementContext(null);
    DefaultLayoutContext layoutContext = new DefaultLayoutContext
            (new ContextId(0, 0, 0), "Bah", "buh", null, new AttributeMap());

    RenderableTextFactory tr = new CollapseTest.MarginRenderableTextFactory(null);


    int[] text = new int[]{' ', ' ', ' ', ' ', ' ', ' '};
View Full Code Here

  public void testMarginCreation()
  {
    DefaultElementContext elementContext = new DefaultElementContext(null);
    DefaultLayoutContext layoutContext = new DefaultLayoutContext
            (new ContextId(0, 0, 0), "Bah", "buh", null, new AttributeMap());

    RenderableTextFactory tr = new MarginRenderableTextFactory(null);


    int[] text = new int[]{' ', 'A', ' ', ' ', 'B', ' '};
View Full Code Here

  public void testChunkCreation()
  {
    DefaultElementContext elementContext = new DefaultElementContext(null);
    DefaultLayoutContext layoutContext = new DefaultLayoutContext
            (new ContextId(0, 0, 0), "Bah", "buh", null, new AttributeMap());

    RenderableTextFactory tr = new MarginRenderableTextFactory(null);


    int[] text0 = new int[]{'A'};
View Full Code Here

TOP

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

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.