Package ej.widget.render
Class TextHelper
- java.lang.Object
-
- ej.widget.render.TextHelper
-
public class TextHelper extends Object
Provides some text facilities.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String[]getLines(String string)Gets the lines in a text.static String[]getWords(String string)Gets the words in a text.static String[]wrap(String string, Font font, int width)Wraps a text in lines.
-
-
-
Method Detail
-
wrap
public static String[] wrap(String string, Font font, int width)
Wraps a text in lines.A new line is started:
- after a '\n',
- when there is no more space on the current line.
- Parameters:
string- the text.font- the font used to render the text.width- the size of a line.- Returns:
- the array of lines.
-
getLines
public static String[] getLines(String string)
Gets the lines in a text.A new line is started after a '\n'.
- Parameters:
string- the text to split.- Returns:
- the array of lines.
-
-