public class WMFHeaderProperties extends AbstractWMFReader
Modifier and Type | Field and Description |
---|---|
private int |
_bbottom |
private int |
_bheight |
private int |
_bleft |
private int |
_bright |
private int |
_btop |
private int |
_bwidth |
private int |
_ibottom |
private int |
_ileft |
private int |
_iright |
private int |
_itop |
static int |
BRUSH |
private int |
currentHorizAlign |
private int |
currentVertAlign |
private boolean |
firstEffectivePaint |
static int |
FONT |
private static java.awt.font.FontRenderContext |
fontCtx |
private static java.lang.Integer |
INTEGER_0 |
static int |
NULL_BRUSH |
static int |
NULL_PEN |
static int |
OBJ_BITMAP |
static int |
OBJ_REGION |
static int |
PALETTE |
static int |
PEN |
private float |
scale |
private int |
startX |
private int |
startY |
protected java.io.DataInputStream |
stream |
private WMFFont |
wf |
bottom, bReading, height, inch, isAldus, isotropic, lastObjectIdx, left, MM_PER_PIXEL, mtHeaderSize, mtMaxRecord, mtNoObjects, mtNoParameters, mtSize, mtType, mtVersion, numObjects, objectVector, PIXEL_PER_INCH, right, scaleX, scaleXY, scaleY, top, vpH, vpW, vpX, vpY, width, windowHeight, windowWidth, xSign, ySign
Constructor and Description |
---|
WMFHeaderProperties()
Creates a new WMFHeaderProperties, with no associated file.
|
WMFHeaderProperties(java.io.File wmffile)
Creates a new WMFHeaderProperties, and sets the associated WMF File.
|
Modifier and Type | Method and Description |
---|---|
void |
closeResource() |
private java.awt.Color |
getColorFromObject(int brushObject)
get the Color corresponding with the Object (pen or brush object).
|
int |
getHeightBoundsPixels() |
int |
getHeightBoundsUnits() |
java.io.DataInputStream |
getStream()
Get the associated stream.
|
private float |
getVerticalAlignmentValue(java.awt.font.TextLayout layout,
int vertAlign)
get the vertical Alignment value for the text.
|
int |
getWidthBoundsPixels() |
int |
getWidthBoundsUnits() |
int |
getXOffset() |
int |
getYOffset() |
private void |
paint(int brushObject,
int penObject,
java.awt.Shape shape)
Resize the bounds of the WMF image according with the bounds of the geometric
Shape.
|
private void |
paintWithPen(int penObject,
java.awt.Shape shape)
Resize the bounds of the WMF image according with the bounds of the geometric
Shape.
|
protected boolean |
readRecords(java.io.DataInputStream is)
Read this InputStream records.
|
void |
reset()
Resets the internal storage and viewport coordinates.
|
private void |
resetBounds() |
private void |
resizeBounds(int x,
int y)
resize Bounds for each primitive encountered.
|
private void |
resizeImageBounds(int x,
int y)
resize Bounds for each image primitive encountered.
|
void |
setFile(java.io.File wmffile)
Creates the properties associated file.
|
addObject, addObjectAt, getBottomUnits, getHeightPixels, getHeightUnits, getLeftUnits, getMetaFileUnitsPerInch, getNumObjects, getObject, getPixelsPerUnit, getRectangleInch, getRectanglePixel, getRectangleUnits, getRightUnits, getTopUnits, getUnitsToPixels, getViewportHeightInch, getViewportHeightUnits, getViewportWidthInch, getViewportWidthUnits, getVpH, getVpHFactor, getVpW, getVpWFactor, getWidthPixels, getWidthUnits, getXSign, getYSign, isReading, read, readInt, readShort, setReading
private static final java.lang.Integer INTEGER_0
protected java.io.DataInputStream stream
private int _bleft
private int _bright
private int _btop
private int _bbottom
private int _bwidth
private int _bheight
private int _ileft
private int _iright
private int _itop
private int _ibottom
private float scale
private int startX
private int startY
private int currentHorizAlign
private int currentVertAlign
private WMFFont wf
private static final java.awt.font.FontRenderContext fontCtx
private transient boolean firstEffectivePaint
public static final int PEN
public static final int BRUSH
public static final int FONT
public static final int NULL_PEN
public static final int NULL_BRUSH
public static final int PALETTE
public static final int OBJ_BITMAP
public static final int OBJ_REGION
public WMFHeaderProperties(java.io.File wmffile) throws java.io.IOException
wmffile
- the WMF Metafilejava.io.IOException
public WMFHeaderProperties()
public void closeResource()
public void setFile(java.io.File wmffile) throws java.io.IOException
java.io.IOException
public void reset()
reset
in class AbstractWMFReader
public java.io.DataInputStream getStream()
protected boolean readRecords(java.io.DataInputStream is) throws java.io.IOException
AbstractWMFReader
AbstractWMFReader.read(DataInputStream)
). The behavior of this method is left
to the subclass.
Each Metafile record is composed of :
Example :
while (functionId > 0) { recSize = readInt( is ); // Subtract size in 16-bit words of recSize and functionId; recSize -= 3; functionId = readShort( is ); if ( functionId <= 0 ) break; switch ( functionId ) { case WMFConstants.<a WMF function ID> { do something when this function is encountered } break; default: for ( int j = 0; j < recSize; j++ ) readShort(is); break;
readRecords
in class AbstractWMFReader
java.io.IOException
WMFConstants
public int getWidthBoundsPixels()
public int getHeightBoundsPixels()
public int getWidthBoundsUnits()
public int getHeightBoundsUnits()
public int getXOffset()
public int getYOffset()
private void resetBounds()
private void resizeBounds(int x, int y)
private void resizeImageBounds(int x, int y)
private java.awt.Color getColorFromObject(int brushObject)
private void paint(int brushObject, int penObject, java.awt.Shape shape)
private void paintWithPen(int penObject, java.awt.Shape shape)
private float getVerticalAlignmentValue(java.awt.font.TextLayout layout, int vertAlign)