Changeset 173


Ignore:
Timestamp:
09/09/11 19:34:03 (13 years ago)
Author:
jhall
Message:

Comments added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swing/DlgSequences.java

    r138 r173  
    2121import java.awt.event.WindowEvent; 
    2222 
     23/** 
     24 * <p> 
     25 * This class provides the dialog to choose one of the available sequences after 
     26 * parsing a log 
     27 * </p> 
     28 *  
     29 * @author Jeffrey Hall 
     30 * @version 1.0 
     31 */ 
    2332public class DlgSequences { 
    2433 
    25         private JFrame frmSequences; 
     34        /** 
     35         * <p> 
     36         * All the sequences that are found in the parsed log 
     37         * </p> 
     38         */ 
    2639        private List<List<Event<?>>> containedSequences; 
    2740 
     41        private JFrame frmSequences; 
     42 
    2843        /** 
    29          * Launch the application. 
     44         * <p> 
     45         * Launch the dialog 
     46         * </p> 
    3047         */ 
    3148        public static void showDialog() { 
     
    4461 
    4562        /** 
    46          * Create the application. 
     63         * <p> 
     64         * Create the dialog 
     65         * </p> 
    4766         */ 
    4867        public DlgSequences() { 
     
    5170 
    5271        /** 
     72         * <p> 
    5373         * Initialize the contents of the frame. 
     74         * </p> 
    5475         */ 
    5576        @SuppressWarnings("unchecked") 
     
    6586                        } 
    6687                }); 
    67                 final javax.swing.DefaultListModel modelListSequences = new javax.swing.DefaultListModel(); 
    68                 final JButton btnSequence = new JButton("Show details"); 
    69                 final JButton btnClose = new JButton("Close"); 
    70                 JPanel panel = new JPanel(); 
    7188 
    72                 // JFrame: frmSequence *** 
    7389                frmSequences.setTitle("Sequences"); 
    7490                frmSequences.setResizable(false); 
     
    7793                frmSequences.getContentPane().setLayout(null); 
    7894 
     95                final javax.swing.DefaultListModel modelListSequences = new javax.swing.DefaultListModel(); 
     96                final JButton btnSequence = new JButton("Show details"); 
     97                final JButton btnClose = new JButton("Close"); 
     98 
     99                JPanel panel = new JPanel(); 
     100                panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); 
     101                panel.setBounds(10, 11, 244, 218); 
     102                frmSequences.getContentPane().add(panel); 
     103                panel.setLayout(null); 
     104 
     105                JScrollPane scrollPane = new JScrollPane(); 
     106                scrollPane.setBounds(10, 11, 224, 196); 
     107                panel.add(scrollPane); 
     108                final JList listSequences = new JList(modelListSequences); 
     109                scrollPane.setViewportView(listSequences); 
     110 
     111                JPanel panel_1 = new JPanel(); 
     112                panel_1.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); 
     113                panel_1.setBounds(10, 240, 244, 53); 
     114                frmSequences.getContentPane().add(panel_1); 
     115                panel_1.setLayout(null); 
     116 
     117                // get the available sequences out of globalDataContainer 
    79118                try { 
    80119                        containedSequences = (List<List<Event<?>>>) GlobalDataContainer 
    81120                                        .getInstance().getData("sequences"); 
    82121                } catch (ClassCastException e) { 
    83                         Console.println("Not able to cast Data in GlobalDataContainer to List of Sequences"); 
     122                        Console.println("Not able to cast data in globalDataContainer to list of sequences"); 
    84123                } 
    85124 
     125                // display sequences in the dialog 
    86126                try { 
    87127                        for (int i = 0; i < containedSequences.size(); i++) { 
     
    93133                } 
    94134 
    95                 panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); 
    96                 panel.setBounds(10, 11, 244, 218); 
    97                 frmSequences.getContentPane().add(panel); 
    98                 panel.setLayout(null); 
    99                 // *** 
    100  
    101                 // JScrollPane: scrollPane 
    102                 JScrollPane scrollPane = new JScrollPane(); 
    103                 scrollPane.setBounds(10, 11, 224, 196); 
    104                 panel.add(scrollPane); 
    105                 final JList listSequences = new JList(modelListSequences); 
    106                 scrollPane.setViewportView(listSequences); 
    107                 // *** 
    108  
    109                 // JList: listSequnces 
     135                // enable/disable the "Show details" button by selecting/deselecting a 
     136                // sequence 
    110137                listSequences.addListSelectionListener(new ListSelectionListener() { 
    111138                        public void valueChanged(ListSelectionEvent arg0) { 
     
    117144                }); 
    118145 
    119                 JPanel panel_1 = new JPanel(); 
    120                 panel_1.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); 
    121                 panel_1.setBounds(10, 240, 244, 53); 
    122                 frmSequences.getContentPane().add(panel_1); 
    123                 panel_1.setLayout(null); 
    124                 // *** 
    125  
    126                 // JButton: btnSequence *** 
     146                // listener for clicking the "Show details" button 
    127147                btnSequence.addMouseListener(new MouseAdapter() { 
    128148                        public void mouseClicked(MouseEvent arg0) { 
     
    140160                panel_1.add(btnSequence); 
    141161                btnSequence.setEnabled(false); 
    142                 // *** 
    143162 
    144                 // JButton: btnClose *** 
     163                // listener for clicking the "Close" button 
    145164                btnClose.addMouseListener(new MouseAdapter() { 
    146165                        public void mouseClicked(MouseEvent arg0) { 
     
    150169                btnClose.setBounds(10, 11, 110, 32); 
    151170                panel_1.add(btnClose); 
    152                 // *** 
    153171        } 
    154172} 
Note: See TracChangeset for help on using the changeset viewer.