use of org.cytoscape.model.CyTable in project cytoscape-impl by cytoscape.
the class ListTablesTask method run.
@Override
public void run(final TaskMonitor taskMonitor) {
Set<CyTable> allTables = cyTableManager.getAllTables(includePrivate);
tables = new ArrayList<CyTable>();
String requestedType = type.getSelectedValue();
String requestedNamespace = getNamespace(namespace);
for (CyTable table : allTables) {
if (!requestedType.equals("all")) {
Class<? extends CyIdentifiable> tableClass = networkTableMgr.getTableType(table);
if (tableClass != null && !requestedType.equals("unattached")) {
String strClass = DataUtils.getIdentifiableType(tableClass);
if (!strClass.equalsIgnoreCase(requestedType))
continue;
if (!requestedNamespace.equalsIgnoreCase(networkTableMgr.getTableNamespace(table)))
continue;
} else if (tableClass != null && requestedType.equals("unattached")) {
continue;
}
}
taskMonitor.showMessage(TaskMonitor.Level.INFO, "Table " + getTableDescription(table));
tables.add(table);
}
}
use of org.cytoscape.model.CyTable in project cytoscape-impl by cytoscape.
the class CreateEdgeAttributeTask method run.
@Override
public void run(final TaskMonitor taskMonitor) {
if (network == null)
network = appMgr.getCurrentNetwork();
CyTable edgeTable = getNetworkTable(network, CyEdge.class, columnTunable.getNamespace());
try {
createColumn(edgeTable, columnTunable.getColumnName(), columnTypeTunable.getColumnType(), columnTypeTunable.getListElementType());
success = true;
if (columnTypeTunable.getColumnType() == "list")
taskMonitor.showMessage(TaskMonitor.Level.INFO, "Created new " + columnTypeTunable.getListElementType() + " list column: " + columnTunable.getColumnName());
else
taskMonitor.showMessage(TaskMonitor.Level.INFO, "Created new " + columnTypeTunable.getColumnType() + " column: " + columnTunable.getColumnName());
} catch (Exception e) {
taskMonitor.showMessage(TaskMonitor.Level.ERROR, "Unable to create new column: " + e.getMessage());
}
}
use of org.cytoscape.model.CyTable in project cytoscape-impl by cytoscape.
the class ListNetworkAttributesTask method run.
@Override
public void run(final TaskMonitor taskMonitor) {
if (network == null)
network = appMgr.getCurrentNetwork();
CyTable networkTable = getNetworkTable(network, CyNetwork.class, namespace);
columnList = networkTable.getColumns();
taskMonitor.showMessage(TaskMonitor.Level.INFO, " Attributes for network " + DataUtils.getNetworkName(network) + ":");
for (CyColumn column : columnList) {
if (column.getType().equals(List.class))
taskMonitor.showMessage(TaskMonitor.Level.INFO, " " + column.getName() + ": " + DataUtils.getType(column.getListElementType()) + " list");
else
taskMonitor.showMessage(TaskMonitor.Level.INFO, " " + column.getName() + ": " + DataUtils.getType(column.getType()));
}
}
use of org.cytoscape.model.CyTable in project cytoscape-impl by cytoscape.
the class ListNodeAttributesTask method run.
@Override
public void run(final TaskMonitor taskMonitor) {
if (network == null)
network = appMgr.getCurrentNetwork();
CyTable networkTable = getNetworkTable(network, CyNode.class, namespace);
columnList = networkTable.getColumns();
taskMonitor.showMessage(TaskMonitor.Level.INFO, " Node columns for network " + DataUtils.getNetworkName(network) + ":");
for (CyColumn column : columnList) {
if (column.getType().equals(List.class))
taskMonitor.showMessage(TaskMonitor.Level.INFO, " " + column.getName() + ": " + DataUtils.getType(column.getListElementType()) + " list");
else
taskMonitor.showMessage(TaskMonitor.Level.INFO, " " + column.getName() + ": " + DataUtils.getType(column.getType()));
}
}
use of org.cytoscape.model.CyTable in project cytoscape-impl by cytoscape.
the class MapGlobalToLocalTableTaskFactoryImpl method createTaskIterator.
@Override
public TaskIterator createTaskIterator(CyTable globalTable, Collection<CyTable> localTables) {
final Map<String, Object> m = new HashMap<String, Object>();
List<String> localTableTitles = new ArrayList<String>();
for (CyTable local : localTables) {
localTableTitles.add(local.getTitle());
}
ListMultipleSelection<String> localTablesTunable = new ListMultipleSelection<String>(localTableTitles);
localTablesTunable.setSelectedValues(localTableTitles);
m.put("localTables", localTablesTunable);
return tunableSetter.createTaskIterator(this.createTaskIterator(globalTable), m);
}
Aggregations