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

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


    // We have to do three things here. First, w have to check what kind
    // of content we deal with.
    // todo: Check whether the raw-object would be understood by the browser
    if (rawObject instanceof URLImageContainer)
    {
      final URLImageContainer urlImageContainer = (URLImageContainer) rawObject;
      final ResourceKey source = urlImageContainer.getResourceKey();
      if (source != null)
      {
        // Cool, we have access to the raw-data. Thats always nice as we
        // dont have to recode the whole thing. We can only recode images, not drawables.
        if (contentGenerator.isRegistered(source) == false)
View Full Code Here


      final Image image = imageContainer.getImage();
      drawImage(content, image);
    }
    else if (o instanceof URLImageContainer)
    {
      final URLImageContainer imageContainer = (URLImageContainer) o;
      if (imageContainer.isLoadable() == false)
      {
        LogicalPageDrawable.logger.info("URL-image cannot be rendered, as it was declared to be not loadable.");
        return;
      }

      final ResourceKey sourceURL = imageContainer.getResourceKey();
      if (sourceURL == null)
      {
        LogicalPageDrawable.logger.info("URL-image cannot be rendered, as it did not return a valid URL.");
      }
View Full Code Here

  {
    ResourceKey url = null;
    // The image has an assigned URL ...
    if (image instanceof URLImageContainer)
    {
      final URLImageContainer urlImage = (URLImageContainer) image;

      url = urlImage.getResourceKey();
      // if we have an source to load the image data from ..
      if (url != null)
      {
        if (urlImage.isLoadable() && isSupportedImageFormat(url))
        {
          try
          {
            final ResourceData data = resourceManager.load(url);
            final byte[] imageData = data.getResource(resourceManager);
View Full Code Here

    }

    final String cacheKey;
    if (image instanceof URLImageContainer)
    {
      final URLImageContainer uic = (URLImageContainer) image;
      cacheKey = uic.getSourceURLString();
      final String retval = knownImages.get(cacheKey);
      if (retval != null)
      {
        return retval;
      }

      final String sourceURLString = uic.getSourceURLString();
      if (uic.isLoadable() == false && sourceURLString != null)
      {
        knownImages.put(cacheKey, sourceURLString);
        return sourceURLString;
      }
    }
View Full Code Here

      return;
    }

    if (o instanceof URLImageContainer)
    {
      final URLImageContainer imageContainer = (URLImageContainer) o;
      if (imageContainer.isLoadable() == false)
      {
        PdfLogicalPageDrawable.logger.info
            ("URL-image cannot be rendered, as it was declared to be not loadable: " +
                imageContainer.getSourceURLString());
      }
      else
      {
        final ResourceKey resource = imageContainer.getResourceKey();
        if (resource == null)
        {
          PdfLogicalPageDrawable.logger.info("URL-image cannot be rendered, as it did not return a valid URL.");
        }
        else
        {
          try
          {
            final ResourceManager resourceManager = getResourceManager();
            final com.lowagie.text.Image instance;
            final Object maybeImage = imageCache.get(resource);
            if (maybeImage != null)
            {
              instance = (com.lowagie.text.Image) maybeImage;
            }
            else
            {
              final ResourceData data = resourceManager.load(resource);
              instance = com.lowagie.text.Image.getInstance(data.getResource(resourceManager));
              imageCache.put(resource, instance);
            }

            final Resource imageWrapped = resourceManager.create(resource, null, Image.class);
            final Image image = (Image) imageWrapped.getResource();

            if (drawImage(content, image, instance))
            {
              drawImageMap(content);
            }
            return;
          }
          catch (InvalidReportStateException re)
          {
            throw re;
          }
          catch (Exception e)
          {
            PdfLogicalPageDrawable.logger.info("URL-image cannot be rendered, as the image was not loadable.", e);
          }
        }
      }
    }

    if (o instanceof LocalImageContainer)
    {
      final LocalImageContainer imageContainer = (LocalImageContainer) o;
      final Image image = imageContainer.getImage();
      if (drawImage(content, image))
      {
        drawImageMap(content);
      }
    }
View Full Code Here

    Image image = null;
    // The image has an assigned URL ...
    if (reference instanceof URLImageContainer)
    {
      final URLImageContainer urlImage = (URLImageContainer) reference;
      final ResourceKey url = urlImage.getResourceKey();
      // if we have an source to load the image data from ..
      if (url != null && urlImage.isLoadable())
      {
        if (reference instanceof LocalImageContainer)
        {
          final LocalImageContainer li = (LocalImageContainer) reference;
          image = li.getImage();
View Full Code Here

  {
    Image image = null;
    // The image has an assigned URL ...
    if (reference instanceof URLImageContainer)
    {
      final URLImageContainer urlImage = (URLImageContainer) reference;
      final ResourceKey url = urlImage.getResourceKey();
      // if we have an source to load the image data from ..
      if (url != null && urlImage.isLoadable())
      {
        // and the image is one of the supported image formats ...
        // we we can embedd it directly ...
        final int format = getImageFormat(url);
        if (format == -1)
View Full Code Here

    Object identity = null;
    java.awt.Image image = null;
    if (reference instanceof URLImageContainer)
    {
      final URLImageContainer urlImageContainer = (URLImageContainer) reference;
      final ResourceKey url = urlImageContainer.getResourceKey();
      if (url != null && urlImageContainer.isLoadable())
      {
        identity = url;
        final Image cached = (Image) cachedImages.get(identity);
        if (cached != null)
        {
View Full Code Here

    Object identity = null;
    java.awt.Image image = null;
    if (reference instanceof URLImageContainer)
    {
      final URLImageContainer urlImageContainer = (URLImageContainer) reference;
      final ResourceKey url = urlImageContainer.getResourceKey();
      if (url != null && urlImageContainer.isLoadable())
      {
        identity = url;
        final Image cached = (Image) cachedImages.get(identity);
        if (cached != null)
        {
View Full Code Here

      LocalImageContainer li = (LocalImageContainer) rawObject;
      return li.getImage();
    }
    if (rawObject instanceof URLImageContainer)
    {
      final URLImageContainer imageContainer = (URLImageContainer) rawObject;
      if (imageContainer.isLoadable() == false)
      {
        logger.info("URL-image cannot be rendered, as it was declared to be not loadable.");
        return null;
      }

      final ResourceKey sourceURL = imageContainer.getResourceKey();
      if (sourceURL == null)
      {
        logger.info("URL-image cannot be rendered, as it did not return a valid URL.");
      }
View Full Code Here

TOP

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

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.