Author: ruschein
Date: 2011-09-07 16:29:54 -0700 (Wed, 07 Sep 2011)
New Revision: 26742

Modified:
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
Log:
Small performance optimisation.

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
     2011-09-07 23:19:56 UTC (rev 26741)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DGraphView.java
     2011-09-07 23:29:54 UTC (rev 26742)
@@ -2706,12 +2706,13 @@
        @Override
        public void handleEvent(NodeViewsChangedEvent e) {
                if ( e.getSource() != cyNetworkView )
-                               return;
+                       return;
                
                for ( ViewChangeRecord<CyNode> record : 
e.getPayloadCollection()) {
                        final Integer index = 
record.getView().getModel().getIndex();
-                       if (m_nodeViewMap.containsKey(index))
-                               
m_nodeViewMap.get(index).setVisualPropertyValue(record.getVisualProperty(), 
record.getValue());
+                       final NodeView view = m_nodeViewMap.get(index);
+                       if (view != null)
+                               
view.setVisualPropertyValue(record.getVisualProperty(), record.getValue());
                }
        }
 
@@ -2725,8 +2726,9 @@
        
                for ( ViewChangeRecord<CyEdge> record : 
e.getPayloadCollection()) {
                        final Integer index = 
record.getView().getModel().getIndex();
-                       if (m_edgeViewMap.containsKey(index))
-                               
m_edgeViewMap.get(index).setVisualPropertyValue(record.getVisualProperty(), 
record.getValue());
+                       final EdgeView view = m_edgeViewMap.get(index);
+                       if (view != null)
+                               
view.setVisualPropertyValue(record.getVisualProperty(), record.getValue());
                }
        }
 

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