Class TextureFactory
- java.lang.Object
-
- org.apache.batik.transcoder.wmf.tosvg.TextureFactory
-
public final class TextureFactory extends java.lang.ObjectThis class generate Paints from WMF hatch definitions. All generated Paints are cached for future use.- Version:
- $Id: TextureFactory.java 1831635 2018-05-15 13:33:47Z ssteiner $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classTextureFactory.ColoredTextureContain a handle to a Colored texture, with optional foreground and background colors.
-
Field Summary
Fields Modifier and Type Field Description private static TextureFactoryfacprivate floatscaleprivate static intSIZEprivate java.util.Maptextures
-
Constructor Summary
Constructors Modifier Constructor Description privateTextureFactory(float scale)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.awt.PaintcreateTexture(int textureId, java.awt.Color foreground, java.awt.Color background)Called internally if the Paint does not exist in the cache and must be created.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.java.awt.PaintgetTexture(int textureId)Get a texture from a WMF hatch definition (in black Color).java.awt.PaintgetTexture(int textureId, java.awt.Color foreground)Get a texture from a WMF hatch definition, with a foreground color.java.awt.PaintgetTexture(int textureId, java.awt.Color foreground, java.awt.Color background)Get a texture from a WMF hatch definition, with a foreground and a background color.voidreset()Rest the factory.
-
-
-
Field Detail
-
fac
private static TextureFactory fac
-
textures
private java.util.Map textures
-
SIZE
private static final int SIZE
- See Also:
- Constant Field Values
-
scale
private float scale
-
-
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
-
reset
public void reset()
Rest the factory. It empties all the previouly cached Paints are disposed of.
-
getTexture
public java.awt.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 java.awt.Paint getTexture(int textureId, java.awt.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 java.awt.Paint getTexture(int textureId, java.awt.Color foreground, java.awt.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.
-
createTexture
private java.awt.Paint createTexture(int textureId, java.awt.Color foreground, java.awt.Color background)Called internally if the Paint does not exist in the cache and must be created.
-
-