Differences between revisions 6 and 7
Revision 6 as of 2009-07-16 01:47:51
Size: 1951
Editor: KeiichiroOno
Comment:
Revision 7 as of 2009-07-16 02:37:29
Size: 3579
Editor: KeiichiroOno
Comment:
Deletions are marked like this. Additions are marked like this.
Line 34: Line 34:
    /**
     * 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);
 /*
  * 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(Container container, View<?> viewModel);
 public RenderingEngine addPresentation(Container container, List<View<?>> viewModels);
}
}}}

{{{#!java
public interface VisualItemRenderer {
 /**
  * Provide a set of Visual Properties this renderer can visualize.
  *
  * @return Set of VP as a VisualLexicon
  */
 public VisualLexicon getVisualLexicon();
}
}}}

{{{#!java
public interface RenderingEngine {
 
 /**
  * Returns backend View Models for this presentation.
  *
  * @return view models.
  */
 public List<View<?>> getViewModels();
 

 /**
  * 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);
Line 45: Line 105:
Our overall design (model-view-presentation) does not completely equivalent to typical scene graph used in many 3D visualizers.
This design is inspired by Prefuse Visualization Toolkit.




=== Case Study ===
==== Visual
ize Attributes ====
Our overall design (model-view-presentation) does not completely equivalent to typical scene graph used in many 3D visualizers.  This design is inspired by Prefuse Visualization Toolkit.  The rendering engine object can take any type of Views, but usually it takes Networks or data tables. For each View, render the object using proper VisualItemRenderer. VisualItemRenderer provides a Visual Lexicon, which is a set of Visual Properties that can be recognized by this rendering engine's drawing classes.

Presentation Layer

Updated on July 15, 2009 by KeiOno

Still under construction!

Introduction

Presentation layer is the set of actual classes which draws network graphics. From 3.0, Cytoscpae can have multiple presentation per view. This means multiple rendering engines can co-exist in an instance of Cytoscape.

Design

Definitions

Data Model

View Model
  • A map from Visual Property type to a value (color, size, ...)
  • One View Model is always associated with a data model.
  • A data model can have multiple View Models.

Presentation
  • Presentation is a visualization of View Model. A View Model can have multiple presentations. In reality, presentation represents a drawing on AWT Canvas or other Swing Components.

API

There are 3 interfaces in Presentation API bundle:

   1 public interface PresentationFactory {
   2         /*
   3          * A presentation can contain multiple view models.
   4          * This enable developers to render multiple View Models in the same display.
   5          * For example, if View<CyNetwork> and View<Decoration> are passed to this, 
   6          * both of them will be rendered in a window, using same rendering engine.
   7          */
   8         public RenderingEngine addPresentation(Container container, View<?> viewModel);
   9         public RenderingEngine addPresentation(Container container, List<View<?>> viewModels);
  10 }
  11 

   1 public interface VisualItemRenderer {
   2         /**
   3          * Provide a set of Visual Properties this renderer can visualize.
   4          *
   5          * @return Set of VP as a VisualLexicon
   6          */
   7         public VisualLexicon getVisualLexicon();
   8 }
   9 

   1 public interface RenderingEngine {
   2         
   3         /**
   4          * Returns backend View Models for this presentation.
   5          * 
   6          * @return view models.
   7          */
   8         public List<View<?>> getViewModels();
   9         
  10 
  11         /**
  12          * Rendering engine dependent properties, like LOD
  13          */
  14         public void setProperties(Properties props);
  15         public Properties getProperties();
  16 
  17         /**
  18          * For export image function.
  19          * 
  20          * @return DOCUMENT ME!
  21          */
  22         public Printable getPrintable();
  23 
  24         /**
  25          * Render image from the current view model state.
  26          * 
  27          * @return Image object created from current window.
  28          */
  29         public Image getImage(int width, int height);
  30 
  31         /**
  32          * For a given Visual Property, render an Icon based on the default value of
  33          * the Visual Property.
  34          * 
  35          * @param vp
  36          *            Visual Property.
  37          * 
  38          * @return DOCUMENT ME!
  39          * 
  40          * @exception IllegalArgumentException
  41          *                if vp is not in the lexicon.
  42          */
  43         public Icon getDefaultIcon(VisualProperty<?> vp);
  44 }
  45 

Discussion

Our overall design (model-view-presentation) does not completely equivalent to typical scene graph used in many 3D visualizers. This design is inspired by Prefuse Visualization Toolkit. The rendering engine object can take any type of Views, but usually it takes Networks or data tables. For each View, render the object using proper VisualItemRenderer. VisualItemRenderer provides a Visual Lexicon, which is a set of Visual Properties that can be recognized by this rendering engine's drawing classes.

Relationship between Presentation Layer and Other Modules

VizMap

Outdated_Cytoscape_3.0/PresentationDiscussions (last edited 2011-02-24 15:32:17 by PietMolenaar)

Funding for Cytoscape is provided by a federal grant from the U.S. National Institute of General Medical Sciences (NIGMS) of the Na tional Institutes of Health (NIH) under award number GM070743-01. Corporate funding is provided through a contract from Unilever PLC.

MoinMoin Appliance - Powered by TurnKey Linux