log = CSMART.createLogger("org.cougaar.tools.csmart.ui.console");
createLogger();
  public ConsoleInternalFrame(NodeComponent node,                               ConsoleNodeListener listener,                              JScrollPane pane,                              JRadioButton statusButton,                              String logFileName,                              NodeServesClient nodeServer,                              CSMARTConsole console) {    super("",   // title          true, //resizable          false, //not closable, because they can't be recreated          true, //maximizable          true);//iconifiable    this.node = node;    this.listener = listener;    this.statusButton = statusButton;    this.logFileName = logFileName;    this.nodeServer = nodeServer;    this.console = console;    log = CSMART.createLogger("org.cougaar.tools.csmart.ui.console");    consoleTextPane = (ConsoleTextPane)pane.getViewport().getView();    // get host component by getting the experiment and     // searching its hosts for one with this node.    experiment =       (Experiment)getPropertyValue(node, "Experiment");    HostComponent[] hosts = experiment.getHosts();    for (int i = 0; i < hosts.length; i++) {      NodeComponent[] nodes = hosts[i].getNodes();      for (int j = 0; j < nodes.length; j++) {        if (nodes[j].equals(node)) {          host = hosts[i];          hostName = host.getShortName();          break;        }      }    }    // title is "Node name (host name)"    setTitle("Node " + node.getShortName() + " (" + hostName + ")");    // init menubar    JMenuBar menuBar = new JMenuBar();    // Node menu    JMenu nodeMenu = new JMenu(NODE_MENU);    Action infoAction = new AbstractAction(INFO_ACTION) {      public void actionPerformed(ActionEvent e) {        displayAbout();      }    };    nodeMenu.add(infoAction);    Action cpuUsageAction = new AbstractAction(CPU_USAGE_ACTION) {      public void actionPerformed(ActionEvent e) {        totalCPUUsage_actionPerformed();      }    };    nodeMenu.add(cpuUsageAction);    Action nodeCPUUsageAction = new AbstractAction(NODE_CPU_USAGE_ACTION) {      public void actionPerformed(ActionEvent e) {        nodeCPUUsage_actionPerformed();      }    };    nodeMenu.add(nodeCPUUsageAction);    Action memoryUsageAction = new AbstractAction(MEMORY_USAGE_ACTION) {      public void actionPerformed(ActionEvent e) {      }    };    memoryUsageAction.setEnabled(false);    nodeMenu.add(memoryUsageAction);    Action historyAction = new AbstractAction(HISTORY_ACTION) {      public void actionPerformed(ActionEvent e) {	history_actionPerformed();      }    };    nodeMenu.add(historyAction);    // Edit menu    JMenu editMenu = new JMenu(EDIT_MENU);    Action cutAction = new AbstractAction(CUT_ACTION) {      public void actionPerformed(ActionEvent e) {        cut_actionPerformed();      }    };    JMenuItem mi = editMenu.add(cutAction);    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X,                                             Event.CTRL_MASK));    Action copyAction = new AbstractAction(COPY_ACTION) {      public void actionPerformed(ActionEvent e) {        copy_actionPerformed();      }    };    mi = editMenu.add(copyAction);    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C,                                             Event.CTRL_MASK));    Action pasteAction = new AbstractAction(PASTE_ACTION) {      public void actionPerformed(ActionEvent e) {        paste_actionPerformed();      }    };    mi = editMenu.add(pasteAction);    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V,                                             Event.CTRL_MASK));    editMenu.addSeparator();    Action selectAllAction = new AbstractAction(SELECT_ALL_ACTION) {      public void actionPerformed(ActionEvent e) {        selectAll_actionPerformed();      }    };    mi = editMenu.add(selectAllAction);    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A,                                             Event.CTRL_MASK));    editMenu.addSeparator();    findAction = new AbstractAction(FIND_ACTION) {      public void actionPerformed(ActionEvent e) {        find_actionPerformed();      }    };    mi = editMenu.add(findAction);    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F,                                             Event.CTRL_MASK));    findNextAction = new AbstractAction(FIND_NEXT_ACTION) {      public void actionPerformed(ActionEvent e) {        findNext_actionPerformed();      }    };    mi = editMenu.add(findNextAction);    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_G,                                             Event.CTRL_MASK));    // view menu    JMenu viewMenu = new JMenu(VIEW_MENU);    Action displayLogAction = new AbstractAction(DISPLAY_LOG_ACTION) {      public void actionPerformed(ActionEvent e) {        displayLog_actionPerformed();      }    };    displayLogAction.setEnabled(false);    viewMenu.add(displayLogAction);    Action setViewSizeAction = new AbstractAction(SET_VIEW_SIZE_ACTION) {      public void actionPerformed(ActionEvent e) {        setViewSize_actionPerformed();      }    };    viewMenu.add(setViewSizeAction);    Action filterAction = new AbstractAction(FILTER_ACTION) {      public void actionPerformed(ActionEvent e) {        filter_actionPerformed();      }    };    viewMenu.add(filterAction);    // control menu    JMenu controlMenu = new JMenu(CONTROL_MENU);    startAction = new AbstractAction(START_ACTION) {      public void actionPerformed(ActionEvent e) {        restart_actionPerformed();      }    };    startAction.setEnabled(false);    controlMenu.add(startAction);    Action moveAction = new AbstractAction(MOVE_ACTION) {      public void actionPerformed(ActionEvent e) {      }    };    moveAction.setEnabled(false);    controlMenu.add(moveAction);    stopAction = new AbstractAction(STOP_ACTION) {      public void actionPerformed(ActionEvent e) {        stop_actionPerformed();      }    };    controlMenu.add(stopAction);    Action traceAction = new AbstractAction(STACK_TRACE_ACTION) {      public void actionPerformed(ActionEvent e) {        trace_actionPerformed();      }    };    controlMenu.add(traceAction);    // notify menu    JMenu notifyMenu = new JMenu(NOTIFY_MENU);    notifyAction = new AbstractAction(SET_NOTIFY_ACTION) {      public void actionPerformed(ActionEvent e) {	notify_actionPerformed();      }    };    mi = notifyMenu.add(notifyAction);    Action removeNotifyAction = new AbstractAction(REMOVE_NOTIFY_ACTION) {      public void actionPerformed(ActionEvent e) {	removeNotify_actionPerformed();      }    };    notifyMenu.add(removeNotifyAction);    notifyNextAction = new AbstractAction(NOTIFY_NEXT_ACTION) {      public void actionPerformed(ActionEvent e) {	notifyNext_actionPerformed();      }    };    mi = notifyMenu.add(notifyNextAction);    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,                                             Event.CTRL_MASK));    Action resetNotifyAction = new AbstractAction(RESET_NOTIFY_ACTION) {      public void actionPerformed(ActionEvent e) {	resetNotifyAction_actionPerformed();      }    };    notifyMenu.add(resetNotifyAction);    menuBar.add(nodeMenu);    menuBar.add(editMenu);    menuBar.add(viewMenu);    menuBar.add(controlMenu);    menuBar.add(notifyMenu);    getRootPane().setJMenuBar(menuBar);    initKeyMap(consoleTextPane);    getContentPane().add(pane);    setSize(300,300);  }