Author: pwang
Date: 2012-09-26 12:05:39 -0700 (Wed, 26 Sep 2012)
New Revision: 30492
Modified:
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/AbstractNetworkReader.java
Log:
Add a new method initNodeMap()
Modified:
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/AbstractNetworkReader.java
===================================================================
---
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/AbstractNetworkReader.java
2012-09-26 18:58:57 UTC (rev 30491)
+++
core3/impl/trunk/io-impl/impl/src/main/java/org/cytoscape/io/internal/read/AbstractNetworkReader.java
2012-09-26 19:05:39 UTC (rev 30492)
@@ -146,7 +146,48 @@
return cyNetworks;
}
+ // Return the rootNetwork based on user selection, if not existed yet,
create a new one
+ protected CyRootNetwork getRootNetwork(){
+ String networkCollectionName =
this.rootNetworkList.getSelectedValue().toString();
+ CyRootNetwork rootNetwork =
this.name2RootMap.get(networkCollectionName);
+
+ if
(networkCollectionName.equalsIgnoreCase(CRERATE_NEW_COLLECTION_STRING)){
+ CyNetwork newNet =
this.cyNetworkFactory.createNetwork();
+ return this.cyRootNetworkManager.getRootNetwork(newNet);
+ }
+
+ return rootNetwork;
+ }
+
// Build the key-node map for the entire root network
+ // Note: The keyColName should start with "shared"
+ protected void initNodeMap(){
+
+ String networkCollectionName =
this.rootNetworkList.getSelectedValue().toString();
+ CyRootNetwork rootNetwork =
this.name2RootMap.get(networkCollectionName);
+
+ if
(networkCollectionName.equalsIgnoreCase(CRERATE_NEW_COLLECTION_STRING)){
+ return;
+ }
+
+ String targetKeyColName =
this.targetColumnList.getSelectedValue();
+
+ if (rootNetwork == null){
+ return;
+ }
+
+ Iterator<CyNode> it = rootNetwork.getNodeList().iterator();
+
+ while (it.hasNext()){
+ CyNode node = it.next();
+ Object keyValue =
rootNetwork.getRow(node).getRaw(targetKeyColName);
+ this.nMap.put(keyValue, node);
+ }
+ }
+
+ // The following is replaced by the above one, it should be removed late
+
+ // Build the key-node map for the entire root network
protected void initNodeMap(CyRootNetwork rootNetwork, String
keyColName){
// Note: The keyColName should start with "shared"
--
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.