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

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


    if (rawObject instanceof DrawableWrapper)
    {
      // render it into an Buffered image and make it a PNG file.
      final DrawableWrapper drawable = (DrawableWrapper) rawObject;
      final StrictBounds cb = new StrictBounds(node.getX(), node.getY(), node.getWidth(), node.getHeight());
      final ImageContainer image = RenderUtility.createImageFromDrawable(drawable, cb, node,
          metaData);
      if (image == null)
      {
        //xmlWriter.writeComment("Drawable content [No image generated]:" + source);
        return;
View Full Code Here


    if (value instanceof Image)
    {
      try
      {
        final ImageContainer imageContainer = new DefaultImageReference((Image) value);
        final RenderNode rawSource = textExtractor.getRawSource();
        final StrictBounds contentBounds =
            new StrictBounds(content.getX(), content.getY() + contentOffset, content.getWidth(), content.getHeight());
        createImageCell(rawSource, imageContainer, sheetLayout, rectangle, contentBounds);
      }
      catch (IOException ioe)
      {
        // Should not happen.
        ExcelPrinter.logger.warn("Failed to process AWT-Image in Excel-Export", ioe);
      }
      return false;
    }
    else if (value instanceof ImageContainer)
    {
      final ImageContainer imageContainer = (ImageContainer) value;
      // todo: this is wrong ..
      final RenderNode rawSource = textExtractor.getRawSource();
      final StrictBounds contentBounds =
          new StrictBounds(content.getX(), content.getY() + contentOffset, content.getWidth(), content.getHeight());
      createImageCell(rawSource, imageContainer, sheetLayout, rectangle, contentBounds);
      return false;
    }
    else if (value instanceof DrawableWrapper)
    {
      final DrawableWrapper drawable = (DrawableWrapper) value;
      final RenderNode rawSource = textExtractor.getRawSource();
      final StrictBounds contentBounds = new StrictBounds
          (rawSource.getX(), rawSource.getY() + contentOffset, rawSource.getWidth(), rawSource.getHeight());
      final ImageContainer imageFromDrawable =
          RenderUtility.createImageFromDrawable(drawable, contentBounds, content, metaData);
      createImageCell(rawSource, imageFromDrawable, sheetLayout, rectangle, contentBounds);
      return false;
    }
    else if (value instanceof Shape)
View Full Code Here

      }
      else if (rawObject instanceof DrawableWrapper)
      {
        final StrictBounds rect = new StrictBounds
            (node.getX(), node.getY(), node.getWidth(), node.getHeight());
        final ImageContainer ic =
            RenderUtility.createImageFromDrawable((DrawableWrapper) rawObject, rect, node, metaData);
        if (ic == null)
        {
          return;
        }
View Full Code Here

    {
      this.imageResolutionMapping = metaData.isFeatureSupported(OutputProcessorFeature.IMAGE_RESOLUTION_MAPPING);
      final double displayResolution = metaData.getNumericFeatureValue(OutputProcessorFeature.DEVICE_RESOLUTION);
      final double correctionFactorPxToPoint = 72.0 / displayResolution;

      final ImageContainer ir = (ImageContainer) content;
      final double scaleX = ir.getScaleX();
      final double scaleY = ir.getScaleY();
      if (imageResolutionMapping)
      {
        contentWidth = StrictGeomUtility.toInternalValue(ir.getImageWidth() * scaleX * correctionFactorPxToPoint);
        contentHeight = StrictGeomUtility.toInternalValue(ir.getImageHeight() * scaleY * correctionFactorPxToPoint);
      }
      else
      {
        contentWidth = StrictGeomUtility.toInternalValue(ir.getImageWidth() * scaleX);
        contentHeight = StrictGeomUtility.toInternalValue(ir.getImageHeight() * scaleY);
      }
    }
    else if (content instanceof DrawableWrapper)
    {
      final DrawableWrapper edr = (DrawableWrapper) content;
View Full Code Here

                                 final StyleSheet styleSheet,
                                 final DrawableWrapper drawable) throws ContentIOException, IOException
  {
    // render it into an Buffered image and make it a PNG file.
    final StrictBounds cb = new StrictBounds(0, 0, width, height);
    final ImageContainer image =
        RenderUtility.createImageFromDrawable(drawable, cb, styleSheet, metaData);
    if (image == null)
    {
      //xmlWriter.writeComment("Drawable content [No image generated]:" + source);
      return false;
View Full Code Here

      }
      else if (rawObject instanceof DrawableWrapper)
      {
        final StrictBounds rect = new StrictBounds
            (node.getX(), node.getY(), node.getWidth(), node.getHeight());
        final ImageContainer ic =
            RenderUtility.createImageFromDrawable((DrawableWrapper) rawObject, rect, node, metaData);
        if (ic == null)
        {
          return;
        }
View Full Code Here

  {
    if (value instanceof Image)
    {
      try
      {
        final ImageContainer imageContainer = new DefaultImageReference((Image) value);
        final StyleSheet rawSource = textExtractor.getRawSource().getStyleSheet();
        final StrictBounds contentBounds =
            new StrictBounds(content.getX(), content.getY() + contentOffset, content.getWidth(), content.getHeight());
        createImageCell(rawSource, imageContainer, sheetLayout, rectangle, contentBounds);
      }
      catch (IOException ioe)
      {
        // Should not happen.
        ExcelPrinter.logger.warn("Failed to process AWT-Image in Excel-Export", ioe);
      }
      return true;
    }
    else if (value instanceof ImageContainer)
    {
      final ImageContainer imageContainer = (ImageContainer) value;
      // todo: this is wrong ..
      final StyleSheet rawSource = textExtractor.getRawSource().getStyleSheet();
      final StrictBounds contentBounds =
          new StrictBounds(content.getX(), content.getY() + contentOffset, content.getWidth(), content.getHeight());
      createImageCell(rawSource, imageContainer, sheetLayout, rectangle, contentBounds);
      return true;
    }
    else if (value instanceof DrawableWrapper)
    {
      final DrawableWrapper drawable = (DrawableWrapper) value;
      final RenderNode rawSource = textExtractor.getRawSource();
      final StrictBounds contentBounds = new StrictBounds
          (rawSource.getX(), rawSource.getY() + contentOffset, rawSource.getWidth(), rawSource.getHeight());
      final ImageContainer imageFromDrawable =
          RenderUtility.createImageFromDrawable(drawable, contentBounds, content, getMetaData());
      createImageCell(rawSource.getStyleSheet(), imageFromDrawable, sheetLayout, rectangle, contentBounds);
      return true;
    }
    else if (value instanceof Shape)
View Full Code Here

    {
      final boolean imageResolutionMapping = metaData.isFeatureSupported(OutputProcessorFeature.IMAGE_RESOLUTION_MAPPING);
      final double displayResolution = metaData.getNumericFeatureValue(OutputProcessorFeature.DEVICE_RESOLUTION);
      final double correctionFactorPxToPoint = 72.0 / displayResolution;

      final ImageContainer ir = (ImageContainer) content;
      final double scaleX = ir.getScaleX();
      final double scaleY = ir.getScaleY();
      if (imageResolutionMapping)
      {
        contentWidth = StrictGeomUtility.toInternalValue(ir.getImageWidth() * scaleX * correctionFactorPxToPoint);
        contentHeight = StrictGeomUtility.toInternalValue(ir.getImageHeight() * scaleY * correctionFactorPxToPoint);
      }
      else
      {
        contentWidth = StrictGeomUtility.toInternalValue(ir.getImageWidth() * scaleX);
        contentHeight = StrictGeomUtility.toInternalValue(ir.getImageHeight() * scaleY);
      }
    }
    else if (content instanceof DrawableWrapper)
    {
      final DrawableWrapper edr = (DrawableWrapper) content;
View Full Code Here

    if (value instanceof Image)
    {
      try
      {
        final StrictBounds contentBounds = sheetLayout.getBounds(rectangle);
        final ImageContainer imageContainer = new DefaultImageReference((Image) value);
        createImageCell(rawSource, imageContainer, sheetLayout, rectangle, contentBounds);
      }
      catch (final IOException ioe)
      {
        // Should not happen.
        logger.warn("Failed to process AWT-Image in Excel-Export", ioe);
      }
      return true;
    }
    else if (value instanceof ImageContainer)
    {
      final ImageContainer imageContainer = (ImageContainer) value;
      final StrictBounds contentBounds = sheetLayout.getBounds(rectangle);
      createImageCell(rawSource, imageContainer, sheetLayout, rectangle, contentBounds);
      return true;
    }
    else if (value instanceof DrawableWrapper)
    {
      final DrawableWrapper drawable = (DrawableWrapper) value;
      final StrictBounds contentBounds = sheetLayout.getBounds(rectangle);
      final ImageContainer imageFromDrawable =
          RenderUtility.createImageFromDrawable(drawable, contentBounds, content.getComputedStyle(), getMetaData());
      createImageCell(rawSource, imageFromDrawable, sheetLayout, rectangle, contentBounds);
      return true;
    }
    else if (value instanceof Shape)
View Full Code Here

TOP

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

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.