Author: kono
Date: 2010-10-26 16:39:41 -0700 (Tue, 26 Oct 2010)
New Revision: 22493

Added:
   
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleRemovedEvent.java
   
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleRemovedListener.java
Removed:
   
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleChangedEvent.java
   
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleChangedListener.java
   
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleDestroyedEvent.java
   
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleDestroyedListener.java
Modified:
   
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/VisualMappingManager.java
   
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleCreatedEvent.java
   
core3/vizmap-api/trunk/src/test/java/org/cytoscape/view/vizmap/VizmapEventsTest.java
   
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMainPanel.java
   
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualMappingManagerImpl.java
   
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualStyleFactoryImpl.java
Log:
Vizmap API is modified based on code review discussion.

Modified: 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/VisualMappingManager.java
===================================================================
--- 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/VisualMappingManager.java
    2010-10-26 23:37:27 UTC (rev 22492)
+++ 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/VisualMappingManager.java
    2010-10-26 23:39:41 UTC (rev 22493)
@@ -48,7 +48,7 @@
  * <p>
  * Add/Remove operations will be done through events. For more information, 
read
  * JavaDoc for {...@linkplain VisualStyleCreatedEvent} and
- * {...@linkplain VisualStyleDestroyedEvent}.
+ * {...@linkplain VisualStyleRemovedEvent}.
  * </p>
  * 
  */

Deleted: 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleChangedEvent.java
===================================================================
--- 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleChangedEvent.java
  2010-10-26 23:37:27 UTC (rev 22492)
+++ 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleChangedEvent.java
  2010-10-26 23:39:41 UTC (rev 22493)
@@ -1,51 +0,0 @@
-/*
- Copyright (c) 2008, 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 org.cytoscape.view.vizmap.events;
-
-import org.cytoscape.event.AbstractCyEvent;
-
-import org.cytoscape.view.vizmap.VisualStyle;
-
-
-/**
- * TODO: Is this necessary?
- * 
-  */
-public final class VisualStyleChangedEvent extends 
AbstractCyEvent<VisualStyle> {
-       
-       public VisualStyleChangedEvent(final VisualStyle source) {
-               super(source, VisualStyleChangedListener.class);
-       }
-}

Deleted: 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleChangedListener.java
===================================================================
--- 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleChangedListener.java
       2010-10-26 23:37:27 UTC (rev 22492)
+++ 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleChangedListener.java
       2010-10-26 23:39:41 UTC (rev 22493)
@@ -1,50 +0,0 @@
-/*
- Copyright (c) 2008, 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 org.cytoscape.view.vizmap.events;
-
-import org.cytoscape.event.CyListener;
-
-
-/**
- * Listener for VisualStyleChangedEvent.
- */
-public interface VisualStyleChangedListener extends CyListener {
-       /**
-        * TODO: is this necessary?
-        * 
-        * @param e DOCUMENT ME!
-        */
-       void handleEvent(VisualStyleChangedEvent e);
-}

Modified: 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleCreatedEvent.java
===================================================================
--- 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleCreatedEvent.java
  2010-10-26 23:37:27 UTC (rev 22492)
+++ 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleCreatedEvent.java
  2010-10-26 23:39:41 UTC (rev 22493)
@@ -36,21 +36,35 @@
 
 import org.cytoscape.event.AbstractCyEvent;
 import org.cytoscape.view.vizmap.VisualStyle;
+import org.cytoscape.view.vizmap.VisualStyleFactory;
 
 /**
  * When {...@linkplain VisualStyleFactory} creates a new {...@linkplain 
VisualStyle}
  * object, it should fire this event.
  * 
  */
-public final class VisualStyleCreatedEvent extends 
AbstractCyEvent<VisualStyle> {
-       
+public final class VisualStyleCreatedEvent extends 
AbstractCyEvent<VisualStyleFactory> {
+
+       private final VisualStyle created;
+
        /**
         * Creates an event for the newly created style.
         * 
+        * @param source Source object which has created new VisualStyle.
         * @param created the new VisualStyle
         */
-       public VisualStyleCreatedEvent(final VisualStyle created) {
-               super(created, VisualStyleCreatedListener.class);
+       public VisualStyleCreatedEvent(final VisualStyleFactory source,
+                       final VisualStyle created) {
+               super(source, VisualStyleCreatedListener.class);
+               this.created = created;
        }
 
+       /**
+        * Get the newly created VisualStyle.
+        * 
+        * @return new VisualStyle
+        */
+       public VisualStyle getCreatedVisualStyle() {
+               return created;
+       }
 }

Deleted: 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleDestroyedEvent.java
===================================================================
--- 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleDestroyedEvent.java
        2010-10-26 23:37:27 UTC (rev 22492)
+++ 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleDestroyedEvent.java
        2010-10-26 23:39:41 UTC (rev 22493)
@@ -1,54 +0,0 @@
-/*
- Copyright (c) 2008, 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 org.cytoscape.view.vizmap.events;
-
-import org.cytoscape.event.AbstractCyEvent;
-import org.cytoscape.view.vizmap.VisualStyle;
-
-/**
- * This event will be fired when {...@linkplain VisualStyle} object is deleted 
from
- * {...@linkplain VisualMappingManager}.
- */
-public final class VisualStyleDestroyedEvent extends 
AbstractCyEvent<VisualStyle> {
-
-       /**
-        * create an event for the deleted VisualStyle.
-        * 
-        * @param destroyed VisualStyle to be deleted.
-        */
-       public VisualStyleDestroyedEvent(final VisualStyle destroyed) {
-               super(destroyed, VisualStyleDestroyedListener.class);
-       }
-}

Deleted: 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleDestroyedListener.java
===================================================================
--- 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleDestroyedListener.java
     2010-10-26 23:37:27 UTC (rev 22492)
+++ 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleDestroyedListener.java
     2010-10-26 23:39:41 UTC (rev 22493)
@@ -1,51 +0,0 @@
-/*
- Copyright (c) 2008, 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 org.cytoscape.view.vizmap.events;
-
-import org.cytoscape.event.CyListener;
-
-/**
- * Listener for {...@linkplain VisualStyleDestroyedEvent}.
- */
-public interface VisualStyleDestroyedListener extends CyListener {
-
-       /**
-        * Update states/GUI using deleted {...@linkplain VisualStyle} 
information.
-        * 
-        * @param e
-        *            Event containing deleted VisualStyle.
-        */
-       void handleEvent(VisualStyleDestroyedEvent e);
-}

Copied: 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleRemovedEvent.java
 (from rev 22481, 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleDestroyedEvent.java)
===================================================================
--- 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleRemovedEvent.java
                          (rev 0)
+++ 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleRemovedEvent.java
  2010-10-26 23:39:41 UTC (rev 22493)
@@ -0,0 +1,70 @@
+/*
+ Copyright (c) 2008, 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 org.cytoscape.view.vizmap.events;
+
+import org.cytoscape.event.AbstractCyEvent;
+import org.cytoscape.view.vizmap.VisualMappingManager;
+import org.cytoscape.view.vizmap.VisualStyle;
+
+/**
+ * This event will be fired when {...@linkplain VisualStyle} object is deleted 
from
+ * {...@linkplain VisualMappingManager}.
+ */
+public final class VisualStyleRemovedEvent extends 
AbstractCyEvent<VisualMappingManager> {
+
+       private final VisualStyle destroyed;
+
+       /**
+        * create an event for the deleted VisualStyle.
+        * 
+        * @param source Source of event.  Anyone can create this event, but 
usually GUI components creates this event.
+        * @param destroyed VisualStyle to be deleted.
+        */
+       public VisualStyleRemovedEvent(final VisualMappingManager source, final 
VisualStyle destroyed) {
+               super(source, VisualStyleRemovedListener.class);
+               this.destroyed = destroyed;
+       }
+
+       
+       /**
+        * Returns deleted VisualStyle.
+        * 
+        * @return VisualStyle just deleted.
+        * 
+        */
+       public VisualStyle getDestroyedVisualStyle() {
+               return destroyed;
+       }
+}

Copied: 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleRemovedListener.java
 (from rev 22472, 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleDestroyedListener.java)
===================================================================
--- 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleRemovedListener.java
                               (rev 0)
+++ 
core3/vizmap-api/trunk/src/main/java/org/cytoscape/view/vizmap/events/VisualStyleRemovedListener.java
       2010-10-26 23:39:41 UTC (rev 22493)
@@ -0,0 +1,51 @@
+/*
+ Copyright (c) 2008, 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 org.cytoscape.view.vizmap.events;
+
+import org.cytoscape.event.CyListener;
+
+/**
+ * Listener for {...@linkplain VisualStyleRemovedEvent}.
+ */
+public interface VisualStyleRemovedListener extends CyListener {
+
+       /**
+        * Update states/GUI using deleted {...@linkplain VisualStyle} 
information.
+        * 
+        * @param e
+        *            Event containing deleted VisualStyle.
+        */
+       void handleEvent(VisualStyleRemovedEvent e);
+}

Modified: 
core3/vizmap-api/trunk/src/test/java/org/cytoscape/view/vizmap/VizmapEventsTest.java
===================================================================
--- 
core3/vizmap-api/trunk/src/test/java/org/cytoscape/view/vizmap/VizmapEventsTest.java
        2010-10-26 23:37:27 UTC (rev 22492)
+++ 
core3/vizmap-api/trunk/src/test/java/org/cytoscape/view/vizmap/VizmapEventsTest.java
        2010-10-26 23:39:41 UTC (rev 22493)
@@ -1,23 +1,27 @@
 package org.cytoscape.view.vizmap;
 
 
-import org.cytoscape.view.vizmap.events.VisualStyleChangedEvent;
+import static org.easymock.EasyMock.createMock;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 import org.cytoscape.view.vizmap.events.VisualStyleCreatedEvent;
-import org.cytoscape.view.vizmap.events.VisualStyleDestroyedEvent;
+import org.cytoscape.view.vizmap.events.VisualStyleRemovedEvent;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
-
 public class VizmapEventsTest {
 
        private VisualStyle style;
+       private VisualStyleFactory factory;
+       private VisualMappingManager manager;
        
        @Before
        public void setUp() throws Exception {
                style = createMock(VisualStyle.class);
+               factory = createMock(VisualStyleFactory.class);
+               manager = createMock(VisualMappingManager.class);
        }
 
        @After
@@ -26,23 +30,16 @@
        
        @Test
        public void testVisualStyleCreatedEvent() {
-               final VisualStyleCreatedEvent event = new 
VisualStyleCreatedEvent(style);
+               final VisualStyleCreatedEvent event = new 
VisualStyleCreatedEvent(factory, style);
                assertNotNull(event);
-               assertEquals(style, event.getSource());
+               assertEquals(style, event.getCreatedVisualStyle());
        }
        
        @Test
        public void testVisualStyleDestroyedEvent() {
-               final VisualStyleDestroyedEvent event = new 
VisualStyleDestroyedEvent(style);
+               final VisualStyleRemovedEvent event = new 
VisualStyleRemovedEvent(manager, style);
                assertNotNull(event);
-               assertEquals(style, event.getSource());
+               assertEquals(style, event.getDestroyedVisualStyle());
        }
-       
-       @Test
-       public void testVisualStyleChangedEvent() {
-               final VisualStyleChangedEvent event = new 
VisualStyleChangedEvent(style);
-               assertNotNull(event);
-               assertEquals(style, event.getSource());
-       }
 
 }

Modified: 
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMainPanel.java
===================================================================
--- 
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMainPanel.java
    2010-10-26 23:37:27 UTC (rev 22492)
+++ 
core3/vizmap-gui-impl/trunk/src/main/java/org/cytoscape/view/vizmap/gui/internal/VizMapperMainPanel.java
    2010-10-26 23:39:41 UTC (rev 22493)
@@ -681,7 +681,7 @@
         * Update GUI components when new Visual Style is created.
         */
        @Override public void handleEvent(final VisualStyleCreatedEvent e) {
-               final VisualStyle newStyle = e.getSource();
+               final VisualStyle newStyle = e.getCreatedVisualStyle();
                if(newStyle == null)
                        return;
                

Modified: 
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualMappingManagerImpl.java
===================================================================
--- 
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualMappingManagerImpl.java
      2010-10-26 23:37:27 UTC (rev 22492)
+++ 
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualMappingManagerImpl.java
      2010-10-26 23:39:41 UTC (rev 22493)
@@ -45,13 +45,13 @@
 import org.cytoscape.view.vizmap.VisualStyle;
 import org.cytoscape.view.vizmap.events.VisualStyleCreatedEvent;
 import org.cytoscape.view.vizmap.events.VisualStyleCreatedListener;
-import org.cytoscape.view.vizmap.events.VisualStyleDestroyedEvent;
-import org.cytoscape.view.vizmap.events.VisualStyleDestroyedListener;
+import org.cytoscape.view.vizmap.events.VisualStyleRemovedEvent;
+import org.cytoscape.view.vizmap.events.VisualStyleRemovedListener;
 
 /**
  *
  */
-public class VisualMappingManagerImpl implements VisualMappingManager, 
VisualStyleCreatedListener, VisualStyleDestroyedListener {
+public class VisualMappingManagerImpl implements VisualMappingManager, 
VisualStyleCreatedListener, VisualStyleRemovedListener {
 
        private final Map<CyNetworkView, VisualStyle> network2VisualStyleMap;
        private final Set<VisualStyle> visualStyles;
@@ -103,7 +103,7 @@
         */
        private void removeVisualStyle(VisualStyle vs) {
                visualStyles.remove(vs);
-               cyEventHelper.fireSynchronousEvent(new 
VisualStyleDestroyedEvent(vs));
+               cyEventHelper.fireSynchronousEvent(new 
VisualStyleRemovedEvent(this, vs));
                vs = null;
        }
 
@@ -128,13 +128,13 @@
        }
 
        @Override
-       public void handleEvent(VisualStyleDestroyedEvent e) {
-               removeVisualStyle(e.getSource());
+       public void handleEvent(VisualStyleRemovedEvent e) {
+               removeVisualStyle(e.getDestroyedVisualStyle());
        }
 
        @Override
        public void handleEvent(VisualStyleCreatedEvent e) {
-               addVisualStyle(e.getSource());
+               addVisualStyle(e.getCreatedVisualStyle());
        }
 
 }

Modified: 
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualStyleFactoryImpl.java
===================================================================
--- 
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualStyleFactoryImpl.java
        2010-10-26 23:37:27 UTC (rev 22492)
+++ 
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/view/vizmap/internal/VisualStyleFactoryImpl.java
        2010-10-26 23:39:41 UTC (rev 22493)
@@ -33,7 +33,7 @@
                        vp = mapping.getVisualProperty();
                }
 
-               eventHelper.fireSynchronousEvent(new 
VisualStyleCreatedEvent(copyVS));
+               eventHelper.fireSynchronousEvent(new 
VisualStyleCreatedEvent(this, copyVS));
 
                return copyVS;
        }
@@ -43,7 +43,7 @@
        public VisualStyle createVisualStyle(String title, final VisualLexicon 
lexicon) {
                final VisualStyle vs = new VisualStyleImpl(title, lexicon);
                
-               eventHelper.fireSynchronousEvent(new 
VisualStyleCreatedEvent(vs));
+               eventHelper.fireSynchronousEvent(new 
VisualStyleCreatedEvent(this, vs));
                return vs;
        }
 

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