cytoscape.visual
Class OldStyleCalculatorIO
java.lang.Object
cytoscape.visual.OldStyleCalculatorIO
public class OldStyleCalculatorIO
- extends Object
This class provides methods to read property keys in the old vizmap format,
construct suitable calculator objects, and install them in a supplied
CalculatorCatalog.
All of the calculators will have the name of the static member variable
'calcName', except that the borderColor calculator, the node height
calculator, and the targetDecoration calculator will have a '2' appended
to the name. (This is because in the old system, node.fillColor and
node.borderColor were separate types, but are both NodeColorCalculators
in the new system, and similarly with the node size and edge arrow calculators).
In addition to the attribute specific calculators, this class will create
a NodeAppearance and EdgeAppearanceCalculator, also named 'calcName', and
set them to use the attribute calculators defined here.
Method Summary |
static void |
checkForCalculators(Properties props,
CalculatorCatalog catalog)
This method takes a properties object as an argument, expected to be the
contents of a cytoscape.props file, and a CalculatorCatalog. |
static void |
loadCalculators(Properties props,
CalculatorCatalog catalog)
Given a properties object, which is expected to come from a
cytoscape.props file, and a CalculatorCatalog, loads all visual mappings
specified in the old format by first converting the properties into the
new format and then running the converted properties through the
machinery of the CalculatorIO class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
packageHeader
public static String packageHeader
calcName
public static String calcName
loaded
public static boolean loaded
OldStyleCalculatorIO
public OldStyleCalculatorIO()
checkForCalculators
public static void checkForCalculators(Properties props,
CalculatorCatalog catalog)
- This method takes a properties object as an argument, expected to be the
contents of a cytoscape.props file, and a CalculatorCatalog. It searches
for property keys in the props that represent visual mappings in the old
format, and if found brings up a UI to inform the user, prompt for a name
for the calculators, and calls the loadCalculators method to convert and
install these visual mappings.
- Parameters:
props
- a properties object, should come from cytoscape.propscatalog
- the catalog in which to store any found visual mappings
loadCalculators
public static void loadCalculators(Properties props,
CalculatorCatalog catalog)
- Given a properties object, which is expected to come from a
cytoscape.props file, and a CalculatorCatalog, loads all visual mappings
specified in the old format by first converting the properties into the
new format and then running the converted properties through the
machinery of the CalculatorIO class.