Class MfCmd
- java.lang.Object
-
- org.pentaho.reporting.libraries.pixie.wmf.records.MfCmd
-
- Direct Known Subclasses:
MfCmdAnimatePalette
,MfCmdArc
,MfCmdBitBlt
,MfCmdChord
,MfCmdCreateBrush
,MfCmdCreateDibPatternBrush
,MfCmdCreateFont
,MfCmdCreatePalette
,MfCmdCreatePatternBrush
,MfCmdCreatePen
,MfCmdCreateRegion
,MfCmdDeleteObject
,MfCmdDibBitBlt
,MfCmdDibStretchBlt
,MfCmdEllipse
,MfCmdEscape
,MfCmdExcludeClipRect
,MfCmdExtFloodFill
,MfCmdExtTextOut
,MfCmdFillRegion
,MfCmdFloodFill
,MfCmdFrameRegion
,MfCmdIntersectClipRect
,MfCmdInvertRegion
,MfCmdLineTo
,MfCmdMoveTo
,MfCmdOffsetClipRgn
,MfCmdOffsetViewportOrg
,MfCmdOffsetWindowOrg
,MfCmdPaintRgn
,MfCmdPatBlt
,MfCmdPie
,MfCmdPolygon
,MfCmdPolyline
,MfCmdPolyPolygon
,MfCmdRealisePalette
,MfCmdRectangle
,MfCmdResizePalette
,MfCmdRestoreDc
,MfCmdRoundRect
,MfCmdSaveDc
,MfCmdScaleViewportExt
,MfCmdScaleWindowExt
,MfCmdSelectClipRegion
,MfCmdSelectObject
,MfCmdSelectPalette
,MfCmdSetBkColor
,MfCmdSetBkMode
,MfCmdSetDibitsToDevice
,MfCmdSetMapMode
,MfCmdSetMapperFlags
,MfCmdSetPaletteEntries
,MfCmdSetPixel
,MfCmdSetPolyFillMode
,MfCmdSetRop2
,MfCmdSetStretchBltMode
,MfCmdSetTextAlign
,MfCmdSetTextCharExtra
,MfCmdSetTextColor
,MfCmdSetTextJustification
,MfCmdSetViewPortExt
,MfCmdSetViewPortOrg
,MfCmdSetWindowExt
,MfCmdSetWindowOrg
,MfCmdStretchBlt
,MfCmdStretchDibits
,MfCmdTextOut
,MfCmdUnknownCommand
public abstract class MfCmd extends Object
This is the base class for all WMF-Records. A WMF record specifies a single command for drawing a element of the image.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MfCmd()
The default constructor, adjusts the scale to 1.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
getRecord
public abstract MfRecord getRecord() throws RecordCreationException
Creates a new record based on the data stored in the MfCommand.- Returns:
- the created record.
- Throws:
RecordCreationException
- if an error occured while generating the record.
-
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.- Parameters:
record
- the raw data that makes up the record.
-
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.- Returns:
- the function identifier.
-
getInstance
public abstract MfCmd getInstance()
Creates a empty unintialized copy of this command implementation.- Returns:
- a new instance of the command.
-
replay
public abstract void replay(WmfFile metafile)
Replays the command on the given WmfFile.- Parameters:
metafile
- the meta file.
-
setScale
public void setScale(float scaleX, float scaleY)
Set the scale for the command.- Parameters:
scaleX
- the horizontal scalescaleY
- the vertical scale
-
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.
-
scaleRect
protected Rectangle scaleRect(Rectangle r)
Scales the given rectangle.- Parameters:
r
- the source rectangle.- Returns:
- a new rectangle containing the scaled values.
-
getScaledWidth
protected int getScaledWidth(int length)
Scales the given horizontal length and makes sure that the lenght is at least 1.- Parameters:
length
- the value that should be scaled.- Returns:
- the scaled value.
-
getScaledHeight
protected int getScaledHeight(int length)
Scales the given vertical length and makes sure that the lenght is at least 1.- Parameters:
length
- the value that should be scaled.- Returns:
- the scaled value.
-
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.- Parameters:
n
- the unscaled source valuesdest
- the array to store the scaled values- Returns:
- dest.
-
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.- Parameters:
n
- the unscaled source valuesdest
- the array to store the scaled values- Returns:
- dest.
-
getScaledY
public int getScaledY(int y)
Return integer scaled to output units.- Parameters:
y
- the unscaled y- Returns:
- the scaled y value
-
getScaledX
public int getScaledX(int x)
Return integer scaled to output units.- Parameters:
x
- the unscaled x- Returns:
- the scaled x value
-
-