/** * Inform User of Network Stats. * * @param taskMonitor */ private void informUserOfGraphStats(CyNetwork newNetwork, TaskMonitor taskMonitor) { NumberFormat formatter = new DecimalFormat("#,###,###"); StringBuffer sb = new StringBuffer(); // Give the user some confirmation sb.append("Successfully loaded network from: "); sb.append(url); sb.append("\n\nNetwork contains " + formatter.format(newNetwork.getNodeCount())); sb.append(" nodes and " + formatter.format(newNetwork.getEdgeCount())); sb.append(" edges.\n\n"); // TODO: Port this // if (newNetwork.getNodeCount() < Integer.parseInt(CytoscapeInit.getProperties() // // .getProperty("viewThreshold"))) { // sb.append("Network is under " // + CytoscapeInit.getProperties().getProperty("viewThreshold") // + " nodes. A view will be automatically created."); // } else { // sb.append("Network is over " // + CytoscapeInit.getProperties().getProperty("viewThreshold") // + " nodes. A view has not been created." // + " If you wish to view this network, use " // + "\"Create View\" from the \"Edit\" menu."); // } taskMonitor.setStatusMessage(sb.toString()); }
/** Assuming we only create one network. */ protected CyNetwork checkSingleNetwork(List<CyNetworkView> views, int numNodes, int numEdges) { assertNotNull(views); assertEquals(1, views.size()); CyNetwork net = views.get(0).getModel(); assertNotNull(net); assertEquals(numNodes, net.getNodeCount()); assertEquals(numEdges, net.getEdgeCount()); return net; }