net.sf.jcgm.core
Class TextCommand
java.lang.Object
net.sf.jcgm.core.Command
net.sf.jcgm.core.TextCommand
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- RestrictedText, Text
public abstract class TextCommand
- extends Command
Common class for text support
- Version:
- $Id: TextCommand.java 46 2011-12-14 08:26:44Z phica $
- Author:
- Philippe Cadé
Field Summary |
protected java.awt.geom.Point2D.Double |
position
The position at which the string should be displayed |
protected java.lang.String |
string
The string to display |
Constructor Summary |
TextCommand(int ec,
int eid,
int l,
java.io.DataInput in)
|
Method Summary |
protected void |
applyTextPath(CGMDisplay d,
java.awt.font.GlyphVector glyphVector)
|
protected java.lang.String |
flipString(java.lang.String s)
Flip the given string for left text path |
java.lang.String |
getString()
|
void |
paint(CGMDisplay d)
|
protected void |
scaleText(CGMDisplay d,
java.awt.FontMetrics fontMetrics,
java.awt.font.GlyphVector glyphVector,
double width,
double height)
|
Methods inherited from class net.sf.jcgm.core.Command |
alignOnWord, clone, getElementClass, getElementCode, info, makeByte, makeChar, makeColorIndex, makeColorIndex, makeDirectColor, makeEnum, makeFixedPoint, makeFixedString, makeFloat32, makeFloatingPoint, makeFloatingPoint32, makeIndex, makeInt, makeName, makePoint, makeReal, makeSDR, makeSignedInt16, makeSignedInt24, makeSignedInt32, makeSignedInt8, makeSizeSpecification, makeString, makeUInt, makeVc, makeVdc, printShape, read, readCommand, sizeOfDirectColor, sizeOfEnum, sizeOfInt, sizeOfPoint, sizeOfVdc, toString, unimplemented, unsupported |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
string
protected java.lang.String string
- The string to display
position
protected java.awt.geom.Point2D.Double position
- The position at which the string should be displayed
TextCommand
public TextCommand(int ec,
int eid,
int l,
java.io.DataInput in)
throws java.io.IOException
- Throws:
java.io.IOException
scaleText
protected void scaleText(CGMDisplay d,
java.awt.FontMetrics fontMetrics,
java.awt.font.GlyphVector glyphVector,
double width,
double height)
paint
public void paint(CGMDisplay d)
- Overrides:
paint
in class Command
flipString
protected java.lang.String flipString(java.lang.String s)
- Flip the given string for left text path
- Parameters:
s
-
- Returns:
applyTextPath
protected void applyTextPath(CGMDisplay d,
java.awt.font.GlyphVector glyphVector)
- Parameters:
glyphVector
-
getString
public java.lang.String getString()
Part of the jcgm library http://jcgm.sourceforge.net/