org.jfree.pixie.wmf.records
Class MfCmd
java.lang.Object
org.jfree.pixie.wmf.records.MfCmd
public abstract class MfCmd
extends java.lang.Object
This is the base class for all WMF-Records. A WMF record specifies a single command for
drawing a element of the image.
MfCmd() - The default constructor, adjusts the scale to 1.
|
protected int[] | applyScaleX(int[] n, int[] dest) - Applies the new x-scaling to all values in the array n and places the values in the
array dest.
|
protected int[] | applyScaleY(int[] n, int[] dest) - Applies the new y-scaling to all values in the array n and places the values in the
array dest.
|
abstract int | getFunction() - Reads the function identifier.
|
abstract MfCmd | getInstance() - Creates a empty unintialized copy of this command implementation.
|
abstract MfRecord | getRecord() - Creates a new record based on the data stored in the MfCommand.
|
protected int | getScaledHeight(int length) - Scales the given vertical length and makes sure that the lenght is at least 1.
|
protected int | getScaledWidth(int length) - Scales the given horizontal length and makes sure that the lenght is at least 1.
|
int | getScaledX(int x) - Return integer scaled to output units.
|
int | getScaledY(int y) - Return integer scaled to output units.
|
abstract void | replay(WmfFile metafile) - Replays the command on the given WmfFile.
|
protected Rectangle | scaleRect(Rectangle r) - Scales the given rectangle.
|
protected abstract void | scaleXChanged() - A callback function to inform the object, that the x scale has changed and the
internal coordinate values have to be adjusted.
|
protected abstract void | scaleYChanged() - A callback function to inform the object, that the y scale has changed and the
internal coordinate values have to be adjusted.
|
abstract void | setRecord(MfRecord record) - Reads the command data from the given record and adjusts the internal parameters
according to the data parsed.
|
void | setScale(float scaleX, float scaleY) - Set the scale for the command.
|
MfCmd
public MfCmd()
The default constructor, adjusts the scale to 1.
applyScaleX
protected int[] applyScaleX(int[] n,
int[] dest)
Applies the new x-scaling to all values in the array n and places the values in the
array dest. Additionally dest is also returned as return value.
n
- the unscaled source valuesdest
- the array to store the scaled values
applyScaleY
protected int[] applyScaleY(int[] n,
int[] dest)
Applies the new y-scaling to all values in the array n and places the values in the
array dest. Additionally dest is also returned as return value.
n
- the unscaled source valuesdest
- the array to store the scaled values
getFunction
public abstract int getFunction()
Reads the function identifier. Every record type is identified by a function number
corresponding to one of the Windows GDI functions used.
getInstance
public abstract MfCmd getInstance()
Creates a empty unintialized copy of this command implementation.
- a new instance of the command.
getScaledHeight
protected int getScaledHeight(int length)
Scales the given vertical length and makes sure that the lenght is at least 1.
length
- the value that should be scaled.
getScaledWidth
protected int getScaledWidth(int length)
Scales the given horizontal length and makes sure that the lenght is at least 1.
length
- the value that should be scaled.
getScaledX
public int getScaledX(int x)
Return integer scaled to output units.
getScaledY
public int getScaledY(int y)
Return integer scaled to output units.
replay
public abstract void replay(WmfFile metafile)
Replays the command on the given WmfFile.
metafile
- the meta file.
scaleRect
protected Rectangle scaleRect(Rectangle r)
Scales the given rectangle.
r
- the source rectangle.
- a new rectangle containing the scaled values.
scaleXChanged
protected abstract void scaleXChanged()
A callback function to inform the object, that the x scale has changed and the
internal coordinate values have to be adjusted.
scaleYChanged
protected abstract void scaleYChanged()
A callback function to inform the object, that the y scale has changed and the
internal coordinate values have to be adjusted.
setRecord
public abstract void setRecord(MfRecord record)
Reads the command data from the given record and adjusts the internal parameters
according to the data parsed.
After the raw record was read from the datasource, the record is parsed by the
concrete implementation.
record
- the raw data that makes up the record.
setScale
public void setScale(float scaleX,
float scaleY)
Set the scale for the command.
scaleX
- the horizontal scalescaleY
- the vertical scale