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

Examples of org.jfree.layouting.renderer.model.table.cells.DataCell


        continue;
      }

      // We dont handle spanned cells here; thats done indirectly by the
      // column model itself.
      final DataCell dataCell = (DataCell) cellAt;

      final RenderNode cell = findCellInRow(box, dataCell.getCellRenderBox());
      if (cell == null)
      {
        throw new IllegalStateException
            ("No such cell: " + dataCell.getCellRenderBox());
      }
      final TableColumn column = columnModel.getColumn(i);
      final int colSpan = dataCell.getColSpan();

      column.updateMinimumChunkSize(colSpan, cell.getMinimumChunkWidth());
      column.updateMaxBoxSize(colSpan, cell.getMaximumBoxWidth());

      final RenderLength computedWidth =
          cell.getComputedLayoutProperties().getComputedWidth();
      if (computedWidth == RenderLength.AUTO == false)
      {
        // if we have a computed width, set it. If the user explicitly specified
        // a width, then that one is returned as computed width.
        column.updatePreferredSize(colSpan, computedWidth.getValue());
      }

      final RenderLength definedHeight =
          box.getBoxDefinition().getPreferredHeight();
      row.updateDefinedSize(dataCell.getRowSpan(),
          definedHeight.resolve(computedWidth.resolve(0)));
    }

    currentTable.increaseRowNumber();
  }
View Full Code Here


            {
              final TableCellRenderBox autoCell =
                      new TableCellRenderBox(EmptyBoxDefinition.getInstance(), true);
              autoCell.close();
              autoCell.setColumnIndex(emptyCellCnt);
              final DataCell dataCell = new DataCell
                  (1, 1, autoCell.getInstanceId());
              autoRowInfo.addCell(dataCell);
              autoGeneratedRow.addChild(autoCell);
            }
          }

          final PlaceHolderCell placeHolder;
          if (cell instanceof DataCell)
          {
            placeHolder = new PlaceHolderCell
                    ((DataCell) cell, cell.getRowSpan() - 1, cell.getColSpan());
          }
          else if (cell instanceof PlaceHolderCell)
          {
            final PlaceHolderCell prevCell = (PlaceHolderCell) cell;
            placeHolder = new PlaceHolderCell
                    (prevCell.getSourceCell(), cell.getRowSpan() - 1, cell.getColSpan());
          }
          else
          {
            throw new IllegalStateException("Unexpected cell type.");
          }
          autoRowInfo.addCell(placeHolder);
        }
        else if (autoGeneratedRow != null)
        {
          // only add, if the auto-row-box has been already generated ..
          // this prevents the generation of totally empty rows ..
          final TableCellRenderBox autoCell =
                  new TableCellRenderBox(EmptyBoxDefinition.getInstance(), true);
          autoCell.close();
          autoCell.setColumnIndex(i);
          final DataCell dataCell = new DataCell
              (1, 1, autoCell.getInstanceId());
          autoRowInfo.addCell(dataCell);
          autoGeneratedRow.addChild(autoCell);
        }
      }
View Full Code Here

        cellPosition = findCellPosition(cellPosition, prevInfoStruct, infoStruct);

        // OK, so we have the insertation point. Lets add our cell there ..
        final int colSpan = cellBox.getColSpan();
        final int rowSpan = cellBox.getRowSpan();
        final DataCell dataCell = new DataCell
            (rowSpan, colSpan, cellBox.getInstanceId());
        infoStruct.addCell(dataCell);
        cellBox.setColumnIndex(cellPosition);

        cellPosition += 1;
View Full Code Here

    {
      // look at the prev-cell definition
      final TableCell prevCell = prevInfoStruct.getCellAt(cellPosition);
      if (prevCell.getRowSpan() > 1)
      {
        final DataCell dataCell;
        if (prevCell instanceof DataCell)
        {
          dataCell = (DataCell) prevCell;
        }
        else if (prevCell instanceof PlaceHolderCell)
View Full Code Here

                                  int cellPosition)
  {
    // no such cell at that position. Good, add the plain cell.
    final int colSpan = cellBox.getColSpan();
    final int rowSpan = cellBox.getRowSpan();
    final DataCell dataCell = new DataCell
        (rowSpan, colSpan, cellBox.getInstanceId());
    infoStruct.addCell(dataCell);
    cellPosition += 1;
    for (int i = 1; i < colSpan; i++)
    {
View Full Code Here

            {
              final TableCellRenderBox autoCell =
                      new TableCellRenderBox(EmptyBoxDefinition.getInstance(), true);
              autoCell.close();
              autoCell.setColumnIndex(emptyCellCnt);
              final DataCell dataCell = new DataCell
                  (1, 1, autoCell.getInstanceId());
              autoRowInfo.addCell(dataCell);
              autoGeneratedRow.addChild(autoCell);
            }
          }

          final PlaceHolderCell placeHolder;
          if (cell instanceof DataCell)
          {
            placeHolder = new PlaceHolderCell
                    ((DataCell) cell, cell.getRowSpan() - 1, cell.getColSpan());
          }
          else if (cell instanceof PlaceHolderCell)
          {
            final PlaceHolderCell prevCell = (PlaceHolderCell) cell;
            placeHolder = new PlaceHolderCell
                    (prevCell.getSourceCell(), cell.getRowSpan() - 1, cell.getColSpan());
          }
          else
          {
            throw new IllegalStateException("Unexpected cell type.");
          }
          autoRowInfo.addCell(placeHolder);
        }
        else if (autoGeneratedRow != null)
        {
          // only add, if the auto-row-box has been already generated ..
          // this prevents the generation of totally empty rows ..
          final TableCellRenderBox autoCell =
                  new TableCellRenderBox(EmptyBoxDefinition.getInstance(), true);
          autoCell.close();
          autoCell.setColumnIndex(i);
          final DataCell dataCell = new DataCell
              (1, 1, autoCell.getInstanceId());
          autoRowInfo.addCell(dataCell);
          autoGeneratedRow.addChild(autoCell);
        }
      }
View Full Code Here

        cellPosition = findCellPosition(cellPosition, prevInfoStruct, infoStruct);

        // OK, so we have the insertation point. Lets add our cell there ..
        final int colSpan = cellBox.getColSpan();
        final int rowSpan = cellBox.getRowSpan();
        final DataCell dataCell = new DataCell
            (rowSpan, colSpan, cellBox.getInstanceId());
        infoStruct.addCell(dataCell);
        cellBox.setColumnIndex(cellPosition);

        cellPosition += 1;
View Full Code Here

    {
      // look at the prev-cell definition
      final TableCell prevCell = prevInfoStruct.getCellAt(cellPosition);
      if (prevCell.getRowSpan() > 1)
      {
        final DataCell dataCell;
        if (prevCell instanceof DataCell)
        {
          dataCell = (DataCell) prevCell;
        }
        else if (prevCell instanceof PlaceHolderCell)
View Full Code Here

                                  int cellPosition)
  {
    // no such cell at that position. Good, add the plain cell.
    final int colSpan = cellBox.getColSpan();
    final int rowSpan = cellBox.getRowSpan();
    final DataCell dataCell = new DataCell
        (rowSpan, colSpan, cellBox.getInstanceId());
    infoStruct.addCell(dataCell);
    cellPosition += 1;
    for (int i = 1; i < colSpan; i++)
    {
View Full Code Here

        continue;
      }

      // We dont handle spanned cells here; thats done indirectly by the
      // column model itself.
      final DataCell dataCell = (DataCell) cellAt;

      final RenderNode cell = findCellInRow(box, dataCell.getCellRenderBox());
      if (cell == null)
      {
        throw new IllegalStateException
            ("No such cell: " + dataCell.getCellRenderBox());
      }
      final TableColumn column = columnModel.getColumn(i);
      final int colSpan = dataCell.getColSpan();

      column.updateMinimumChunkSize(colSpan, cell.getMinimumChunkWidth());
      column.updateMaxBoxSize(colSpan, cell.getMaximumBoxWidth());

      final RenderLength computedWidth =
          cell.getComputedLayoutProperties().getComputedWidth();
      if (computedWidth == RenderLength.AUTO == false)
      {
        // if we have a computed width, set it. If the user explicitly specified
        // a width, then that one is returned as computed width.
        column.updatePreferredSize(colSpan, computedWidth.getValue());
      }

      final RenderLength definedHeight =
          box.getBoxDefinition().getPreferredHeight();
      row.updateDefinedSize(dataCell.getRowSpan(),
          definedHeight.resolve(computedWidth.resolve(0)));
    }

    currentTable.increaseRowNumber();
  }
View Full Code Here

TOP

Related Classes of org.jfree.layouting.renderer.model.table.cells.DataCell

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.