Author: paperwing
Date: 2012-02-17 11:49:37 -0800 (Fri, 17 Feb 2012)
New Revision: 28315

Modified:
   
csplugins/trunk/toronto/yuedong/multi_renderer/impl/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingRenderer.java
Log:
Updated class type comparisons to use qualified names due to classes using 
different class loaders; Cytoscape now runs with new API implementation and Ding

Modified: 
csplugins/trunk/toronto/yuedong/multi_renderer/impl/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingRenderer.java
===================================================================
--- 
csplugins/trunk/toronto/yuedong/multi_renderer/impl/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingRenderer.java
        2012-02-17 19:37:01 UTC (rev 28314)
+++ 
csplugins/trunk/toronto/yuedong/multi_renderer/impl/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingRenderer.java
        2012-02-17 19:49:37 UTC (rev 28315)
@@ -44,16 +44,22 @@
        public RenderingEngineFactory<?> getRenderingEngineFactory(
                        final Class<? extends RenderingEngineFactory<?>> type) {
        
-               if (type == MainViewRenderingEngineFactory.class) {
+               System.out.println("DingRenderer.getRenderingEngineFactory 
called. Requested: " + type.toString());
+               
+               // Class comparisons are done by name as we can't guarantee 
that they are 
+               // loaded by the same class loader (hence the equals() method 
may not work)
+               if 
(type.getName().equals(MainViewRenderingEngineFactory.class.getName())) {
                        return mainRenderingEngineFactory;
-               } else if (type == BirdsEyeViewRenderingEngineFactory.class) {
+               } else if 
(type.getName().equals(BirdsEyeViewRenderingEngineFactory.class.getName())) {
                        return birdEyeRenderingEngineFactory;
-               } else if (type == 
VisualStylePreviewRenderingEngineFactory.class) {
+               } else if 
(type.getName().equals(VisualStylePreviewRenderingEngineFactory.class.getName()))
 {
                        
                        // Ding uses the default rendering engine factory for 
visual style previews
                        return mainRenderingEngineFactory;
                }
                
+               System.out.println("DingRenderer.getRenderingEngineFactory does 
not recognized type. Returning null.");
+               
                return null;
        }
 

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