org.jfree.pixie.wmf.records
Class MfCmdExtTextOut

java.lang.Object
  |
  +--org.jfree.pixie.wmf.records.MfCmd
        |
        +--org.jfree.pixie.wmf.records.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()
           
 
Method Summary
protected  int calcDeltaX(int valign, int textWidth)
           
protected  int calcDeltaY(int halign, java.awt.FontMetrics fm)
           
 java.awt.Rectangle getClippingRect()
           
 int getFlags()
           
 int getFunction()
          Reads the function identifier.
 MfCmd getInstance()
          Creates a empty unintialized copy of this command implementation.
 java.awt.Point getOrigin()
           
 MfRecord getRecord()
          Creates a new record based on the data stored in the MfCommand.
 java.awt.Rectangle getScaledClippingRect()
           
 java.awt.Point getScaledOrigin()
           
 java.lang.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(java.lang.String text)
           
 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
 

Field Detail

ETO_OPAQUE

public static final int ETO_OPAQUE
See Also:
Constant Field Values

ETO_CLIPPED

public static final int ETO_CLIPPED
See Also:
Constant Field Values

ETO_GLYPH_INDEX

public static final int ETO_GLYPH_INDEX
See Also:
Constant Field Values

ETO_RTLREADING

public static final int ETO_RTLREADING
See Also:
Constant Field Values

ETO_IGNORELANGUAGE

public static final int ETO_IGNORELANGUAGE
See Also:
Constant Field Values
Constructor Detail

MfCmdExtTextOut

public MfCmdExtTextOut()
Method Detail

replay

public void replay(WmfFile file)
Replays the command on the given WmfFile.

Specified by:
replay in class MfCmd
Parameters:
file - the meta file.

calcDeltaX

protected int calcDeltaX(int valign,
                         int textWidth)

calcDeltaY

protected int calcDeltaY(int halign,
                         java.awt.FontMetrics fm)

getInstance

public MfCmd getInstance()
Creates a empty unintialized copy of this command implementation.

Specified by:
getInstance in class MfCmd
Returns:
a new instance of the command.

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.

Specified by:
getFunction in class MfCmd
Returns:
the function identifier.

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.

Specified by:
setRecord in class MfCmd
Parameters:
record - the raw data that makes up the record.

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.

Specified by:
getRecord in class MfCmd
Returns:
the created record.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setOrigin

public void setOrigin(int x,
                      int y)

getOrigin

public java.awt.Point getOrigin()

getScaledOrigin

public java.awt.Point getScaledOrigin()

isClipped

public boolean isClipped()

isOpaque

public boolean isOpaque()

getFlags

public int getFlags()

setFlags

public void setFlags(int flags)

setClippingRect

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

getClippingRect

public java.awt.Rectangle getClippingRect()

getScaledClippingRect

public java.awt.Rectangle getScaledClippingRect()

setText

public void setText(java.lang.String text)

getText

public java.lang.String getText()

scaleXChanged

protected void scaleXChanged()
Description copied from class: MfCmd
A callback function to inform the object, that the x scale has changed and the internal coordinate values have to be adjusted.

Specified by:
scaleXChanged in class MfCmd

scaleYChanged

protected void scaleYChanged()
Description copied from class: MfCmd
A callback function to inform the object, that the y scale has changed and the internal coordinate values have to be adjusted.

Specified by:
scaleYChanged in class MfCmd