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: WMFPainter.java 1831630 2018-05-15 12:56:55Z ssteiner $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Color
private BufferedInputStream
private float
private boolean
private Color
private static final int
Size of the buffer used for reading input WMF filesprivate static final Integer
private ImageObserver
private boolean
private float
private float
private float
private static BasicStroke
private static BasicStroke
private float
private float
private float
private float
private float
private float
Fields inherited from class org.apache.batik.transcoder.wmf.tosvg.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 void
drawPolyPolygon
(Graphics2D g2d, List pols) Just to be consistent with PolyPolygon filling.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.private void
fillPolyPolygon
(Graphics2D g2d, List pols) Need to do this for POLYPOLYGON, because only GeneralPaths can handle complex WMF shapes.private void
fillTextBackground
(int align, int flag, Graphics2D g2d, float x, float y, float width, TextLayout layout) private int
getHorizontalAlignement
(int align) private Paint
getPaint
(byte[] bit) Returns the WMFRecordStore this WMFPainter rendersprivate Paint
getStoredPaint
(WMFRecordStore currentStore, int object) private float
getVerticalAlignmentValue
(TextLayout layout, int vertAlign) private void
paint
(int brushObject, int penObject, Shape shape, Graphics2D g2d) Draw or / and fill the Shape, depending on the pen or brush Objects selected.void
Renders the WMF image(s).private void
paintWithPen
(int penObject, Shape shape, Graphics2D g2d) Draw the Shape, depending on the pen or brush Objects selected.private void
setBrushPaint
(WMFRecordStore currentStore, Graphics2D g2d, int brushObject) private void
setPenColor
(WMFRecordStore currentStore, Graphics2D g2d, int penObject) private void
setStroke
(Graphics2D g2d, int penStyle, float penWidth, float scale) Methods inherited from class org.apache.batik.transcoder.wmf.tosvg.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:
getRecordStore
in classAbstractWMFPainter
-