Author: scooter
Date: 2010-08-17 20:26:43 -0700 (Tue, 17 Aug 2010)
New Revision: 21446

Added:
   
cytoscape/trunk/application/src/main/java/cytoscape/groups/CyGroupChangeEvent.java
Modified:
   
cytoscape/trunk/application/src/main/java/cytoscape/groups/CyGroupChangeListener.java
   
cytoscape/trunk/application/src/main/java/cytoscape/groups/CyGroupManager.java
Log:
Add CyGroupChangeEvent (actually rename CyGroupChangeListener.ChangeType to
avoid conflicts with CyGroupViewer.ChangeType).


Added: 
cytoscape/trunk/application/src/main/java/cytoscape/groups/CyGroupChangeEvent.java
===================================================================
--- 
cytoscape/trunk/application/src/main/java/cytoscape/groups/CyGroupChangeEvent.java
                          (rev 0)
+++ 
cytoscape/trunk/application/src/main/java/cytoscape/groups/CyGroupChangeEvent.java
  2010-08-18 03:26:43 UTC (rev 21446)
@@ -0,0 +1,44 @@
+/* vim :set ts=2: */
+/*
+  File: CyGroupChangeListener.java
+
+  Copyright (c) 2007, The Cytoscape Consortium (www.cytoscape.org)
+
+  The Cytoscape Consortium is:
+  - Institute for Systems Biology
+  - University of California San Diego
+  - Memorial Sloan-Kettering Cancer Center
+  - Institut Pasteur
+  - Agilent Technologies
+
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published
+  by the Free Software Foundation; either version 2.1 of the License, or
+  any later version.
+
+  This library is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+  MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
+  documentation provided hereunder is on an "as is" basis, and the
+  Institute for Systems Biology and the Whitehead Institute
+  have no obligations to provide maintenance, support,
+  updates, enhancements or modifications.  In no event shall the
+  Institute for Systems Biology and the Whitehead Institute
+  be liable to any party for direct, indirect, special,
+  incidental or consequential damages, including lost profits, arising
+  out of the use of this software and its documentation, even if the
+  Institute for Systems Biology and the Whitehead Institute
+  have been advised of the possibility of such damage.  See
+  the GNU Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with this library; if not, write to the Free Software Foundation,
+  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package cytoscape.groups;
+
+/**
+ * The types of notifications we pass to our listeners
+ */
+public enum CyGroupChangeEvent { GROUP_CREATED, GROUP_DELETED, GROUP_MODIFIED }
+

Modified: 
cytoscape/trunk/application/src/main/java/cytoscape/groups/CyGroupChangeListener.java
===================================================================
--- 
cytoscape/trunk/application/src/main/java/cytoscape/groups/CyGroupChangeListener.java
       2010-08-18 03:24:55 UTC (rev 21445)
+++ 
cytoscape/trunk/application/src/main/java/cytoscape/groups/CyGroupChangeListener.java
       2010-08-18 03:26:43 UTC (rev 21446)
@@ -39,13 +39,12 @@
 
 /**
  * The CyGroupChangeListener interface provides a mechanism for plugins that 
track
- * group related information to get notified of changes to groups.
+ * group-related events to get notified of global group changes (new groups, 
etc.).
  */
 public interface CyGroupChangeListener {
        /**
-        * The types of notifications we pass to our listeners
-        */
-       public static enum ChangeType { GROUP_CREATED, GROUP_DELETED, 
GROUP_MODIFIED }
-
-       public void groupChanged(CyGroup group, ChangeType change);
+        * This method will be called by the CyGroupManager when a group is 
created, deleted, 
+        * or modified.
+        */
+       public void groupChanged(CyGroup group, CyGroupChangeEvent change);
 }

Modified: 
cytoscape/trunk/application/src/main/java/cytoscape/groups/CyGroupManager.java
===================================================================
--- 
cytoscape/trunk/application/src/main/java/cytoscape/groups/CyGroupManager.java  
    2010-08-18 03:24:55 UTC (rev 21445)
+++ 
cytoscape/trunk/application/src/main/java/cytoscape/groups/CyGroupManager.java  
    2010-08-18 03:26:43 UTC (rev 21446)
@@ -48,7 +48,7 @@
 import cytoscape.CyNode;
 import cytoscape.Cytoscape;
 import cytoscape.view.CyNetworkView;
-import cytoscape.data.CyAttributes;;
+import cytoscape.data.CyAttributes;
 
 /**
  * The CyGroup class provides the implementation for a group model that
@@ -222,7 +222,7 @@
                // Create the group itself
                CyGroup group = new CyGroupImpl(groupNode, nodeList, 
innerEdgeList, outerEdgeList, network);
                groupMap.put(group.getGroupNode(), group);
-               notifyListeners(group, 
CyGroupChangeListener.ChangeType.GROUP_CREATED);
+               notifyListeners(group, CyGroupChangeEvent.GROUP_CREATED);
                if (viewer != null)
                        setGroupViewer(group, viewer, null, true);
                return group;
@@ -247,7 +247,7 @@
                CyGroup group = new CyGroupImpl(groupName);
                groupMap.put(group.getGroupNode(), group);
                setGroupNetwork(group, network);
-               notifyListeners(group, 
CyGroupChangeListener.ChangeType.GROUP_CREATED);
+               notifyListeners(group, CyGroupChangeEvent.GROUP_CREATED);
                setGroupViewer(group, viewer, null, true);
                return group;
        }
@@ -271,7 +271,7 @@
                CyGroup group = new CyGroupImpl(groupName, nodeList);
                groupMap.put(group.getGroupNode(), group);
                setGroupNetwork(group, network);
-               notifyListeners(group, 
CyGroupChangeListener.ChangeType.GROUP_CREATED);
+               notifyListeners(group, CyGroupChangeEvent.GROUP_CREATED);
                setGroupViewer(group, viewer, null, false);
                return group;
        }
@@ -310,7 +310,7 @@
 
                setGroupNetwork(group, network);
 
-               notifyListeners(group, 
CyGroupChangeListener.ChangeType.GROUP_CREATED);
+               notifyListeners(group, CyGroupChangeEvent.GROUP_CREATED);
 
                if (viewer != null)
                        setGroupViewer(group, viewer, null, true);
@@ -417,7 +417,7 @@
                        // Remove it from the root graph
                        // rg.removeNode(groupNode);
 
-                       notifyListeners(group, 
CyGroupChangeListener.ChangeType.GROUP_DELETED);
+                       notifyListeners(group, 
CyGroupChangeEvent.GROUP_DELETED);
                }
        }
 
@@ -492,7 +492,7 @@
                                } else if (currentView != null) {
                                        v.groupCreated(group, currentView);
                                }
-                               notifyListeners(group, 
CyGroupChangeListener.ChangeType.GROUP_MODIFIED);
+                               notifyListeners(group, 
CyGroupChangeEvent.GROUP_MODIFIED);
                        }
                }
 
@@ -563,7 +563,7 @@
         * @param group the group that has changed
         * @param whatChanged the thing that has changed about the group
         */
-       private static void notifyListeners(CyGroup group, 
CyGroupChangeListener.ChangeType whatChanged) {
+       private static void notifyListeners(CyGroup group, CyGroupChangeEvent 
whatChanged) {
                for (CyGroupChangeListener listener: changeListeners) {
                        listener.groupChanged(group, whatChanged);
                }

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