org.apache.batik.transcoder.wmf.tosvg

Class AbstractWMFPainter

public class AbstractWMFPainter extends Object

This class provides generic methods that must be used by a particular WMFPainter.
Field Summary
protected booleanbReadingWMF
protected BufferedInputStreambufStream
static intBRUSH
protected intcurrentHorizAlign
protected WMFRecordStorecurrentStore
protected intcurrentVertAlign
static intFONT
static intNULL_BRUSH
static intNULL_PEN
static intOBJ_BITMAP
static intOBJ_REGION
static intPALETTE
static intPEN
protected WMFFontwmfFont
static StringWMF_FILE_EXTENSION
Method Summary
protected intaddObject(WMFRecordStore store, int type, Object obj)
protected intaddObjectAt(WMFRecordStore store, int type, Object obj, int idx)
protected AttributedStringgetAttributedString(Graphics2D g2d, String sr, WMFFont wmffont)
protected AttributedCharacterIteratorgetCharacterIterator(Graphics2D g2d, String sr, WMFFont wmffont)
Create an AttributedCharacterIterator with the current definition of the WMF Font, and the input String.
protected AttributedCharacterIteratorgetCharacterIterator(Graphics2D g2d, String sr, WMFFont wmffont, int align)
Create an AttributedCharacterIterator with the current definition of the WMF Font, and the input String.
protected BufferedImagegetImage(byte[] bit, int width, int height)
Return the image associated with a bitmap in a Metafile.
protected BufferedImagegetImage(byte[] bit)
Return the image associated with a bitmap in a Metafile.
protected DimensiongetImageDimension(byte[] bit)
WMFRecordStoregetRecordStore()
Returns the WMFRecordStore this WMFPainter renders
voidsetRecordStore(WMFRecordStore currentStore)
Sets the WMFRecordStore this WMFPainter should use to render

Field Detail

bReadingWMF

protected transient boolean bReadingWMF

bufStream

protected transient BufferedInputStream bufStream

BRUSH

public static final int BRUSH

currentHorizAlign

protected int currentHorizAlign

currentStore

protected WMFRecordStore currentStore

currentVertAlign

protected int currentVertAlign

FONT

public static final int FONT

NULL_BRUSH

public static final int NULL_BRUSH

NULL_PEN

public static final int NULL_PEN

OBJ_BITMAP

public static final int OBJ_BITMAP

OBJ_REGION

public static final int OBJ_REGION

PALETTE

public static final int PALETTE

PEN

public static final int PEN

wmfFont

protected WMFFont wmfFont

WMF_FILE_EXTENSION

public static final String WMF_FILE_EXTENSION

Method Detail

addObject

protected int addObject(WMFRecordStore store, int type, Object obj)

addObjectAt

protected int addObjectAt(WMFRecordStore store, int type, Object obj, int idx)

getAttributedString

protected AttributedString getAttributedString(Graphics2D g2d, String sr, WMFFont wmffont)

getCharacterIterator

protected AttributedCharacterIterator getCharacterIterator(Graphics2D g2d, String sr, WMFFont wmffont)
Create an AttributedCharacterIterator with the current definition of the WMF Font, and the input String.

getCharacterIterator

protected AttributedCharacterIterator getCharacterIterator(Graphics2D g2d, String sr, WMFFont wmffont, int align)
Create an AttributedCharacterIterator with the current definition of the WMF Font, and the input String.

getImage

protected BufferedImage getImage(byte[] bit, int width, int height)
Return the image associated with a bitmap in a Metafile. 24 bits and 8 bits bitmaps are handled.

Parameters: bit the bitmap byte array width the bitmap assumed width height the bitmap assumed height

Returns: the Image associated with the bitmap (null if the dimensions detected in the header are not consistent with the assumed dimensions)

getImage

protected BufferedImage getImage(byte[] bit)
Return the image associated with a bitmap in a Metafile. 24 bits and 8 bits bitmaps are handled.

Parameters: bit the bitmap byte array

Returns: the Image associated with the bitmap (null if the dimensions detected in the header are not consistent with the assumed dimensions)

getImageDimension

protected Dimension getImageDimension(byte[] bit)

getRecordStore

public WMFRecordStore getRecordStore()
Returns the WMFRecordStore this WMFPainter renders

setRecordStore

public void setRecordStore(WMFRecordStore currentStore)
Sets the WMFRecordStore this WMFPainter should use to render
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.