0
|
1 package rep;
|
|
2
|
1
|
3 import java.awt.Container;
|
133
|
4 import javax.swing.JFrame;
|
|
5 import rep.channel.REPSocketChannel;
|
8
|
6
|
5
|
7
|
1
|
8 public class SessionManagerGUI implements Runnable{
|
2
|
9 public static void main(String[] args) {
|
|
10 SessionManagerGUI gui = new SessionManagerGUI();
|
|
11 Thread th = new Thread( gui );
|
|
12 th.start();
|
|
13 }
|
|
14
|
|
15 private RPanel rp;
|
5
|
16 //private ConnectionPanel rp;
|
2
|
17 private JFrame frame;
|
0
|
18
|
1
|
19 public void run() {
|
2
|
20 frame = new JFrame("SessionManager");
|
55
|
21 frame.setBounds(100, 100, 600, 300);
|
5
|
22 //rp = new ConnectionPanel();
|
|
23 rp = new RPanel();
|
1
|
24 Container cont = frame.getContentPane();
|
|
25 cont.add(rp);
|
|
26
|
|
27 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
2
|
28 //frame.pack();
|
1
|
29 frame.setVisible(true);
|
|
30 }
|
2
|
31
|
|
32 public void addConnectionListener(ConnectionListener listener) {
|
|
33 //System.out.println(rp.toString());
|
5
|
34 System.out.print("waiting for launching GUI.");
|
2
|
35 while(rp == null){
|
5
|
36 System.out.print(".");
|
2
|
37 try {
|
5
|
38 Thread.sleep(200);
|
2
|
39 } catch (InterruptedException e) {
|
|
40 e.printStackTrace();
|
|
41 }
|
|
42 }
|
5
|
43 System.out.println("");
|
2
|
44 rp.addConnectionListener(listener);
|
|
45 }
|
8
|
46
|
133
|
47 public void setComboEditor(int eid, REPSocketChannel channel) {
|
8
|
48 rp.setComboEditor(eid, channel);
|
55
|
49 rp.setTableEditor(eid, channel);
|
8
|
50 }
|
|
51
|
133
|
52 public void addREPActionListener(REPActionListener<REPCommand> listener) {
|
122
|
53 rp.addREPActionListener(listener);
|
8
|
54 }
|
|
55
|
|
56 public void setComboSession(int sessionID, String string) {
|
|
57 rp.setComboSession(sessionID, string);
|
55
|
58 rp.setTableSession(sessionID, string);
|
8
|
59 }
|
122
|
60
|
1
|
61 } |