Package org.jfree.layouting.renderer.model.table

Examples of org.jfree.layouting.renderer.model.table.TableSectionRenderBox


      RenderNode node = table.getFirstChild();
      while (node != null)
      {
        if (node instanceof TableSectionRenderBox)
        {
          final TableSectionRenderBox section = (TableSectionRenderBox) node;
          if (DisplayRole.TABLE_ROW_GROUP.equals(section.getDisplayRole()))
          {
            foundBodyGroup = true;
            boolean foundRow = false;
            // We found a tbody element ..
            // next - check whether the first row is closed ..
            RenderNode maybeRow = section.getVisibleFirst();
            while (maybeRow != null)
            {
              if (maybeRow instanceof TableRowRenderBox)
              {
                if (maybeRow.isOpen())
                {
                  // not layoutable - bail out ..
                  layoutFailureNodeId = maybeRow.getInstanceId();
                  layoutFailureResolution = BOX_MUST_BE_CLOSED;
                  return false;
                }
                foundRow = true;
              }
              maybeRow = maybeRow.getNext();
            }

            if (foundRow == false)
            {
              // not layoutable - bail out ..
              layoutFailureNodeId = box.getInstanceId();
              layoutFailureResolution = NEED_MORE_DATA;
              return false;
            }
          }
        }
        node = node.getNext();
      }
      if (foundBodyGroup == false)
      {
        // even if the table will never declare a tbody-group, it will become
        // layoutable as soon as it is closed.

        layoutFailureNodeId = box.getInstanceId();
        layoutFailureResolution = NEED_MORE_DATA;
        return false;
      }
    }
    else if (box instanceof TableRowRenderBox)
    {
      final TableRowRenderBox row = (TableRowRenderBox) box;
      final TableSectionRenderBox section = (TableSectionRenderBox) row.getParent();
      if (DisplayRole.TABLE_ROW_GROUP.equals(section.getDisplayRole()))
      {
        // we need to have at least one complete row of data (not counting header
        // and footer sections. The first row has no prev-element, so we simply
        // test whether there is one ..
        if (row.getVisiblePrev() == null)
View Full Code Here


      {
        rowGroupNode = rowGroupNode.getNext();
        continue;
      }

      final TableSectionRenderBox sectionBox =
          (TableSectionRenderBox) rowGroupNode;
      if (role.equals
          (sectionBox.getDisplayRole()) == false)
      {
        // not a header ..
        rowGroupNode = rowGroupNode.getNext();
        continue;
      }
View Full Code Here

    this.pageContext = pageContext.update(context);

    final BoxDefinition definition =
        boxDefinitionFactory.createBlockBoxDefinition
            (context, layoutProcess.getOutputMetaData());
    final TableSectionRenderBox tableRenderBox =
        new TableSectionRenderBox(definition);
    tableRenderBox.appyStyle(context, layoutProcess.getOutputMetaData());
    tableRenderBox.setPageContext(pageContext.getPageContext());
    getInsertationPoint().addChild(tableRenderBox);

    // tryValidateOutput();

  }
View Full Code Here

      {
        rowGroupNode = rowGroupNode.getNext();
        continue;
      }

      final TableSectionRenderBox sectionBox =
          (TableSectionRenderBox) rowGroupNode;
      if (role.equals
          (sectionBox.getDisplayRole()) == false)
      {
        // not a header ..
        rowGroupNode = rowGroupNode.getNext();
        continue;
      }
View Full Code Here

      tableStack.push(currentTable);
    }
    else if (box instanceof TableSectionRenderBox)
    {
      final TableSectionRenderBox sectionBox = (TableSectionRenderBox) box;
      currentTable.setRowModel(sectionBox.getRowModel());
    }

    // caching would be cool?
    return true;
  }
View Full Code Here

      currentTable = new TableInfoStructure(table);
      tableStack.push(currentTable);
    }
    else if (box instanceof TableSectionRenderBox)
    {
      final TableSectionRenderBox sectionBox = (TableSectionRenderBox) box;
      currentTable.setRowModel(sectionBox.getRowModel());
    }

    // caching would be cool?
    return true;
  }
View Full Code Here

  private void finishTableRow(final TableRowRenderBox box)
  {
    final TableRenderBox table = currentTable.getTable();
    final TableColumnModel columnModel = table.getColumnModel();

    final TableSectionRenderBox section = (TableSectionRenderBox) box.getParent();
    final TableRowModel rowModel = section.getRowModel();

    final TableRowInfoStructure rowInfoStructure = box.getRowInfoStructure();
    final int rowNumber = currentTable.getRowNumber();
    rowInfoStructure.setRowNumber(rowNumber);
    final TableRow row = rowModel.getRow(rowNumber);
View Full Code Here

      {
        node = node.getNext();
        continue;
      }
      // OK; nice we are done. All other column definitions will be ignored
      final TableSectionRenderBox section = (TableSectionRenderBox) node;

      if (section.isStructureValidated() == false)
      {
        // we start with an empty prev-struct; that signals that there are no
        // spanned cells in a first row.
        TableRowInfoStructure prevInfoStruct =
                new TableRowInfoStructure();
        RenderNode rowNode = section.getFirstChild();
        while (rowNode != null)
        {
          if (rowNode.isOpen())
          {
            throw new IllegalStateException
                    ("An open row cannot be part of a layoutable model.");
          }

          // OK, we got a non open row. Now we traverse through the table from
          // top to bottom building the validated row model.
          if (rowNode instanceof TableRowRenderBox == false)
          {
            rowNode = rowNode.getNext();
            continue;
          }

          final TableRowInfoStructure infoStruct =
                  validateRow(section, rowNode, prevInfoStruct);
          final int cellCount = infoStruct.getCellCount();
          if (currentTable.getColumns() < cellCount)
          {
            currentTable.setColumns(cellCount);
          }
          // And finally ... add the new columns to the model ..
          while (cellCount > columnModel.getColumnCount())
          {
            columnModel.addAutoColumn();
          }

          rowNode = rowNode.getNext();
          prevInfoStruct = infoStruct;
        }

        if (section.isOpen() == false)
        {
          // when the section has been closed, we can stop the revalidation ...
          validateFinalRows(section);
          section.setStructureValidated(true);
        }
      }

      node = node.getNext();
    }
View Full Code Here

      {
        return startTable((TableRenderBox) box, builder);
      }
      else if (box instanceof TableSectionRenderBox)
      {
        final TableSectionRenderBox section = (TableSectionRenderBox) box;
        final CSSValue displayRole = section.getDisplayRole();
        if (DisplayRole.TABLE_HEADER_GROUP.equals(displayRole))
        {
          return startTableHeader((TableSectionRenderBox) box, builder);
        }
        else if (DisplayRole.TABLE_FOOTER_GROUP.equals(displayRole))
View Full Code Here

      {
        finishTable((TableRenderBox) box);
      }
      else if (box instanceof TableSectionRenderBox)
      {
        final TableSectionRenderBox section = (TableSectionRenderBox) box;
        final CSSValue displayRole = section.getDisplayRole();
        if (DisplayRole.TABLE_HEADER_GROUP.equals(displayRole))
        {
          finishTableHeader((TableSectionRenderBox) box);
        }
        else if (DisplayRole.TABLE_FOOTER_GROUP.equals(displayRole))
View Full Code Here

TOP

Related Classes of org.jfree.layouting.renderer.model.table.TableSectionRenderBox

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.