|
Eclipse Draw2d 3.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.draw2d.TextUtilities
public class TextUtilities
Provides miscellaneous text operations. Clients may subclass this class if necessary.
| Field Summary | |
|---|---|
static TextUtilities |
INSTANCE
a singleton default instance |
| Constructor Summary | |
|---|---|
TextUtilities()
|
|
| Method Summary | |
|---|---|
int |
getAscent(Font font)
Gets the font's ascent. |
int |
getDescent(Font font)
Gets the font's descent. |
int |
getLargestSubstringConfinedTo(String s,
Font f,
int availableWidth)
Returns the largest substring of s in Font f that can be confined to the number of pixels in availableWidth. |
Dimension |
getStringExtents(String s,
Font f)
Returns the Dimensions of s in Font f. |
Dimension |
getTextExtents(String s,
Font f)
Returns the Dimensions of the given text, converting newlines and tabs appropriately. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static TextUtilities INSTANCE
| Constructor Detail |
|---|
public TextUtilities()
| Method Detail |
|---|
public Dimension getStringExtents(String s,
Font f)
s - the stringf - the font
public Dimension getTextExtents(String s,
Font f)
s - the textf - the font
public int getAscent(Font font)
font -
public int getDescent(Font font)
font -
public int getLargestSubstringConfinedTo(String s,
Font f,
int availableWidth)
s - the original stringf - the fontavailableWidth - the available width
|
Eclipse Draw2d 3.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||