source: trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/commands/CMDshowSequences.java @ 225

Last change on this file since 225 was 203, checked in by sherbold, 13 years ago
  • Changed data type for handling of sequence-sets. Before, List<List<Event<?>>> was used, now Collection<List<Event<?>>> is used.
  • Property svn:mime-type set to text/plain
File size: 1.3 KB
Line 
1package de.ugoe.cs.eventbench.commands;
2
3import java.security.InvalidParameterException;
4import java.util.Collection;
5import java.util.List;
6
7import de.ugoe.cs.eventbench.swing.DlgSequences;
8import de.ugoe.cs.util.console.Command;
9import de.ugoe.cs.util.console.Console;
10import de.ugoe.cs.eventbench.data.GlobalDataContainer;
11import de.ugoe.cs.eventbench.data.Event;
12
13public class CMDshowSequences implements Command {
14
15        public void help() {
16                Console.println("Usage: showSequences");
17        }
18
19        @SuppressWarnings("unchecked")
20        public void run(List<Object> parameters) {
21
22                if (parameters.size() > 0)
23                        throw new InvalidParameterException();
24
25                Collection<List<Event<?>>> containedSequences = null;
26
27                try {
28                        containedSequences = (Collection<List<Event<?>>>) GlobalDataContainer
29                                        .getInstance().getData("sequences");
30                } catch (ClassCastException e) {
31                        Console.println("Not able to cast Data in GlobalDataContainer to List of Sequences");
32                }
33
34                if (containedSequences == null) {
35                        Console.printerrln("No sequences found.");
36                } else {
37
38                        DlgSequences.showDialog();
39
40                        synchronized (Console.getInstance()) {
41                                try {
42                                        Console.getInstance().wait();
43                                } catch (InterruptedException e) {
44                                        e.printStackTrace();
45                                }
46                        }
47                }
48        }
49}
Note: See TracBrowser for help on using the repository browser.