Author: rodche
Date: 2011-12-09 11:55:41 -0800 (Fri, 09 Dec 2011)
New Revision: 27753

Removed:
   
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/SelectUtil.java
Modified:
   csplugins/trunk/toronto/rodche/cpathsquared-impl/pom.xml
   
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ExecuteGetRecordByCPathId.java
   
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/GetParentInteractionsTask.java
   
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ViewNetworkNeighborhoodTask.java
   
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/AttributeUtil.java
Log:
Updated to sync with the recent core API changes... Removed unused utility 
class.

Modified: csplugins/trunk/toronto/rodche/cpathsquared-impl/pom.xml
===================================================================
--- csplugins/trunk/toronto/rodche/cpathsquared-impl/pom.xml    2011-12-09 
19:15:04 UTC (rev 27752)
+++ csplugins/trunk/toronto/rodche/cpathsquared-impl/pom.xml    2011-12-09 
19:55:41 UTC (rev 27753)
@@ -46,7 +46,6 @@
         <dependency>
                <groupId>org.cytoscape</groupId>
                <artifactId>layout-api</artifactId>
-               <version>${cytoscape.api.version}</version>
                <scope>provided</scope>
         </dependency>
         <dependency>
@@ -67,7 +66,6 @@
                <dependency>
                        <groupId>org.cytoscape</groupId>
                        <artifactId>biopax-api</artifactId>
-                       <version>${parent.version}</version>
                        <scope>provided</scope>
                </dependency>
                <dependency>

Modified: 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ExecuteGetRecordByCPathId.java
===================================================================
--- 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ExecuteGetRecordByCPathId.java
      2011-12-09 19:15:04 UTC (rev 27752)
+++ 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ExecuteGetRecordByCPathId.java
      2011-12-09 19:55:41 UTC (rev 27753)
@@ -212,13 +212,13 @@
        private void addLinksToCPathInstance(CyNetwork cyNetwork) {
                String serverName = CPathProperties.serverName;
                String serverURL = CPathProperties.cPathUrl;
-               CyRow row = cyNetwork.getCyRow();
+               CyRow row = cyNetwork.getCyRow(cyNetwork);
                String cPathServerDetailsUrl = 
row.get(ExecuteGetRecordByCPathId.CPATH_SERVER_DETAILS_URL, String.class);
                if (cPathServerDetailsUrl == null) {
-                       AttributeUtil.set(cyNetwork, 
ExecuteGetRecordByCPathId.CPATH_SERVER_NAME_ATTRIBUTE, serverName,
-                                       String.class);
+                       AttributeUtil.set(cyNetwork, cyNetwork, 
ExecuteGetRecordByCPathId.CPATH_SERVER_NAME_ATTRIBUTE,
+                                       serverName, String.class);
                        String url = serverURL.replaceFirst("webservice.do", 
"record2.do?id=");
-                       AttributeUtil.set(cyNetwork, 
ExecuteGetRecordByCPathId.CPATH_SERVER_DETAILS_URL, url, String.class);
+                       AttributeUtil.set(cyNetwork, cyNetwork, 
ExecuteGetRecordByCPathId.CPATH_SERVER_DETAILS_URL, url, String.class);
                }
        }
 
@@ -236,10 +236,10 @@
                final CyNetwork cyNetwork = view.getModel();
 
                // Set the Quick Find Default Index
-               AttributeUtil.set(cyNetwork, "quickfind.default_index", 
"biopax.node_label", String.class);
+               AttributeUtil.set(cyNetwork, cyNetwork, 
"quickfind.default_index", "biopax.node_label", String.class);
 
                // Specify that this is a BINARY_NETWORK
-               AttributeUtil.set(cyNetwork, 
BinarySifVisualStyleFactory.BINARY_NETWORK, Boolean.TRUE, Boolean.class);
+               AttributeUtil.set(null, cyNetwork, 
BinarySifVisualStyleFactory.BINARY_NETWORK, Boolean.TRUE, Boolean.class);
 
                // Get all node details.
                getNodeDetails(cyNetwork, taskMonitor);
@@ -262,7 +262,7 @@
                                        networkTitleWithUnderscores = 
networkTitleWithUnderscores.replaceAll(" ", "_");
                                        CyNetworkNaming naming = 
cPathFactory.getCyNetworkNaming();
                                        networkTitleWithUnderscores = 
naming.getSuggestedNetworkTitle(networkTitleWithUnderscores);
-                                       AttributeUtil.set(cyNetwork, 
CyNetwork.NAME, networkTitleWithUnderscores, String.class);
+                                       AttributeUtil.set(cyNetwork, cyNetwork, 
CyNetwork.NAME, networkTitleWithUnderscores, String.class);
                                }
                        });
                } else {
@@ -276,7 +276,6 @@
 
        //TODO may be remove this method
        private void postProcessingBioPAX(final CyNetworkView view, TaskMonitor 
taskMonitor) {
-               final CyNetwork cyNetwork = view.getModel();
                if (haltFlag == false) {
                        if (taskMonitor != null) {
                                taskMonitor.setStatusMessage("Creating Network 
View...");
@@ -309,7 +308,7 @@
                        Map<String, CyNode> nodes = new HashMap<String, 
CyNode>();
                        for (int j = 0; j < currentList.size(); j++) {
                                CyNode node = currentList.get(j);
-                               String name = node.getCyRow().get(CyNode.NAME, 
String.class);
+                               String name = 
cyNetwork.getCyRow(node).get(CyNode.NAME, String.class);
                                nodes.put(name, node);
                                ids[j] = name;
                        }
@@ -350,7 +349,7 @@
                List<CyNode> currentList = new ArrayList<CyNode>();
                int counter = 0;
                for (CyNode node : cyNetwork.getNodeList()) {
-                       CyRow row = node.getCyRow();
+                       CyRow row = cyNetwork.getCyRow(node);
                        String label = row.get(CyNode.NAME, String.class);
 
                        // If we already have details on this node, skip it.

Modified: 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/GetParentInteractionsTask.java
===================================================================
--- 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/GetParentInteractionsTask.java
      2011-12-09 19:15:04 UTC (rev 27752)
+++ 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/GetParentInteractionsTask.java
      2011-12-09 19:55:41 UTC (rev 27753)
@@ -28,7 +28,7 @@
        private final CPath2Factory factory;
 
     public GetParentInteractionsTask (CyNetwork network, CyNode node, 
CPath2Factory factory) {
-        this.uri = node.getCyRow().get(MapBioPaxToCytoscape.BIOPAX_RDF_ID, 
String.class);
+        this.uri = 
network.getCyRow(node).get(MapBioPaxToCytoscape.BIOPAX_RDF_ID, String.class);
         this.node = node;
         this.network = network;
         this.factory = factory;
@@ -52,7 +52,7 @@
             CySwingApplication application = factory.getCySwingApplication();
             JDialog dialog = new JDialog(application.getJFrame());
 
-            String nodeLabel = node.getCyRow().get(CyNode.NAME, String.class);
+            String nodeLabel = network.getCyRow(node).get(CyNode.NAME, 
String.class);
             if (nodeLabel != null) {
                 dialog.setTitle(nodeLabel);
             } else {

Modified: 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ViewNetworkNeighborhoodTask.java
===================================================================
--- 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ViewNetworkNeighborhoodTask.java
    2011-12-09 19:15:04 UTC (rev 27752)
+++ 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/task/ViewNetworkNeighborhoodTask.java
    2011-12-09 19:55:41 UTC (rev 27753)
@@ -27,7 +27,8 @@
        
     @Override
     public void run(TaskMonitor taskMonitor) throws Exception {
-        CyRow row = networkView.getModel().getCyRow();
+       CyNetwork cyNetwork = networkView.getModel();
+        CyRow row = cyNetwork.getCyRow(cyNetwork);
         // grab web services url from network attributes
         String webServicesURL = row.get("biopax.web_services_url", 
String.class);
         if (webServicesURL == null) {
@@ -42,7 +43,7 @@
 
         // generate menu url
         CyNode cyNode = nodeView.getModel();
-        CyRow nodeRow = cyNode.getCyRow();
+        CyRow nodeRow = cyNetwork.getCyRow(cyNode);
         String biopaxID = nodeRow.get(MapBioPaxToCytoscape.BIOPAX_RDF_ID, 
String.class);
         biopaxID = biopaxID.replace("CPATH-", "");
         String neighborhoodParam = "Neighborhood: " + nodeRow.get(CyNode.NAME, 
String.class);
@@ -79,7 +80,7 @@
                   return false;
           }
           
-          Boolean value = 
cyNetwork.getCyRow().get(MapBioPaxToCytoscape.BIOPAX_NETWORK, Boolean.class);
+          Boolean value = 
cyNetwork.getCyRow(cyNetwork).get(MapBioPaxToCytoscape.BIOPAX_NETWORK, 
Boolean.class);
           if (value == null || !value) {
                   return false;
           }

Modified: 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/AttributeUtil.java
===================================================================
--- 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/AttributeUtil.java
  2011-12-09 19:15:04 UTC (rev 27752)
+++ 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/AttributeUtil.java
  2011-12-09 19:55:41 UTC (rev 27753)
@@ -3,13 +3,14 @@
 import java.util.List;
 
 import org.cytoscape.model.CyColumn;
+import org.cytoscape.model.CyNetwork;
 import org.cytoscape.model.CyRow;
 import org.cytoscape.model.CyTable;
 import org.cytoscape.model.CyTableEntry;
 
 public class AttributeUtil {
-       public static void set(CyTableEntry entry, String name, Object value, 
Class<?> type) {
-               CyRow row = entry.getCyRow();
+       public static void set(CyNetwork network, CyTableEntry entry, String 
name, Object value, Class<?> type) {
+               CyRow row = network.getCyRow(entry);
                CyTable table = row.getTable();
                CyColumn column = table.getColumn(name);
                if (column == null) {

Deleted: 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/SelectUtil.java
===================================================================
--- 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/SelectUtil.java
     2011-12-09 19:15:04 UTC (rev 27752)
+++ 
csplugins/trunk/toronto/rodche/cpathsquared-impl/src/main/java/org/cytoscape/cpathsquared/internal/util/SelectUtil.java
     2011-12-09 19:55:41 UTC (rev 27753)
@@ -1,92 +0,0 @@
-package org.cytoscape.cpathsquared.internal.util;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.cytoscape.model.CyEdge;
-import org.cytoscape.model.CyNetwork;
-import org.cytoscape.model.CyNode;
-import org.cytoscape.model.CyRow;
-import org.cytoscape.model.CyTableEntry;
-
-public class SelectUtil {
-       public static void unselectAllNodes(CyNetwork network) {
-               setSelectedState(network.getNodeList(), Boolean.FALSE);
-       }
-       
-       public static void unselectAllEdges(CyNetwork network) {
-               setSelectedState(network.getEdgeList(), Boolean.FALSE);
-       }
-
-       public static void setSelectedNodeState(Collection<CyNode> list, 
boolean selected) {
-               setSelectedState(list, selected);
-       }
-
-       public static void setSelectedEdgeState(Collection<CyEdge> list, 
boolean selected) {
-               setSelectedState(list, selected);
-       }
-
-       static void setSelectedState(Collection<? extends CyTableEntry> list, 
Boolean selected) {
-               for (CyTableEntry edge : list) {
-                       CyRow row = edge.getCyRow();
-                       row.set(CyNetwork.SELECTED, selected);
-               }
-               
-       }
-       
-       public static Set<CyNode> getSelectedNodes(CyNetwork cyNetwork) {
-               return getSelected(cyNetwork.getNodeList());
-       }
-
-       public static Set<CyEdge> getSelectedEdges(CyNetwork cyNetwork) {
-               return getSelected(cyNetwork.getEdgeList());
-       }
-       
-       static <T extends CyTableEntry> Set<T> getSelected(Collection<T> items) 
{
-               Set<T> entries = new HashSet<T>();
-               for (T item : items) {
-                       CyRow row = item.getCyRow();
-                       if (row.get(CyNetwork.SELECTED, Boolean.class)) {
-                               entries.add(item);
-                       }
-               }
-               return entries;
-       }
-       
-       public static void selectAllNodes(CyNetwork cyNetwork) {
-               selectAll(cyNetwork.getNodeList());
-       }
-       
-       public static void selectAllEdges(CyNetwork cyNetwork) {
-               selectAll(cyNetwork.getEdgeList());
-       }
-       
-       static <T extends CyTableEntry> void selectAll(Collection<T> items) {
-               for (T item : items) {
-                       CyRow row = item.getCyRow();
-                       if (!row.get(CyNetwork.SELECTED, Boolean.class)) {
-                               row.set(CyNetwork.SELECTED, Boolean.TRUE);
-                       }
-               }
-       }
-
-       public static int getSelectedNodeCount(CyNetwork cyNetwork) {
-               return countSelected(cyNetwork.getNodeList());
-       }
-
-       public static int getSelectedEdgeCount(CyNetwork cyNetwork) {
-               return countSelected(cyNetwork.getNodeList());
-       }
-       
-       static <T extends CyTableEntry> int countSelected(Collection<T> items) {
-               int count = 0;
-               for (T item : items) {
-                       CyRow row = item.getCyRow();
-                       if (row.get(CyNetwork.SELECTED, Boolean.class)) {
-                               count++;
-                       }
-               }
-               return count;
-       }
-}

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