use of org.cytoscape.io.internal.util.cytables.model.VirtualColumns in project cytoscape-impl by cytoscape.
the class CyTablesXMLWriter method buildModel.
private CyTables buildModel() {
CyTables model = new CyTables();
VirtualColumns virtualColumns = new VirtualColumns();
model.setVirtualColumns(virtualColumns);
List<VirtualColumn> columns = virtualColumns.getVirtualColumn();
for (CyTableMetadata metadata : tables) {
CyTable table = metadata.getTable();
String targetTable = tableFileNamesBySUID.get(table.getSUID());
if (targetTable == null) {
continue;
}
for (CyColumn cyColumn : table.getColumns()) {
VirtualColumnInfo info = cyColumn.getVirtualColumnInfo();
if (!info.isVirtual()) {
continue;
}
String sourceTable = tableFileNamesBySUID.get(info.getSourceTable().getSUID());
if (sourceTable == null) {
// log this
continue;
}
VirtualColumn column = new VirtualColumn();
column.setName(cyColumn.getName());
column.setSourceColumn(info.getSourceColumn());
column.setSourceTable(sourceTable);
column.setSourceJoinKey(info.getSourceJoinKey());
column.setTargetTable(targetTable);
column.setTargetJoinKey(info.getTargetJoinKey());
columns.add(column);
}
}
return model;
}
Aggregations