Author: kono
Date: 2011-07-05 12:23:16 -0700 (Tue, 05 Jul 2011)
New Revision: 26025

Modified:
   
core3/vizmap-impl/trunk/impl/src/main/java/org/cytoscape/view/vizmap/internal/VisualMappingManagerImpl.java
Log:
Some logging messages and null checks had been added.

Modified: 
core3/vizmap-impl/trunk/impl/src/main/java/org/cytoscape/view/vizmap/internal/VisualMappingManagerImpl.java
===================================================================
--- 
core3/vizmap-impl/trunk/impl/src/main/java/org/cytoscape/view/vizmap/internal/VisualMappingManagerImpl.java
 2011-07-05 18:54:09 UTC (rev 26024)
+++ 
core3/vizmap-impl/trunk/impl/src/main/java/org/cytoscape/view/vizmap/internal/VisualMappingManagerImpl.java
 2011-07-05 19:23:16 UTC (rev 26025)
@@ -49,11 +49,16 @@
 import org.cytoscape.view.vizmap.VisualStyleFactory;
 import org.cytoscape.view.vizmap.events.VisualStyleAboutToBeRemovedEvent;
 import org.cytoscape.view.vizmap.events.VisualStyleAddedEvent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  *
  */
 public class VisualMappingManagerImpl implements VisualMappingManager {
+       
+       private static final Logger logger = 
LoggerFactory.getLogger(VisualMappingManagerImpl.class);
+       
        public static final String DEFAULT_STYLE_NAME = "default";
        
        // Default Style
@@ -107,12 +112,7 @@
        }
 
        /**
-        * Get VisualStyle for the given view model.
-        * 
-        * @param nv
-        *            DOCUMENT ME!
-        * 
-        * @return DOCUMENT ME!
+        * Returns an associated Visual Style for the View Model.
         */
        @Override
        public VisualStyle getVisualStyle(CyNetworkView nv) {
@@ -177,20 +177,30 @@
                        }
                }
                
+               logger.info("Visual Style about to be removed from VMM: " + 
vs.getTitle());
                cyEventHelper.fireEvent(new 
VisualStyleAboutToBeRemovedEvent(this, vs));
                visualStyles.remove(vs);
                vs = null;
+               
+               logger.info("Total Number of VS in VMM after remove = " + 
visualStyles.size());
        }
 
+
        /**
-        * Add a new VisualStyle ot this manager. This will be called through 
OSGi
+        * Add a new VisualStyle to this manager. This will be called through 
OSGi
         * service mechanism.
         * 
-        * @param vs
+        * @param vs new Visual Style to be added.
         */
        @Override
        public void addVisualStyle(final VisualStyle vs) {
+               if(vs == null)
+                       throw new NullPointerException("Visual Style is null.");
+               
                this.visualStyles.add(vs);
+               logger.info("New visual Style registered to VMM: " + 
vs.getTitle());
+               logger.info("Total Number of VS in VMM = " + 
visualStyles.size());
+               
                cyEventHelper.fireEvent(new VisualStyleAddedEvent(this, 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