|
Draw2d 3.9.100.201405261516 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.draw2d.text.FlowUtilities
public class FlowUtilities
Utility class for FlowFigures.
Field Summary | |
---|---|
static FlowUtilities |
INSTANCE
a singleton default instance |
Constructor Summary | |
---|---|
FlowUtilities()
|
Method Summary | |
---|---|
protected float |
getAverageCharWidth(TextFragmentBox fragment,
Font font)
Gets the average character width. |
protected Rectangle |
getTextLayoutBounds(java.lang.String s,
Font f,
int start,
int end)
|
protected TextUtilities |
getTextUtilities()
Returns an instance of a TextUtililities class on which text
calculations can be performed. |
protected void |
setupFragment(TextFragmentBox fragment,
Font font,
java.lang.String string)
Sets up the fragment width based using the font and string passed in. |
protected int |
wrapFragmentInContext(TextFragmentBox frag,
java.lang.String string,
FlowContext context,
org.eclipse.draw2d.text.FlowUtilities.LookAhead lookahead,
Font font,
int wrapping)
Sets up a fragment and returns the number of characters consumed from the given String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static FlowUtilities INSTANCE
Constructor Detail |
---|
public FlowUtilities()
Method Detail |
---|
protected float getAverageCharWidth(TextFragmentBox fragment, Font font)
fragment
- the supplied TextFragmentBox to use for calculation. if the
length is 0 or if the width is or below 0, the average
character width is taken from standard font metrics.font
- the font to use in case the TextFragmentBox conditions above
are true.
protected final void setupFragment(TextFragmentBox fragment, Font font, java.lang.String string)
fragment
- the text fragment whose width will be setfont
- the font to be used in the calculationstring
- the string to be used in the calculationprotected final int wrapFragmentInContext(TextFragmentBox frag, java.lang.String string, FlowContext context, org.eclipse.draw2d.text.FlowUtilities.LookAhead lookahead, Font font, int wrapping)
frag
- the TextFragmentBoxstring
- the Stringfont
- the Font used for measuringcontext
- the flow contextwrapping
- the word wrap style
protected Rectangle getTextLayoutBounds(java.lang.String s, Font f, int start, int end)
TextLayout#getBounds()
protected TextUtilities getTextUtilities()
TextUtililities
class on which text
calculations can be performed. Clients may override to customize.
TextUtililities
instance
|
Draw2d 3.9.100.201405261516 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |