protected synchronized void initInterface(Iterator<OMEvent> it,boolean setSelected){
  if (logger.isLoggable(Level.FINE)) {
    logger.fine("initing interface");
  }
  DefaultListModel listModel=new DefaultListModel();
  int selectedIndex=-1;
  int curIndex=0;
  while (it.hasNext()) {
    OMEvent curEvent=it.next();
    listModel.addElement(curEvent);
    if (lastSelectedEvent == curEvent && lastSelectedEvent != null) {
      selectedIndex=curIndex;
    }
    curIndex++;
  }
  if (logger.isLoggable(Level.FINE)) {
    logger.fine("added " + curIndex + " events to list");
  }
  if (displayList == null) {
    if (logger.isLoggable(Level.FINE)) {
      logger.fine("Creating gui components");
    }
    JPanel wrapper=new JPanel();
    GridBagLayout gridbag=new GridBagLayout();
    GridBagConstraints c=new GridBagConstraints();
    wrapper.setLayout(gridbag);
    c.fill=GridBagConstraints.BOTH;
    c.weighty=1f;
    c.weightx=1f;
    c.gridwidth=GridBagConstraints.REMAINDER;
    c.insets=new Insets(0,2,0,2);
    if (ttmanager == null) {
      ttmanager=ToolTipManager.sharedInstance();
      ttmanager.setEnabled(true);
      ttmanager.setInitialDelay(1);
    }
 else     if (displayList != null) {
      ttmanager.unregisterComponent(displayList);
    }
    displayList=new JList(listModel);
    displayList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    displayList.addListSelectionListener(this);
    displayList.addMouseListener(this);
    displayList.addMouseMotionListener(this);
    displayList.setCellRenderer(getEventCellRenderer());
    ttmanager.registerComponent(displayList);
    JScrollPane listScrollPane=new JScrollPane(displayList);
    listScrollPane.setPreferredSize(new Dimension(prefWidth,prefHeight));
    listScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    listScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    gridbag.setConstraints(listScrollPane,c);
    wrapper.add(listScrollPane);
    c.fill=GridBagConstraints.HORIZONTAL;
    c.weighty=0f;
    detailSpace=new JLabel("");
    detailSpacePanel=new JPanel(new BorderLayout());
    detailSpacePanel.setBackground(new Color(0xffffcc));
    detailSpacePanel.setVisible(false);
    detailSpacePanel.add(detailSpace,BorderLayout.CENTER);
    gridbag.setConstraints(detailSpacePanel,c);
    wrapper.add(detailSpacePanel);
    JComponent ecp=getEventControlPanel();
    gridbag.setConstraints(ecp,c);
    wrapper.add(ecp);
    add(wrapper,BorderLayout.CENTER);
    validate();
    repaint();
    if (logger.isLoggable(Level.FINE)) {
      logger.fine("Done creating gui components");
    }
  }
 else {
    setListModel(listModel);
    displayList.revalidate();
    displayList.repaint();
  }
  if (logger.isLoggable(Level.FINE)) {
    logger.fine("done initing");
  }
  if (selectedIndex >= 0 && setSelected) {
    displayList.setSelectedIndex(selectedIndex);
  }
 else {
    lastSelectedEvent=null;
  }
}

protected synchronized void initInterface ( Iterator < OMEvent > it , boolean setSelected ) { if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "initing interface" ) ; } DefaultListModel listModel = new DefaultListModel ( ) ; int selectedIndex = - 1 ; int curIndex = 0 ; while ( it . hasNext ( ) ) { OMEvent curEvent = it . next ( ) ; listModel . addElement ( curEvent ) ; if ( lastSelectedEvent == curEvent && lastSelectedEvent != null ) { selectedIndex = curIndex ; } curIndex ++ ; } if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "added " + curIndex + " events to list" ) ; } if ( displayList == null ) { if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "Creating gui components" ) ; } JPanel wrapper = new JPanel ( ) ; GridBagLayout gridbag = new GridBagLayout ( ) ; GridBagConstraints c = new GridBagConstraints ( ) ; wrapper . setLayout ( gridbag ) ; c . fill = GridBagConstraints . BOTH ; c . weighty = 1f ; c . weightx = 1f ; c . gridwidth = GridBagConstraints . REMAINDER ; c . insets = new Insets ( 0 , 2 , 0 , 2 ) ; if ( ttmanager == null ) { ttmanager = ToolTipManager . sharedInstance ( ) ; ttmanager . setEnabled ( true ) ; ttmanager . setInitialDelay ( 1 ) ; } else if ( displayList != null ) { ttmanager . unregisterComponent ( displayList ) ; } displayList = new JList ( listModel ) ; displayList . setSelectionMode ( ListSelectionModel . MULTIPLE_INTERVAL_SELECTION ) ; displayList . addListSelectionListener ( this ) ; displayList . addMouseListener ( this ) ; displayList . addMouseMotionListener ( this ) ; displayList . setCellRenderer ( getEventCellRenderer ( ) ) ; ttmanager . registerComponent ( displayList ) ; JScrollPane listScrollPane = new JScrollPane ( displayList ) ; listScrollPane . setPreferredSize ( new Dimension ( prefWidth , prefHeight ) ) ; listScrollPane . setHorizontalScrollBarPolicy ( JScrollPane . HORIZONTAL_SCROLLBAR_NEVER ) ; listScrollPane . setVerticalScrollBarPolicy ( JScrollPane . VERTICAL_SCROLLBAR_AS_NEEDED ) ; gridbag . setConstraints ( listScrollPane , c ) ; wrapper . add ( listScrollPane ) ; c . fill = GridBagConstraints . HORIZONTAL ; c . weighty = 0f ; detailSpace = new JLabel ( "" ) ; detailSpacePanel = new JPanel ( new BorderLayout ( ) ) ; detailSpacePanel . setBackground ( new Color ( 0xffffcc ) ) ; detailSpacePanel . setVisible ( false ) ; detailSpacePanel . add ( detailSpace , BorderLayout . CENTER ) ; gridbag . setConstraints ( detailSpacePanel , c ) ; wrapper . add ( detailSpacePanel ) ; JComponent ecp = getEventControlPanel ( ) ; gridbag . setConstraints ( ecp , c ) ; wrapper . add ( ecp ) ; add ( wrapper , BorderLayout . CENTER ) ; validate ( ) ; repaint ( ) ; if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "Done creating gui components" ) ; } } else { setListModel ( listModel ) ; displayList . revalidate ( ) ; displayList . repaint ( ) ; } if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "done initing" ) ; } if ( selectedIndex >= 0 && setSelected ) { displayList . setSelectedIndex ( selectedIndex ) ; } else { lastSelectedEvent = null ; } }
resets the event list .
