Package org.pentaho.reporting.libraries.resourceloader

Examples of org.pentaho.reporting.libraries.resourceloader.SimpleResource


      final SVGDrawable drawable = new SVGDrawable(node);
      final BufferedImage bi = new BufferedImage((int) bounds.getWidth(), (int) bounds.getHeight(), BufferedImage.TYPE_INT_ARGB);
      final Graphics2D graphics = (Graphics2D) bi.getGraphics();
      drawable.draw(graphics, new Rectangle2D.Double(0, 0, bounds.getWidth(), bounds.getHeight()));
      graphics.dispose();
      return new SimpleResource(data.getKey(), bi, Image.class, version);
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to process SVG file", e);
    }
View Full Code Here


          throws ResourceLoadingException
  {
    final long version = data.getVersion(caller);
    final Image image =
            Toolkit.getDefaultToolkit().createImage(data.getResource(caller));
    return new SimpleResource (data.getKey(), image, Image.class, version);
  }
View Full Code Here

      }
      finally
      {
        stream.close();
      }
      return new SimpleResource (data.getKey(), properties, data.getVersion(manager));
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to load the properties file.",e);
    }
View Full Code Here

      final SVGDocument document = (SVGDocument) loader.loadDocument
          (String.valueOf(data.getKey().getIdentifier()), data.getResourceAsStream(caller));
      final BridgeContext ctx = new BridgeContext(userAgent, loader);
      final GVTBuilder builder = new GVTBuilder();
      final GraphicsNode node = builder.build(ctx, document);
      return new SimpleResource(data.getKey(), new SVGDrawable(node), version);
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to process WMF file", e);
    }
View Full Code Here

      final InputStream stream = data.getResourceAsStream(caller);
      try
      {
        final WmfFile wmfFile = new WmfFile(stream, -1, -1);
        final Image image = wmfFile.replay();
        return new SimpleResource(data.getKey(), image, version);
      }
      finally
      {
        stream.close();
      }
View Full Code Here

      final StaticRenderer staticRenderer = new StaticRenderer();
      staticRenderer.setDoubleBuffered(true);
      staticRenderer.setTree(node);
      staticRenderer.updateOffScreen((int) bounds.getWidth(), (int) bounds.getHeight());
      return new SimpleResource(data.getKey(), staticRenderer.getOffScreen(), version);
    }
    catch (IOException e)
    {
      throw new ResourceLoadingException("Failed to process SVG file", e);
    }
View Full Code Here

    if (image == null)
    {
      throw new ResourceCreationException("Failed to load the image. ImageIO#read returned null");
    }

    return new SimpleResource(data.getKey(), image, version);
  }
View Full Code Here

      final long version = data.getVersion(caller);
      final InputStream stream = data.getResourceAsStream(caller);
      try
      {
        final WmfFile wmfFile = new WmfFile(stream, -1, -1);
        return new SimpleResource (data.getKey(), wmfFile, version);
      }
      finally
      {
        stream.close();
      }
View Full Code Here

          throw new ResourceCreationException("This is no 8Bit Encoding data");
        }
        final External8BitEncodingData encData = (External8BitEncodingData) ob;
        final External8BitEncodingCore encCore =
                new External8BitEncodingCore(encData);
        return new SimpleResource(data.getKey(), encCore, data.getVersion(manager));
      }
      finally
      {
        oin.close();
      }
View Full Code Here

          throws ResourceLoadingException
  {
    final long version = data.getVersion(caller);
    final Image image =
            Toolkit.getDefaultToolkit().createImage(data.getResource(caller));
    return new SimpleResource (data.getKey(), image, version);
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.resourceloader.SimpleResource

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.