Runtime

## org.eclipse.gmf.runtime.draw2d.ui.render.factory
Class RenderedImageFactory

    java.lang.Object
      org.eclipse.gmf.runtime.draw2d.ui.render.factory.RenderedImageFactory

public class RenderedImageFactory
extends java.lang.Object

Constructor Summary
`RenderedImageFactory()`

Method Summary
`static RenderInfo` `createInfo(int width, int height, boolean maintainAspectRatio, boolean antialias, RGB fill, RGB outline)` createInfo static Utility to create a RenderInfo object.
`static RenderedImage` `getInstance(byte[] buffer)` getInstance static constructor method for retrieving the appropriate instance of the immutable class `RenderedImage`.
`static RenderedImage` `getInstance(byte[] buffer, RenderInfo info)` getInstance static constructor method for retrieving the appropriate instance of the immutable class `RenderedImage`.
`static RenderedImage` `getInstance(java.lang.String szFilePath)` getInstance static constructor method for retrieving the appropriate instance of the immutable class `RenderedImage`.
`static RenderedImage` `getInstance(java.lang.String szFilePath, RenderInfo info)` getInstance static constructor method for retrieving the appropriate instance of the immutable class `RenderedImage`.
`static RenderedImage` `getInstance(java.net.URL theURL)` getInstance static constructor method for retrieving the appropriate instance of the immutable class `RenderedImage`.
`static RenderedImage` `getInstance(java.net.URL theURL, RenderInfo info)` getInstance static constructor method for retrieving the appropriate instance of the immutable class `RenderedImage`.
`static RenderedImage` `getRelatedInstance(RenderedImage image, RenderInfo info)` Returns a related instance of the given `RenderedImage` that is based on the same byte stream or file info but instrumented for the passed in `RenderInfo` object

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RenderedImageFactory

    public RenderedImageFactory()

Method Detail

### createInfo

    public static RenderInfo createInfo(int width,
                                        int height,
                                        boolean maintainAspectRatio,
                                        boolean antialias,
                                        RGB fill,
                                        RGB outline)

  createInfo static Utility to create a RenderInfo object.

  Parameters:
    `width` - the width of the rendered image to set
    `height` - the height of the rendered image to set
    `maintainAspectRatio` - `boolean` `true` if aspect ratio of original vector file is maintained, `false` otherwise
    `antialias` - `boolean` `true` if the image is to be rendered using anti-aliasing (removing "jaggies" producing smoother lines), `false` otherwise
    `fill` - the `RGB` of the fill that could instrumented into image formats that support dynamic color replacement. Typically, this would replace colors in the image which are "white" i.e. RGB(255,255,255)
    `outline` - the `RGB` of the outline that could instrumented into image formats that support dynamic color replacement. Typically, this would replace colors in the image which are "black" i.e. RGB(0,0,0)
  Returns:
    `RenderInfo` object that contains information about the rendered image.

### getInstance

    public static RenderedImage getInstance(java.net.URL theURL)

  getInstance static constructor method for retrieving the appropriate instance of the immutable class `RenderedImage`. This method is used to read svg images from JARs.

  Parameters:
    `theURL` - URL of the SVG image. Normally in a JAR
  Returns:
    `RenderedImage` instance with the size dimensions requested.

### getInstance

    public static RenderedImage getInstance(java.net.URL theURL,
                                            RenderInfo info)

  getInstance static constructor method for retrieving the appropriate instance of the immutable class `RenderedImage`. This method is used to read svg images from JARs.

  Parameters:
    `theURL` - URL of the SVG image.
    `info` - object containing information about the size and general data regarding how the image will be rendered.
  Returns:
    `RenderedImage` instance with the size dimensions requested.

### getInstance

    public static RenderedImage getInstance(java.lang.String szFilePath)

  getInstance static constructor method for retrieving the appropriate instance of the immutable class `RenderedImage`.

  Parameters:
    `szFilePath` - `String` file path of svg file
  Returns:
    `RenderedImage` instance with the size dimensions requested.

### getInstance

    public static RenderedImage getInstance(java.lang.String szFilePath,
                                            RenderInfo info)

  getInstance static constructor method for retrieving the appropriate instance of the immutable class `RenderedImage`.

  Parameters:
    `szFilePath` - `String` file path of svg file
    `info` - `RenderInfo` object containing information about the size and general data regarding how the image will be rendered.
  Returns:
    `RenderedImage` instance with the size dimensions requested.

### getInstance

    public static RenderedImage getInstance(byte[] buffer)

  getInstance static constructor method for retrieving the appropriate instance of the immutable class `RenderedImage`.

  Parameters:
    `buffer` - `byte[]` array containing an cached SVG image file.
  Returns:
    the `RenderedImage` that encapsulates the contents of the given byte buffer.

### getRelatedInstance

    public static RenderedImage getRelatedInstance(RenderedImage image,
                                                   RenderInfo info)

  Returns a related instance of the given `RenderedImage` that is based on the same byte stream or file info but instrumented for the passed in `RenderInfo` object

  Parameters:
    `image` - `RenderedImage` that is used as a base to retrieve the related instance.
    `info` - `RenderInfo` object containing information about the size and general data regarding how the image will be rendered.
  Returns:
    `RenderedImage` instance with the size dimensions requested. May return `null` if no related instance can be found or if the original buffer cannot be retrieved.

### getInstance

    public static RenderedImage getInstance(byte[] buffer,
                                            RenderInfo info)

  getInstance static constructor method for retrieving the appropriate instance of the immutable class `RenderedImage`.

  Parameters:
    `buffer` - byte[] array containing an cached SVG image file.
    `info` - object containing information about the size and general data regarding how the image will be rendered.
  Returns:
    `RenderedImage` instance with the size dimensions requested.

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.