public class WMFPainter extends AbstractWMFPainter
Graphics
object.Modifier and Type | Field and Description |
---|---|
private java.awt.Color |
bkgdColor |
private java.io.BufferedInputStream |
bufStream |
private float |
conv |
private boolean |
firstEffectivePaint |
private java.awt.Color |
frgdColor |
private static int |
INPUT_BUFFER_SIZE
Size of the buffer used for reading input WMF files
|
private static java.lang.Integer |
INTEGER_0 |
private java.awt.image.ImageObserver |
observer |
private boolean |
opaque |
private float |
scale |
private float |
scaleX |
private float |
scaleY |
private static java.awt.BasicStroke |
solid |
private static java.awt.BasicStroke |
textSolid |
private float |
vpH |
private float |
vpW |
private float |
vpX |
private float |
vpY |
private float |
xOffset |
private float |
yOffset |
bReadingWMF, BRUSH, currentHorizAlign, currentStore, currentVertAlign, FONT, NULL_BRUSH, NULL_PEN, OBJ_BITMAP, OBJ_REGION, PALETTE, PEN, WMF_FILE_EXTENSION, wmfFont
Constructor and Description |
---|
WMFPainter(WMFRecordStore currentStore,
float scale)
Basic constructor.
|
WMFPainter(WMFRecordStore currentStore,
int xOffset,
int yOffset,
float scale)
Basic constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
drawPolyPolygon(java.awt.Graphics2D g2d,
java.util.List pols)
Just to be consistent with PolyPolygon filling.
|
private void |
drawString(int flag,
java.awt.Graphics2D g2d,
java.text.AttributedCharacterIterator ati,
float x,
float y,
java.awt.font.TextLayout layout,
WMFFont wmfFont,
int align)
Draw an AttributedCharacterIterator taking into account the following characteristics.
|
private void |
fillPolyPolygon(java.awt.Graphics2D g2d,
java.util.List pols)
Need to do this for POLYPOLYGON, because only GeneralPaths can handle complex
WMF shapes.
|
private void |
fillTextBackground(int align,
int flag,
java.awt.Graphics2D g2d,
float x,
float y,
float width,
java.awt.font.TextLayout layout) |
private int |
getHorizontalAlignement(int align) |
private java.awt.Paint |
getPaint(byte[] bit) |
WMFRecordStore |
getRecordStore()
Returns the WMFRecordStore this WMFPainter renders
|
private java.awt.Paint |
getStoredPaint(WMFRecordStore currentStore,
int object) |
private float |
getVerticalAlignmentValue(java.awt.font.TextLayout layout,
int vertAlign) |
void |
paint(java.awt.Graphics g)
Renders the WMF image(s).
|
private void |
paint(int brushObject,
int penObject,
java.awt.Shape shape,
java.awt.Graphics2D g2d)
Draw or / and fill the Shape, depending on the pen or brush Objects selected.
|
private void |
paintWithPen(int penObject,
java.awt.Shape shape,
java.awt.Graphics2D g2d)
Draw the Shape, depending on the pen or brush Objects selected.
|
private void |
setBrushPaint(WMFRecordStore currentStore,
java.awt.Graphics2D g2d,
int brushObject) |
private void |
setPenColor(WMFRecordStore currentStore,
java.awt.Graphics2D g2d,
int penObject) |
private void |
setStroke(java.awt.Graphics2D g2d,
int penStyle,
float penWidth,
float scale) |
addObject, addObjectAt, getAttributedString, getCharacterIterator, getCharacterIterator, getImage, getImage, getImageDimension, setRecordStore
private static final int INPUT_BUFFER_SIZE
private static final java.lang.Integer INTEGER_0
private float scale
private float scaleX
private float scaleY
private float conv
private float xOffset
private float yOffset
private float vpX
private float vpY
private float vpW
private float vpH
private java.awt.Color frgdColor
private java.awt.Color bkgdColor
private boolean opaque
private transient boolean firstEffectivePaint
private static java.awt.BasicStroke solid
private static java.awt.BasicStroke textSolid
private transient java.awt.image.ImageObserver observer
private transient java.io.BufferedInputStream bufStream
public WMFPainter(WMFRecordStore currentStore, float scale)
currentStore
- where the WMF records are storedscale
- the scale of the imagepublic WMFPainter(WMFRecordStore currentStore, int xOffset, int yOffset, float scale)
scale
- the scale of the imagecurrentStore
- where the WMF records are storedxOffset
- x value for offsetyOffset
- y value for offsetpublic void paint(java.awt.Graphics g)
private java.awt.Paint getPaint(byte[] bit)
private void drawString(int flag, java.awt.Graphics2D g2d, java.text.AttributedCharacterIterator ati, float x, float y, java.awt.font.TextLayout layout, WMFFont wmfFont, int align)
The other characteristics of the text, deriving from the WMF Font, must have been collected before to constitute the AttributedCharacterIterator.
private void fillTextBackground(int align, int flag, java.awt.Graphics2D g2d, float x, float y, float width, java.awt.font.TextLayout layout)
private void drawPolyPolygon(java.awt.Graphics2D g2d, java.util.List pols)
private void fillPolyPolygon(java.awt.Graphics2D g2d, java.util.List pols)
private void setStroke(java.awt.Graphics2D g2d, int penStyle, float penWidth, float scale)
private void setPenColor(WMFRecordStore currentStore, java.awt.Graphics2D g2d, int penObject)
private int getHorizontalAlignement(int align)
private void setBrushPaint(WMFRecordStore currentStore, java.awt.Graphics2D g2d, int brushObject)
private java.awt.Paint getStoredPaint(WMFRecordStore currentStore, int object)
private void paint(int brushObject, int penObject, java.awt.Shape shape, java.awt.Graphics2D g2d)
private void paintWithPen(int penObject, java.awt.Shape shape, java.awt.Graphics2D g2d)
private float getVerticalAlignmentValue(java.awt.font.TextLayout layout, int vertAlign)
public WMFRecordStore getRecordStore()
getRecordStore
in class AbstractWMFPainter