int from;
int to;
String[] fromNodeInfo;
String[] toNodeInfo;
String[] edgeInfo;
DNVEdge edge;
DNVNode fromNode;
DNVNode toNode;
int lineIndex = 0;
line = graphFileReader.readLine();
while( line != null && !line.equals( "" ) )
{
lineTokenizer = new StringTokenizer( line );
from = Integer.parseInt( lineTokenizer.nextToken() );
to = Integer.parseInt( lineTokenizer.nextToken() );
fromNodeInfo = (String[])nodeFileList.get( from - 1 );
fromNode = (DNVNode)graph.getNodeByBbId( fromNodeInfo[1] );
if( fromNode == null )
{
fromNode = new DNVNode( graph );
fromNode.setLabel( fromNodeInfo[0] );
fromNode.setBbId( fromNodeInfo[1] );
fromNode.setPosition( (float)Math.random(), (float)Math.random() );
graph.addNode( 0, fromNode );
}
toNodeInfo = (String[])nodeFileList.get( to - 1 );
toNode = (DNVNode)graph.getNodeByBbId( toNodeInfo[1] );
if( toNode == null )
{
toNode = new DNVNode( graph );
toNode.setLabel( toNodeInfo[0] );
toNode.setBbId( toNodeInfo[1] );
toNode.setPosition( (float)Math.random(), (float)Math.random() );
graph.addNode( 0, toNode );
}
edgeInfo = (String[])linkFileList.get( lineIndex );
edge = new DNVEdge( fromNode, toNode, graph );
edge.setLabel( edgeInfo[1] + ", " + edgeInfo[3] + ", " + edgeInfo[5] + ", " + edgeInfo[6] + ", " + edgeInfo[7] );
graph.addNode( 0, edge );
line = graphFileReader.readLine();
lineIndex++;
}