Examples of StaticBoxLayoutProperties


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

   * @return true if the box is new, false otherwise
   */
  private boolean updateStaticProperties(final RenderBox box)
  {
    final BoxDefinition boxDefinition = box.getBoxDefinition();
    final StaticBoxLayoutProperties sblp = box.getStaticBoxLayoutProperties();
    if (sblp.getNominalBaselineInfo() != null)
    {
      // mark box as seen ..
      box.setStaticBoxPropertiesAge(box.getChangeTracker());
      return false;
    }

    final long parentWidth = ProcessUtility.computeBlockContextWidth(box);
    sblp.setMarginTop(boxDefinition.getMarginTop().resolve(parentWidth));
    sblp.setMarginLeft(boxDefinition.getMarginLeft().resolve(parentWidth));
    sblp.setMarginBottom(boxDefinition.getMarginBottom().resolve(parentWidth));
    sblp.setMarginRight(boxDefinition.getMarginRight().resolve(parentWidth));

    final Border border = boxDefinition.getBorder();
    sblp.setBorderTop(border.getTop().getWidth());
    sblp.setBorderLeft(border.getLeft().getWidth());
    sblp.setBorderBottom(border.getBottom().getWidth());
    sblp.setBorderRight(border.getRight().getWidth());

    final StyleSheet style = box.getStyleSheet();
    if (box.getNodeType() == LayoutNodeTypes.TYPE_BOX_LINEBOX)
    {
      sblp.setAvoidPagebreakInside(true);
    }
    else
    {
      sblp.setAvoidPagebreakInside(style.getBooleanStyleProperty(ElementStyleKeys.AVOID_PAGEBREAK_INSIDE, false));
    }

    sblp.setDominantBaseline(-1);
    sblp.setOrphans(style.getIntStyleProperty(ElementStyleKeys.ORPHANS, 0));
    sblp.setWidows(style.getIntStyleProperty(ElementStyleKeys.WIDOWS, 0));

    final ExtendedBaselineInfo baselineInfo = metaData.getBaselineInfo('x', style);
    if (baselineInfo == null)
    {
      throw new IllegalStateException();
    }
    sblp.setNominalBaselineInfo(baselineInfo);
    sblp.setFontFamily(metaData.getNormalizedFontFamilyName((String) style.getStyleProperty(TextStyleKeys.FONT)));

    final Object collapse = style.getStyleProperty(TextStyleKeys.WHITE_SPACE_COLLAPSE);
    sblp.setPreserveSpace(WhitespaceCollapse.PRESERVE.equals(collapse));
    sblp.setOverflowX(style.getBooleanStyleProperty(ElementStyleKeys.OVERFLOW_X, overflowXSupported));
    sblp.setOverflowY(style.getBooleanStyleProperty(ElementStyleKeys.OVERFLOW_Y, overflowYSupported));
    sblp.setInvisibleConsumesSpace(style.getBooleanStyleProperty
        (ElementStyleKeys.INVISIBLE_CONSUMES_SPACE, box.getNodeType() == LayoutNodeTypes.TYPE_BOX_ROWBOX));
    sblp.setVisible(style.getBooleanStyleProperty(ElementStyleKeys.VISIBLE));
    box.setStaticBoxPropertiesAge(box.getChangeTracker());
    computeBreakIndicator(box);
    return true;
  }
View Full Code Here

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

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

        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

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

      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

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

    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

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

    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

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

    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

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

    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

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

    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

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

  {
    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
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.