Class MfRecord
- java.lang.Object
-
- org.pentaho.reporting.libraries.pixie.wmf.Buffer
-
- org.pentaho.reporting.libraries.pixie.wmf.MfRecord
-
public class MfRecord extends Buffer
A Windows metafile record. Every record has a standard header.bytes meaning 4 Size of header in words 2 type of the record n*2 array with n words parameters
-
-
Field Summary
Fields Modifier and Type Field Description static int
RECORD_HEADER_SIZE
The size of the record header in bytes.
-
Constructor Summary
Constructors Constructor Description MfRecord(int parcount)
Creates a new MetaFileRecord with the specified capacitiy.MfRecord(InputStream in)
Constructs a new MfRecord by reading the data from the input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doesMark()
True if this record marks the screen.int
getLongParam(int p)
Return a 32-bit param from the given offset.String
getName()
Return the name of this type of record.int
getParam(int p)
Return a 16-bit param from the given offset.String
getStringParam(int p, int len)
Return a string param from the given offset.int
getType()
Queries the 16-bit type of this record.boolean
isMappingMode()
True if this record affects mapping modes.protected void
read(InputStream in)
Read a record from an input stream.void
setLongParam(int p, int value)
Defines a 32-bit param at the given offset.void
setParam(int p, int value)
Defines a 16-bit param at the given offset.void
setStringParam(int p, String s)
Defines a string param at the given offset.void
setType(int type)
Defines the 16-bit type of this record.String
toString()
Return debug info.
-
-
-
Field Detail
-
RECORD_HEADER_SIZE
public static final int RECORD_HEADER_SIZE
The size of the record header in bytes.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MfRecord
public MfRecord(int parcount)
Creates a new MetaFileRecord with the specified capacitiy. The capacity is given in 16-Bit words. The resulting buffer has the size of 2*parcount + RECORD_HEADER.- Parameters:
parcount
- the number of 16-Bit words stored as bulk in the record.
-
MfRecord
public MfRecord(InputStream in) throws IOException
Constructs a new MfRecord by reading the data from the input stream.- Parameters:
in
- the source inputstream- Throws:
IOException
- if an IOError occurs.
-
-
Method Detail
-
read
protected void read(InputStream in) throws IOException
Read a record from an input stream.- Throws:
IOException
-
getType
public int getType()
Queries the 16-bit type of this record.- Returns:
- the RecordType
-
setType
public void setType(int type)
Defines the 16-bit type of this record.- Parameters:
type
- the RecordType
-
getParam
public int getParam(int p)
Return a 16-bit param from the given offset. Offset is in 16-bit words.- Parameters:
p
- the parameter position in words.- Returns:
- the parameter value.
-
setParam
public void setParam(int p, int value)
Defines a 16-bit param at the given offset. Offset is in 16-bit words.- Parameters:
p
- the parameter position in words.value
- the parameter value.
-
getLongParam
public int getLongParam(int p)
Return a 32-bit param from the given offset. Offset is in 16-bit words.- Parameters:
p
- the parameter position in words.- Returns:
- the parameter value.
-
setLongParam
public void setLongParam(int p, int value)
Defines a 32-bit param at the given offset. Offset is in 16-bit words.- Parameters:
p
- the parameter position in words.value
- the parameter value.
-
getStringParam
public String getStringParam(int p, int len)
Return a string param from the given offset. Offset is in 16-bit words.- Parameters:
p
- the parameter position in words.- Returns:
- the parameter value.
-
setStringParam
public void setStringParam(int p, String s)
Defines a string param at the given offset. Offset is in 16-bit words.- Parameters:
p
- the parameter position in words.s
- the parameter value.
-
getName
public String getName()
Return the name of this type of record.
-
doesMark
public boolean doesMark()
True if this record marks the screen. Currently such records are ignored.
-
isMappingMode
public boolean isMappingMode()
True if this record affects mapping modes.
-
-