Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.common.swing
Class GuiConvert

    java.lang.Object
      org.crosswire.common.swing.GuiConvert

    public final class GuiConvert

extends Object

Conversions between various types and Strings.

Author:
  Joe Walker
See Also:
  `The GNU General Public License for details.`

Field Summary
`private static org.slf4j.Logger` | `log` The log stream

Constructor Summary
`private` | `GuiConvert()` We don't want anyone doing this ...

Method Summary
`static String` | `color2String(Color color)` Convert a Color to a String
`static Font` | `deriveFont(String fontspec, String fontName)` Create a font just like the another with regard to style and size, but differing in font family.
`static String` | `font2String(Font font)` Convert a Font to a String.
`static Color` | `string2Color(String value)` Convert a String to a Color
`static Font` | `string2Font(String value)` Convert a String to a Font.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### log

    private static final org.slf4j.Logger log

  The log stream

Constructor Detail

### GuiConvert

    private GuiConvert()

  We don't want anyone doing this ...

Method Detail

### string2Font

    public static Font string2Font(String value)

  Convert a String to a Font. Accepts one of two inputs: FamilyName-STYLE-size, where STYLE is either PLAIN, BOLD, ITALIC or BOLDITALIC
  or
  FamilyName,style,size, where STYLE is 0 for PLAIN, 1 for BOLD, 2 for ITALIC or 3 for BOLDITALIC.

  Parameters:
    `value` - the thing to convert
  Returns:
    the converted data

### font2String

    public static String font2String(Font font)

  Convert a Font to a String. Produces a format that can be read with `Font.decode(String)`.

  Parameters:
    `font` - the thing to convert
  Returns:
    the converted data

### deriveFont

    public static Font deriveFont(String fontspec,
                                  String fontName)

  Create a font just like the another with regard to style and size, but differing in font family.

  Parameters:
    `fontspec` - the font to model
    `fontName` - the font to use
  Returns:
    the font

### string2Color

    public static Color string2Color(String value)

  Convert a String to a Color

  Parameters:
    `value` - the thing to convert
  Returns:
    the converted data

### color2String

    public static String color2String(Color color)

  Convert a Color to a String

  Parameters:
    `color` - the thing to convert
  Returns:
    the converted data

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¨ 2003-2015
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD