Examples of ElementAlignment


Examples of org.pentaho.reporting.engine.classic.core.ElementAlignment

        activeXulWrapper = groupDef;
 
        // Set the bindings on this group definition
        fieldAndGroupBindings.add(getBindingFactory().createBinding(groupDef, GROUP_TOTALS_LABEL_PROPERTY_NAME, FORMAT_GROUP_TOTALS_LABEL_TB_ID, VALUE_PROPERTY_NAME));
        fieldAndGroupBindings.add(getBindingFactory().createBinding(groupDef, DISPLAY_NAME_PROPERTY_NAME, FORMAT_GROUP_DISPLAY_NAME_TB_ID, VALUE_PROPERTY_NAME));
        final ElementAlignment alignment = groupDef.getTotalsHorizontalAlignment();
     
      /*
       * This element was commented to turn off the Group Summary Alignment.  Uncomment this to turn this
       * feature back on when the engine supports it.
       */
 
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.ElementAlignment

        }
      }

      final int clipWidth = Math.min(width, (int) Math.ceil(deviceScaleFactor * imageWidth));
      final int clipHeight = Math.min(height, (int) Math.ceil(deviceScaleFactor * imageHeight));
      final ElementAlignment horizontalAlignment =
          (ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.ALIGNMENT);
      final ElementAlignment verticalAlignment =
          (ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.VALIGNMENT);
      final int alignmentX = (int) RenderUtility.computeHorizontalAlignment(horizontalAlignment, width, clipWidth);
      final int alignmentY = (int) RenderUtility.computeVerticalAlignment(verticalAlignment, height, clipHeight);

      g2 = (Graphics2D) getGraphics().create();
      g2.clip(drawAreaBounds);
      g2.translate(x, y);
      g2.translate(alignmentX, alignmentY);
      g2.clip(new Rectangle2D.Float(0, 0, clipWidth, clipHeight));
      g2.scale(deviceScaleFactor, deviceScaleFactor);

      scaleTransform = null;
    }
    else
    {
      g2 = (Graphics2D) getGraphics().create();
      g2.clip(drawAreaBounds);
      g2.translate(x, y);
      g2.clip(new Rectangle2D.Float(0, 0, width, height));

      final double scaleX;
      final double scaleY;

      final boolean keepAspectRatio = layoutContext.getBooleanStyleProperty(ElementStyleKeys.KEEP_ASPECT_RATIO);
      if (keepAspectRatio)
      {
        final double scaleFactor = Math.min(width / (double) imageWidth, height / (double) imageHeight);
        scaleX = scaleFactor;
        scaleY = scaleFactor;
      }
      else
      {
        scaleX = width / (double) imageWidth;
        scaleY = height / (double) imageHeight;
      }

      final int clipWidth = (int) (scaleX * imageWidth);
      final int clipHeight = (int) (scaleY * imageHeight);

      final ElementAlignment horizontalAlignment =
          (ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.ALIGNMENT);
      final ElementAlignment verticalAlignment =
          (ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.VALIGNMENT);
      final int alignmentX = (int) RenderUtility.computeHorizontalAlignment(horizontalAlignment, width, clipWidth);
      final int alignmentY = (int) RenderUtility.computeVerticalAlignment(verticalAlignment, height, clipHeight);

      g2.translate(alignmentX, alignmentY);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.ElementAlignment

    breakState.add(EndSequenceElement.INSTANCE, inlineRenderBox);

    final ParagraphRenderBox paragraph = breakState.getParagraph();

    final ElementAlignment textAlignment = paragraph.getTextAlignment();
    final long textIndent = paragraph.getTextIndent();
    final long firstLineIndent = paragraph.getFirstLineIndent();
    // This aligns all direct childs. Once that is finished, we have to
    // check, whether possibly existing inner-paragraphs are still valid
    // or whether moving them violated any of the inner-pagebreak constraints.
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.ElementAlignment

      if (colSpan > 1)
      {
        attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, "colspan", String.valueOf(colSpan));
      }

      final ElementAlignment verticalAlignment = content.getNodeLayoutProperties().getVerticalAlignment();
      attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, "valign", translateVerticalAlignment(verticalAlignment));
    }

    if (background != null && content != null)
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.ElementAlignment

    else
    {
      styleBuilder.append("text-decoration", "none");
    }

    final ElementAlignment align = (ElementAlignment) styleSheet.getStyleProperty(ElementStyleKeys.ALIGNMENT);
    styleBuilder.append("text-align", translateHorizontalAlignment(align));

    final double wordSpacing = styleSheet.getDoubleStyleProperty(TextStyleKeys.WORD_SPACING, 0);
    styleBuilder.append("word-spacing", styleBuilder.getPointConverter().format
        (fixLengthForSafari(wordSpacing, fixLength)), "pt");
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.ElementAlignment

      final boolean value = style.getBooleanStyleProperty(ElementStyleKeys.AVOID_PAGEBREAK_INSIDE);
      bandStyleAtts.setAttribute(BundleNamespaces.STYLE, "avoid-page-break", String.valueOf(value));
    }
    if (style.isLocalKey(ElementStyleKeys.ALIGNMENT))
    {
      final ElementAlignment value = (ElementAlignment) style.getStyleProperty(ElementStyleKeys.ALIGNMENT);
      if (ElementAlignment.CENTER.equals(value))
      {
        bandStyleAtts.setAttribute(BundleNamespaces.STYLE, "alignment", "center");
      }
      else if (ElementAlignment.RIGHT.equals(value))
      {
        bandStyleAtts.setAttribute(BundleNamespaces.STYLE, "alignment", "right");
      }
      else if (ElementAlignment.LEFT.equals(value))
      {
        bandStyleAtts.setAttribute(BundleNamespaces.STYLE, "alignment", "left");
      }
    }
    if (style.isLocalKey(ElementStyleKeys.VALIGNMENT))
    {
      final ElementAlignment value = (ElementAlignment) style.getStyleProperty(ElementStyleKeys.VALIGNMENT);
      if (ElementAlignment.MIDDLE.equals(value))
      {
        bandStyleAtts.setAttribute(BundleNamespaces.STYLE, "vertical-alignment", "middle");
      }
      else if (ElementAlignment.BOTTOM.equals(value))
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.ElementAlignment

        }
      }

      final int clipWidth = Math.min(width, (int) Math.ceil(deviceScaleFactor * imageWidth));
      final int clipHeight = Math.min(height, (int) Math.ceil(deviceScaleFactor * imageHeight));
      final ElementAlignment horizontalAlignment =
          (ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.ALIGNMENT);
      final ElementAlignment verticalAlignment =
          (ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.VALIGNMENT);
      final int alignmentX = (int) RenderUtility.computeHorizontalAlignment(horizontalAlignment, width, clipWidth);
      final int alignmentY = (int) RenderUtility.computeVerticalAlignment(verticalAlignment, height, clipHeight);

      g2 = (Graphics2D) getGraphics().create();
      g2.clip(drawAreaBounds);
      g2.translate(x, y);
      g2.translate(alignmentX, alignmentY);
      g2.clip(new Rectangle2D.Float(0, 0, clipWidth, clipHeight));
      g2.scale(deviceScaleFactor, deviceScaleFactor);

      scaleTransform = null;
    }
    else
    {
      g2 = (Graphics2D) getGraphics().create();
      g2.clip(drawAreaBounds);
      g2.translate(x, y);
      g2.clip(new Rectangle2D.Float(0, 0, width, height));

      final double scaleX;
      final double scaleY;

      final boolean keepAspectRatio = layoutContext.getBooleanStyleProperty(ElementStyleKeys.KEEP_ASPECT_RATIO);
      if (keepAspectRatio)
      {
        final double scaleFactor = Math.min(width / (double) imageWidth, height / (double) imageHeight);
        scaleX = scaleFactor;
        scaleY = scaleFactor;
      }
      else
      {
        scaleX = width / (double) imageWidth;
        scaleY = height / (double) imageHeight;
      }

      final int clipWidth = (int) (scaleX * imageWidth);
      final int clipHeight = (int) (scaleY * imageHeight);

      final ElementAlignment horizontalAlignment =
          (ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.ALIGNMENT);
      final ElementAlignment verticalAlignment =
          (ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.VALIGNMENT);
      final int alignmentX = (int) RenderUtility.computeHorizontalAlignment(horizontalAlignment, width, clipWidth);
      final int alignmentY = (int) RenderUtility.computeVerticalAlignment(verticalAlignment, height, clipHeight);

      g2.translate(alignmentX, alignmentY);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.ElementAlignment

  {
    // Aligns elements with vertical-align TOP and vertical-align BOTTOM
    AlignContext child = box.getFirstChild();
    while (child != null)
    {
      final ElementAlignment verticalAlignment = child.getNode().getNodeLayoutProperties().getVerticalAlignment();
      if (ElementAlignment.TOP.equals(verticalAlignment))
      {
        final long childTopEdge = child.getBeforeEdge();
        final long parentTopEdge = lineBox.getBeforeEdge();
        child.shift(parentTopEdge - childTopEdge);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.ElementAlignment

      else
      {
        scaleFactor = 1;
      }

      final ElementAlignment horizontalAlignment =
          (ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.ALIGNMENT);
      final ElementAlignment verticalAlignment =
          (ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.VALIGNMENT);

      final long internalImageWidth = StrictGeomUtility.toInternalValue(scaleFactor * imageWidth);
      final long internalImageHeight = StrictGeomUtility.toInternalValue(scaleFactor * imageHeight);

 
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.ElementAlignment

    {
      // grab the node's y2
      if (computedContentHeight > usedHeight)
      {
        // we have extra space to distribute. So lets shift some boxes.
        final ElementAlignment valign = box.getNodeLayoutProperties().getVerticalAlignment();
        if (ElementAlignment.BOTTOM.equals(valign))
        {
          final long boxBottom = (box.getCachedY() + computedContentHeight - insetBottom);
          final long delta = boxBottom - childY2;
          CacheBoxShifter.shiftBoxChilds(box, delta);
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.