Class AbstractWMFPainter
- java.lang.Object
-
- org.apache.batik.transcoder.wmf.tosvg.AbstractWMFPainter
-
- Direct Known Subclasses:
WMFPainter
public class AbstractWMFPainter extends java.lang.ObjectThis class provides generic methods that must be used by a particular WMFPainter.- Version:
- $Id: AbstractWMFPainter.java 1831630 2018-05-15 12:56:55Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanbReadingWMFstatic intBRUSHprotected java.io.BufferedInputStreambufStreamprotected intcurrentHorizAlignprotected WMFRecordStorecurrentStoreprotected intcurrentVertAlignstatic intFONTstatic intNULL_BRUSHstatic intNULL_PENstatic intOBJ_BITMAPstatic intOBJ_REGIONstatic intPALETTEstatic intPENstatic java.lang.StringWMF_FILE_EXTENSIONprotected WMFFontwmfFont
-
Constructor Summary
Constructors Constructor Description AbstractWMFPainter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intaddObject(WMFRecordStore store, int type, java.lang.Object obj)protected intaddObjectAt(WMFRecordStore store, int type, java.lang.Object obj, int idx)protected java.text.AttributedStringgetAttributedString(java.awt.Graphics2D g2d, java.lang.String sr, WMFFont wmffont)protected java.text.AttributedCharacterIteratorgetCharacterIterator(java.awt.Graphics2D g2d, java.lang.String sr, WMFFont wmffont)Create an AttributedCharacterIterator with the current definition of the WMF Font, and the input String.protected java.text.AttributedCharacterIteratorgetCharacterIterator(java.awt.Graphics2D g2d, java.lang.String sr, WMFFont wmffont, int align)Create an AttributedCharacterIterator with the current definition of the WMF Font, and the input String.protected java.awt.image.BufferedImagegetImage(byte[] bit)Return the image associated with a bitmap in a Metafile.protected java.awt.image.BufferedImagegetImage(byte[] bit, int width, int height)Return the image associated with a bitmap in a Metafile.protected java.awt.DimensiongetImageDimension(byte[] bit)WMFRecordStoregetRecordStore()Returns the WMFRecordStore this WMFPainter rendersvoidsetRecordStore(WMFRecordStore currentStore)Sets the WMFRecordStore this WMFPainter should use to render
-
-
-
Field Detail
-
WMF_FILE_EXTENSION
public static final java.lang.String WMF_FILE_EXTENSION
- See Also:
- Constant Field Values
-
wmfFont
protected WMFFont wmfFont
-
currentHorizAlign
protected int currentHorizAlign
-
currentVertAlign
protected int currentVertAlign
-
PEN
public static final int PEN
- See Also:
- Constant Field Values
-
BRUSH
public static final int BRUSH
- See Also:
- Constant Field Values
-
FONT
public static final int FONT
- See Also:
- Constant Field Values
-
NULL_PEN
public static final int NULL_PEN
- See Also:
- Constant Field Values
-
NULL_BRUSH
public static final int NULL_BRUSH
- See Also:
- Constant Field Values
-
PALETTE
public static final int PALETTE
- See Also:
- Constant Field Values
-
OBJ_BITMAP
public static final int OBJ_BITMAP
- See Also:
- Constant Field Values
-
OBJ_REGION
public static final int OBJ_REGION
- See Also:
- Constant Field Values
-
currentStore
protected WMFRecordStore currentStore
-
bReadingWMF
protected transient boolean bReadingWMF
-
bufStream
protected transient java.io.BufferedInputStream bufStream
-
-
Method Detail
-
getImage
protected java.awt.image.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 arraywidth- the bitmap assumed widthheight- 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)
-
getImageDimension
protected java.awt.Dimension getImageDimension(byte[] bit)
-
getImage
protected java.awt.image.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)
-
getCharacterIterator
protected java.text.AttributedCharacterIterator getCharacterIterator(java.awt.Graphics2D g2d, java.lang.String sr, WMFFont wmffont)Create an AttributedCharacterIterator with the current definition of the WMF Font, and the input String.
-
getCharacterIterator
protected java.text.AttributedCharacterIterator getCharacterIterator(java.awt.Graphics2D g2d, java.lang.String sr, WMFFont wmffont, int align)Create an AttributedCharacterIterator with the current definition of the WMF Font, and the input String.
-
getAttributedString
protected java.text.AttributedString getAttributedString(java.awt.Graphics2D g2d, java.lang.String sr, WMFFont wmffont)
-
setRecordStore
public void setRecordStore(WMFRecordStore currentStore)
Sets the WMFRecordStore this WMFPainter should use to render
-
getRecordStore
public WMFRecordStore getRecordStore()
Returns the WMFRecordStore this WMFPainter renders
-
addObject
protected int addObject(WMFRecordStore store, int type, java.lang.Object obj)
-
addObjectAt
protected int addObjectAt(WMFRecordStore store, int type, java.lang.Object obj, int idx)
-
-