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

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


  protected void computeInlineBlock(final RenderBox box,
                                    final long position,
                                    final long itemElementWidth)
  {
    final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
    box.setCachedX(position + blp.getMarginLeft());
    final long width = itemElementWidth - blp.getMarginLeft() - blp.getMarginRight();
    if (width == 0)
    {
      //ModelPrinter.printParents(box);

      throw new IllegalStateException("A box without any width? " +
          Integer.toHexString(System.identityHashCode(box)) + ' ' + box.getClass());
    }
    box.setCachedWidth(width);

    final BoxDefinition bdef = box.getBoxDefinition();
    final long leftInsets = bdef.getPaddingLeft() + blp.getBorderLeft();
    final long rightInsets = bdef.getPaddingRight() + blp.getBorderRight();
    box.setContentAreaX1(box.getCachedX() + leftInsets);
    box.setContentAreaX2(box.getCachedX() + box.getCachedWidth() - rightInsets);

    final InfiniteMinorAxisLayoutStep layoutStep = new InfiniteMinorAxisLayoutStep(metaData);
    layoutStep.continueComputation(getPageGrid(), box);
View Full Code Here


        box.getStaticBoxLayoutProperties().setBlockContextWidth(0);
      }
      else
      {
        final BoxDefinition boxDefinition = box.getBoxDefinition();
        final StaticBoxLayoutProperties sblp = box.getStaticBoxLayoutProperties();
        final long insets = sblp.getBorderLeft() + sblp.getBorderRight() +
            boxDefinition.getPaddingLeft() + boxDefinition.getPaddingRight();
        box.getStaticBoxLayoutProperties().setBlockContextWidth(Math.max(0, computedWidth - insets));
      }
    }
View Full Code Here

      final Shape borderShape = getBorderShape();
      g2d.setColor(backgroundColor);
      g2d.fill(borderShape);
    }

    final StaticBoxLayoutProperties sblp = this.staticBoxLayoutProperties;
    if (sblp.getBorderTop() > 0)
    {
      final BorderEdge borderEdge = border.getTop();
      final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderTop());
      if (basicStroke != null)
      {
        g2d.setColor(borderEdge.getColor());
        g2d.setStroke(basicStroke);
        g2d.draw(getBorderTopShape());
      }
    }

    if (sblp.getBorderRight() > 0)
    {
      final BorderEdge borderEdge = border.getRight();
      final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderRight());
      if (basicStroke != null)
      {
        g2d.setColor(borderEdge.getColor());
        g2d.setStroke(basicStroke);
        g2d.draw(getBorderRightShape());
      }
    }

    if (sblp.getBorderBottom() > 0)
    {
      final BorderEdge borderEdge = border.getBottom();
      final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderBottom());
      if (basicStroke != null)
      {
        g2d.setColor(borderEdge.getColor());
        g2d.setStroke(basicStroke);
        g2d.draw(getBorderBottomShape());
      }
    }

    if (sblp.getBorderLeft() > 0)
    {
      final BorderEdge borderEdge = border.getLeft();
      final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderLeft());
      if (basicStroke != null)
      {
View Full Code Here

    if (borderShape != null)
    {
      return borderShape;
    }

    final StaticBoxLayoutProperties sblp = this.staticBoxLayoutProperties;
    final long x = this.x + (sblp.getBorderLeft() / 2);
    final long y = this.y + (sblp.getBorderTop() / 2);
    final long w = this.width - ((sblp.getBorderLeft() + sblp.getBorderRight()) / 2);
    final long h = this.height - ((sblp.getBorderTop() + sblp.getBorderBottom()) / 2);

    final Border border = boxDefinition.getBorder();
    final long topLeftWidth = border.getTopLeft().getWidth();
    final long topLeftHeight = border.getTopLeft().getHeight();
    final long topRightWidth;
View Full Code Here

    if (borderShapeTop != null)
    {
      return borderShapeTop;
    }

    final StaticBoxLayoutProperties sblp = this.staticBoxLayoutProperties;
    final long halfBorderWidth = sblp.getBorderTop() / 2;
    final long x = this.x;
    final long y = this.y + halfBorderWidth;
    final long w = this.width;

    final Border border = boxDefinition.getBorder();
View Full Code Here

    if (borderShapeBottom != null)
    {
      return borderShapeBottom;
    }

    final StaticBoxLayoutProperties sblp = this.staticBoxLayoutProperties;
    final long halfBorderWidth = sblp.getBorderBottom() / 2;
    final long x = this.x;
    final long y = this.y;
    final long w = this.width;
    final long h = this.height;
View Full Code Here

    if (borderShapeLeft != null)
    {
      return borderShapeLeft;
    }

    final StaticBoxLayoutProperties sblp = this.staticBoxLayoutProperties;
    final long halfBorderWidth = sblp.getBorderLeft() / 2;
    final long x = this.x;
    final long y = this.y;
    final long h = this.height;

    final Border border = boxDefinition.getBorder();
View Full Code Here

    if (borderShapeRight != null)
    {
      return borderShapeRight;
    }

    final StaticBoxLayoutProperties sblp = this.staticBoxLayoutProperties;
    final long halfBorderWidth = sblp.getBorderRight() / 2;
    final long x = this.x;
    final long y = this.y;
    final long w = this.width;
    final long h = this.height;
View Full Code Here

  {
    super(box);

    simpleContext = true;

    final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
    ExtendedBaselineInfo baselineInfo = box.getBaselineInfo();
    if (baselineInfo == null)
    {
      baselineInfo = blp.getNominalBaselineInfo();
    }
    if (baselineInfo == null)
    {
      throw new IllegalStateException("A box that has no baseline info.");
    }
    final int dominantBaselineValue = blp.getDominantBaseline();
    if (dominantBaselineValue == -1)
    {
      setDominantBaseline(baselineInfo.getDominantBaseline());
    }
    else
    {
      setDominantBaseline(dominantBaselineValue);
    }

    final BoxDefinition bdef = box.getBoxDefinition();
    insetsTop = blp.getBorderTop() + bdef.getPaddingTop();
    insetsBottom = blp.getBorderBottom() + bdef.getPaddingBottom();

    baselines = (long[]) baselineInfo.getBaselines();
    final int length = baselines.length;
    for (int i = 1; i < length; i++)
    {
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",
          convertColorToString(top));
      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",
          convertColorToString(left));
      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",
          convertColorToString(bottom));
      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",
          convertColorToString(right));
      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

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.