Package org.jfree.report.structure

Examples of org.jfree.report.structure.Node


  {
    final Node[] nodes = getNodes();
    int index = getIndex() + 1;
    for (; index < nodes.length; index++)
    {
      final Node node = nodes[index];
      if (node.isEnabled())
      {
        break;
      }
    }
View Full Code Here


  protected LayoutController processContent(final ReportTarget target)
      throws DataSourceException, ReportProcessingException, ReportDataFactoryException
  {

    final Node node = getElement();
    final FlowController flowController = getFlowController();
    final LayoutExpressionRuntime er =
        LayoutControllerUtil.getExpressionRuntime(flowController, node);
    final ContentElement element = (ContentElement) node;
    final Expression ex = element.getValueExpression();
    final Object value;

    if (ex != null)
    {
      try
      {
        ex.setRuntime(er);
        value = ex.computeValue();
      }
      finally
      {
        ex.setRuntime(null);
      }
    }
    else
    {
      value = null;
    }

    // This should be a very rare case indeed ..
    if (value instanceof DataFlags)
    {
      target.processContent((DataFlags) value);

      final ContentElementLayoutController derived = (ContentElementLayoutController) clone();
      derived.setProcessingState(ElementLayoutController.FINISHING);
      derived.setFlowController(flowController);
      return derived;
    }

    if (value instanceof Node)
    {
      // we explictly allow structural content here.
      // As this might be a very expensive thing, if we
      // keep it in a single state, we continue on a separate state.
      final Node valueNode = (Node) value;
      valueNode.updateParent(node.getParent());
      final ReportContext reportContext = flowController.getReportContext();
      final LayoutControllerFactory layoutControllerFactory =
          reportContext.getLayoutControllerFactory();

      // actually, this is the same as if the element were a
View Full Code Here

                                     final Node n)
  {
    final Node[] nodes = parentSection.getNodeArray();
    for (int i = 0; i < nodes.length; i++)
    {
      final Node node = nodes[i];
      if (node == n)
      {
        return i;
      }
    }
View Full Code Here

   */
  public static boolean isGroupFinished(final FlowController fc,
                                        final Node node)
      throws DataSourceException
  {
    final Node nodeParent = node.getParent();
    if (nodeParent == null)
    {
      return false;
    }
    Group group = nodeParent.getGroup();
    if (group == null)
    {
      return false;
    }

    // maybe we can move this state into the layoutstate itself so that
    // we do not have to rebuild that crap all the time.
    LayoutExpressionRuntime ler = null;

    // OK, now we are almost complete.
    while (group != null)
    {
      if (ler == null)
      {
        ler = getExpressionRuntime(fc, node);
      }

      ler.setDeclaringParent(group);

      final Expression groupingExpression = group.getGroupingExpression();
      if (groupingExpression != null)
      {
        groupingExpression.setRuntime(ler);
        final Object groupFinished;
        try
        {
          groupFinished = groupingExpression.computeValue();
        }
        finally
        {
          groupingExpression.setRuntime(null);
        }

        if (Boolean.TRUE.equals(groupFinished))
        {
          // If the group expression returns true, we should pack our belongings
          // and stop with that process. The group is finished.

          // In Cobol, this would mean that one of the group-fields has changed.
          return true;
        }
      }

      final Node parent = group.getParent();
      if (parent == null)
      {
        group = null;
      }
      else
      {
        group = parent.getGroup();
      }
    }
    return false;
  }
View Full Code Here

  private void writeSectionChilds(final Node[] nodes)
      throws IOException
  {
    for (int i = 0; i < nodes.length; i++)
    {
      final Node node = nodes[i];
      if (node instanceof Section)
      {
        writeSection((Section) node);
      }
      else if (node instanceof Element)
View Full Code Here

        final Node[] nodes = tableRow.getNodeArray();
        final String namespace = tableCell.getNamespace();
        final String type = tableCell.getType();
        for (int i = 0; i < nodes.length; i++)
        {
            final Node node = nodes[i];
            if (!(node instanceof Element))
            {
                continue;
            }
            final Element child = (Element) node;
View Full Code Here

        final Section s = (Section) element;
        int rowCount = 0;
        final Node[] nodeArray = s.getNodeArray();
        for (int i = 0; i < nodeArray.length; i++)
        {
            final Node node = nodeArray[i];
            if (node instanceof Element)
            {
                final Element child = (Element) node;
                if (OfficeNamespaces.TABLE_NS.equals(child.getNamespace()) &&
                        OfficeToken.TABLE_ROW.equals(child.getType()))
View Full Code Here

        {
            // tables.add(section);
            final Node[] nodeArray = section.getNodeArray();
            for (int i = 0; i < nodeArray.length; i++)
            {
                final Node node = nodeArray[i];
                tables.add(node);
            }

        }
    }
View Full Code Here

    private void addFromBody(final List tables, final Section section)
    {
        final Node[] nodeArray = section.getNodeArray();
        for (int i = 0; i < nodeArray.length; i++)
        {
            final Node node = nodeArray[i];
            if (node instanceof Section)
            {
                final Section child = (Section) node;
                if (node instanceof OfficeGroup)
                {
View Full Code Here

    private void addFromGroup(final List tables, final Section section)
    {
        final Node[] nodeArray = section.getNodeArray();
        for (int i = 0; i < nodeArray.length; i++)
        {
            final Node node = nodeArray[i];
            if (node instanceof Section)
            {
                final Section element = (Section) node;
                if (JFreeReportInfo.REPORT_NAMESPACE.equals(element.getNamespace()) && "group-body".equals(element.getType()))
                {
View Full Code Here

TOP

Related Classes of org.jfree.report.structure.Node

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.