use of org.cytoscape.io.write.VizmapWriterFactory in project cytoscape-impl by cytoscape.
the class MakeVisualStylesDefaultTask method run.
@Override
public void run(final TaskMonitor monitor) throws Exception {
if (!confirm)
return;
final VisualMappingManager vmMgr = servicesUtil.get(VisualMappingManager.class);
final Set<VisualStyle> currentStyles = vmMgr.getAllVisualStyles();
if (!currentStyles.isEmpty()) {
final VizmapWriterFactory vizmapWriterFactory = servicesUtil.get(VizmapWriterFactory.class);
final CyApplicationConfiguration config = servicesUtil.get(CyApplicationConfiguration.class);
final FileOutputStream os = new FileOutputStream(new File(config.getConfigurationDirectoryLocation(), VizMapperProxy.PRESET_VIZMAP_FILE));
final CyWriter vizmapWriter = vizmapWriterFactory.createWriter(os, currentStyles);
if (!cancelled)
vizmapWriter.run(monitor);
}
}
Aggregations