Package org.pentaho.reporting.libraries.resourceloader.factory.drawable

Examples of org.pentaho.reporting.libraries.resourceloader.factory.drawable.DrawableWrapper


    else
    {
      final Object o = content.getContent().getRawObject();
      if (o instanceof DrawableWrapper)
      {
        final DrawableWrapper drawable = (DrawableWrapper) o;
        return RenderUtility.extractImageMap(content, drawable);
      }
      else
      {
        return null;
View Full Code Here


      return value;
    }
    if (value instanceof Component)
    {
      final Component c = (Component) value;
      return new DrawableWrapper(createComponentDrawable(runtime, c));
    }
    if (value instanceof DrawableWrapper)
    {
      return value;
    }
    if (DrawableWrapper.isDrawable(value))
    {
      return new DrawableWrapper(value);
    }

    if (failureCache != null)
    {
      final Object o = failureCache.get(value);
      if (Boolean.TRUE.equals(o))
      {
        return null;
      }
    }
    try
    {
      final ResourceKey contentBase = runtime.getProcessingContext().getContentBase();
      final ResourceManager resManager = runtime.getProcessingContext().getResourceManager();
      final ResourceKey key;
      if (value instanceof ResourceKey)
      {
        key = (ResourceKey) value;
      }
      else if (value instanceof Blob)
      {
        final Blob b = (Blob) value;
        final byte[] data = IOUtils.getInstance().readBlob(b);
        key = resManager.createKey(data);
      }
      else if (value instanceof String)
      {
        final Object baseURL = element.getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.CONTENT_BASE);
        if (baseURL instanceof String)
        {
          final ResourceKey baseKey = createKeyFromString(resManager, null, (String) baseURL);
          key = createKeyFromString(resManager, baseKey, (String) value);
        }
        else if (baseURL instanceof ResourceKey)
        {
          final ResourceKey baseKey = (ResourceKey) baseURL;
          key = createKeyFromString(resManager, baseKey, (String) value);
        }
        else if (baseURL != null)
        {
          // if a base-url object is given, we assume that it is indeed valid.
          final ResourceKey baseKey = resManager.createKey(baseURL);
          key = createKeyFromString(resManager, baseKey, (String) value);
        }
        else
        {
          key = createKeyFromString(resManager, contentBase, (String) value);
        }
      }
      else
      {
        key = resManager.createKey(value);
      }
      if (key == null)
      {
        return null;
      }

      final Resource resource = resManager.create(key, contentBase, ContentType.TARGETS);
      final Object resourceContent = resource.getResource();
      if (resourceContent instanceof DrawableWrapper)
      {
        return resourceContent;
      }
      else if (DrawableWrapper.isDrawable(resourceContent))
      {
        return new DrawableWrapper(resourceContent);
      }
      else if (resourceContent instanceof Image)
      {
        return new DefaultImageReference(resource);
      }
View Full Code Here

      {
        processReplacedContent(value, rawValue, parentRenderBox, element, stateKey);
      }
      else if (DrawableWrapper.isDrawable(value))
      {
        processReplacedContent(new DrawableWrapper(value), rawValue, parentRenderBox, element, stateKey);
      }
      else
      {
        processText(value, rawValue, parentRenderBox, element, stateKey);
      }
View Full Code Here

    {
      elementStyle = styleCache.getStyleSheet(element.getStyle());
    }

    reportDrawable.setStyleSheet(elementStyle);
    final DrawableWrapper wrapper;
    if (reportDrawable instanceof DrawableWrapper)
    {
      wrapper = (DrawableWrapper) (reportDrawable);
    }
    else
    {
      wrapper = new DrawableWrapper(reportDrawable);
    }

    final RenderableReplacedContent content = new RenderableReplacedContent(elementStyle, wrapper, null, metaData);
    final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(elementStyle);
    final RenderableReplacedContentBox child =
View Full Code Here

    {
      setDrawable((DrawableWrapper) o);
    }
    else
    {
      setDrawable(new DrawableWrapper(o));
    }
  }
View Full Code Here

      final Object rawContentObject = rpc.getRawObject();
      if (rawContentObject instanceof DrawableWrapper == false)
      {
        return true;
      }
      final DrawableWrapper wrapper = (DrawableWrapper) rawContentObject;
      final Object rawbackend = wrapper.getBackend();
      if (rawbackend instanceof ShapeDrawable == false)
      {
        return true;
      }
      final ShapeDrawable drawable = (ShapeDrawable) rawbackend;
View Full Code Here

      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());
View Full Code Here

      return value;
    }
    if (value instanceof Component)
    {
      final Component c = (Component) value;
      return new DrawableWrapper(createComponentDrawable(runtime, c, element));
    }
    if (value instanceof DrawableWrapper)
    {
      return value;
    }
    if (DrawableWrapper.isDrawable(value))
    {
      return new DrawableWrapper(value);
    }

    final ContentTypeContext context = element.getElementContext(ContentTypeContext.class);
    if (context.failureCache != null)
    {
      final Object o = context.failureCache.get(value);
      if (Boolean.TRUE.equals(o))
      {
        return null;
      }
    }
    try
    {
      final ResourceKey contentBase = runtime.getProcessingContext().getContentBase();
      final ResourceManager resManager = runtime.getProcessingContext().getResourceManager();
      final Object contentBaseValue = element.getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.CONTENT_BASE);
      final ResourceKey key = resManager.createOrDeriveKey(contentBase, value, contentBaseValue);
      if (key == null)
      {
        return null;
      }

      final Resource resource = resManager.create(key, contentBase, ContentType.TARGETS);
      final Object resourceContent = resource.getResource();
      if (resourceContent instanceof DrawableWrapper)
      {
        return resourceContent;
      }
      else if (DrawableWrapper.isDrawable(resourceContent))
      {
        return new DrawableWrapper(resourceContent);
      }
      else if (resourceContent instanceof Image)
      {
        return new DefaultImageReference(resource);
      }
View Full Code Here

      }
    }

    if (rawObject instanceof DrawableWrapper)
    {
      final DrawableWrapper drawable = (DrawableWrapper) rawObject;
      // render it into an Buffered image and make it a PNG file.
      final StrictBounds cb = new StrictBounds(0, 0, width, height);
      final DefaultImageReference image =
          RenderUtility.createImageFromDrawable(drawable, cb, styleSheet, metaData);
      if (image == null)
View Full Code Here

    {
      drawImage(content, (Image) o);
    }
    else if (o instanceof DrawableWrapper)
    {
      final DrawableWrapper d = (DrawableWrapper) o;
      drawDrawable(content, g2, d);
    }
    else if (o instanceof LocalImageContainer)
    {
      final LocalImageContainer imageContainer = (LocalImageContainer) o;
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.resourceloader.factory.drawable.DrawableWrapper

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.