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

Examples of org.pentaho.reporting.engine.classic.core.layout.model.context.StaticBoxLayoutProperties


    {
      return;
    }

    final BoxDefinition bdef = box.getBoxDefinition();
    final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
    box.setCachedX(x);
    // next, compute the width ...

    final long leftPadding = blp.getBorderLeft() + bdef.getPaddingLeft();
    final long rightPadding = blp.getBorderRight() + bdef.getPaddingRight();

    // computed width is box-size, so it contains the paddings already
    final long computedWidth = box.getComputedWidth();

    final long bcw = ProcessUtility.computeBlockContextWidth(box);
View Full Code Here


   * @param box
   */
  private void applyStrictComputedWidth(final RenderBox box)
  {
    final BoxDefinition bdef = box.getBoxDefinition();
    final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
    // next, compute the width ...

    final long leftPadding = blp.getBorderLeft() + bdef.getPaddingLeft();
    final long rightPadding = blp.getBorderRight() + bdef.getPaddingRight();

    // computed width is box-size, so it contains the paddings already
    final long computedWidth = box.getComputedWidth();
    final long contentAreaX1 = box.getContentAreaX1();
    long usedX2 = box.getContentAreaX2();
View Full Code Here

    {
      // if an explicit preferred width was set, we accept it unchallenged.

      final long x = box.getCachedX();
      final long contentEnd = box.getContentAreaX2();
      final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
      final BoxDefinition bdef = box.getBoxDefinition();
      final long boxEnd = contentEnd + blp.getBorderRight() + bdef.getPaddingRight();
      box.setCachedWidth(boxEnd - x);
      return;
    }


    long nodeX2 = box.getContentAreaX2();
    if (box.getStyleSheet().getBooleanStyleProperty(ElementStyleKeys.USE_MIN_CHUNKWIDTH))
    {
      RenderNode node = box.getFirstChild();
      while (node != null)
      {
        final long nodeWidth = node.getCachedWidth() + node.getCachedX();
        if (nodeWidth > nodeX2)
        {
          nodeX2 = nodeWidth;
        }
        node = node.getNext();
      }
    }

    // now apply the maximum X2 we just computed ..

    final long x = box.getCachedX();
    final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
    final BoxDefinition bdef = box.getBoxDefinition();
    final long boxEnd = nodeX2 + blp.getBorderRight() + bdef.getPaddingRight();
    box.setCachedWidth(boxEnd - x);
  }
View Full Code Here

        // 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
View Full Code Here

    }

    this.pinned = -1;
    this.boxDefinition = boxDefinition;
    this.open = true;
    this.staticBoxLayoutProperties = new StaticBoxLayoutProperties();
    this.staticBoxPropertiesAge = -1;
    this.staticBoxLayoutProperties.setBreakAfter
        (getStyleSheet().getBooleanStyleProperty(BandStyleKeys.PAGEBREAK_AFTER));
    this.stateKey = stateKey;
  }
View Full Code Here

  private AttributeList createBoxAttributeList(final RenderBox box)
  {
    final AttributeList attributeList = new AttributeList();
    final BoxDefinition definition = box.getBoxDefinition();
    final Border border = definition.getBorder();
    final StaticBoxLayoutProperties sblp = box.getStaticBoxLayoutProperties();

    final BorderEdge top = border.getTop();
    if (BorderEdge.EMPTY.equals(top) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-color",
          ColorValueConverter.colorToString(top.getColor()));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-width",
          String.valueOf(StrictGeomUtility.toExternalValue(sblp.getBorderTop())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-style",
          String.valueOf(top.getBorderStyle()));
    }

    final BorderEdge left = border.getLeft();
    if (BorderEdge.EMPTY.equals(left) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-color",
          ColorValueConverter.colorToString(left.getColor()));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-width",
          String.valueOf(StrictGeomUtility.toExternalValue(sblp.getBorderLeft())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-style",
          String.valueOf(left.getBorderStyle()));
    }

    final BorderEdge bottom = border.getBottom();
    if (BorderEdge.EMPTY.equals(bottom) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-color",
          ColorValueConverter.colorToString(bottom.getColor()));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-width",
          String.valueOf(StrictGeomUtility.toExternalValue(sblp.getBorderBottom())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-style",
          String.valueOf(bottom.getBorderStyle()));
    }

    final BorderEdge right = border.getRight();
    if (BorderEdge.EMPTY.equals(right) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-color",
          ColorValueConverter.colorToString(right.getColor()));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-width",
          String.valueOf(StrictGeomUtility.toExternalValue(sblp.getBorderRight())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-style",
          String.valueOf(right.getBorderStyle()));
    }

    final BorderCorner topLeft = border.getTopLeft();
    if (isEmptyCorner(topLeft) == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-left-x",
          String.valueOf(StrictGeomUtility.toExternalValue(topLeft.getWidth())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-left-y",
          String.valueOf(StrictGeomUtility.toExternalValue(topLeft.getHeight())));
    }

    final BorderCorner topRight = border.getTopRight();
    if (isEmptyCorner(topRight) == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-right-x",
          String.valueOf(StrictGeomUtility.toExternalValue(topRight.getWidth())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-right-y",
          String.valueOf(StrictGeomUtility.toExternalValue(topRight.getHeight())));
    }

    final BorderCorner bottomLeft = border.getBottomLeft();
    if (isEmptyCorner(bottomLeft) == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-left-x",
          String.valueOf(StrictGeomUtility.toExternalValue(bottomLeft.getWidth())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-left-y",
          String.valueOf(StrictGeomUtility.toExternalValue(bottomLeft.getHeight())));
    }

    final BorderCorner bottomRight = border.getBottomRight();
    if (isEmptyCorner(bottomRight) == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-right-x",
          String.valueOf(StrictGeomUtility.toExternalValue(bottomRight.getWidth())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-right-y",
          String.valueOf(StrictGeomUtility.toExternalValue(bottomRight.getHeight())));
    }

    if (sblp.getMarginTop() > 0)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "margin-top",
          String.valueOf(StrictGeomUtility.toExternalValue(sblp.getMarginTop())));
    }
    if (sblp.getMarginLeft() > 0)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "margin-left",
          String.valueOf(StrictGeomUtility.toExternalValue(sblp.getMarginLeft())));
    }
    if (sblp.getMarginBottom() > 0)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "margin-bottom",
          String.valueOf(StrictGeomUtility.toExternalValue(sblp.getMarginBottom())));
    }
    if (sblp.getMarginRight() > 0)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "margin-right",
          String.valueOf(StrictGeomUtility.toExternalValue(sblp.getMarginRight())));
    }

    if (definition.getPaddingTop() > 0)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "padding-top",
View Full Code Here

        // In this case, we can skip the replace-action below ..
        return true;
      }
    }

    final StaticBoxLayoutProperties sblp = box.getStaticBoxLayoutProperties();
    final long insetsTop = sblp.getBorderTop() + box.getBoxDefinition().getPaddingTop();

    // So lets get started. We remove all nodes between (and inclusive)
    // node and last.
    final long width = box.getContentAreaX2() - box.getContentAreaX1();
    final long lastY2;
View Full Code Here

    if (box.getTextEllipseBox() != null)
    {
      return false;
    }

    final StaticBoxLayoutProperties sblp = box.getStaticBoxLayoutProperties();
    final BoxDefinition bdef = box.getBoxDefinition();
    final long boxContentX2 = (box.getX() + box.getWidth() - bdef.getPaddingRight() - sblp.getBorderRight());
    if (boxContentX2 > getContentAreaX2())
    {
      // This is an overflow. Compute the text-ellipse ..
      final RenderBox textEllipseBox = processTextEllipse(box, getContentAreaX2());
      box.setTextEllipseBox(textEllipseBox);
View Full Code Here

        // we have a silbling. Position yourself directly below your silbling ..
        return (marginTop + prev.getCachedY() + prev.getCachedHeight());
      }
      else
      {
        final StaticBoxLayoutProperties blp = parent.getStaticBoxLayoutProperties();
        final BoxDefinition bdef = parent.getBoxDefinition();
        final long insetTop = (blp.getBorderTop() + bdef.getPaddingTop());

        return (marginTop + insetTop + parent.getCachedY());
      }
    }
    else
View Full Code Here

    }

    final long rminH = minimumHeight.resolve(resolveSize, 0);
    final long rmaxH = maximumHeight.resolve(resolveSize, CanvasMajorAxisLayoutStep.MAX_AUTO);

    final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
    final long insetBottom = blp.getBorderBottom() + boxDefinition.getPaddingBottom();
    final long insetTop = blp.getBorderTop() + boxDefinition.getPaddingTop();
//todo
    final long computedContentHeight;
    if (boxDefinition.isSizeSpecifiesBorderBox())
    {
      final long rprefH = preferredHeight.resolve(resolveSize, usedHeight + insetTop + insetBottom);
View Full Code Here

TOP

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

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.