Package org.eclipse.draw2d
Class TextUtilities
java.lang.Object
org.eclipse.draw2d.TextUtilities
Provides miscellaneous text operations. Clients may subclass this class if
 necessary.
- Since:
- 3.4
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintGets the font's ascent.intgetDescent(Font font) Gets the font's descent.intgetLargestSubstringConfinedTo(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.getStringExtents(String s, Font f) Returns the Dimensions of s in Font f.getTextExtents(String s, Font f) Returns the Dimensions of the given text, converting newlines and tabs appropriately.
- 
Field Details- 
INSTANCEa singleton default instance
 
- 
- 
Constructor Details- 
TextUtilitiespublic TextUtilities()
 
- 
- 
Method Details- 
getStringExtentsReturns the Dimensions of s in Font f.- Parameters:
- s- the string
- f- the font
- Returns:
- the dimensions of the given string
 
- 
getTextExtentsReturns the Dimensions of the given text, converting newlines and tabs appropriately.- Parameters:
- s- the text
- f- the font
- Returns:
- the dimensions of the given text
 
- 
getAscentGets the font's ascent.- Parameters:
- font-
- Returns:
- the font's ascent
 
- 
getDescentGets the font's descent.- Parameters:
- font-
- Returns:
- the font's descent
 
- 
getLargestSubstringConfinedToReturns the largest substring of s in Font f that can be confined to the number of pixels in availableWidth.- Parameters:
- s- the original string
- f- the font
- availableWidth- the available width
- Returns:
- the largest substring that fits in the given width
 
 
-