org.homeunix.thecave.moss.util
Class Formatter
java.lang.Object
org.homeunix.thecave.moss.util.Formatter
public class Formatter
- extends java.lang.Object
A combination of many Formatting functions.
- Author:
- wyatt
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Formatter
public Formatter()
getDecimalFormat
public static java.text.NumberFormat getDecimalFormat()
getDecimalFormat
public static java.text.NumberFormat getDecimalFormat(int decimalPlaces)
getDateFormat
public static java.text.DateFormat getDateFormat()
getDateFormat
public static java.text.DateFormat getDateFormat(java.lang.String format)
getStringLengthFormat
public static Formatter.StringLengthFormat getStringLengthFormat(int length)
getStringToLength
public static java.lang.String getStringToLength(java.lang.String value,
int maxPixelWidth,
java.awt.FontMetrics fm)
- Returns a string which will be at most maxPixelWidth pixels long as displayed by
the given FontMetrics object. If the string is any longer than that, it will
be cut off, and show '...' at the end.
- Parameters:
value - maxPixelWidth - fm -
- Returns: