if(log.isDebugEnabled()) { log.error("Illegal number: "+sLimit);
if(log.isErrorEnabled()) { log.error("Illegal number: "+sLimit, nfe);
  public void actionPerformed(ActionEvent evt) {    String command = ((JMenuItem)evt.getSource()).getText();    if (command.equals(NEW_WITH_SELECTION_MENU_ITEM)) {      // check that at least one node is selected, else do nothing      if (!graph.isNodeSelected())	return;      CSMARTGraph newGraph = graph.newGraphFromSelection();      new ULPlanFrame(NamedFrame.PLAN, newGraph, filter.copy());      return;    }    if (command.equals(LEGEND_MENU_ITEM)) {      createLegend();      return;    }    if (command.equals(THREAD_UP_MENU_ITEM) ||	 command.equals(THREAD_DOWN_MENU_ITEM)) {      // will gather these parameters:      String UID;      String agentName;      int limit;      boolean isDown;      // get the parameter values      Vector selected = graph.getSelectedElements();      if (selected == null || selected.size() == 0)         return;      Element element = (Element)selected.elementAt(0);      if (!(element.isNode()))        return;      UID = element.getName();      if (UID == null)        return;      agentName =         (String)element.getAttributeValue(PropertyNames.AGENT_ATTR);      if (agentName == null)        return;      isDown = (command.equals(THREAD_DOWN_MENU_ITEM));      // popup for limit      String sLimit = JOptionPane.showInputDialog("Trace limit (e.g. 200 objects): ");      if (sLimit == null) {        return;      }      try {        limit = Integer.parseInt(sLimit);      } catch (NumberFormatException nfe) {        if(log.isDebugEnabled()) {          log.error("Illegal number: "+sLimit);        }        return;      }      // create the thread graph      CSMARTUL.makeThreadGraph(UID, agentName, isDown, limit);      return;    }    // filter menu item is declared in base CSMARTFrame class    // by copying the filter here, if the user    // creates a new graph from the filter, then the new graph    // correctly gets the new filter, and this graph retains    // the unaltered filter    if (command.equals(FILTER_MENU_ITEM)) {      ULPlanFilter filterCopy = filter.copy();      filterCopy.postFilter(this, graph);      return;    }    if (command.equals(PARENTS_MENU_ITEM)) {      Vector elements = graph.getSelectedElements();      if (elements == null)	return;      graph.resetColors();      for (int i = 0; i < elements.size(); i++) {	Element element = (Element)elements.elementAt(i);	if (element instanceof Node)	  graph.markTails((Node)element, COLOR_PARENTS);      }      return;    }    if (command.equals(CHILDREN_MENU_ITEM)) {      Vector elements = graph.getSelectedElements();      if (elements == null)	return;      graph.resetColors();      for (int i = 0; i < elements.size(); i++) {	Element element = (Element)elements.elementAt(i);	if (element instanceof Node)	  graph.markHeads((Node)element, COLOR_CHILDREN);      }      return;    }    if (command.equals(FIND_PLAN_OBJECTS_MENU_ITEM)) {      // create hashtable mapping community to agents for the finder      if (communityToAgents == null) {	communityToAgents = new Hashtable();	Vector nodes = graph.vectorOfElements(GrappaConstants.NODE);	for (int i = 0; i < nodes.size(); i++) {	  Node node = (Node)nodes.get(i);	  String agent = 	    (String)node.getAttributeValue(PropertyNames.AGENT_ATTR);	  String community =	    (String)node.getAttributeValue(PropertyNames.PLAN_OBJECT_COMMUNITY_NAME);	  if (agent != null && community != null) {	    Vector agents = (Vector)communityToAgents.get(community);	    if (agents == null) {	      agents = new Vector();	      agents.addElement(agent);	      communityToAgents.put(community, agents);	    } else if (!agents.contains(agent))	      agents.addElement(agent);	  }	}      }      if (finder == null)        finder = new ULPlanFinder(this, graph, communityToAgents);      finder.displayFinder();      return;    }    super.actionPerformed(evt); // let CSMARTFrame handle the rest  }