CyNode[] nodes = new CyNode[this.nodesList.size()];
Integer[] integers = new Integer[nodes.length];
for (int i = 0; i < nodes.length; i++) {
CyNode from_node = (CyNode)this.nodesList.get(i);
if (from_node != null)
{
int index = ((Integer)this.nodeIndexToMatrixIndexMap.get(from_node.getSUID())).intValue();
if ((index < 0) || (index >= nodes.length)) {
System.err.println("WARNING: GraphNode \"" + from_node +
"\" has an index value that is out of range: " + index +
". Graph indices should be maintained such " + "that no index is unused.");
return null;
}
if (nodes[index] != null) {
System.err.println("WARNING: GraphNode \"" + from_node + "\" has an index value ( " + index +
" ) that is the same as " + "that of another GraphNode ( \"" + nodes[index] +
"\" ). Graph indices should be maintained such " + "that indices are unique.");
return null;
}
nodes[index] = from_node;
integers[index] = Integer.valueOf(index);
}
}
LinkedList queue = new LinkedList();
boolean[] completed_nodes = new boolean[nodes.length];
for (int from_node_index = 0; from_node_index < nodes.length; from_node_index++) {
if (this.canceled)
{
this.distances = null;
return this.distances;
}
CyNode from_node = nodes[from_node_index];
if (from_node == null)
{
if (this.distances[from_node_index] == null) {
this.distances[from_node_index] = new int[nodes.length];
}
Arrays.fill(this.distances[from_node_index], 2147483647);
}
else
{
if (this.distances[from_node_index] == null) {
this.distances[from_node_index] = new int[nodes.length];
}
Arrays.fill(this.distances[from_node_index], 2147483647);
this.distances[from_node_index][from_node_index] = 0;
Arrays.fill(completed_nodes, false);
queue.add(integers[from_node_index]);
while (!queue.isEmpty())
{
if (this.canceled)
{
this.distances = null;
return this.distances;
}
int index = ((Integer)queue.removeFirst()).intValue();
if (completed_nodes[index])
{
completed_nodes[index] = true;
CyNode to_node = nodes[index];
int to_node_distance = this.distances[from_node_index][index];
int i;
if (index < from_node_index)
{
for (i = 0; i < nodes.length; i++) {