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

Examples of org.pentaho.reporting.engine.classic.core.util.ReportDrawable


  public static ImageMap extractImageMap(final RenderableReplacedContentBox node, final DrawableWrapper drawable)
  {
    final Object backend = drawable.getBackend();
    if (backend instanceof ReportDrawable)
    {
      final ReportDrawable rdrawable = (ReportDrawable) backend;
      final int imageWidth = (int) StrictGeomUtility.toExternalValue(node.getWidth());
      final int imageHeight = (int) StrictGeomUtility.toExternalValue(node.getHeight());
      if (imageWidth == 0 || imageHeight == 0)
      {
        return null;
      }
      return rdrawable.getImageMap(new Rectangle2D.Double(0, 0, imageWidth, imageHeight));
    }
    return null;
  }
View Full Code Here


    if (value instanceof ReportDrawable)
    {
      // A report drawable element receives some context information as well.

      final ReportDrawable reportDrawable = (ReportDrawable) value;
      final ProcessingContext processingContext = runtime.getProcessingContext();
      reportDrawable.setConfiguration(processingContext.getConfiguration());
      reportDrawable.setResourceBundleFactory(processingContext.getResourceBundleFactory());
      processReportDrawableContent(reportDrawable, parentRenderBox, element, stateKey);
    }
    else if (value instanceof Anchor)
    {
      DefaultLayoutBuilder.logger.warn
          ("The use of anchor-objects is deprecated and will be removed from future reports. " +
              "Update your report definition.");
      processAnchor((Anchor) value, parentRenderBox, element, stateKey);
    }
    else
    {
      final DataSource dataSource = element.getElementType();
      final Object rawValue;
      if (dataSource instanceof RawDataSource)
      {
        final RawDataSource rds = (RawDataSource) dataSource;
        rawValue = rds.getRawValue(runtime, element);
      }
      else
      {
        rawValue = null;
      }
      // String is final, so it is safe to do this ...
      if (DefaultLayoutBuilder.STRING_CLASSNAME.equals(value.getClass().getName()))
      {
        processText(value, rawValue, parentRenderBox, element, stateKey);
      }
      else if (value instanceof Shape)
      {
        final Shape shape = (Shape) value;
        final ReportDrawable reportDrawable = new ShapeDrawable
            (shape, element.getStyle().getBooleanStyleProperty(ElementStyleKeys.KEEP_ASPECT_RATIO));
        final ProcessingContext processingContext = runtime.getProcessingContext();
        reportDrawable.setConfiguration(processingContext.getConfiguration());
        reportDrawable.setResourceBundleFactory(processingContext.getResourceBundleFactory());
        processReportDrawableContent(reportDrawable, parentRenderBox, element, stateKey);
      }
      else if (value instanceof ImageContainer ||
          value instanceof DrawableWrapper)
      {
View Full Code Here

    }
    else if (computedValue instanceof Shape)
    {
      final StyleSheet resolvedStyle = element.getComputedStyle();
      final Shape shape = (Shape) computedValue;
      final ReportDrawable reportDrawable = new ShapeDrawable
          (shape, resolvedStyle.getBooleanStyleProperty(ElementStyleKeys.KEEP_ASPECT_RATIO));
      processReportDrawable(element, reportDrawable, rawValue);
    }
    else if (computedValue instanceof ReportDrawable)
    {
View Full Code Here

                                          final long height)
  {
    final Object backend = drawable.getBackend();
    if (backend instanceof ReportDrawable)
    {
      final ReportDrawable rdrawable = (ReportDrawable) backend;
      final int imageWidth = (int) StrictGeomUtility.toExternalValue(width);
      final int imageHeight = (int) StrictGeomUtility.toExternalValue(height);
      if (imageWidth == 0 || imageHeight == 0)
      {
        return null;
      }
      return rdrawable.getImageMap(new Rectangle2D.Double(0, 0, imageWidth, imageHeight));
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.util.ReportDrawable

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.