Examples of RenderBox


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

  protected void processParagraphChilds(final ParagraphRenderBox box)
  {
    if (box.isComplexParagraph())
    {
      final RenderBox lineboxContainer = box.getLineboxContainer();
      RenderNode node = lineboxContainer.getFirstChild();
      while (node != null)
      {
        // all childs of the linebox container must be inline boxes. They
        // represent the lines in the paragraph. Any other element here is
        // a error that must be reported
View Full Code Here

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

    return leftProcessor;
  }

  private long computeBlockPosition(final RenderNode node)
  {
    final RenderBox parent = node.getParent();
    if (parent == null)
    {
      return 0;
    }
    return parent.getContentAreaX1();
  }
View Full Code Here

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

    return parent.getContentAreaX1();
  }

  private long computeCanvasPosition(final RenderNode node)
  {
    final RenderBox parent = node.getParent();
    if (parent == null)
    {
      return 0;
    }

    final long contentAreaX1 = parent.getContentAreaX1();
    final long bcw = ProcessUtility.computeBlockContextWidth(node);
    final double posX = node.getNodeLayoutProperties().getPosX();
    final long position = RenderLength.resolveLength(bcw, posX);
    return (contentAreaX1 + position);
  }
View Full Code Here

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

  {
    // we have no margins yet ..
    final long marginLeft = 0;

    // The y-position of a box depends on the parent.
    final RenderBox parent = node.getParent();

    // A table row is something special. Although it is a block box,
    // it layouts its children from left to right
    if (parent != null)
    {
      final RenderNode prev = node.getPrev();
      if (prev != null)
      {
        // we have a silbling. Position yourself directly below your silbling ..
        return (marginLeft + prev.getCachedX() + prev.getCachedWidth());
      }
      else
      {
        final StaticBoxLayoutProperties blp = parent.getStaticBoxLayoutProperties();
        final BoxDefinition bdef = parent.getBoxDefinition();
        final long insetLeft = (blp.getBorderLeft() + bdef.getPaddingLeft());

        return (marginLeft + insetLeft + parent.getCachedX());
      }
    }
    else
    {
      // there's no parent ..
View Full Code Here

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

    {
      xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "row", XmlWriter.OPEN);

      for (short col = 0; col < columnCount; col++)
      {
        final RenderBox content = contentProducer.getContent(row, col);

        if (content == null)
        {
          final int sectionType = contentProducer.getSectionType(row, col);
          final CellBackground background = cellBackgroundProducer.getBackgroundAt
              (logicalPageBox, sheetLayout, col, row, true, sectionType);
          if (background == null)
          {
            xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "empty-cell", XmlWriter.CLOSE);
            continue;
          }

          // A empty cell with a defined background ..
          xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "empty-cell", createCellAttributes(background),
              XmlWriter.OPEN);

          writeAttributes(background.getAttributes(), background.getElementType());
          xmlWriter.writeCloseTag();
          continue;
        }

        if (content.isCommited() == false)
        {
          throw new InvalidReportStateException("Uncommited content encountered");
        }

        final TableRectangle rectangle = sheetLayout.getTableBounds
            (content.getX(), content.getY(), content.getWidth(), content.getHeight(), null);
        if (rectangle.isOrigin(col, row) == false)
        {
          // A spanned cell ..
          xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "spanned-cell", XmlWriter.CLOSE);
          continue;
        }

        final int sectionType = contentProducer.getSectionType(row, col);
        final CellBackground realBackground = cellBackgroundProducer.getBackgroundAt
            (logicalPageBox, sheetLayout, rectangle.getX1(), rectangle.getY1(), rectangle.getColumnSpan(),
                rectangle.getRowSpan(), false, sectionType);

        final AttributeList attributeList;
        if (realBackground != null)
        {
          attributeList = createCellAttributes(realBackground);
        }
        else
        {
          attributeList = new AttributeList();
        }
        attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "row-span", String.valueOf(
            rectangle.getRowSpan()));
        attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "col-span", String.valueOf(
            rectangle.getColumnSpan()));
        attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "href",
            (String) content.getStyleSheet().getStyleProperty(ElementStyleKeys.HREF_TARGET));
        attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "href-window",
            (String) content.getStyleSheet().getStyleProperty(ElementStyleKeys.HREF_WINDOW));
        attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "href-title",
            (String) content.getStyleSheet().getStyleProperty(ElementStyleKeys.HREF_TITLE));

        // export the cell and all content ..
        xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "cell", attributeList, XmlWriter.OPEN);
        processBoxChilds(content);
        xmlWriter.writeCloseTag();
        content.setFinished(true);
      }
      xmlWriter.writeCloseTag();
    }
    xmlWriter.writeCloseTag();
  }
View Full Code Here

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

      final double lastRowHeight = StrictGeomUtility.toExternalValue(sheetLayout.getRowHeight(row));
      hssfRow.setHeightInPoints((float) (lastRowHeight));

      for (short col = 0; col < colCount; col++)
      {
        final RenderBox content = contentProducer.getContent(row, col);
        if (content == null)
        {
          final int sectionType = contentProducer.getSectionType(row, col);
          final CellBackground background =
              cellBackgroundProducer.getBackgroundAt(logicalPage, sheetLayout, col, row, 1, 1, false, sectionType);
          if (background == null)
          {
            if (row == 0 && col == 0)
            {
              // create a single cell, so that we dont run into nullpointer inside POI..
              getCellAt(col, row);
            }
            // An empty cell .. ignore
            continue;
          }

          // A empty cell with a defined background ..
          final Cell cell = getCellAt(col, row);
          final CellStyle style = cellStyleProducer.createCellStyle(null, background);
          if (style != null)
          {
            cell.setCellStyle(style);
          }
          continue;
        }

        if (content.isCommited() == false)
        {
          throw new InvalidReportStateException("Uncommited content encountered");
        }

        final long contentOffset = contentProducer.getContentOffset(row, col);
        final TableRectangle rectangle = sheetLayout.getTableBounds
            (content.getX(), content.getY() + contentOffset,
                content.getWidth(), content.getHeight(), null);
        if (rectangle.isOrigin(col, row) == false)
        {
          // A spanned cell ..
          continue;
        }

        final int sectionType = contentProducer.getSectionType(row, col);
        final CellBackground realBackground = cellBackgroundProducer.getBackgroundAt
            (logicalPage, sheetLayout,
                rectangle.getX1(), rectangle.getY1(), rectangle.getColumnSpan(), rectangle.getRowSpan(), false, sectionType);

        // export the cell and all content ..

        final Cell cell = getCellAt(col, row);
        final CellStyle style = cellStyleProducer.createCellStyle(content, realBackground);
        if (style != null)
        {
          cell.setCellStyle(style);
        }

        if (applyCellValue(metaData, content, cell, sheetLayout, rectangle, contentOffset))
        {
          mergeCellRegion(rectangle, row, col, sheetLayout, logicalPage, content, contentProducer);
        }

        content.setFinished(true);
      }

    }

    if (incremental == false)
View Full Code Here

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

    }

    if (nodeType == LayoutNodeTypes.TYPE_BOX_BREAKMARK)
    {

      final RenderBox parent = box.getParent();
      if (parent == null)
      {
        // No parent? Unlikely and should not happen. Throw an assert-failure
        throw new IllegalStateException("Encountered a render-node that has no parent. How can that be?");
      }

      // A breakmark box must be translated into a finished node, so that we consume space without
      // triggering yet another break. The finished node will consume all space up to the next pagebreak.
      final long width = box.getContentAreaX2() - box.getContentAreaX1();
      final RenderNode prevSilbling = box.getPrev();
      if (prevSilbling == null)
      {
        // Node is first, so the parent's y is the next edge we take care of.
        final long y = parent.getY();
        final long y2 = Math.max(pageOffset, box.getY() + box.getHeight());
        parent.replaceChild(box, new FinishedRenderNode(width, y2 - y, 0, 0, true));
      }
      else
      {
        final long y = prevSilbling.getY() + prevSilbling.getHeight();
        final long y2 = Math.max(pageOffset, box.getY() + box.getHeight());
        parent.replaceChild(box, new FinishedRenderNode(width, y2 - y, 0, 0, true));
      }
    }

    if (box.isFinished() == false)
    {
View Full Code Here

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

      return true;
    }

    if ((node.getNodeType() & LayoutNodeTypes.MASK_BOX_BLOCK) == LayoutNodeTypes.MASK_BOX_BLOCK)
    {
      final RenderBox box = (RenderBox) node;
      final RenderNode lastChild = box.getLastChild();
      if (lastChild != null)
      {
        return isBreakAfter(lastChild);
      }
    }
View Full Code Here

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

        }
        finishInlineBox(box);
      }
      else if ((nodeType & LayoutNodeTypes.MASK_BOX_ROW) == LayoutNodeTypes.MASK_BOX_ROW)
      {
        final RenderBox box = (RenderBox) node;
        if (startRowBox(box))
        {
          processBoxChilds(box);
        }
        finishRowBox(box);
      }
      else
      {
        final RenderBox box = (RenderBox) node;
        if (startOtherBox(box))
        {
          processBoxChilds(box);
        }
        finishOtherBox(box);
View Full Code Here

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

          if (((lastChild.getNodeType() & LayoutNodeTypes.MASK_BOX) == LayoutNodeTypes.MASK_BOX) == false)
          {
            lastChild = lastChild.getPrev();
            continue;
          }
          final RenderBox lastBox = (RenderBox) lastChild;
          if (updateStateKeyDeep(lastBox))
          {
            return true;
          }
          lastChild = lastBox.getPrev();
        }
        return false;
      }
    }
    else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.