Package org.pentaho.reporting.engine.classic.core.layout.model

Examples of org.pentaho.reporting.engine.classic.core.layout.model.LogicalPageBox


    // Test whether the final page has out-of-bounds boxes. The FillPhysicalPages step should have removed them
    final PrintReportProcessor rp = new PrintReportProcessor(report);
    for (int page = 0; page < rp.getNumberOfPages(); page += 1)
    {
      final PhysicalPageDrawable pageDrawable = (PhysicalPageDrawable) rp.getPageDrawable(page);
      final LogicalPageBox logicalPageBox = pageDrawable.getPageDrawable().getLogicalPageBox();

      //ModelPrinter.print(logicalPageBox);
      //if (true) return;
      final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, new ElementMatcher(TableRowRenderBox.class));
      for (int i = 0; i < all.length; i += 1)
      {
        final RenderNode node = all[i];
        // temporary workaround:
        final RenderBox parent = node.getParent();
        if (parent instanceof TableSectionRenderBox)
        {
          final TableSectionRenderBox parentBox = (TableSectionRenderBox) parent;
          if (parentBox.getDisplayRole() != TableSectionRenderBox.Role.BODY)
          {
            continue;
          }
        }

        assertFalse((node.getY() + node.getHeight()) <= logicalPageBox.getPageOffset());
        assertFalse(node.getY() >= logicalPageBox.getPageEnd());

        if (node.getY() < logicalPageBox.getPageEnd() &&
            (node.getY() + node.getHeight()) > logicalPageBox.getPageEnd())
        {
          fail(" y=" + node.getY() + " height=" + node.getHeight());
        }
      }
    }
View Full Code Here


    final PrintReportProcessor rp = new PrintReportProcessor(report);
    for (int page = 0; page < rp.getNumberOfPages(); page += 1)
    {

      final PhysicalPageDrawable pageDrawable = (PhysicalPageDrawable) rp.getPageDrawable(page);
      final LogicalPageBox logicalPageBox = pageDrawable.getPageDrawable().getLogicalPageBox();


//      new FileModelPrinter("Prd-3930-page-" + page + "-", DebugReportRunner.createTestOutputFile()).print(logicalPageBox);

      final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, new ElementMatcher(TableRowRenderBox.class));
      for (int i = 0; i < all.length; i += 1)
      {
        final RenderNode node = all[i];
        // temporary workaround:
        final RenderBox parent = node.getParent();
        if (parent instanceof TableSectionRenderBox)
        {
          final TableSectionRenderBox parentBox = (TableSectionRenderBox) parent;
          if (parentBox.getDisplayRole() != TableSectionRenderBox.Role.BODY)
          {
            continue;
          }
        }

        try
        {
          assertFalse((node.getY() + node.getHeight()) <= logicalPageBox.getPageOffset());
          assertFalse(node.getY() >= logicalPageBox.getPageEnd());

          if (node.getY() < logicalPageBox.getPageEnd() &&
              (node.getY() + node.getHeight()) > logicalPageBox.getPageEnd())
          {
            fail(" y=" + node.getY() + " height=" + node.getHeight());
          }
        }
        catch (AssertionFailedError afe)
View Full Code Here

    final PrintReportProcessor rp = new PrintReportProcessor(report);
    DebugLog.log("Pages: " + rp.getNumberOfPages());
    for (int page = 0; page < rp.getNumberOfPages(); page += 1)
    {
      final PhysicalPageDrawable pageDrawable = (PhysicalPageDrawable) rp.getPageDrawable(page);
      final LogicalPageBox logicalPageBox = pageDrawable.getPageDrawable().getLogicalPageBox();

      //ModelPrinter.print(logicalPageBox);
      //if (true) return;
      final RenderNode[] all = MatchFactory.matchAll(logicalPageBox, new ElementMatcher(TableRowRenderBox.class));
      for (int i = 0; i < all.length; i += 1)
      {
        final RenderNode node = all[i];
        // temporary workaround:
        final RenderBox parent = node.getParent();
        if (parent instanceof TableSectionRenderBox)
        {
          final TableSectionRenderBox parentBox = (TableSectionRenderBox) parent;
          if (parentBox.getDisplayRole() != TableSectionRenderBox.Role.BODY)
          {
            continue;
          }
        }

        assertFalse((node.getY() + node.getHeight()) <= logicalPageBox.getPageOffset());
        assertFalse(node.getY() >= logicalPageBox.getPageEnd());
      }
    }
  }
View Full Code Here

    addLabel("Text 1", b, 20);
    addLabel("Text 2", b, 40);

    header.addElement(b);

    final LogicalPageBox logicalPageBox =
        DebugReportRunner.layoutSingleBand(report, report.getReportHeader(), false, false);
    // simple test, we assert that all paragraph-poolboxes are on either 485000 or 400000
    // and that only two lines exist for each
//    ModelPrinter.print(logicalPageBox);
    new ValidateRunner().startValidation(logicalPageBox);
View Full Code Here

    // to enable the complex-processing mode, set this configuration option to true
    report.getReportConfiguration().setConfigProperty
        (ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "true");

    ReportHeader reportHeader = report.getReportHeader();
    LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, reportHeader);

    // this creates a print-out of the layout. This is great to quickly see what the layouter produces.
    ModelPrinter.INSTANCE.print(logicalPageBox);

    // use the MatchFactory to quickly locate elements inside the layout model
View Full Code Here

    ReportHeader reportHeader = report.getReportHeader();
    reportHeader.setLayout(BandStyleKeys.LAYOUT_ROW);
    reportHeader.addElement(b);
    reportHeader.getStyle().setStyleProperty(ElementStyleKeys.INVISIBLE_CONSUMES_SPACE, false);

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, reportHeader);

    RenderNode[] elementsByNodeType = MatchFactory.findElementsByNodeType(logicalPageBox, LayoutNodeTypes.TYPE_NODE_TEXT);
    Assert.assertEquals(0, elementsByNodeType.length);
  }
View Full Code Here

    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();
    report.setCompatibilityLevel(ClassicEngineBoot.computeVersionId(4, 0, 0));

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);
    //ModelPrinter.print(logicalPageBox);
  }
View Full Code Here

    report.getReportConfiguration().setConfigProperty(ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "false");
    ReportHeader reportHeader = report.getReportHeader();
    reportHeader.setLayout(BandStyleKeys.LAYOUT_ROW);
    reportHeader.addElement(b);

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, reportHeader);
    RenderNode[] elementsByNodeType = MatchFactory.findElementsByNodeType(logicalPageBox, LayoutNodeTypes.TYPE_NODE_TEXT);
    Assert.assertEquals(1, elementsByNodeType.length);
  }
View Full Code Here

    reportHeader.setLayout(BandStyleKeys.LAYOUT_ROW);
    reportHeader.addElement(TableTestUtil.createDataItem("Test"));
    reportHeader.getStyle().setStyleProperty(ElementStyleKeys.INVISIBLE_CONSUMES_SPACE, false);
    reportHeader.setVisible(false);

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, reportHeader);
    RenderNode[] elementsByNodeType = MatchFactory.findElementsByNodeType(logicalPageBox, LayoutNodeTypes.TYPE_NODE_TEXT);
    Assert.assertEquals(0, elementsByNodeType.length);
  }
View Full Code Here

    reportHeader.setLayout(BandStyleKeys.LAYOUT_ROW);
    reportHeader.addElement(test);
    reportHeader.getStyle().setStyleProperty(ElementStyleKeys.INVISIBLE_CONSUMES_SPACE, false);
    reportHeader.setVisible(false);

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, reportHeader);
    RenderNode[] elementsByNodeType = MatchFactory.findElementsByNodeType(logicalPageBox, LayoutNodeTypes.TYPE_NODE_TEXT);
    Assert.assertEquals(0, elementsByNodeType.length);
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.layout.model.LogicalPageBox

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.