Author: scooter
Date: 2010-01-30 18:17:38 -0800 (Sat, 30 Jan 2010)
New Revision: 19082

Modified:
   cytoscape/trunk/src/cytoscape/CyMain.java
   cytoscape/trunk/src/cytoscape/Cytoscape.java
   cytoscape/trunk/src/cytoscape/data/readers/XGMMLReader.java
Log:
Group fixes


Modified: cytoscape/trunk/src/cytoscape/CyMain.java
===================================================================
--- cytoscape/trunk/src/cytoscape/CyMain.java   2010-01-30 06:08:39 UTC (rev 
19081)
+++ cytoscape/trunk/src/cytoscape/CyMain.java   2010-01-31 02:17:38 UTC (rev 
19082)
@@ -305,7 +305,7 @@
                                 * For Mac: move menue bar to OS X default bar 
(next to Apple
                                 * icon)
                                 */
-                               
System.setProperty("apple.laf.useScreenMenuBar", "true");                       
        
+                               
System.setProperty("apple.laf.useScreenMenuBar", "true");
                                
                        } else {
                                /*

Modified: cytoscape/trunk/src/cytoscape/Cytoscape.java
===================================================================
--- cytoscape/trunk/src/cytoscape/Cytoscape.java        2010-01-30 06:08:39 UTC 
(rev 19081)
+++ cytoscape/trunk/src/cytoscape/Cytoscape.java        2010-01-31 02:17:38 UTC 
(rev 19082)
@@ -79,6 +79,8 @@
 import cytoscape.ding.DingNetworkView;
 import cytoscape.giny.CytoscapeFingRootGraph;
 import cytoscape.giny.CytoscapeRootGraph;
+import cytoscape.groups.CyGroup;
+import cytoscape.groups.CyGroupManager;
 import cytoscape.init.CyInitParams;
 import cytoscape.layout.CyLayoutAlgorithm;
 import cytoscape.layout.CyLayouts;
@@ -716,14 +718,19 @@
 
                if (create && attribute instanceof String && 
attribute.equals(Semantics.INTERACTION)) {
                        // create the edge
-                       CyEdge edge = (CyEdge) Cytoscape.getRootGraph()
-                                                       
.getEdge(Cytoscape.getRootGraph()
-                                                                         
.createEdge(source, target));
+                       int rootEdge = 
Cytoscape.getRootGraph().createEdge(source, target);
+                       // System.out.println("Created edge: "+rootEdge+"from 
"+source.getRootGraphIndex()+" to "+target.getRootGraphIndex());
 
+                       //CyEdge edge = (CyEdge) Cytoscape.getRootGraph()
+                       //                                
.getEdge(Cytoscape.getRootGraph()
+                       //                                                  
.createEdge(source, target));
+                       CyEdge edge = (CyEdge) 
Cytoscape.getRootGraph().getEdge(rootEdge);
+
                        // create the edge id
                        String edge_name = 
CyEdge.createIdentifier(source.getIdentifier(),
                                                                   (String) 
attribute_value,
                                                                   
target.getIdentifier());
+                       // System.out.println("Setting ID for edge: 
"+edge_name);
                        edge.setIdentifier(edge_name);
 
                        edgeAttributes.setAttribute(edge_name, 
Semantics.INTERACTION, (String) attribute_value);
@@ -1865,6 +1872,12 @@
         * Clear all networks and attributes and start a new session.
         */
        public static void createNewSession() {
+               // Clear groups
+               List<CyGroup>groups = CyGroupManager.getGroupList();
+               for (CyGroup group: groups) {
+                       CyGroupManager.removeGroup(group);
+               }
+
                // Destroy all networks
                Set<CyNetwork> netSet = getNetworkSet();
 

Modified: cytoscape/trunk/src/cytoscape/data/readers/XGMMLReader.java
===================================================================
--- cytoscape/trunk/src/cytoscape/data/readers/XGMMLReader.java 2010-01-30 
06:08:39 UTC (rev 19081)
+++ cytoscape/trunk/src/cytoscape/data/readers/XGMMLReader.java 2010-01-31 
02:17:38 UTC (rev 19082)
@@ -688,6 +688,7 @@
 
                        CyGroup newGroup = null;
                        String viewer = null;
+
                        for (CyNode groupNode : groupMap.keySet()) {
                                List<CyNode> childList = 
groupMap.get(groupNode);
                                viewer = 
nodeAttributes.getStringAttribute(groupNode.getIdentifier(), 
CyGroup.GROUP_VIEWER_ATTR);
@@ -718,7 +719,7 @@
                        }
                }
 
-               if (view == Cytoscape.getNullNetworkView())
+               if (view == null || view == Cytoscape.getNullNetworkView())
                        return;
                
                // Apply visual style before updateView().

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