if(log.isDebugEnabled()) {
if(log.isErrorEnabled()) {
  private Node makeNode(NodeObject obj) {    String UID = obj.getUID();    if (UIDToNode.get(UID) != null)      return null; // don't make duplicates    Node node = new Node(this, UID);    UIDToNode.put(UID, node);    if (!obj.isVisible()) {      node.setAttribute(INVISIBLE_ATTRIBUTE, "true");      node.visible = false;    }    node.setAttribute(PropertyNames.UID_ATTR, UID);    node.setAttribute(GrappaConstants.LABEL_ATTR, obj.getLabel());    node.setAttribute(GrappaConstants.TIP_ATTR, obj.getToolTip());    node.setAttribute(GrappaConstants.SHAPE_ATTR, obj.getShape());    // only set these if they're not the default value    String sides = obj.getSides();    if (!sides.equals("0"))      node.setAttribute(GrappaConstants.SIDES_ATTR, sides);    String distortion = obj.getDistortion();    if (!distortion.equals("0"))      node.setAttribute(GrappaConstants.DISTORTION_ATTR, distortion);    String orientation = obj.getOrientation();    if (!orientation.equals("0"))      node.setAttribute(GrappaConstants.ORIENTATION_ATTR, orientation);    String width = obj.getWidth();    if (!width.equals("0"))      node.setAttribute(GrappaConstants.WIDTH_ATTR, width);    String height = obj.getHeight();    if (!height.equals("0"))      node.setAttribute(GrappaConstants.HEIGHT_ATTR, height);    // get a string that determines the color    String colorName = obj.getColor();    // add mapping from this string to a real Color in grappa    GrappaColor.addColor(colorName, properties.getClusterColor(colorName));    node.setAttribute(GrappaConstants.COLOR_ATTR, colorName);    GrappaStyle gs = new GrappaStyle(GrappaConstants.NODE, 	   "filled(true), line_color(" + colorName + ")");    node.setAttribute(GrappaConstants.STYLE_ATTR, gs);    String fontStyle = obj.getFontStyle();    if (!fontStyle.equals("normal"))      node.setAttribute(GrappaConstants.FONTSTYLE_ATTR, fontStyle);    // set attribute for what string determines color    // used to reconstitute color mapping from saved nodes    node.setAttribute(COLOR_DETERMINER, colorName);    // get attributes for the object    PropertyTree properties = obj.getProperties();    Set names = properties.keySet();    Iterator namesIter = names.iterator();    while (namesIter.hasNext()) {      String name = (String)namesIter.next();      Object o = properties.get(name);      if (o instanceof String)	node.setAttribute(name, (String)o);      else if (o instanceof Double)        node.setAttribute(name, ((Double)o).toString());      else if (o instanceof Float)	node.setAttribute(name, ((Float)o).toString());      else if (o instanceof Long)        node.setAttribute(name, ((Long)o).toString());      else if (o instanceof Vector) {	Vector values = (Vector)o;	for (int i = 0; i < values.size(); i++)	  node.setAttribute(name + "_" + i, (String)values.elementAt(i));      } else if (o instanceof ArrayList) {        ArrayList values = (ArrayList)o;        // try/catch block in case someone passes in an array list of values        // that can't be cast to strings; this prints an error and ignores them        try {          for (int i = 0; i < values.size(); i++)            node.setAttribute(name + "_" + i, (String)values.get(i));        } catch (ClassCastException e) {          if(log.isDebugEnabled()) {            log.error("CSMARTGraph: exception setting attribute with name: " +                      name + " " + e);          }        }      }      // for debugging      else      if(log.isDebugEnabled()) {        log.warn(                 "CSMARTGraph: WARNING: Displaying property: " + name +                 " of class: " + ((o != null) ? o.getClass().getName() : "null") +                 " not supported");      }    }    // get UIDs at the incoming (tail) end of a link    Vector incomingLinks = obj.getIncomingLinks();    if (incomingLinks != null) {      for (int i = 0; i < incomingLinks.size(); i++) {	String tailUID = (String)incomingLinks.elementAt(i);	// get the node for each incoming link	Node tailNode = (Node)UIDToNode.get(tailUID);	// if no node exists for the tail UID	if (tailNode == null) {	  // get or create the set of outgoing links for the tail UID	  Set outgoing = (Set)UIDToOutgoing.get(tailUID);	  if (outgoing == null)	    outgoing = new HashSet();	  // add the current node to the set of outgoing links to create	  outgoing.add(node);	  UIDToOutgoing.put(tailUID, outgoing);	} else {	  Edge edge = null;	  try {	    edge = new Edge(this, tailNode, node);	  } catch (RuntimeException e) {	    // we'll probably get exceptions for duplicate edges, so ignore            if(log.isDebugEnabled()) {              log.debug("Couldn't create edge from: " + 			tailNode.getName() + " " +                        node.getName() + " " + e);            }  	    continue;	  }	  edge.setAttribute(GrappaConstants.TIP_ATTR, 			    (tailNode.getAttributeValue(PropertyNames.UID_ATTR)).toString() +			    " " +			    (node.getAttributeValue(PropertyNames.UID_ATTR)).toString());	}      }    }    // handle the case where the other end of the link was created first    Set outgoing = (Set)UIDToOutgoing.get(UID);    if (outgoing != null)      for (Iterator i = outgoing.iterator(); i.hasNext(); ) {	Node headNode = (Node)i.next();	Edge edge = null;	try {	  edge = new Edge(this, node, headNode);	} catch (RuntimeException e) {	    // we'll probably get exceptions for duplicate edges, so ignore          if(log.isDebugEnabled()) {            log.debug("Couldn't create edge from: " +                      node.getName() + " " +                      headNode.getName() + " " + e);          }	  continue;	}	edge.setAttribute(GrappaConstants.TIP_ATTR, 			  (node.getAttributeValue(PropertyNames.UID_ATTR)).toString() +			  " " +			  (headNode.getAttributeValue(PropertyNames.UID_ATTR)).toString());      }    // get UIDs at the outgoing (head) end of a link    Vector outgoingLinks = obj.getOutgoingLinks();    if (outgoingLinks != null) {      for (int i = 0; i < outgoingLinks.size(); i++) {	String headUID = (String)outgoingLinks.elementAt(i);	Node headNode = (Node)UIDToNode.get(headUID);	if (headNode == null) {	  Set incoming = (Set)UIDToIncoming.get(headUID);	  if (incoming == null)	    incoming = new HashSet();	  incoming.add(node);	  UIDToIncoming.put(headUID, incoming);	} else {	  Edge edge = null;	  try {	    edge = new Edge(this, node, headNode);	  } catch (RuntimeException e) {	    // we'll probably get exceptions for duplicate edges, so ignore            if(log.isDebugEnabled()) {              log.error("Couldn't create edge from: " +                        node.getName() + " " +                        headNode.getName() + " " + e);            }	    continue;	  }	  edge.setAttribute(GrappaConstants.TIP_ATTR, 			    (node.getAttributeValue(PropertyNames.UID_ATTR)).toString() +			    " " +			    (headNode.getAttributeValue(PropertyNames.UID_ATTR)).toString());	}      }    }    // handle case where the other end of the link was created first    Set incoming = (Set)UIDToIncoming.get(UID);    if (incoming != null) {      for (Iterator i = incoming.iterator(); i.hasNext(); ) {	Node tailNode = (Node)i.next();	Edge edge = null;	try {	  edge = new Edge(this, tailNode, node);	} catch (RuntimeException e) {          // we'll probably get exceptions for duplicate edges, so ignore          if(log.isDebugEnabled()) {          log.error("Couldn't create edge from: " +                    tailNode.getName() + " " +                    node.getName() + " " + e);          }	  continue;	}	edge.setAttribute(GrappaConstants.TIP_ATTR, 			  (tailNode.getAttributeValue(PropertyNames.UID_ATTR)).toString() +			  " " +			  (node.getAttributeValue(PropertyNames.UID_ATTR)).toString());      }    }    // create bidirectional links    Vector bidirectionalLinks = obj.getBidirectionalLinks();    if (bidirectionalLinks != null) {      for (int i = 0; i < bidirectionalLinks.size(); i++) {	String linkedToUID = (String)bidirectionalLinks.elementAt(i);	Node linkedToNode = (Node)UIDToNode.get(linkedToUID);	if (linkedToNode != null) {	  try {	    Edge edge = new Edge(this, node, linkedToNode);	    edge.setAttribute(GrappaConstants.DIR_ATTR, "none");	  } catch (Exception e) {	    // we'll probably get exceptions for duplicate edges            if(log.isDebugEnabled()) {              log.error("Couldn't create edge from: " +                        node.getName() + " " +                        linkedToNode.getName() + " " + e);            }	    continue;	  }	} else {	  Set bidirectional = (Set)UIDToBidirectional.get(linkedToUID);	  if (bidirectional == null)	    bidirectional = new HashSet();	  bidirectional.add(node);	  UIDToBidirectional.put(linkedToUID, bidirectional);	}      }    }    // bidirectional links are not necessarily referenced in both nodes    // so handle the case where only one node has the link    Set bidirectional = (Set)UIDToBidirectional.get(UID);    if (bidirectional != null) {      for (Iterator i = bidirectional.iterator(); i.hasNext(); ) {	Node linkedToNode = (Node)i.next();	try {	  Edge edge = new Edge(this, node, linkedToNode);	  edge.setAttribute(GrappaConstants.DIR_ATTR, "none");	} catch (Exception e) {          if(log.isDebugEnabled()) {            log.error("Couldn't create edge from: " +                      node.getName() + " " +                      linkedToNode.getName() + " " + e);          }	  continue;	}      }    }    return node;  }