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

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


    }

    final LinkedHashSet<Element> elements = new LinkedHashSet<Element>(nodes.length);
    for (int i = 0; i < nodes.length; i++)
    {
      final RenderNode node = nodes[i];
      final Element reportElement = elementsById.get(node.getInstanceId());
      if (reportElement != null)
      {
        elements.add(reportElement);
      }
    }
View Full Code Here


    report.getReportHeader().addElement(tableSection);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);
    //ModelPrinter.print(logicalPageBox);

    final RenderNode renderedCell1 = MatchFactory.findElementByName(logicalPageBox, "c-0-0");
    assertNotNull(renderedCell1);
    assertEquals(StrictGeomUtility.toInternalValue(0), renderedCell1.getY());
    assertEquals(StrictGeomUtility.toInternalValue(0), renderedCell1.getX());
    assertEquals(StrictGeomUtility.toInternalValue(40), renderedCell1.getHeight());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell1.getWidth());

    final RenderNode renderedCell2 = MatchFactory.findElementByName(logicalPageBox, "c-0-1");
    assertNotNull(renderedCell2);
    assertEquals(StrictGeomUtility.toInternalValue(0), renderedCell2.getY());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell2.getX());
    assertEquals(StrictGeomUtility.toInternalValue(20), renderedCell2.getHeight());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell2.getWidth());

    final RenderNode renderedCell3 = MatchFactory.findElementByName(logicalPageBox, "c-1-1");
    assertNotNull(renderedCell3);
    assertEquals(StrictGeomUtility.toInternalValue(20), renderedCell3.getY());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell3.getX());
    assertEquals(StrictGeomUtility.toInternalValue(20), renderedCell3.getHeight());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell3.getWidth());

    // Validate that tableCell1 has a layouted height of 40 (2* 20)

  }
View Full Code Here

    report.getReportHeader().addElement(tableSection);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);
    //ModelPrinter.print(logicalPageBox);

    final RenderNode renderedCell1 = MatchFactory.findElementByName(logicalPageBox, "c-0-0");
    assertNotNull(renderedCell1);
    long heightCell00 = renderedCell1.getHeight();
    assertEquals(StrictGeomUtility.toInternalValue(0), renderedCell1.getY());
    assertEquals(StrictGeomUtility.toInternalValue(0), renderedCell1.getX());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell1.getWidth());

    final RenderNode renderedCell2 = MatchFactory.findElementByName(logicalPageBox, "c-0-1");
    assertNotNull(renderedCell2);
    long heightCell01 = renderedCell2.getHeight();
    assertEquals(StrictGeomUtility.toInternalValue(0), renderedCell2.getY());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell2.getX());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell2.getWidth());

    final RenderNode renderedCell3 = MatchFactory.findElementByName(logicalPageBox, "c-1-1");
    assertNotNull(renderedCell3);
    long heightCell11 = renderedCell3.getHeight();
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell3.getX());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell3.getWidth());

    Assert.assertTrue(heightCell00 > 0);
    Assert.assertTrue(heightCell01 > 0);
    Assert.assertTrue(heightCell11 > 0);
View Full Code Here

    report.getReportHeader().addElement(tableSection);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);
    //ModelPrinter.print(logicalPageBox);

    final RenderNode renderedCell1 = MatchFactory.findElementByName(logicalPageBox, "c-0-0");
    assertNotNull(renderedCell1);
    assertEquals(StrictGeomUtility.toInternalValue(0), renderedCell1.getY());
    assertEquals(StrictGeomUtility.toInternalValue(0), renderedCell1.getX());
    assertEquals(StrictGeomUtility.toInternalValue(20), renderedCell1.getHeight());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell1.getWidth());

    final RenderNode renderedCell2 = MatchFactory.findElementByName(logicalPageBox, "c-0-1");
    assertNotNull(renderedCell2);
    assertEquals(StrictGeomUtility.toInternalValue(0), renderedCell2.getY());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell2.getX());
    assertEquals(StrictGeomUtility.toInternalValue(10), renderedCell2.getHeight());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell2.getWidth());

    final RenderNode renderedCell3 = MatchFactory.findElementByName(logicalPageBox, "c-1-1");
    assertNotNull(renderedCell3);
    assertEquals(StrictGeomUtility.toInternalValue(10), renderedCell3.getY());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell3.getX());
    assertEquals(StrictGeomUtility.toInternalValue(10), renderedCell3.getHeight());
    assertEquals(StrictGeomUtility.toInternalValue(234), renderedCell3.getWidth());

    // Validate that tableCell1 has a layouted height of 40 (2* 20)

  }
View Full Code Here

    report.getReportHeader().addElement(table);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, report.getReportHeader(), false, false);
    //ModelPrinter.print(logicalPageBox);

    final RenderNode table1 = MatchFactory.findElementByName(logicalPageBox, "table");
    assertEquals(StrictGeomUtility.toInternalValue(150), table1.getWidth());
    assertEquals(StrictGeomUtility.toInternalValue(40), table1.getHeight());

    final RenderNode row1 = MatchFactory.findElementByName(logicalPageBox, "r-0");
    assertEquals(StrictGeomUtility.toInternalValue(150), row1.getWidth());
    assertEquals(StrictGeomUtility.toInternalValue(20), row1.getHeight());

    final RenderNode row2 = MatchFactory.findElementByName(logicalPageBox, "r-1");
    assertEquals(StrictGeomUtility.toInternalValue(150), row2.getWidth());
    assertEquals(StrictGeomUtility.toInternalValue(20), row2.getHeight());

    final RenderNode cell1 = MatchFactory.findElementByName(logicalPageBox, "hr-0-0");
    assertEquals(StrictGeomUtility.toInternalValue(150), cell1.getWidth());
    assertEquals(StrictGeomUtility.toInternalValue(20), cell1.getHeight());

    final RenderNode cell2 = MatchFactory.findElementByName(logicalPageBox, "dr-0-0");
    assertEquals(StrictGeomUtility.toInternalValue(150), cell2.getWidth());
    assertEquals(StrictGeomUtility.toInternalValue(20), cell2.getHeight());


  }
View Full Code Here

    table.getStyle().setStyleProperty(ElementStyleKeys.POS_X, 50f);
    report.getReportHeader().addElement(table);

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand(report, report.getReportHeader(), false, false);

    final RenderNode table1 = MatchFactory.findElementByName(logicalPageBox, "table");
    assertEquals(StrictGeomUtility.toInternalValue(300), table1.getWidth());
    assertEquals(StrictGeomUtility.toInternalValue(40), table1.getHeight());

    final RenderNode row1 = MatchFactory.findElementByName(logicalPageBox, "r-0");
    assertEquals(StrictGeomUtility.toInternalValue(300), row1.getWidth());
    assertEquals(StrictGeomUtility.toInternalValue(20), row1.getHeight());

    final RenderNode row2 = MatchFactory.findElementByName(logicalPageBox, "r-1");
    assertEquals(StrictGeomUtility.toInternalValue(300), row2.getWidth());
    assertEquals(StrictGeomUtility.toInternalValue(20), row2.getHeight());

    final RenderNode cell1 = MatchFactory.findElementByName(logicalPageBox, "hr-0-0");
    assertEquals(StrictGeomUtility.toInternalValue(150), cell1.getWidth());
    assertEquals(StrictGeomUtility.toInternalValue(20), cell1.getHeight());

    final RenderNode cell1a = MatchFactory.findElementByName(logicalPageBox, "hr-0-1");
    assertEquals(StrictGeomUtility.toInternalValue(150), cell1a.getWidth());
    assertEquals(StrictGeomUtility.toInternalValue(20), cell1a.getHeight());

    final RenderNode cell2 = MatchFactory.findElementByName(logicalPageBox, "dr-0-0");
    assertEquals(StrictGeomUtility.toInternalValue(150), cell2.getWidth());
    assertEquals(StrictGeomUtility.toInternalValue(20), cell2.getHeight());

    final RenderNode cell2a = MatchFactory.findElementByName(logicalPageBox, "dr-0-1");
    assertEquals(StrictGeomUtility.toInternalValue(150), cell2a.getWidth());
    assertEquals(StrictGeomUtility.toInternalValue(20), cell2a.getHeight());

  }
View Full Code Here

    report.getReportHeader().getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, Color.YELLOW);
    report.getReportFooter().clear();

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);

    RenderNode second = MatchFactory.findElementByName(logicalPageBox, "second");
    assertTrue(second instanceof RenderBox);

    ExcelOutputProcessorMetaData metaData = new ExcelOutputProcessorMetaData(ExcelOutputProcessorMetaData.PAGINATION_FULL);
    metaData.initialize(report.getConfiguration());
View Full Code Here

    report.getReportHeader().getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, Color.YELLOW);
    report.getReportFooter().clear();

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);

    RenderNode second = MatchFactory.findElementByName(logicalPageBox, "second");
    assertTrue(second instanceof RenderBox);

    HtmlRenderingSetup setup = new HtmlRenderingSetup(report);
    HtmlTextExtractor te = setup.createTextExtractor();
View Full Code Here

    ResourceManager mgr = new ResourceManager();
    MasterReport report = (MasterReport) mgr.createDirectly(resource, MasterReport.class).getResource();
    report.getReportConfiguration().setConfigProperty(ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "true");

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);
    RenderNode first = MatchFactory.findElementByName(logicalPageBox, "first");
    assertNotNull(first);
    assertTrue(first.getHeight() > StrictGeomUtility.toInternalValue(20));

    RenderNode[] elementsByNodeType = MatchFactory.findElementsByNodeType(first, LayoutNodeTypes.TYPE_NODE_COMPLEX_TEXT);
    assertEquals(1, elementsByNodeType.length);
    assertTrue(elementsByNodeType[0] instanceof RenderableComplexText);

    RenderableComplexText text = (RenderableComplexText) elementsByNodeType[0];
    RichTextSpec richText = text.getRichText();
    assertEquals(4, richText.getStyleChunks().size());
    assertEquals("Label@LabelLabel", richText.getText());

    RenderNode second = MatchFactory.findElementByName(logicalPageBox, "second");
    assertTrue(second instanceof ParagraphRenderBox);
    ParagraphRenderBox p = (ParagraphRenderBox) second;
    assertTrue(p.getPool().getFirstChild().getNext() instanceof RenderableReplacedContentBox);

    assertTrue(second.getHeight() > StrictGeomUtility.toInternalValue(20));
    RenderNode[] secondText = MatchFactory.findElementsByNodeType(second, LayoutNodeTypes.TYPE_NODE_COMPLEX_TEXT);
    assertTrue(secondText.length > 10); // this is an approximate value. There is no safe stable value with complex text
    assertTrue(secondText[0] instanceof RenderableComplexText);
  }
View Full Code Here

    report.getReportHeader().removeElement(report.getReportHeader().getElement(0));
    report.getReportHeader().getElement(0).getStyle().setStyleProperty(TextStyleKeys.DIRECTION, TextDirection.RTL);

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);

    RenderNode second = MatchFactory.findElementByName(logicalPageBox, "second");
    assertTrue(second instanceof ParagraphRenderBox);
    ParagraphRenderBox p = (ParagraphRenderBox) second;
    assertTrue(p.getPool().getFirstChild().getNext() instanceof RenderableReplacedContentBox);

    ParagraphLineBreakStep step = new ParagraphLineBreakStep();
View Full Code Here

TOP

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

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.