Author: jm
Date: 2012-05-02 13:18:44 -0700 (Wed, 02 May 2012)
New Revision: 29083
Modified:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/layout/ui/LayoutSettingsDialog.java
Log:
Reduced number of heap allocations when checking for selected nodes
Modified:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/layout/ui/LayoutSettingsDialog.java
===================================================================
---
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/layout/ui/LayoutSettingsDialog.java
2012-05-02 20:16:59 UTC (rev 29082)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/layout/ui/LayoutSettingsDialog.java
2012-05-02 20:18:44 UTC (rev 29083)
@@ -448,12 +448,8 @@
private boolean hasSelectedNodes(CyNetworkView view) {
CyNetwork network = view.getModel();
- for (CyNode node : network.getNodeList()) {
- if (network.getRow(node).get(CyNetwork.SELECTED,
Boolean.class)) {
- return true;
- }
- }
- return false;
+ CyTable table = network.getDefaultNodeTable();
+ return table.countMatchingRows(CyNetwork.SELECTED,
Boolean.TRUE) > 0;
}
private List<String> getAttributeList(CyNetwork network, Set<Class<?>>
allowedNodeAttributeTypes, Set<Class<?>> allowedEdgeAttributeTypes) {
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.