Author: mes
Date: 2012-05-29 16:13:36 -0700 (Tue, 29 May 2012)
New Revision: 29386

Modified:
   
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/CyNetworkViewFactory.java
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewEdit.java
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewTask.java
   
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingViewModelFactory.java
Log:
fixes #1039 Removed the view threshold from the network view factory.  This 
feature was never actually used as the view threshold was (and still is) used 
elsewhere in the code to determine whether or not to create views in the first 
place.

Modified: 
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/CyNetworkViewFactory.java
===================================================================
--- 
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/CyNetworkViewFactory.java
      2012-05-29 23:03:37 UTC (rev 29385)
+++ 
core3/api/trunk/viewmodel-api/src/main/java/org/cytoscape/view/model/CyNetworkViewFactory.java
      2012-05-29 23:13:36 UTC (rev 29386)
@@ -38,33 +38,21 @@
 
 
 /**
- * Factory for {@linkplain CyNetworkView} objects.
+ * Factory for {@link CyNetworkView} objects.
  * Modules which need to create view models should import this as a service.
  * @CyAPI.Api.Interface
  */
 public interface CyNetworkViewFactory {
        
        /** 
-        * Create a {@linkplain CyNetworkView} from a {@linkplain CyNetwork} 
object. 
-        * This method always checks viewThreshold property value found in 
cytoscape3.props
-        * and returns null if the number of graph objects (nodes and edges) is 
above the threshold.
+        * Create a {@link CyNetworkView} from a {@link CyNetwork} object. 
+        * This method will create a view regardless of the viewThreshold
+        * property.
         * This method only creates a CyNetworkView instance and does nothing 
with respect to visual
         * style, layout, or CyNetworkViewManager. 
         * @param network Network for which the CyNetworkView is to be created
         * @return the view model for the network data model
         */
        public CyNetworkView createNetworkView(final CyNetwork network);
-       
-       /**
-        * Creates view with or without using viewThreshold property.
-        * This method only creates a CyNetworkView instance and does nothing 
with respect to visual
-        * style, layout, or CyNetworkViewManager. 
-        * @param network Network for which the CyNetworkView is to be created
-        * @param useThreshold If true the view model is created respecting the 
"viewThreshold" property
-        * found in cytoscape3.props, which means the view model might not be 
created if the size of the
-        * network exceeds the threshold. If false, the view model is created 
regardless of what the 
-        * threshold is.
-        * @return View model for the given data model.
-        */
-       public CyNetworkView createNetworkView(final CyNetwork network, final 
Boolean useThreshold);
+
 }

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewEdit.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewEdit.java
       2012-05-29 23:03:37 UTC (rev 29385)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewEdit.java
       2012-05-29 23:13:36 UTC (rev 29386)
@@ -52,7 +52,7 @@
                ;
 
                final CyNetworkView view =
-                       viewFactory.createNetworkView(network, /* useThreshold 
= */ false);
+                       viewFactory.createNetworkView(network);
                networkViewManager.addNetworkView(view);
 
                for (final View<CyNode> nodeView : view.getNodeViews())

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewTask.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewTask.java
       2012-05-29 23:03:37 UTC (rev 29385)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/creation/CreateNetworkViewTask.java
       2012-05-29 23:13:36 UTC (rev 29386)
@@ -86,10 +86,12 @@
                taskMonitor.setProgress(0.0);
                taskMonitor.setTitle("Creating Network View");
                taskMonitor.setStatusMessage("Creating network view...");
+               System.out.println("entering create view");
 
                int i = 0;
                int viewCount = networks.size();
                for (final CyNetwork n : networks) {
+                       System.out.println("checking network " + n.toString());
                        if (networkViewManager.getNetworkViews(n).isEmpty()) {
                                createView(n);
                                taskMonitor.setStatusMessage("Network view 
successfully created for:  "
@@ -102,14 +104,15 @@
                taskMonitor.setProgress(1.0);
        }
 
-       private final void createView(CyNetwork network) throws Exception {     
        
+       private final void createView(CyNetwork network) throws Exception {     
+               System.out.println("actually creating view " + 
network.toString());
 
                final long start = System.currentTimeMillis();
 
                try {
                        // By calling this task, actual view will be created 
even if it's a
                        // large network.
-                       final CyNetworkView view = 
viewFactory.createNetworkView(network, false);
+                       final CyNetworkView view = 
viewFactory.createNetworkView(network);
                        networkViewManager.addNetworkView(view);
 
                        // If a source view has been provided, use that to set 
the X/Y

Modified: 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingViewModelFactory.java
===================================================================
--- 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingViewModelFactory.java
   2012-05-29 23:03:37 UTC (rev 29385)
+++ 
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DingViewModelFactory.java
   2012-05-29 23:13:36 UTC (rev 29386)
@@ -61,12 +61,6 @@
 
        @Override
        public CyNetworkView createNetworkView(final CyNetwork network) {
-               return createNetworkView(network, false);
-       }
-
-       @Override
-       public CyNetworkView createNetworkView(final CyNetwork network, final 
Boolean useThreshold) {
-
                if (network == null)
                        throw new IllegalArgumentException("Cannot create view 
without model.");
 

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