Author: scooter
Date: 2012-10-11 21:31:16 -0700 (Thu, 11 Oct 2012)
New Revision: 30660

Modified:
   
core3/impl/trunk/group-view-impl/src/main/java/org/cytoscape/group/view/internal/GroupViewDoubleClickListener.java
Log:
Restrict the double-click NodeViewTaskFactory to only be active if the node is
a group or a member of a group


Modified: 
core3/impl/trunk/group-view-impl/src/main/java/org/cytoscape/group/view/internal/GroupViewDoubleClickListener.java
===================================================================
--- 
core3/impl/trunk/group-view-impl/src/main/java/org/cytoscape/group/view/internal/GroupViewDoubleClickListener.java
  2012-10-12 03:11:14 UTC (rev 30659)
+++ 
core3/impl/trunk/group-view-impl/src/main/java/org/cytoscape/group/view/internal/GroupViewDoubleClickListener.java
  2012-10-12 04:31:16 UTC (rev 30660)
@@ -99,6 +99,25 @@
                }
        }
 
+       public boolean isReady(View<CyNode> nodeView, CyNetworkView 
networkView) {
+               CyNode node = nodeView.getModel();
+               CyNetwork net = networkView.getModel();
+
+               // Do we care about this double-click?
+               if (cyGroupManager.isGroup(node, net)) {
+                       return true;
+               } else {
+                       List<CyGroup> groups = 
cyGroupManager.getGroupsForNode(node);
+                       for (CyGroup g: groups) {
+                               // Make sure we're in the right network
+                               if (cyGroupManager.isGroup(g.getGroupNode(), 
net)) {
+                                       return true;
+                               }
+                       }
+               }
+               return false;
+       }
+
        class NullTask extends AbstractTask {
                public void run(TaskMonitor tm) throws Exception {
                        return;

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