Class WMFPainter
java.lang.Object
org.apache.batik.transcoder.wmf.tosvg.AbstractWMFPainter
org.apache.batik.transcoder.wmf.tosvg.WMFPainter
Core class for rendering the WMF image. It is able to render a
WMF file in a
Graphics object.- Version:
- $Id$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Colorprivate BufferedInputStreamprivate floatprivate booleanprivate Colorprivate static final intSize of the buffer used for reading input WMF filesprivate static final Integerprivate ImageObserverprivate booleanprivate floatprivate floatprivate floatprivate static BasicStrokeprivate static BasicStrokeprivate floatprivate floatprivate floatprivate floatprivate floatprivate floatFields inherited from class AbstractWMFPainter
bReadingWMF, BRUSH, currentHorizAlign, currentStore, currentVertAlign, FONT, NULL_BRUSH, NULL_PEN, OBJ_BITMAP, OBJ_REGION, PALETTE, PEN, WMF_FILE_EXTENSION, wmfFont -
Constructor Summary
ConstructorsConstructorDescriptionWMFPainter(WMFRecordStore currentStore, float scale) Basic constructor.WMFPainter(WMFRecordStore currentStore, int xOffset, int yOffset, float scale) Basic constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate voiddrawPolyPolygon(Graphics2D g2d, List pols) Just to be consistent with PolyPolygon filling.private voiddrawString(int flag, Graphics2D g2d, AttributedCharacterIterator ati, float x, float y, TextLayout layout, WMFFont wmfFont, int align) Draw an AttributedCharacterIterator taking into account the following characteristics.private voidfillPolyPolygon(Graphics2D g2d, List pols) Need to do this for POLYPOLYGON, because only GeneralPaths can handle complex WMF shapes.private voidfillTextBackground(int align, int flag, Graphics2D g2d, float x, float y, float width, TextLayout layout) private intgetHorizontalAlignement(int align) private PaintgetPaint(byte[] bit) Returns the WMFRecordStore this WMFPainter rendersprivate PaintgetStoredPaint(WMFRecordStore currentStore, int object) private floatgetVerticalAlignmentValue(TextLayout layout, int vertAlign) private voidpaint(int brushObject, int penObject, Shape shape, Graphics2D g2d) Draw or / and fill the Shape, depending on the pen or brush Objects selected.voidRenders the WMF image(s).private voidpaintWithPen(int penObject, Shape shape, Graphics2D g2d) Draw the Shape, depending on the pen or brush Objects selected.private voidsetBrushPaint(WMFRecordStore currentStore, Graphics2D g2d, int brushObject) private voidsetPenColor(WMFRecordStore currentStore, Graphics2D g2d, int penObject) private voidsetStroke(Graphics2D g2d, int penStyle, float penWidth, float scale) Methods inherited from class AbstractWMFPainter
addObject, addObjectAt, getAttributedString, getCharacterIterator, getCharacterIterator, getImage, getImage, getImageDimension, setRecordStore
-
Field Details
-
INPUT_BUFFER_SIZE
private static final int INPUT_BUFFER_SIZESize of the buffer used for reading input WMF files- See Also:
-
INTEGER_0
-
scale
private float scale -
scaleX
private float scaleX -
scaleY
private float scaleY -
conv
private float conv -
xOffset
private float xOffset -
yOffset
private float yOffset -
vpX
private float vpX -
vpY
private float vpY -
vpW
private float vpW -
vpH
private float vpH -
frgdColor
-
bkgdColor
-
opaque
private boolean opaque -
firstEffectivePaint
private transient boolean firstEffectivePaint -
solid
-
textSolid
-
observer
-
bufStream
-
-
Constructor Details
-
WMFPainter
Basic constructor.- Parameters:
currentStore- where the WMF records are storedscale- the scale of the image
-
WMFPainter
Basic constructor.- Parameters:
currentStore- where the WMF records are storedxOffset- x value for offsetyOffset- y value for offsetscale- the scale of the image
-
-
Method Details
-
paint
Renders the WMF image(s). -
getPaint
-
drawString
private void drawString(int flag, Graphics2D g2d, AttributedCharacterIterator ati, float x, float y, TextLayout layout, WMFFont wmfFont, int align) Draw an AttributedCharacterIterator taking into account the following characteristics. :- the orientation (escapement) of the WMF Font
- the aligment of the text
The other characteristics of the text, deriving from the WMF Font, must have been collected before to constitute the AttributedCharacterIterator.
-
fillTextBackground
private void fillTextBackground(int align, int flag, Graphics2D g2d, float x, float y, float width, TextLayout layout) -
drawPolyPolygon
Just to be consistent with PolyPolygon filling. -
fillPolyPolygon
Need to do this for POLYPOLYGON, because only GeneralPaths can handle complex WMF shapes. -
setStroke
-
setPenColor
-
getHorizontalAlignement
private int getHorizontalAlignement(int align) -
setBrushPaint
-
getStoredPaint
-
paint
Draw or / and fill the Shape, depending on the pen or brush Objects selected. -
paintWithPen
Draw the Shape, depending on the pen or brush Objects selected. -
getVerticalAlignmentValue
-
getRecordStore
Returns the WMFRecordStore this WMFPainter renders- Overrides:
getRecordStorein classAbstractWMFPainter
-