Author: abeld
Date: 2009-03-15 05:11:10 -0700 (Sun, 15 Mar 2009)
New Revision: 16268

Modified:
   
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/CyNetworkView.java
   
core3/viewmodel-impl/trunk/src/main/java/org/cytoscape/view/model/internal/ColumnOrientedNetworkViewImpl.java
   
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/vizmap/internal/VisualStyleImpl.java
Log:
viewmodel: make CyNetworkView extend View<CyNetwork>
i.e. CyNetworkViews are now is-a View<CyNetwork> (instead of has-a)

remove CyNetworkView.getNetworkView() method, since that is now not needed.


Modified: 
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/CyNetworkView.java
===================================================================
--- 
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/CyNetworkView.java
 2009-03-15 12:08:32 UTC (rev 16267)
+++ 
core3/viewmodel-api/trunk/src/main/java/org/cytoscape/view/model/CyNetworkView.java
 2009-03-15 12:11:10 UTC (rev 16268)
@@ -46,7 +46,7 @@
 /**
  * Contains the visual representation of a Network.
  */
-public interface CyNetworkView {
+public interface CyNetworkView extends View<CyNetwork>{
        /**
         * Returns the network this view was created for.  The network is 
immutable for this
         * view, so there is no way to set it.
@@ -88,14 +88,6 @@
        List<View<CyEdge>> getCyEdgeViews();
 
        /**
-        * Returns the view for this Network.
-        * i.e. returns the object that stores the Network VisualProperty values
-        *
-        * @return  DOCUMENT ME!
-        */
-       View<CyNetwork> getNetworkView();
-
-       /**
         * Returns a list of all View including those for Nodes, Edges, and 
Network.
         *
         * @return  DOCUMENT ME!

Modified: 
core3/viewmodel-impl/trunk/src/main/java/org/cytoscape/view/model/internal/ColumnOrientedNetworkViewImpl.java
===================================================================
--- 
core3/viewmodel-impl/trunk/src/main/java/org/cytoscape/view/model/internal/ColumnOrientedNetworkViewImpl.java
       2009-03-15 12:08:32 UTC (rev 16267)
+++ 
core3/viewmodel-impl/trunk/src/main/java/org/cytoscape/view/model/internal/ColumnOrientedNetworkViewImpl.java
       2009-03-15 12:11:10 UTC (rev 16268)
@@ -74,7 +74,7 @@
        private HashMap<CyNode, ColumnOrientedViewImpl<CyNode>> nodeViews;
        private HashMap<CyEdge, ColumnOrientedViewImpl<CyEdge>> edgeViews;
        private HashMap<String, Set<View<? extends GraphObject>>> subsets;
-       private ColumnOrientedViewImpl<CyNetwork> networkView;
+       private ColumnOrientedViewImpl<CyNetwork> viewCyNetwork;
        private HashMap<VisualProperty<?>, ColumnOrientedViewColumn<?>> columns;
 
        /**
@@ -105,7 +105,7 @@
                        edgeViews.put(edge, new 
ColumnOrientedViewImpl<CyEdge>(edge, this));
                }
 
-               networkView = new ColumnOrientedViewImpl<CyNetwork>(network, 
this);
+               viewCyNetwork = new ColumnOrientedViewImpl<CyNetwork>(network, 
this);
        }
 
        /**
@@ -161,15 +161,6 @@
        }
 
        /**
-        * Returns the view for this Network.
-        * 
-        * @return DOCUMENT ME!
-        */
-       public View<CyNetwork> getNetworkView() {
-               return networkView;
-       }
-
-       /**
         * Returns a list of all View including those for Nodes, Edges, and 
Network.
         * 
         * @return DOCUMENT ME!
@@ -178,7 +169,7 @@
                final List<View<? extends GraphObject>> result = new 
ArrayList<View<? extends GraphObject>>(
                                nodeViews.values());
                result.addAll(edgeViews.values());
-               result.add(networkView);
+               result.add(this);
 
                return result;
        }
@@ -347,4 +338,45 @@
                eventHelper.fireSynchronousEvent(new 
SubsetDestroyedEventImpl(this,
                                name), SubsetDestroyedListener.class);
        }
+       // The following are the View<CyNetwork> methods, implemented as 
proxies to viewCyNetwork.methods
+
+       /** {...@inheritdoc}
+        */
+       public <T> void setVisualProperty(VisualProperty<T> vp, T o){
+               viewCyNetwork.setVisualProperty(vp, o);
+       }
+       /** {...@inheritdoc}
+        */
+       public <T> T getVisualProperty(VisualProperty<T> vp){
+               return viewCyNetwork.getVisualProperty(vp);
+       }
+       /** {...@inheritdoc}
+        */
+       public <T> void setLockedValue(VisualProperty<T> vp, T value){
+               viewCyNetwork.setLockedValue(vp, value);
+       }
+
+       /** {...@inheritdoc}
+        */
+       public boolean isValueLocked(VisualProperty<?> vp){
+               return viewCyNetwork.isValueLocked(vp);
+       }
+
+       /** {...@inheritdoc}
+        */
+       public void clearValueLock(VisualProperty<?> vp){
+               viewCyNetwork.clearValueLock(vp);
+       }
+
+       /** {...@inheritdoc}
+        */
+       public CyNetwork getSource(){
+               return viewCyNetwork.getSource();
+       }
+
+       /** {...@inheritdoc}
+        */
+       public long getSUID() {
+               return viewCyNetwork.getSUID();
+       }
 }

Modified: 
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/vizmap/internal/VisualStyleImpl.java
===================================================================
--- 
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/vizmap/internal/VisualStyleImpl.java
    2009-03-15 12:08:32 UTC (rev 16267)
+++ 
core3/vizmap-impl/trunk/src/main/java/org/cytoscape/vizmap/internal/VisualStyleImpl.java
    2009-03-15 12:11:10 UTC (rev 16268)
@@ -37,6 +37,7 @@
 import org.cytoscape.event.CyEventHelper;
 
 import org.cytoscape.model.CyEdge;
+import org.cytoscape.model.CyNetwork;
 import org.cytoscape.model.CyNode;
 import org.cytoscape.model.GraphObject;
 
@@ -144,7 +145,7 @@
                          vpCatalog.collectionOfVisualProperties(nodeviews, 
VisualProperty.NODE));
                applyImpl(view, edgeviews,
                          vpCatalog.collectionOfVisualProperties(edgeviews, 
VisualProperty.EDGE));
-               applyImpl(view, Arrays.asList(view.getNetworkView()),
+               applyImpl(view, Arrays.asList((View<CyNetwork>)view),
                          
vpCatalog.collectionOfVisualProperties(VisualProperty.NETWORK));
        }
 


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