org.apache.batik.transcoder.wmf.tosvg

Class TextureFactory

public class TextureFactory extends Object

This class generate Paints from WMF hatch definitions. All generated Paints are cached for future use.
Method Summary
static TextureFactorygetInstance()
Get the unique instance of the class.
static TextureFactorygetInstance(float scale)
Get the unique instance of the class, setting the scale of the pattern.
PaintgetTexture(int textureId)
Get a texture from a WMF hatch definition (in black Color).
PaintgetTexture(int textureId, Color foreground)
Get a texture from a WMF hatch definition, with a foreground color.
PaintgetTexture(int textureId, Color foreground, Color background)
Get a texture from a WMF hatch definition, with a foreground and a background color.
voidreset()
Rest the factory.

Method Detail

getInstance

public static TextureFactory getInstance()
Get the unique instance of the class.

getInstance

public static TextureFactory getInstance(float scale)
Get the unique instance of the class, setting the scale of the pattern. TODO : scale is not handled for now

getTexture

public Paint getTexture(int textureId)
Get a texture from a WMF hatch definition (in black Color). This texture will be cached, so the Paint will only be created once.

getTexture

public Paint getTexture(int textureId, Color foreground)
Get a texture from a WMF hatch definition, with a foreground color. This texture will be cached, so the Paint will only be created once.

getTexture

public Paint getTexture(int textureId, Color foreground, Color background)
Get a texture from a WMF hatch definition, with a foreground and a background color. This texture will be cached, so the Paint will only be created once.

reset

public void reset()
Rest the factory. It empties all the previouly cached Paints are disposed of.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.