Package org.jfree.report.flow.layoutprocessor

Examples of org.jfree.report.flow.layoutprocessor.LayoutController


      outputProcessor.setInterceptor(interceptor);

      final LibLayoutReportTarget target =
          (LibLayoutReportTarget) targetState.restore(outputProcessor);

      LayoutController position = state.getLayoutController();

      // we have the data and we have our position inside the report.
      // lets generate something ...
      while (position.isAdvanceable())
      {
        position = position.advance(target);
        target.commit();

        while (position.isAdvanceable() == false &&
               position.getParent() != null)
        {
          final LayoutController parent = position.getParent();
          position = parent.join(position.getFlowController());
        }

        if (interceptor.isMoreContentNeeded() == false)
        {
          outputProcessor.setInterceptor(null);
View Full Code Here


  {
  }

  protected AutoTableLayoutController findTableParent ()
  {
    LayoutController parent = getParent();
    while (parent != null)
    {
      if (parent instanceof AutoTableLayoutController)
      {
        return (AutoTableLayoutController) parent;
      }

      parent = parent.getParent();
    }
    return null;
  }
View Full Code Here

  {
    if (context == null)
    {

      // Step 1: Find the parent cell.
      final LayoutController cellController = findParentCell();
      if (cellController == null)
      {
        Log.warn("Image is not contained in a table. Unable to calculate the image-size.");
        return null;
      }
      final Element tableCell = (Element) cellController.getNode();
      final int rowSpan = TextUtilities.parseInt
          ((String) tableCell.getAttribute(OfficeNamespaces.TABLE_NS, "number-rows-spanned"), 1);
      final int colSpan = TextUtilities.parseInt
          ((String) tableCell.getAttribute(OfficeNamespaces.TABLE_NS, "number-cols-spanned"), 1);
      if (rowSpan < 1 || colSpan < 1)
      {
        Log.warn("Rowspan or colspan for image-size calculation was invalid.");
        return null;
      }

      final LayoutController rowController = cellController.getParent();
      if (rowController == null)
      {
        Log.warn("Table-Cell has no parent. Unable to calculate the image-size.");
        return null;
      }
      final Section tableRow = (Section) rowController.getNode();
      // we are now making the assumption, that the row is a section, that contains the table-cell.
      // This breaks the ability to return nodes or to construct reports on the fly, but the OO-report format
      // is weird anyway and wont support such advanced techniques for the next few centuries ..
      final int columnPos = findNodeInSection(tableRow, tableCell);
      if (columnPos == -1)
      {
        Log.warn("Table-Cell is not a direct child of the table-row. Unable to calculate the image-size.");
        return null;
      }

      final LayoutController tableController = rowController.getParent();
      if (tableController == null)
      {
        Log.warn("Table-Row has no Table. Unable to calculate the image-size.");
        return null;
      }

      final Section table = (Section) tableController.getNode();
      // ok, we got a table, so as next we have to search for the columns now.
      final Section columns = (Section) table.findFirstChild(OfficeNamespaces.TABLE_NS, "table-columns");
      if (columns.getNodeCount() <= columnPos + colSpan)
      {
        // the colspan is to large. The table definition is therefore invalid. We do not try to fix this.
View Full Code Here

    return -1;
  }

  private LayoutController findParentCell()
  {
    LayoutController parent = getParent();
    while (parent != null)
    {
      final Object node = parent.getNode();
      if (node instanceof Element)
      {
        final Element element = (Element) node;
        if (OfficeNamespaces.TABLE_NS.equals(element.getNamespace()) && "table-cell".equals(element.getType()))
        {
          return parent;
        }
      }
      parent = parent.getParent();
    }
    return null;
  }
View Full Code Here

    // we have the data and we have our position inside the report.
    // lets generate something ...
    final FlowController flowController = createFlowControler(context, job);

    LayoutController layoutController =
        layoutFactory.create(flowController, job.getReportStructureRoot(), null);

    try
    {
      stateList.add(new PageState(target.saveState(), layoutController,
          outputProcessor.getPageCursor()));
      int logPageCount = outputProcessor.getLogicalPageCount();
      int physPageCount = outputProcessor.getPhysicalPageCount();

      while (layoutController.isAdvanceable())
      {
        layoutController = layoutController.advance(target);
        target.commit();

        while (layoutController.isAdvanceable() == false &&
               layoutController.getParent() != null)
        {
          final LayoutController parent = layoutController.getParent();
          layoutController = parent.join(layoutController.getFlowController());
        }

        // check whether a pagebreak has been encountered.
        if (target.isPagebreakEncountered())
        {
View Full Code Here

    final ReportTargetState targetState = previousState.getTargetState();
    final LibLayoutReportTarget target =
        (LibLayoutReportTarget) targetState.restore(outputProcessor);
    outputProcessor.setPageCursor(previousState.getPageCursor());

    LayoutController position = previousState.getLayoutController();

    // we have the data and we have our position inside the report.
    // lets generate something ...

    while (position.isAdvanceable())
    {
      position = position.advance(target);
      target.commit();

      // else check whether this state is finished, and try to join the subflow
      // with the parent.
      while (position.isAdvanceable() == false &&
             position.getParent() != null)
      {
        final LayoutController parent = position.getParent();
        position = parent.join(position.getFlowController());
      }

      // check whether a pagebreak has been encountered.
      if (target.isPagebreakEncountered())
      {
View Full Code Here

  {
  }

  private OfficeRepeatingStructureLayoutController getRepeatingParent()
  {
    LayoutController parent = getParent();
    while (parent != null)
    {
      if (parent instanceof OfficeRepeatingStructureLayoutController)
      {
        return (OfficeRepeatingStructureLayoutController) parent;
      }
      parent = parent.getParent();
    }
    return null;
  }
View Full Code Here

      outputProcessor.setInterceptor(interceptor);

      final LibLayoutReportTarget target =
          (LibLayoutReportTarget) targetState.restore(outputProcessor);

      LayoutController position = state.getLayoutController();

      // we have the data and we have our position inside the report.
      // lets generate something ...
      while (position.isAdvanceable())
      {
        position = position.advance(target);
        target.commit();

        while (position.isAdvanceable() == false &&
               position.getParent() != null)
        {
          final LayoutController parent = position.getParent();
          position = parent.join(position.getFlowController());
        }

        if (interceptor.isMoreContentNeeded() == false)
        {
          outputProcessor.setInterceptor(null);
View Full Code Here

  {
  }

  protected AutoTableLayoutController findTableParent ()
  {
    LayoutController parent = getParent();
    while (parent != null)
    {
      if (parent instanceof AutoTableLayoutController)
      {
        return (AutoTableLayoutController) parent;
      }

      parent = parent.getParent();
    }
    return null;
  }
View Full Code Here

          context.getLayoutControllerFactory();
      // we have the data and we have our position inside the report.
      // lets generate something ...
      final FlowController flowController = createFlowControler(context, job);

      LayoutController layoutController =
          layoutFactory.create(flowController, job.getReportStructureRoot(), null);

      while (layoutController.isAdvanceable())
      {
        layoutController = layoutController.advance(target);
        while (layoutController.isAdvanceable() == false &&
               layoutController.getParent() != null)
        {
          final LayoutController parent = layoutController.getParent();
          target.commit();
          layoutController = parent.join(layoutController.getFlowController());
        }
      }
      target.commit();
    }
  }
View Full Code Here

TOP

Related Classes of org.jfree.report.flow.layoutprocessor.LayoutController

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.