|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.pixie.wmf.records.MfCmd
org.jfree.pixie.wmf.records.MfCmdCreateRegion
Currently i have no clue, how this is implemented. From The WINE-Sources:
The layout of the record looks something like this: rdParm meaning 0 Always 0? 1 Always 6? 2 Looks like a handle? - not constant 3 0 or 1 ?? 4 Total number of bytes 5 No. of separate bands = n [see below] 6 Largest number of x co-ords in a band 7-10 Bounding box x1 y1 x2 y2 11-... n bands Regions are divided into bands that are uniform in the y-direction. Each band consists of pairs of on/off x-coords and is written as m y0 y1 x1 x2 x3 ... xm m into successive rdParm[]s. This is probably just a dump of the internal RGNOBJ?
static BOOL MF_Play_MetaCreateRegion( METARECORD *mr, HRGN hrgn ) { WORD band, pair; WORD *start, *end; INT16 y0, y1; HRGN hrgn2 = CreateRectRgn( 0, 0, 0, 0 ); for(band = 0, start = &(mr->rdParm[11]); band < mr->rdParm[5]; band++, start = end + 1) { if(*start / 2 != (*start + 1) / 2) { WARN("Delimiter not even.\n"); DeleteObject( hrgn2 ); return FALSE; } end = start + *start + 3; if(end > (WORD *)mr + mr->rdSize) { WARN("End points outside record.\n"); DeleteObject( hrgn2 ); return FALSE; } if(*start != *end) { WARN("Mismatched delimiters.\n"); DeleteObject( hrgn2 ); return FALSE; } y0 = *(INT16 *)(start + 1); y1 = *(INT16 *)(start + 2); for(pair = 0; pair < *start / 2; pair++) { SetRectRgn( hrgn2, *(INT16 *)(start + 3 + 2*pair), y0, (INT16 *)(start + 4 + 2*pair), y1 ); CombineRgn(hrgn, hrgn, hrgn2, RGN_OR); } } DeleteObject( hrgn2 ); return TRUE; }
Constructor Summary | |
MfCmdCreateRegion()
|
Method Summary | |
int |
getFunction()
Reads the function identifier. |
MfCmd |
getInstance()
Creates a empty unintialized copy of this command implementation. |
MfRecord |
getRecord()
Writer function |
java.awt.Rectangle[] |
getRects()
|
int |
getRegionHeight()
|
int |
getRegionWidth()
|
int |
getRegionX()
|
int |
getRegionY()
|
void |
replay(WmfFile file)
Replays the command on the given WmfFile. |
protected 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 void |
scaleYChanged()
A callback function to inform the object, that the y scale has changed and the internal coordinate values have to be adjusted. |
void |
setRecord(MfRecord record)
Reads the command data from the given record and adjusts the internal parameters according to the data parsed. |
void |
setRects(java.awt.Rectangle[] rects)
|
void |
setRegionHeight(int regionHeight)
|
void |
setRegionWidth(int regionWidth)
|
void |
setRegionX(int regionX)
|
void |
setRegionY(int regionY)
|
java.lang.String |
toString()
|
Methods inherited from class org.jfree.pixie.wmf.records.MfCmd |
applyScaleX, applyScaleY, getScaledHeight, getScaledWidth, getScaledX, getScaledY, scaleRect, setScale |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MfCmdCreateRegion()
Method Detail |
public void setRecord(MfRecord record)
MfCmd
After the raw record was read from the datasource, the record is parsed by the concrete implementation.
setRecord
in class MfCmd
record
- the raw data that makes up the record.public MfRecord getRecord()
getRecord
in class MfCmd
public java.lang.String toString()
public int getFunction()
MfCmd
getFunction
in class MfCmd
public void replay(WmfFile file)
MfCmd
replay
in class MfCmd
file
- the meta file.public MfCmd getInstance()
MfCmd
getInstance
in class MfCmd
protected void scaleXChanged()
MfCmd
scaleXChanged
in class MfCmd
protected void scaleYChanged()
MfCmd
scaleYChanged
in class MfCmd
public int getRegionX()
public void setRegionX(int regionX)
public int getRegionY()
public void setRegionY(int regionY)
public int getRegionWidth()
public void setRegionWidth(int regionWidth)
public int getRegionHeight()
public void setRegionHeight(int regionHeight)
public java.awt.Rectangle[] getRects()
public void setRects(java.awt.Rectangle[] rects)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |