org.brains2b.swingext.util
Class FontHelper

java.lang.Object
  extended by org.brains2b.swingext.util.FontHelper

public final class FontHelper
extends java.lang.Object

Helper class to encode a Font into a String that can be decoded with Font.decode(String)

Version:
1.0
Author:
dennis@brains2b.nl

Constructor Summary
FontHelper()
           
 
Method Summary
static java.lang.String encode(java.awt.Font f)
          Encode a Font into a String that can be decoded with Font.decode(String)
static java.lang.String getStyle(int style)
          get the String representation of the style constants from Font
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontHelper

public FontHelper()
Method Detail

encode

public static java.lang.String encode(java.awt.Font f)
Encode a Font into a String that can be decoded with Font.decode(String)

Parameters:
f - Font, the font to encode
Returns:
String, the String representation of this Font

getStyle

public static java.lang.String getStyle(int style)
get the String representation of the style constants from Font

Parameters:
style - int, one of the constants Font.BOLD, Font.ITALIC, Font.PLAIN or the sum of those
Returns:
String, the decodable String representation of the Style, or PLAIN if it is not a valid value.