use of org.cytoscape.io.write.CyWriter in project cytoscape-impl by cytoscape.
the class SessionWriterImpl method zipNetworkViews.
/**
* Writes network view files to the session zip.
* @throws Exception
*/
private void zipNetworkViews() throws Exception {
final Set<CyNetworkView> netViews = session.getNetworkViews();
for (final CyNetworkView view : netViews) {
if (cancelled)
return;
String xgmmlFile = SessionUtil.getXGMMLFilename(view);
zos.putNextEntry(new ZipEntry(sessionDir + NETWORK_VIEWS_FOLDER + xgmmlFile));
CyWriter writer = networkViewWriterFactory.createWriter(zos, view);
writer.run(taskMonitor);
zos.closeEntry();
writer = null;
}
}
use of org.cytoscape.io.write.CyWriter in project cytoscape-impl by cytoscape.
the class SessionWriterImpl method zipVizmap.
/**
* Writes the vizmap.props file to the session zip.
*/
private void zipVizmap() throws Exception {
Set<VisualStyle> styles = session.getVisualStyles();
zos.putNextEntry(new ZipEntry(sessionDir + VIZMAP_FILE));
CyWriter vizmapWriter = vizmapWriterMgr.getWriter(styles, vizmapFilter, zos);
vizmapWriter.run(taskMonitor);
zos.closeEntry();
vizmapWriter = null;
}
use of org.cytoscape.io.write.CyWriter in project cytoscape-impl by cytoscape.
the class SessionWriterImpl method zipTables.
private void zipTables() throws Exception {
tableFilenamesBySUID = new HashMap<>();
Set<CyTableMetadata> tableData = session.getTables();
for (CyTableMetadata metadata : tableData) {
if (cancelled)
return;
CyTable table = metadata.getTable();
if (table.getSavePolicy() != SavePolicy.SESSION_FILE)
continue;
String tableTitle = SessionUtil.escape(table.getTitle());
String filename;
CyNetwork network = metadata.getNetwork();
if (network == null) {
filename = String.format("global/%d-%s.cytable", table.getSUID(), tableTitle);
} else {
filename = SessionUtil.getNetworkTableFilename(network, metadata);
}
tableFilenamesBySUID.put(table.getSUID(), filename);
zos.putNextEntry(new ZipEntry(sessionDir + TABLES_FOLDER + filename));
try {
CyWriter writer = tableWriterMgr.getWriter(table, tableFilter, zos);
writer.run(taskMonitor);
} finally {
zos.closeEntry();
}
}
}
Aggregations