cytoscape.visual
Class CalculatorIO

java.lang.Object
  extended by cytoscape.visual.CalculatorIO

public class CalculatorIO
extends Object

This class defines static methods for reading calculator definitions from a properties object and installing them into a CalculatorCatalog, and for constructing a properties object that describes all the calculators in a CalculatorCatalog.


Field Summary
static String dirHeader
           
static String edgeAppearanceBaseKey
           
static String edgeArrowBaseKey
           
static String edgeArrowClassName
           
static String edgeColorBaseKey
           
static String edgeColorClassName
           
static String edgeFontFaceBaseKey
           
static String edgeFontFaceClassName
           
static String edgeFontSizeBaseKey
           
static String edgeFontSizeClassName
           
static String edgeLabelBaseKey
           
static String edgeLabelClassName
           
static String edgeLineTypeBaseKey
           
static String edgeLineTypeClassName
           
static String edgeToolTipBaseKey
           
static String edgeToolTipClassName
           
static String globalAppearanceBaseKey
           
static String nodeAppearanceBaseKey
           
static String nodeColorBaseKey
           
static String nodeColorClassName
           
static String nodeFontFaceBaseKey
           
static String nodeFontFaceClassName
           
static String nodeFontSizeBaseKey
           
static String nodeFontSizeClassName
           
static String nodeLabelBaseKey
           
static String nodeLabelClassName
           
static String nodeLineTypeBaseKey
           
static String nodeLineTypeClassName
           
static String nodeShapeBaseKey
           
static String nodeShapeClassName
           
static String nodeSizeBaseKey
           
static String nodeSizeClassName
           
static String nodeToolTipBaseKey
           
static String nodeToolTipClassName
           
 
Constructor Summary
CalculatorIO()
           
 
Method Summary
static Properties getProperties(CalculatorCatalog catalog)
          Given a CalculatorCatalog, assembles a Properties object representing all of the calculators contained in the catalog.
static void loadCalculators(Properties props, CalculatorCatalog catalog)
          Equivalent to loadCalculators(props, catalog, true);
static void loadCalculators(Properties props, CalculatorCatalog catalog, boolean overWrite)
          Loads calculators from their description in a Properties object into a supplied CalculatorCatalog object.
static void removeDuplicate(Calculator c, CalculatorCatalog catalog)
          Given a Calculator of a given type and a CalculatorCatalog, removes any existing calculator of the same type and name.
static void renameAsNeeded(Calculator c, CalculatorCatalog catalog)
          Given a Calculator of a given type and a CalculatorCatalog, checks for an existing catalog with the same name and type.
static void storeCatalog(CalculatorCatalog catalog, File outFile)
          Writes the contents of a CalculatorCatalog to the specified file as a properties file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dirHeader

public static final String dirHeader
See Also:
Constant Field Values

nodeColorBaseKey

public static final String nodeColorBaseKey
See Also:
Constant Field Values

nodeColorClassName

public static final String nodeColorClassName
See Also:
Constant Field Values

nodeLineTypeBaseKey

public static final String nodeLineTypeBaseKey
See Also:
Constant Field Values

nodeLineTypeClassName

public static final String nodeLineTypeClassName
See Also:
Constant Field Values

nodeShapeBaseKey

public static final String nodeShapeBaseKey
See Also:
Constant Field Values

nodeShapeClassName

public static final String nodeShapeClassName
See Also:
Constant Field Values

nodeSizeBaseKey

public static final String nodeSizeBaseKey
See Also:
Constant Field Values

nodeSizeClassName

public static final String nodeSizeClassName
See Also:
Constant Field Values

nodeLabelBaseKey

public static final String nodeLabelBaseKey
See Also:
Constant Field Values

nodeLabelClassName

public static final String nodeLabelClassName
See Also:
Constant Field Values

nodeToolTipBaseKey

public static final String nodeToolTipBaseKey
See Also:
Constant Field Values

nodeToolTipClassName

public static final String nodeToolTipClassName
See Also:
Constant Field Values

nodeFontFaceBaseKey

public static final String nodeFontFaceBaseKey
See Also:
Constant Field Values

nodeFontFaceClassName

public static final String nodeFontFaceClassName
See Also:
Constant Field Values

nodeFontSizeBaseKey

public static final String nodeFontSizeBaseKey
See Also:
Constant Field Values

nodeFontSizeClassName

public static final String nodeFontSizeClassName
See Also:
Constant Field Values

edgeColorBaseKey

public static final String edgeColorBaseKey
See Also:
Constant Field Values

edgeColorClassName

public static final String edgeColorClassName
See Also:
Constant Field Values

edgeLineTypeBaseKey

public static final String edgeLineTypeBaseKey
See Also:
Constant Field Values

edgeLineTypeClassName

public static final String edgeLineTypeClassName
See Also:
Constant Field Values

edgeArrowBaseKey

public static final String edgeArrowBaseKey
See Also:
Constant Field Values

edgeArrowClassName

public static final String edgeArrowClassName
See Also:
Constant Field Values

edgeLabelBaseKey

public static final String edgeLabelBaseKey
See Also:
Constant Field Values

edgeLabelClassName

public static final String edgeLabelClassName
See Also:
Constant Field Values

edgeToolTipBaseKey

public static final String edgeToolTipBaseKey
See Also:
Constant Field Values

edgeToolTipClassName

public static final String edgeToolTipClassName
See Also:
Constant Field Values

edgeFontFaceBaseKey

public static final String edgeFontFaceBaseKey
See Also:
Constant Field Values

edgeFontFaceClassName

public static final String edgeFontFaceClassName
See Also:
Constant Field Values

edgeFontSizeBaseKey

public static final String edgeFontSizeBaseKey
See Also:
Constant Field Values

edgeFontSizeClassName

public static final String edgeFontSizeClassName
See Also:
Constant Field Values

nodeAppearanceBaseKey

public static final String nodeAppearanceBaseKey
See Also:
Constant Field Values

edgeAppearanceBaseKey

public static final String edgeAppearanceBaseKey
See Also:
Constant Field Values

globalAppearanceBaseKey

public static final String globalAppearanceBaseKey
See Also:
Constant Field Values
Constructor Detail

CalculatorIO

public CalculatorIO()
Method Detail

storeCatalog

public static void storeCatalog(CalculatorCatalog catalog,
                                File outFile)
Writes the contents of a CalculatorCatalog to the specified file as a properties file. This method sorts the lines of text produced by the store method of Properties, so that the properties descriptions of the calculators are reasonably human-readable.


getProperties

public static Properties getProperties(CalculatorCatalog catalog)
Given a CalculatorCatalog, assembles a Properties object representing all of the calculators contained in the catalog. The resulting Properties object, if passed to the loadCalculators method, would reconstruct all the calculators. This method works by getting each set of calculators from the catalog and calling the getProperties method on each calculator with the proper header for the property key.


loadCalculators

public static void loadCalculators(Properties props,
                                   CalculatorCatalog catalog)
Equivalent to loadCalculators(props, catalog, true);


loadCalculators

public static void loadCalculators(Properties props,
                                   CalculatorCatalog catalog,
                                   boolean overWrite)
Loads calculators from their description in a Properties object into a supplied CalculatorCatalog object. This method searches the Properties object for known keys identifying calculators, then delegates to other methods that use the preprocessed properties to construct valid calculator objects. For any calculator defined by the Properties, it is possible for the catalog to already hold a calculator with the same name and interface type (especially if this method has already been run with the same Properties object and catalog). If the overWrite argument is true, this method will remove any such duplicate calculator before adding the new one to prevent duplicate name exceptions. If overwrite is false, this method will get a unique name from the catalog and change the name of the installed calculator as needed.


removeDuplicate

public static void removeDuplicate(Calculator c,
                                   CalculatorCatalog catalog)
Given a Calculator of a given type and a CalculatorCatalog, removes any existing calculator of the same type and name.


renameAsNeeded

public static void renameAsNeeded(Calculator c,
                                  CalculatorCatalog catalog)
Given a Calculator of a given type and a CalculatorCatalog, checks for an existing catalog with the same name and type. If one exists, gets a new unique name from the catalog and applied it to the calculator argument.