Author: kono
Date: 2009-07-21 15:16:10 -0700 (Tue, 21 Jul 2009)
New Revision: 17505

Added:
   
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/RenderingEngine.java
   
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/VisualItemRenderer.java
Removed:
   
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/Renderer.java
Modified:
   
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/PresentationFactory.java
Log:
Presentation API had been refactored based on the discussion last week.

Modified: 
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/PresentationFactory.java
===================================================================
--- 
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/PresentationFactory.java
 2009-07-21 21:13:48 UTC (rev 17504)
+++ 
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/PresentationFactory.java
 2009-07-21 22:16:10 UTC (rev 17505)
@@ -1,21 +1,23 @@
-package org.cytoscape.view.presentation;
-
-import java.awt.Container;
-
-import org.cytoscape.view.model.View;
-
-public interface PresentationFactory {
-    /**
-     * This method should add whatever content it likes to the JInternalFrame 
for
-     * display.  It should also be sure to register said content as a transfer
-     * (Drag 'n Drop) listener, if so desired.
-     */
-    public <T extends View<?>> Renderer<T> addPresentation(Container 
presentationContainer, T view);
-
-       /**
-        * 
-        */
-    public NavigationPresentation addNavigationPresentation(Object 
targetComponent, Object navBounds);
-    
-    public <T extends View<?>> Renderer<T> createPresentation(T view);
-}
+package org.cytoscape.view.presentation;
+
+import org.cytoscape.view.model.View;
+
+public interface PresentationFactory {
+       /**
+        * A presentation can contain multiple view models. This enable 
developers
+        * to render multiple View Models in the same display. For example, if
+        * View<CyNetwork> and View<Decoration> are passed to this, both of them
+        * will be rendered in a window, using same rendering engine.
+        */
+       public RenderingEngine addPresentation(Object container, View<?> 
viewModel);
+
+       /**
+        * This method should be removed.
+        * 
+        * @param targetComponent
+        * @param navBounds
+        * @return
+        */
+       public NavigationPresentation addNavigationPresentation(
+                       Object targetComponent, Object navBounds);
+}

Deleted: 
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/Renderer.java
===================================================================
--- 
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/Renderer.java
    2009-07-21 21:13:48 UTC (rev 17504)
+++ 
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/Renderer.java
    2009-07-21 22:16:10 UTC (rev 17505)
@@ -1,78 +0,0 @@
-package org.cytoscape.view.presentation;
-
-import java.awt.Image;
-import java.awt.print.Printable;
-import java.util.Properties;
-
-import javax.swing.Icon;
-
-import org.cytoscape.view.model.View;
-import org.cytoscape.view.model.VisualLexicon;
-import org.cytoscape.view.model.VisualProperty;
-
-/**
- * Generic interface for all presentations.
- * Represents a drawing function for a given data model.
- * 
- *  This can be used for any view model, including networks and attributes.
- */
-public interface Renderer<T extends View<?>> {
-       
-       /**
-        * Returns backend View data structure.
-        * Model can be extracted from the View object.
-        * 
-        * @return view model.
-        */
-       public T getViewModel();
-       
-       /**
-        * Return a Visual Lexicon which contains compatible Visual Properties 
for
-        * this renderer.
-        * 
-        */
-       public VisualLexicon getVisualLexicon();
-
-       /**
-        * 
-        * 
-        * @param props
-        *            DOCUMENT ME!
-        */
-       public void setProperties(Properties props);
-
-       /**
-        * DOCUMENT ME!
-        * 
-        * @return DOCUMENT ME!
-        */
-       public Properties getProperties();
-
-       /**
-        * For export image function.
-        * 
-        * @return DOCUMENT ME!
-        */
-       public Printable getPrintable();
-
-       /**
-        * Render image from the current view model state.
-        * 
-        * @return Image object created from current window.
-        */
-       public Image getImage(int width, int height);
-
-       /**
-        * For a given Visual Property, render an Icon based on the default 
value of
-        * the Visual Property.
-        * 
-        * @param vp
-        *            Visual Property.
-        * 
-        * @return DOCUMENT ME!
-        * 
-        * @exception IllegalArgumentException
-        *                if vp is not in the lexicon.
-        */
-       public Icon getDefaultIcon(VisualProperty<?> vp);
-}

Added: 
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/RenderingEngine.java
===================================================================
--- 
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/RenderingEngine.java
                             (rev 0)
+++ 
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/RenderingEngine.java
     2009-07-21 22:16:10 UTC (rev 17505)
@@ -0,0 +1,56 @@
+package org.cytoscape.view.presentation;
+
+import java.awt.Image;
+import java.awt.print.Printable;
+import java.util.Properties;
+
+import javax.swing.Icon;
+
+import org.cytoscape.view.model.View;
+import org.cytoscape.view.model.VisualProperty;
+
+
+public interface RenderingEngine {
+       
+       /**
+        * Returns backend View Models for this presentation.
+        * 
+        * @return view models.
+        */
+       public View<?> getViewModel();
+       
+
+       /**
+        * Rendering engine dependent properties, like LOD
+        */
+       public void setProperties(Properties props);
+       public Properties getProperties();
+
+       /**
+        * For export image function.
+        * 
+        * @return DOCUMENT ME!
+        */
+       public Printable getPrintable();
+
+       /**
+        * Render image from the current view model state.
+        * 
+        * @return Image object created from current window.
+        */
+       public Image getImage(int width, int height);
+
+       /**
+        * For a given Visual Property, render an Icon based on the default 
value of
+        * the Visual Property.
+        * 
+        * @param vp
+        *            Visual Property.
+        * 
+        * @return DOCUMENT ME!
+        * 
+        * @exception IllegalArgumentException
+        *                if vp is not in the lexicon.
+        */
+       public Icon getDefaultIcon(VisualProperty<?> vp);
+}

Added: 
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/VisualItemRenderer.java
===================================================================
--- 
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/VisualItemRenderer.java
                          (rev 0)
+++ 
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/VisualItemRenderer.java
  2009-07-21 22:16:10 UTC (rev 17505)
@@ -0,0 +1,13 @@
+package org.cytoscape.view.presentation;
+
+import org.cytoscape.view.model.View;
+import org.cytoscape.view.model.VisualLexicon;
+
+public interface VisualItemRenderer<T extends View<?>> {
+       /**
+        * Provide a set of Visual Properties this renderer can visualize.
+        *
+        * @return Set of VP as a VisualLexicon
+        */
+       public VisualLexicon getVisualLexicon();
+}


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