private static HashMap<String, CyRootNetwork> getRootNetworkMap(
      CyNetworkManager cyNetworkManager, CyRootNetworkManager cyRootNetworkManager) {

    HashMap<String, CyRootNetwork> name2RootMap = new HashMap<String, CyRootNetwork>();

    for (CyNetwork net : cyNetworkManager.getNetworkSet()) {
      final CyRootNetwork rootNet = cyRootNetworkManager.getRootNetwork(net);
      if (!name2RootMap.containsValue(rootNet))
        name2RootMap.put(rootNet.getRow(rootNet).get(CyRootNetwork.NAME, String.class), rootNet);
    }

    return name2RootMap;
  }
  // Build the key-node map for the entire root network
  // Note: The keyColName should start with "shared"
  private 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);
    }
  }