uk.ac.starlink.util.gui
Class AWTXMLEncodeDecode

java.lang.Object
  extended by uk.ac.starlink.util.gui.AWTXMLEncodeDecode

public class AWTXMLEncodeDecode
extends Object

A static utility class for encoding and decoding some AWT primitives to and from XML.

Version:
$Id$
Author:
Peter W. Draper

Method Summary
static void addChildElement(Element rootElement, String name, AlphaComposite value)
          Add an element with an AlphaComposite value as a child of another element.
static void addChildElement(Element rootElement, String name, Color value)
          Add an element with a Color value as a child of another element.
static void addChildElement(Element rootElement, String name, Font value)
          Add an element with a Font value as a child of another element.
static Color colorFromString(String value)
          Convert a String object back to a Color object.
static String colorToString(Color value)
          Convert a Color object to a string.
static AlphaComposite compositeFromString(String value)
          Convert a String object back to an AlphaComposite object.
static String compositeToString(AlphaComposite value)
          Convert an AlphaComposite object to a string.
static Font fontFromString(String value)
          Convert a String back to a Font.
static String fontToString(Font font)
          Convert a Font to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addChildElement

public static void addChildElement(Element rootElement,
                                   String name,
                                   Font value)
Add an element with a Font value as a child of another element.


fontToString

public static String fontToString(Font font)
Convert a Font to a string.


fontFromString

public static Font fontFromString(String value)
Convert a String back to a Font.


addChildElement

public static void addChildElement(Element rootElement,
                                   String name,
                                   Color value)
Add an element with a Color value as a child of another element.


colorToString

public static String colorToString(Color value)
Convert a Color object to a string.


colorFromString

public static Color colorFromString(String value)
Convert a String object back to a Color object.


addChildElement

public static void addChildElement(Element rootElement,
                                   String name,
                                   AlphaComposite value)
Add an element with an AlphaComposite value as a child of another element.


compositeToString

public static String compositeToString(AlphaComposite value)
Convert an AlphaComposite object to a string.


compositeFromString

public static AlphaComposite compositeFromString(String value)
Convert a String object back to an AlphaComposite object.



Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.