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

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


  }

  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();
View Full Code Here


      {
        maxRowSpan = cs;
      }
    }

    final TableRenderBox table = getTableSection().getTable();
    rowSpacing = table.getRowSpacing().resolve(0);

    preferredSize = (rowCount - 1) * rowSpacing;

    // first, find out how much space is already used.
    final long[] preferredSizes = new long[rowCount];
View Full Code Here

    if (box instanceof TableRenderBox == false)
    {
      return true;
    }

    final TableRenderBox table = (TableRenderBox) box;
    currentTable = new TableInfoStructure(table);
    tableStack.push(currentTable);

    // if the table is not open and has been validated, then ignore it ..
    if (table.isOpen() == false)
    {
      if (table.isStructureValidated() == false)
      {
        validateTable();
        return true;
      }
      // a table may contain sub-tables. Once the table has been closed, we
View Full Code Here

  {
    // first step: Check, whether the column model is complete.
    validatePredefinedColumns();
    validateRowStructure();

    final TableRenderBox table = currentTable.getTable();
    if (table.isOpen() == false)
    {
      table.setStructureValidated(true);
    }
  }
View Full Code Here

  private void validateRowStructure()
  {
    // check all the newly closed rows and look at their number of columns
    // (cache that one for faster access)
    final TableRenderBox table = currentTable.getTable();
    if (table.isPredefinedColumnsValidated() == false)
    {
      // the predefined columns must be validated first ...
      return;
    }

    final TableColumnModel columnModel = currentTable.getColumnModel();
    // ok, the real work starts here. Forward-Traverse the table by its table-
    // sections.
    RenderNode node = table.getFirstChild();
    while (node != null)
    {
      if (node instanceof TableSectionRenderBox == false)
      {
        node = node.getNext();
View Full Code Here

    return cellPosition;
  }

  private void validatePredefinedColumns()
  {
    final TableRenderBox table = currentTable.getTable();
    if (table.isPredefinedColumnsValidated())
    {
      // all work as been done already ...
      return;
    }

    final TableColumnModel columnModel = table.getColumnModel();

    int colCount = 0;
    RenderNode node = table.getFirstChild();
    while (node != null)
    {
      if (node instanceof TableColumnNode)
      {
        TableColumnNode columnNode = (TableColumnNode) node;
        if (colCount >= columnModel.getColumnCount())
        {
          // No column exists at that position ..
          final BoxDefinition boxDefinition = columnNode.getBoxDefinition();
          final Border border = boxDefinition.getBorder();
          final RenderLength width = boxDefinition.getPreferredWidth();
          final TableColumn column = new TableColumn(border, width, false);
          final TableColumnGroup group = new TableColumnGroup();
          group.addColumn(column);
          columnModel.addColumnGroup(group);
          colCount += 1;
        }
        else
        {
          // We do not change existing columns. That validation should be the
          // first that checks column definitions, so that state should always
          // be correct.
        }
      }
      else if (node instanceof TableColumnGroupNode)
      {
        TableColumnGroupNode groupNode = (TableColumnGroupNode) node;

        final boolean newGroupGenerated;
        final TableColumnGroup group;
        if (colCount >= columnModel.getColumnCount())
        {
          group = new TableColumnGroup(groupNode.getBorder());
          newGroupGenerated = true;
        }
        else
        {
          group = columnModel.getGroupForIndex(colCount);
          newGroupGenerated = false;
        }

        RenderNode groupColNode = groupNode.getFirstChild();
        while (groupColNode != null)
        {
          if (groupColNode instanceof TableColumnNode)
          {
            final TableColumnNode columnNode = (TableColumnNode) groupColNode;
            if (colCount >= columnModel.getColumnCount())
            {
              final BoxDefinition boxDefinition = columnNode.getBoxDefinition();
              final Border border = boxDefinition.getBorder();
              final RenderLength width = boxDefinition.getPreferredWidth();
              final TableColumn column = new TableColumn(border, width, false);
              group.addColumn(column);
            }
            else
            {
              colCount += 1;
            }
          }
          else
          {
            // ignore silently ..
          }
          groupColNode = groupColNode.getNext();
        }

        if (newGroupGenerated)
        {
          columnModel.addColumnGroup(group);
          colCount += group.getColumnCount();
        }

      }
      else if (node instanceof TableSectionRenderBox)
      {
        // OK; nice we are done. All other column definitions will be ignored
        table.setPredefinedColumnsValidated(true);
      }
      else
      {
        // ignore ...
      }
View Full Code Here

        Log.debug ("CELL: " + i + " = " + cell.getRowSpan() + " " + cell.getColSpan() + " " + cell);
      }
    }
    else if (box instanceof TableRenderBox)
    {
      TableRenderBox table = (TableRenderBox) box;
      final TableColumnModel columnModel = table.getColumnModel();
      for (int i = 0; i < columnModel.getColumnCount(); i++)
      {
        final TableColumn col = columnModel.getColumn(i);
        Log.debug ("COLUMN: EffectiveSize: " + col.getEffectiveSize() " Computed Max Width: " + col.getComputedMaximumWidth() + " Computed ChunkSize: " + col.getComputedMinChunkSize());
//        for (int cs = 1; cs < 3; cs++)
View Full Code Here

    final BoxDefinition definition =
        boxDefinitionFactory.createBlockBoxDefinition
            (context, layoutProcess.getOutputMetaData());
    this.pageContext = pageContext.update(context);

    TableRenderBox tableRenderBox =
        new TableRenderBox(definition);
    tableRenderBox.appyStyle(context, layoutProcess.getOutputMetaData());
    tableRenderBox.setPageContext(pageContext.getPageContext());

    getInsertationPoint().addChild(tableRenderBox);

    // tryValidateOutput();
View Full Code Here

  protected void processBlockLevelChild(final RenderNode node)
  {
    if (node instanceof TableRenderBox)
    {
      final TableRenderBox table = (TableRenderBox) node;
      processTable(table);
    }
    else
    {
      super.processBlockLevelChild(node);
View Full Code Here

  private void computeCellArea(final TableCellRenderBox cellRenderBox)
  {
    // This is slightly different for table cells ...
    final int columnIndex = cellRenderBox.getColumnIndex();
    final TableRenderBox table = cellRenderBox.getTable();
    final TableColumnModel columnModel = table.getColumnModel();
    final TableColumn column = columnModel.getColumn(columnIndex);
    long effectiveSize = column.getEffectiveSize();

    final int colSpan = cellRenderBox.getColSpan();
    if (colSpan > 1)
View Full Code Here

TOP

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

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.