]> git.somenet.org - pub/jan/sbc.git/blob - src/main/java/at/ac/tuwien/sbc/valesriegler/group/GroupAgent.java
GroupAgent now handles Group creation and run-Group-as-Thread as expected
[pub/jan/sbc.git] / src / main / java / at / ac / tuwien / sbc / valesriegler / group / GroupAgent.java
1 package at.ac.tuwien.sbc.valesriegler.group;
2
3 import javax.swing.SwingUtilities;
4
5 import at.ac.tuwien.sbc.valesriegler.group.gui.GroupOverviewModel;
6 import at.ac.tuwien.sbc.valesriegler.group.jms.JMSGroupConnector;
7
8 /**
9  * The Main class of the Group component.
10  * <p />
11  * Start the communication and the group GUI:
12  * 
13  * @author Gregor Riegler <gregor DOT riegler AT gmail DOT com>
14  * @author jan
15  * 
16  */
17 public class GroupAgent {
18         public static GroupAgent groupAgent;
19         private GroupOverviewModel groupModel;
20         private AbstractGroupConnector groupconn;
21
22         public static void main(String[] args) {
23                 // TODO: use jms and xvsm manager here.
24                 groupAgent = new GroupAgent(new JMSGroupConnector());
25                 SwingUtilities.invokeLater(new GroupGUI());
26         }
27
28         public GroupAgent(JMSGroupConnector groupconn) {
29                 groupModel = new GroupOverviewModel();
30                 this.groupconn = groupconn;
31                 groupconn.init();
32         }
33
34         public static GroupAgent getInstance() {
35                 return groupAgent;
36         }
37
38         public AbstractGroupConnector getGroupcomm() {
39                 return groupconn;
40         }
41
42         public GroupOverviewModel getGroupModel() {
43                 return groupModel;
44         }
45 }