/** Creates VisualStyle from the node and edge appearance calculators. */
private VisualStyle createVisualStyle(CustomStyle style, Collection<Calculator> nodeAppearanceCalculators,
Collection<Calculator> edgeAppearanceCalculators) {
String name = style.toString();
CySBML.LOGGER.config("createVisualStyle( " + name + " )");
VisualStyle vs = new VisualStyle(name);
VisualPropertyDependency deps = createVisualPropertyDependencies(vs);
// add node appearance
NodeAppearanceCalculator nac = new NodeAppearanceCalculator(deps);
for (Calculator nc: nodeAppearanceCalculators){
nac.setCalculator(nc);
}
vs.setNodeAppearanceCalculator(nac);
// add edge appearance
EdgeAppearanceCalculator eac = new EdgeAppearanceCalculator(deps);
for (Calculator ec: edgeAppearanceCalculators){
eac.setCalculator(ec);
}
vs.setEdgeAppearanceCalculator(eac);
// add global appearance
VisualMappingManager vmm = Cytoscape.getVisualMappingManager();
GlobalAppearanceCalculator gac = vmm.getVisualStyle().getGlobalAppearanceCalculator();
gac.setDefaultBackgroundColor(new Color(new Float(1.0), new Float(1.0), new Float(1.0)));
vs.setGlobalAppearanceCalculator(gac);
return vs;
}