Author: paperwing
Date: 2012-02-13 15:31:09 -0800 (Mon, 13 Feb 2012)
New Revision: 28249

Modified:
   
csplugins/trunk/toronto/yuedong/multi_renderer/api/presentation-api/src/main/java/org/cytoscape/view/presentation/ExternalRenderer.java
   
csplugins/trunk/toronto/yuedong/multi_renderer/api/presentation-api/src/main/java/org/cytoscape/view/presentation/ExternalRendererManager.java
Log:
Updated API interfaces for the top-level renderer class and its manager 
service. Updated current methods, added new methods, and added javadoc for 
explanation.

Modified: 
csplugins/trunk/toronto/yuedong/multi_renderer/api/presentation-api/src/main/java/org/cytoscape/view/presentation/ExternalRenderer.java
===================================================================
--- 
csplugins/trunk/toronto/yuedong/multi_renderer/api/presentation-api/src/main/java/org/cytoscape/view/presentation/ExternalRenderer.java
     2012-02-13 20:11:55 UTC (rev 28248)
+++ 
csplugins/trunk/toronto/yuedong/multi_renderer/api/presentation-api/src/main/java/org/cytoscape/view/presentation/ExternalRenderer.java
     2012-02-13 23:31:09 UTC (rev 28249)
@@ -1,13 +1,47 @@
 package org.cytoscape.view.presentation;
 
+import org.cytoscape.model.CyNetwork;
+import org.cytoscape.view.model.CyNetworkViewFactory;
+import org.cytoscape.view.model.View;
+import org.cytoscape.view.model.VisualLexicon;
+
 /**
  * Draft version of top-level ExternalRenderer class that represents a 
Cytoscape renderer, and should
  * correspondingly have one instance per installed renderer.
  */
 public interface ExternalRenderer {
-
+       
+       String rendererID = null;
+       
+       enum RenderPurpose {
+               BIRDS_EYE_VIEW,
+               DETAIL_VIEW,
+               VISUAL_STYLE_PREVIEW
+       }
+       
+       /**
+        * Return the renderer's ID. This ID is used to distinguish between 
different renderers.
+        * 
+        * @return The renderer's ID
+        */
        public String getRendererID();
        
+       /**
+        * Return a {@link RenderingEngineFactory} object to be used for 
creating {@link RenderingEngine} objects with the given rendering purpose,
+        * such as bird's eye view or detail view.
+        */
+       RenderingEngineFactory<?> getRenderingEngineFactory(RenderPurpose 
renderPurpose);
+       
+       // Allow returning different CyNetworkView factories. This could be 
helpful for efficiency. For example, a bird's eye RenderingEngine may not
+       // need some visual properties of the main view.
+       CyNetworkViewFactory getNetworkViewFactory(RenderPurpose renderPurpose);
+       
+       // Allow returning different VisualLexicons; a bird's eye 
RenderingEngine may not need some visual properties of the main view.
+       VisualLexicon getVisualLexicon(RenderPurpose renderPurpose);
+       
+       
        // TODO: Determine how RenderingEngine instances will be obtained: via 
returning RenderingEngineFactory objects or directly
        // creating RenderingEngine objects
+       
+       
 }

Modified: 
csplugins/trunk/toronto/yuedong/multi_renderer/api/presentation-api/src/main/java/org/cytoscape/view/presentation/ExternalRendererManager.java
===================================================================
--- 
csplugins/trunk/toronto/yuedong/multi_renderer/api/presentation-api/src/main/java/org/cytoscape/view/presentation/ExternalRendererManager.java
      2012-02-13 20:11:55 UTC (rev 28248)
+++ 
csplugins/trunk/toronto/yuedong/multi_renderer/api/presentation-api/src/main/java/org/cytoscape/view/presentation/ExternalRendererManager.java
      2012-02-13 23:31:09 UTC (rev 28249)
@@ -8,18 +8,55 @@
 public interface ExternalRendererManager {
        
        /**
-        * Adds a renderer to this manager.
-        * @param externalRenderer
+        * Installs a renderer and adds it to this manager.
+        * 
+        * @param ExternalRenderer The renderer to be installed.
         */
-       public void addRenderer(ExternalRenderer renderer);
+       public void installRenderer(ExternalRenderer externalRenderer);
        
-       public void removeRenderer(ExternalRenderer renderer);
+       /**
+        * Uninstalls a renderer and removes it from this manager.
+        * 
+        * @param externalRenderer The renderer to be installed.
+        */
+       public void uninstallRenderer(ExternalRenderer externalRenderer);
        
+       /**
+        * Removes a renderer based on its renderer ID.
+        * 
+        * @param renderID The renderer ID of the renderer to be removed.
+        */
+       public void uninstallRenderer(String rendererID);
+       
+       /**
+        * Return a defensively copied {@link List} containing the list of 
installed renderers' IDs.
+        * 
+        * @return A defensively copied list of the IDs of the currently 
installed renderers.
+        */
        public List<String> getInstalledRenderers();
        
-       public void getRenderer(String rendererID);
+       /**
+        * Returns the installed {@link ExternalRenderer} associated with the 
given renderer ID, if there is one.
+        * 
+        * @param rendererID The renderer ID of the desired renderer.
+        * @return The {@link ExternalRenderer} associated with the given 
renderer ID, or <code>null</code> if there is none.
+        */
+       public ExternalRenderer getRenderer(String rendererID);
        
-       public void setDefaultRenderer(String rendererID);
+       /**
+        * Sets the ID used to look for the default renderer.
+        * 
+        * @param rendererID The ID of the renderer to be used as the default 
renderer.
+        * @return The ID of the new default renderer, or <code>null</code> if 
there is no new default or if no renderer was found with the given renderer ID.
+        */
+       public String setDefaultRendererID(String rendererID);
        
-       public void getDefaultRenderer();       
+       
+       /**
+        * Return the default renderer's renderer ID.
+        * 
+        * @return The ID of the default renderer, or null if there are no 
renderers installed. If there is only 1 renderer installed, the ID of that 
renderer
+        * will be returned.
+        */
+       public String getDefaultRendererID();   
 }

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