Author: scooter
Date: 2013-03-11 19:33:22 -0700 (Mon, 11 Mar 2013)
New Revision: 31153

Modified:
   
cytoscape/trunk/coreplugins/CoreCommands/src/main/java/coreCommands/namespaces/NodeNamespace.java
Log:
Fixed bug in "node select"


Modified: 
cytoscape/trunk/coreplugins/CoreCommands/src/main/java/coreCommands/namespaces/NodeNamespace.java
===================================================================
--- 
cytoscape/trunk/coreplugins/CoreCommands/src/main/java/coreCommands/namespaces/NodeNamespace.java
   2013-03-08 18:09:55 UTC (rev 31152)
+++ 
cytoscape/trunk/coreplugins/CoreCommands/src/main/java/coreCommands/namespaces/NodeNamespace.java
   2013-03-12 02:33:22 UTC (rev 31153)
@@ -155,10 +155,13 @@
                } else if (SELECT.equals(command)) {
                        CyNetwork net = getNetwork(command, args);
                        List<CyNode> nodeList = getNodeList(net, result, args);
-                       if (nodeList == null)
-                               throw new CyCommandException("node: nothing to 
select");
-                       net.setSelectedNodeState(nodeList, true);
-                       result.addMessage("node: selected "+nodeList.size()+" 
nodes");
+                       if (nodeList == null) {
+                               net.selectAllNodes();
+                               result.addMessage("node: selected all nodes");
+                       } else {
+                               net.setSelectedNodeState(nodeList, true);
+                               result.addMessage("node: selected 
"+nodeList.size()+" nodes");
+                       }
                        if (net == Cytoscape.getCurrentNetwork()) {
                                Cytoscape.getCurrentNetworkView().updateView();
                        }
@@ -166,18 +169,14 @@
                // de-select some ndoes
                } else if (DESELECT.equals(command)) {
                        CyNetwork net = getNetwork(command, args);
-                       try {
-                               List<CyNode> nodeList = getNodeList(net, 
result, args);
-                               if (nodeList == null)
-                                       throw new CyCommandException("node: 
nothing to deselect");
-
-                               net.setSelectedNodeState(nodeList, false);
-                               result.addMessage("node: deselected 
"+nodeList.size()+" nodes");
-                       } catch (CyCommandException e) {
-                               // deselect everything
+                       List<CyNode> nodeList = getNodeList(net, result, args);
+                       if (nodeList == null) {
                                net.unselectAllNodes();
                                result.addMessage("node: deselected all nodes");
-                       } 
+                       } else {
+                               net.setSelectedNodeState(nodeList, false);
+                               result.addMessage("node: deselected 
"+nodeList.size()+" nodes");
+                       }
 
                        if (net == Cytoscape.getCurrentNetwork()) {
                                Cytoscape.getCurrentNetworkView().updateView();

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cytoscape-cvs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to