boolean urlIsXML = getBooleanAttr(node, "urlIsXML", false);
String nodeID = node.getAttribute("nodeID",null);
if (nodeID==null)
throw new TGException(TGException.NODE_NO_ID, "node has no ID");
LBNode newNode = new LBNode(nodeID, nodeName, nodeUrl);
newNode.setVisible(true);
newNode.setURLIsLocal(urlIsLocal);
newNode.setURLIsXML(urlIsXML);
newNode.setLocation(new Point(x,y));
newNode.setHint(nodeHint);
switch (col) {
case 0: newNode.setBackColor(color); break;
case 1: newNode.setBackColor(new Color(160, 64, 0)); break;
case 2: newNode.setBackColor(new Color(64, 160, 0)); break;
case 3: newNode.setBackColor(new Color(0, 0, 224)); break;
default: newNode.setBackColor(color); break;
}
graphEltSet.addNode(newNode);
}
IXMLElement edgeSet =
(IXMLElement) tglbXML.getChildrenNamed("EDGESET").firstElement();
Enumeration edgeEnum = (edgeSet).enumerateChildren();
while (edgeEnum.hasMoreElements()) {
IXMLElement edge = (IXMLElement)(edgeEnum.nextElement());
String fromID = edge.getAttribute("fromID",null);
String toID = edge.getAttribute("toID",null);
int tension = edge.getAttribute("tension", 4000); //For backward compatibility
int length = edge.getAttribute("length", 4000);
int edgeType = edge.getAttribute("type", 1);
if (length ==0) length= tension;
Color color= Edge.DEFAULT_COLOR;
try {
String colorString = edge.getAttribute("color",null);
if (colorString!=null) color = Color.decode(colorString);
}
catch ( NumberFormatException ex) {};
LBNode fromNode = (LBNode) graphEltSet.findNode(fromID);
LBNode toNode = (LBNode) graphEltSet.findNode(toID);
LBEdge newEdge = new LBEdge(fromNode,toNode, length/100);
newEdge.setVisible(true);
newEdge.setColor(color);
switch (edgeType) {