public abstract class MfCmd extends Object
Modifier | Constructor and Description |
---|---|
protected |
MfCmd()
The default constructor, adjusts the scale to 1.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public abstract MfRecord getRecord() throws RecordCreationException
RecordCreationException
- if an error occured while generating the record.public abstract void setRecord(MfRecord record)
record
- the raw data that makes up the record.public abstract int getFunction()
public abstract MfCmd getInstance()
public abstract void replay(WmfFile metafile)
metafile
- the meta file.public void setScale(float scaleX, float scaleY)
scaleX
- the horizontal scalescaleY
- the vertical scaleprotected abstract void scaleXChanged()
protected abstract void scaleYChanged()
protected Rectangle scaleRect(Rectangle r)
r
- the source rectangle.protected int getScaledWidth(int length)
length
- the value that should be scaled.protected int getScaledHeight(int length)
length
- the value that should be scaled.protected int[] applyScaleX(int[] n, int[] dest)
n
- the unscaled source valuesdest
- the array to store the scaled valuesprotected int[] applyScaleY(int[] n, int[] dest)
n
- the unscaled source valuesdest
- the array to store the scaled valuespublic int getScaledY(int y)
y
- the unscaled ypublic int getScaledX(int x)
x
- the unscaled xCopyright © 2019 Hitachi Vantara. All rights reserved.