Author: ruschein
Date: 2009-11-24 16:03:59 -0800 (Tue, 24 Nov 2009)
New Revision: 18575

Modified:
   cytoscape/trunk/src/cytoscape/CyNode.java
Log:
Added a new "has_nested_network" attribute to nodes that is set to "yes", if 
they have a nested network.

Modified: cytoscape/trunk/src/cytoscape/CyNode.java
===================================================================
--- cytoscape/trunk/src/cytoscape/CyNode.java   2009-11-24 23:36:43 UTC (rev 
18574)
+++ cytoscape/trunk/src/cytoscape/CyNode.java   2009-11-25 00:03:59 UTC (rev 
18575)
@@ -52,6 +52,7 @@
  */
 public class CyNode implements giny.model.Node {
        public static final String NESTED_NETWORK_ID_ATTR = "nested_network_id";
+       public static final String HAS_NESTED_NETWORK_ATTR = 
"has_nested_network";
        public static final String PARENT_NODES_ATTR = "parent_nodes";
        
        // Variables specific to public get/set methods.
@@ -258,7 +259,7 @@
                // create or update Network Attribute "parent.node.name.list" 
for the Network   
                final String[] attributeNames = 
Cytoscape.getNetworkAttributes().getAttributeNames();
                boolean attrFound = false;
-               for (String name : attributeNames) {
+               for (final String name : attributeNames) {
                        if (name.equals(PARENT_NODES_ATTR)) {
                                attrFound = true;
                                break;
@@ -277,6 +278,13 @@
                        }
                }
                Cytoscape.getNetworkAttributes().setListAttribute(networkID, 
PARENT_NODES_ATTR, parentNodeList);
+
+               // tag or untag the node as having a nested network
+               if (graphPerspective != null) {
+                       
Cytoscape.getNodeAttributes().setAttribute(this.getIdentifier(), 
HAS_NESTED_NETWORK_ATTR, "yes");
+               } else {
+                       
Cytoscape.getNodeAttributes().deleteAttribute(this.getIdentifier(), 
HAS_NESTED_NETWORK_ATTR);
+               }
                
                // Let listeners know nested network was assigned to this node.
                if (this.graphPerspective != null) {

--

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