Author: ruschein
Date: 2010-08-02 10:00:59 -0700 (Mon, 02 Aug 2010)
New Revision: 21117

Modified:
   cytoscape/trunk/src/main/java/cytoscape/view/NetworkPanel.java
Log:
Added selecting of nested networks in the network panel when an associated node 
has been selected in a network view.

Modified: cytoscape/trunk/src/main/java/cytoscape/view/NetworkPanel.java
===================================================================
--- cytoscape/trunk/src/main/java/cytoscape/view/NetworkPanel.java      
2010-08-02 16:54:26 UTC (rev 21116)
+++ cytoscape/trunk/src/main/java/cytoscape/view/NetworkPanel.java      
2010-08-02 17:00:59 UTC (rev 21117)
@@ -329,31 +329,29 @@
                                        
selectedNestedNetworkIDs.add(nestedNetwork.getIdentifier());
                        }
 
-                       if (!selectedNestedNetworkIDs.isEmpty()) {
-                               doNotEnterValueChanged = true;
-                               try {
-                                       final TreePath[] treePaths = new 
TreePath[selectedNestedNetworkIDs.size() + 1];
-                                       int index = 0;
-                                       final String currentNetworkID = 
Cytoscape.getCurrentNetwork().getIdentifier();
-                                       TreePath currentPath = null;
-                                       final JTree tree = treeTable.getTree();
-                                       for (int row = 0; row < 
tree.getRowCount(); ++row) {
-                                               final TreePath path = 
tree.getPathForRow(row);
-                                               final String ID = 
((NetworkTreeNode)path.getLastPathComponent()).getNetworkID();
-                                               if (ID.equals(currentNetworkID))
-                                                       currentPath = path;
-                                               else if 
(selectedNestedNetworkIDs.contains(ID))
-                                                       treePaths[index++] = 
path;
-                                       }
+                       doNotEnterValueChanged = true;
+                       try {
+                               final TreePath[] treePaths = new 
TreePath[selectedNestedNetworkIDs.size() + 1];
+                               int index = 0;
+                               final String currentNetworkID = 
Cytoscape.getCurrentNetwork().getIdentifier();
+                               TreePath currentPath = null;
+                               final JTree tree = treeTable.getTree();
+                               for (int row = 0; row < tree.getRowCount(); 
++row) {
+                                       final TreePath path = 
tree.getPathForRow(row);
+                                       final String ID = 
((NetworkTreeNode)path.getLastPathComponent()).getNetworkID();
+                                       if (ID.equals(currentNetworkID))
+                                               currentPath = path;
+                                       else if 
(selectedNestedNetworkIDs.contains(ID))
+                                               treePaths[index++] = path;
+                               }
 
-                                       
Cytoscape.setSelectedNetworks(selectedNestedNetworkIDs);
+                               
Cytoscape.setSelectedNetworks(selectedNestedNetworkIDs);
 
-                                       treePaths[index] = currentPath;
-                                       
tree.getSelectionModel().setSelectionPaths(treePaths);
-                                       tree.scrollPathToVisible(currentPath);
-                               } finally {
-                                       doNotEnterValueChanged = false;
-                               }
+                               treePaths[index] = currentPath;
+                               
tree.getSelectionModel().setSelectionPaths(treePaths);
+                               tree.scrollPathToVisible(currentPath);
+                       } finally {
+                               doNotEnterValueChanged = false;
                        }
                }
 

-- 
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.

Reply via email to