log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.plan");
createLogger();
  public ULPlanFinder(CSMARTFrame frame,                       CSMARTGraph graph,                       Hashtable communityToAgents) {    super(frame, "Finder");    log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.plan");    this.communityToAgents = communityToAgents;    this.graph = graph;    this.frame = frame;    findPanel = new JPanel(new BorderLayout());    // community    JPanel communityPanel = new JPanel();    communityPanel.setLayout(new GridBagLayout());    TitledBorder communityTitledBorder = new TitledBorder("Community");    Font font = communityTitledBorder.getTitleFont();    Font titleFont = font.deriveFont(Font.ITALIC);    communityTitledBorder.setTitleFont(titleFont);    communityPanel.setBorder(communityTitledBorder);    JLabel communityLabel = new JLabel("Community: ");    communityCB = new JComboBox();    Enumeration keys = communityToAgents.keys();    communityCB.addItem(ALL);    while (keys.hasMoreElements()) {      communityCB.addItem((String)keys.nextElement());    }    communityCB.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {	communityActionPerformed(e);      }    });    communityPanel.add(communityLabel,		   new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,					  GridBagConstraints.WEST,					  GridBagConstraints.HORIZONTAL,					  new Insets(0, 0, 0, 0), 0, 0));    communityPanel.add(communityCB,		   new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0,					  GridBagConstraints.WEST,					  GridBagConstraints.HORIZONTAL,					  new Insets(0, 0, 0, 0), 0, 0));    box.add(communityPanel);    // agent    JPanel agentPanel = new JPanel();    agentPanel.setLayout(new GridBagLayout());    TitledBorder agentTitledBorder = new TitledBorder("Agent");    agentTitledBorder.setTitleFont(titleFont);    agentPanel.setBorder(agentTitledBorder);    JLabel agentLabel = new JLabel("Agent: ");    agentCB = new JComboBox();    agentPanel.add(agentLabel,		   new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,					  GridBagConstraints.WEST,					  GridBagConstraints.HORIZONTAL,					  new Insets(0, 0, 0, 0), 0, 0));    agentPanel.add(agentCB,		   new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0,					  GridBagConstraints.WEST,					  GridBagConstraints.HORIZONTAL,					  new Insets(0, 0, 0, 0), 0, 0));    box.add(agentPanel);    // planObject types    JPanel planObjectPanel = new JPanel();    planObjectPanel.setLayout(new GridBagLayout());    TitledBorder planObjectTitledBorder = new TitledBorder("PlanObject Type");    planObjectTitledBorder.setTitleFont(titleFont);    planObjectPanel.setBorder(planObjectTitledBorder);    JLabel planObjectTypeLabel = new JLabel("PlanObject Types: ");    planObjectTypeCB = new JComboBox();    planObjectTypeCB.addItem(ALL);    planObjects = graph.getValuesOfAttribute(PropertyNames.OBJECT_TYPE);    planElements = graph.getValuesOfAttribute(PropertyNames.PLAN_ELEMENT_TYPE);    for (int i = 0; i < planObjects.size(); i++ ) {      if (planObjects.elementAt(i).equals("Plan_Element")) {        for (int j = 0; j < planElements.size(); j++ ) {          planObjectTypeCB.addItem(planElements.elementAt(j));        }      } else {        planObjectTypeCB.addItem(planObjects.elementAt(i));      }    }    planObjectTypeCB.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {	planObjectTypeActionPerformed(e);      }    });    planObjectPanel.add(planObjectTypeLabel,		   new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,					  GridBagConstraints.WEST,					  GridBagConstraints.HORIZONTAL,					  new Insets(0, 0, 0, 0), 0, 0));    planObjectPanel.add(planObjectTypeCB,		   new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0,					  GridBagConstraints.WEST,					  GridBagConstraints.HORIZONTAL,					  new Insets(0, 0, 0, 0), 0, 0));    box.add(planObjectPanel);    findPanel.add(box, BorderLayout.CENTER);    JPanel buttonPanel = new JPanel();    final JButton findButton = new JButton("Find");    findButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {	find();	findButton.setEnabled(false);      }    });    buttonPanel.add(findButton);    findNextButton = new JButton("Find Next");    // find next is disabled until user selects find    findNextButton.setEnabled(false);    findNextButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {	findNext();      }    });    buttonPanel.add(findNextButton);    JButton cancelButton = new JButton("Cancel");    cancelButton.addActionListener(new ActionListener() {      public void actionPerformed(ActionEvent e) {	cancel();      }    });    buttonPanel.add(cancelButton);    findPanel.add(buttonPanel, BorderLayout.SOUTH);    getContentPane().add(findPanel);    pack();    // find next is disabled and find is enabled    // when any other dialog change is made    // so user must select "find" to process the values in the dialog    // and determine the new set of selected objects    disableFindNext = new ActionListener() {      public void actionPerformed(ActionEvent e) {	findNextButton.setEnabled(false);	findButton.setEnabled(true);      }    };    communityCB.addActionListener(disableFindNext);    agentCB.addActionListener(disableFindNext);    planObjectTypeCB.addActionListener(disableFindNext);  }