Changeset 173 for trunk/EventBenchConsole
- Timestamp:
- 09/09/11 19:34:03 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/swing/DlgSequences.java
r138 r173 21 21 import java.awt.event.WindowEvent; 22 22 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 */ 23 32 public class DlgSequences { 24 33 25 private JFrame frmSequences; 34 /** 35 * <p> 36 * All the sequences that are found in the parsed log 37 * </p> 38 */ 26 39 private List<List<Event<?>>> containedSequences; 27 40 41 private JFrame frmSequences; 42 28 43 /** 29 * Launch the application. 44 * <p> 45 * Launch the dialog 46 * </p> 30 47 */ 31 48 public static void showDialog() { … … 44 61 45 62 /** 46 * Create the application. 63 * <p> 64 * Create the dialog 65 * </p> 47 66 */ 48 67 public DlgSequences() { … … 51 70 52 71 /** 72 * <p> 53 73 * Initialize the contents of the frame. 74 * </p> 54 75 */ 55 76 @SuppressWarnings("unchecked") … … 65 86 } 66 87 }); 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();71 88 72 // JFrame: frmSequence ***73 89 frmSequences.setTitle("Sequences"); 74 90 frmSequences.setResizable(false); … … 77 93 frmSequences.getContentPane().setLayout(null); 78 94 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 79 118 try { 80 119 containedSequences = (List<List<Event<?>>>) GlobalDataContainer 81 120 .getInstance().getData("sequences"); 82 121 } 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"); 84 123 } 85 124 125 // display sequences in the dialog 86 126 try { 87 127 for (int i = 0; i < containedSequences.size(); i++) { … … 93 133 } 94 134 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 110 137 listSequences.addListSelectionListener(new ListSelectionListener() { 111 138 public void valueChanged(ListSelectionEvent arg0) { … … 117 144 }); 118 145 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 127 147 btnSequence.addMouseListener(new MouseAdapter() { 128 148 public void mouseClicked(MouseEvent arg0) { … … 140 160 panel_1.add(btnSequence); 141 161 btnSequence.setEnabled(false); 142 // ***143 162 144 // JButton: btnClose ***163 // listener for clicking the "Close" button 145 164 btnClose.addMouseListener(new MouseAdapter() { 146 165 public void mouseClicked(MouseEvent arg0) { … … 150 169 btnClose.setBounds(10, 11, 110, 32); 151 170 panel_1.add(btnClose); 152 // ***153 171 } 154 172 }
Note: See TracChangeset
for help on using the changeset viewer.