Ascent Phase Corp.

org.ascentphase.suit
Class TextUtil

java.lang.Object
  |
  +--org.ascentphase.suit.TextUtil

public class TextUtil
extends java.lang.Object

Static help methods for text utilities.

Version:
Author:
huyd

Constructor Summary
TextUtil()
           
 
Method Summary
static java.lang.String getTruncatedWord(java.lang.String text, Font f, int width)
          Returns the maximum number of characters within the given word that will fit into the specified width with the given word.
static java.lang.String getWordsWithin(java.lang.String text, Font f, int width)
          Returns all the words within the given string that will fit in the width specified with the given Font.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextUtil

public TextUtil()
Method Detail

getWordsWithin

public static java.lang.String getWordsWithin(java.lang.String text,
                                              Font f,
                                              int width)
Returns all the words within the given string that will fit in the width specified with the given Font.

Parameters:
text - the text string.
f - the Font to calculate for.
width - the width in pixel the words must fit within.

getTruncatedWord

public static java.lang.String getTruncatedWord(java.lang.String text,
                                                Font f,
                                                int width)
Returns the maximum number of characters within the given word that will fit into the specified width with the given word.

Parameters:
text - the text string.
f - the Font to calculate for.
width - the width in pixel the words must fit within.

Ascent Phase Corp.

Copyright © 2002 Ascent Phase Corp. All Rights Reserved.