package de.ugoe.cs.eventbench.swing; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JList; import java.util.List; import javax.swing.JButton; import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionEvent; import de.ugoe.cs.eventbench.data.Event; import de.ugoe.cs.eventbench.data.GlobalDataContainer; import de.ugoe.cs.util.console.Console; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.JPanel; import javax.swing.border.EtchedBorder; import javax.swing.JScrollPane; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; /** *
* This class provides the dialog to choose one of the available sequences after * parsing a log *
* * @author Jeffrey Hall * @version 1.0 */ public class DlgSequences { /** ** All the sequences that are found in the parsed log *
*/ private List* Launch the dialog *
*/ public static void showDialog() { EventQueue.invokeLater(new Runnable() { public void run() { try { DlgSequences window = new DlgSequences(); window.frmSequences.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** ** Create the dialog *
*/ public DlgSequences() { initialize(); } /** ** Initialize the contents of the frame. *
*/ @SuppressWarnings("unchecked") private void initialize() { frmSequences = new JFrame(); frmSequences.addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent arg0) { synchronized (Console.getInstance()) { Console.getInstance().notify(); } } }); frmSequences.setTitle("Sequences"); frmSequences.setResizable(false); frmSequences.setBounds(100, 100, 270, 332); frmSequences.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frmSequences.getContentPane().setLayout(null); final javax.swing.DefaultListModel modelListSequences = new javax.swing.DefaultListModel(); final JButton btnSequence = new JButton("Show details"); final JButton btnClose = new JButton("Close"); JPanel panel = new JPanel(); panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); panel.setBounds(10, 11, 244, 218); frmSequences.getContentPane().add(panel); panel.setLayout(null); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(10, 11, 224, 196); panel.add(scrollPane); final JList listSequences = new JList(modelListSequences); scrollPane.setViewportView(listSequences); JPanel panel_1 = new JPanel(); panel_1.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); panel_1.setBounds(10, 240, 244, 53); frmSequences.getContentPane().add(panel_1); panel_1.setLayout(null); // get the available sequences out of globalDataContainer try { containedSequences = (List