org.jfree.pixie.wmf.records

Class MfCmdExtTextOut


public class MfCmdExtTextOut
extends MfCmd

The ExtTextOut function draws text using the currently selected font, background color, and text color. You can optionally provide dimensions to be used for clipping, opaquing, or both.

META_EXTTEXTOUT

NEAREST API CALL

#include <windows.h>
 BOOL32 ExtTextOutA
 (
 HDC32 hdc,
 INT32 x,
 INT32 y,
 UINT32 flags,
 const RECT32 *lprect,
 LPCSTR str,
 UINT32 count,
 const INT32 *lpDx
 );
 

Field Summary

static int
ETO_CLIPPED
static int
ETO_GLYPH_INDEX
static int
ETO_IGNORELANGUAGE
static int
ETO_OPAQUE
static int
ETO_RTLREADING

Constructor Summary

MfCmdExtTextOut()
The default constructor, adjusts the scale to 1.

Method Summary

protected int
calcDeltaX(int valign, int textWidth)
protected int
calcDeltaY(int halign, FontMetrics fm)
Rectangle
getClippingRect()
int
getFlags()
int
getFunction()
Reads the function identifier.
MfCmd
getInstance()
Creates a empty unintialized copy of this command implementation.
Point
getOrigin()
MfRecord
getRecord()
Creates a new record based on the data stored in the MfCommand.
Rectangle
getScaledClippingRect()
Point
getScaledOrigin()
String
getText()
boolean
isClipped()
boolean
isOpaque()
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
setClippingRect(int cx, int cy, int cw, int ch)
void
setFlags(int flags)
void
setOrigin(int x, int y)
void
setRecord(MfRecord record)
Reads the command data from the given record and adjusts the internal parameters according to the data parsed.
void
setText(String text)
String
toString()

Methods inherited from class org.jfree.pixie.wmf.records.MfCmd

applyScaleX, applyScaleY, getFunction, getInstance, getRecord, getScaledHeight, getScaledWidth, getScaledX, getScaledY, replay, scaleRect, scaleXChanged, scaleYChanged, setRecord, setScale

Field Details

ETO_CLIPPED

public static final int ETO_CLIPPED
Field Value:
4

ETO_GLYPH_INDEX

public static final int ETO_GLYPH_INDEX
Field Value:
16

ETO_IGNORELANGUAGE

public static final int ETO_IGNORELANGUAGE
Field Value:
4096

ETO_OPAQUE

public static final int ETO_OPAQUE
Field Value:
2

ETO_RTLREADING

public static final int ETO_RTLREADING
Field Value:
128

Constructor Details

MfCmdExtTextOut

public MfCmdExtTextOut()
The default constructor, adjusts the scale to 1.

Method Details

calcDeltaX

protected int calcDeltaX(int valign,
                         int textWidth)

calcDeltaY

protected int calcDeltaY(int halign,
                         FontMetrics fm)

getClippingRect

public Rectangle getClippingRect()

getFlags

public int getFlags()

getFunction

public int getFunction()
Reads the function identifier. Every record type is identified by a function number corresponding to one of the Windows GDI functions used.
Overrides:
getFunction in interface MfCmd
Returns:
the function identifier.

getInstance

public MfCmd getInstance()
Creates a empty unintialized copy of this command implementation.
Overrides:
getInstance in interface MfCmd
Returns:
a new instance of the command.

getOrigin

public Point getOrigin()

getRecord

public MfRecord getRecord()
Creates a new record based on the data stored in the MfCommand. This writer does not write a char-spacing record.
Overrides:
getRecord in interface MfCmd
Returns:
the created record.

getScaledClippingRect

public Rectangle getScaledClippingRect()

getScaledOrigin

public Point getScaledOrigin()

getText

public String getText()

isClipped

public boolean isClipped()

isOpaque

public boolean isOpaque()

replay

public void replay(WmfFile file)
Replays the command on the given WmfFile.
Overrides:
replay in interface MfCmd
Parameters:
file - the meta file.

scaleXChanged

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.
Overrides:
scaleXChanged in interface MfCmd

scaleYChanged

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.
Overrides:
scaleYChanged in interface MfCmd

setClippingRect

public void setClippingRect(int cx,
                            int cy,
                            int cw,
                            int ch)

setFlags

public void setFlags(int flags)

setOrigin

public void setOrigin(int x,
                      int y)

setRecord

public 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.

Overrides:
setRecord in interface MfCmd
Parameters:
record - the raw data that makes up the record.

setText

public void setText(String text)

toString

public String toString()