Package org.pentaho.reporting.engine.classic.core

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


    }
  }

  private void computeCellStyle(final RenderBox content, final Cell cell)
  {
    final ElementAlignment verticalAlign = content.getNodeLayoutProperties().getVerticalAlignment();
    if (ElementAlignment.BOTTOM.equals(verticalAlign))
    {
      cell.setVerticalAlignment(Element.ALIGN_BOTTOM);
    }
    else if (ElementAlignment.MIDDLE.equals(verticalAlign))
    {
      cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
    }
    else
    {
      cell.setVerticalAlignment(Element.ALIGN_TOP);
    }

    final ElementAlignment textAlign = (ElementAlignment)
        content.getStyleSheet().getStyleProperty(ElementStyleKeys.ALIGNMENT);
    if (ElementAlignment.RIGHT.equals(textAlign))
    {
      cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    }
View Full Code Here

          (MetaAttributeNames.Style.NAMESPACE, MetaAttributeNames.Style.FONTFAMILY, String.class, context);
      final Color textColor = (Color) attributes.getMetaAttribute
          (MetaAttributeNames.Style.NAMESPACE, MetaAttributeNames.Style.COLOR, Color.class, context);
      final Color bgColor = (Color) attributes.getMetaAttribute
          (MetaAttributeNames.Style.NAMESPACE, MetaAttributeNames.Style.BACKGROUND_COLOR, Color.class, context);
      final ElementAlignment hAlign = (ElementAlignment) attributes.getMetaAttribute
          (MetaAttributeNames.Style.NAMESPACE, MetaAttributeNames.Style.HORIZONTAL_ALIGNMENT,
              ElementAlignment.class, context);
      final ElementAlignment vAlign = (ElementAlignment) attributes.getMetaAttribute
          (MetaAttributeNames.Style.NAMESPACE, MetaAttributeNames.Style.VERTICAL_ALIGNMENT, ElementAlignment.class,
              context);

      final ElementStyleSheet styleSheet = e.getStyle();
      if (isMetaStylingEnabled(e.getAttributes().getAttribute
View Full Code Here

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

      final ElementAlignment verticalAlignment = (ElementAlignment) styleSheet.getStyleProperty(ElementStyleKeys.VALIGNMENT);
      attrList.setAttribute(HtmlPrinter.XHTML_NAMESPACE, "valign", translateVerticalAlignment(verticalAlignment));
    }

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

    }

    processFontStyle(styleSheet, filterStyleBuilder, pointConverter);
    processTextDecoration(styleSheet, filterStyleBuilder);

    final ElementAlignment align = (ElementAlignment) styleSheet.getStyleProperty(ElementStyleKeys.ALIGNMENT);
    filterStyleBuilder.append(DefaultStyleBuilder.CSSKeys.TEXT_ALIGN, translateHorizontalAlignment(align));

    final double wordSpacing = styleSheet.getDoubleStyleProperty(TextStyleKeys.WORD_SPACING, 0);
    filterStyleBuilder.append(DefaultStyleBuilder.CSSKeys.WORD_SPACING, pointConverter.format
        (fixLengthForSafari(wordSpacing)), "pt");
View Full Code Here

    final OutputProcessorMetaData metaData = getMetaData();
    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

        final HSSFFontWrapper wrapper = new HSSFFontWrapper
            (contentStyle, fontColorProducer.getNearestColor(textColor));
        final Font excelFont = fontFactory.getExcelFont(wrapper);
        this.font = excelFont.getIndex();

        final ElementAlignment horizontal =
            (ElementAlignment) contentStyle.getStyleProperty(ElementStyleKeys.ALIGNMENT);
        this.horizontalAlignment = HSSFCellStyleProducer.convertAlignment(horizontal);
        final ElementAlignment vertical =
            (ElementAlignment) contentStyle.getStyleProperty(ElementStyleKeys.VALIGNMENT);
        this.verticalAlignment = HSSFCellStyleProducer.convertAlignment(vertical);
        final String dataStyle =
            (String) contentStyle.getStyleProperty(ElementStyleKeys.EXCEL_DATA_FORMAT_STRING);
        if (dataStyle != null)
View Full Code Here

        }
      }

      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

    final long computedHeight = box.getCachedHeight();
    if (computedHeight > 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() + box.getCachedHeight() - insetBottom);
        final long delta = boxBottom - childY2;
        CacheBoxShifter.shiftBoxChilds(box, delta);
View Full Code Here

      if (mergedLine == null)
      {
        return;
      }

      final ElementAlignment textAlignment = paragraph.getLastLineAlignment();
      final LastLineTextAlignmentProcessor proc = create(textAlignment);

      // Now Build the sequence list that holds all nodes for the horizontal alignment computation.
      // The last line will get a special "last-line" horizontal alignment. This is quite usefull if
      // we are working with justified text and want the last line to be left-aligned.
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.ElementAlignment

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.