use of org.cytoscape.model.CyTable in project cytoscape-impl by cytoscape.
the class ViewUtil method getParent.
public static CySubNetwork getParent(final CySubNetwork net, final CyServiceRegistrar serviceRegistrar) {
final CyTable hiddenTable = net.getTable(CyNetwork.class, CyNetwork.HIDDEN_ATTRS);
final CyRow row = hiddenTable != null ? hiddenTable.getRow(net.getSUID()) : null;
final Long suid = row != null ? row.get(PARENT_NETWORK_COLUMN, Long.class) : null;
if (suid != null) {
final CyNetwork parent = serviceRegistrar.getService(CyNetworkManager.class).getNetwork(suid);
if (parent instanceof CySubNetwork)
return (CySubNetwork) parent;
}
return null;
}
use of org.cytoscape.model.CyTable in project cytoscape-impl by cytoscape.
the class DynamicLayoutMenu method addNodeAttributeMenus.
private void addNodeAttributeMenus(final JMenu parent, final boolean selectedOnly) {
CyNetwork network = networkRef.get();
if (network != null) {
final CyTable nodeAttributes = network.getDefaultNodeTable();
addAttributeMenus(parent, nodeAttributes, layout.getSupportedNodeAttributeTypes(), selectedOnly);
}
}
use of org.cytoscape.model.CyTable in project cytoscape-impl by cytoscape.
the class DynamicLayoutMenu method addEdgeAttributeMenus.
private void addEdgeAttributeMenus(final JMenu parent, final boolean selectedOnly) {
CyNetwork network = networkRef.get();
if (network != null) {
final CyTable edgeAttributes = network.getDefaultEdgeTable();
addAttributeMenus(parent, edgeAttributes, layout.getSupportedEdgeAttributeTypes(), selectedOnly);
}
}
use of org.cytoscape.model.CyTable in project cytoscape-impl by cytoscape.
the class LayoutSettingsDialog method getAttributeList.
private List<String> getAttributeList(CyNetwork network, Set<Class<?>> allowedNodeAttributeTypes, Set<Class<?>> allowedEdgeAttributeTypes) {
List<String> attributes = new ArrayList<String>();
Set<Class<?>> allowedTypes;
CyTable table;
if (allowedNodeAttributeTypes.size() > 0) {
allowedTypes = allowedNodeAttributeTypes;
table = network.getDefaultNodeTable();
} else if (allowedEdgeAttributeTypes.size() > 0) {
allowedTypes = allowedEdgeAttributeTypes;
table = network.getDefaultEdgeTable();
} else {
return attributes;
}
for (final CyColumn column : table.getColumns()) {
if (column.getName().equals(CyNetwork.SELECTED) || column.getName().equals(CyNetwork.SUID))
continue;
if (allowedTypes.contains(column.getType())) {
attributes.add(column.getName());
}
}
Collections.sort(attributes);
if (attributes.size() > 0)
attributes.add(0, UNWEIGHTED);
return attributes;
}
use of org.cytoscape.model.CyTable in project cytoscape-impl by cytoscape.
the class LayoutSettingsDialog method hasSelectedNodes.
private boolean hasSelectedNodes(final CyNetworkView view) {
if (view == null)
return false;
final CyNetwork network = view.getModel();
final CyTable table = network.getDefaultNodeTable();
return table.countMatchingRows(CyNetwork.SELECTED, Boolean.TRUE) > 0;
}
Aggregations