annotate rep/SessionManagerGUI.java @ 84:54334d83194a

*** empty log message ***
author pin
date Fri, 21 Dec 2007 16:03:04 +0900
parents 57a16534ba5a
children 790c8dd42a7b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e41994ce73c7 *** empty log message ***
pin
parents:
diff changeset
1 package rep;
e41994ce73c7 *** empty log message ***
pin
parents:
diff changeset
2
1
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
3 import java.awt.BorderLayout;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
4 import java.awt.Container;
8
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
5 import java.nio.channels.SocketChannel;
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
6
1
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
7 import javax.swing.JButton;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
8 import javax.swing.JFrame;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
9 import javax.swing.JLabel;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
10 import javax.swing.JPanel;
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
11
5
91a33a634fef *** empty log message ***
pin
parents: 2
diff changeset
12 import rep.gui.ConnectionPanel;
91a33a634fef *** empty log message ***
pin
parents: 2
diff changeset
13
1
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
14 public class SessionManagerGUI implements Runnable{
2
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
15 public static void main(String[] args) {
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
16 SessionManagerGUI gui = new SessionManagerGUI();
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
17 Thread th = new Thread( gui );
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
18 th.start();
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
19 }
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
20
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
21 private RPanel rp;
5
91a33a634fef *** empty log message ***
pin
parents: 2
diff changeset
22 //private ConnectionPanel rp;
2
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
23 private JFrame frame;
0
e41994ce73c7 *** empty log message ***
pin
parents:
diff changeset
24
1
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
25 public void run() {
2
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
26 frame = new JFrame("SessionManager");
55
57a16534ba5a change window size
chiaki
parents: 8
diff changeset
27 frame.setBounds(100, 100, 600, 300);
5
91a33a634fef *** empty log message ***
pin
parents: 2
diff changeset
28 //rp = new ConnectionPanel();
91a33a634fef *** empty log message ***
pin
parents: 2
diff changeset
29 rp = new RPanel();
1
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
30 Container cont = frame.getContentPane();
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
31 cont.add(rp);
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
32
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
33 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
2
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
34 //frame.pack();
1
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
35 frame.setVisible(true);
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
36 }
2
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
37
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
38 public void addConnectionListener(ConnectionListener listener) {
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
39 //System.out.println(rp.toString());
5
91a33a634fef *** empty log message ***
pin
parents: 2
diff changeset
40 System.out.print("waiting for launching GUI.");
2
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
41 while(rp == null){
5
91a33a634fef *** empty log message ***
pin
parents: 2
diff changeset
42 System.out.print(".");
2
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
43 try {
5
91a33a634fef *** empty log message ***
pin
parents: 2
diff changeset
44 Thread.sleep(200);
2
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
45 } catch (InterruptedException e) {
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
46 e.printStackTrace();
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
47 }
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
48 }
5
91a33a634fef *** empty log message ***
pin
parents: 2
diff changeset
49 System.out.println("");
2
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
50 rp.addConnectionListener(listener);
02fa9a68d9a2 *** empty log message ***
pin
parents: 1
diff changeset
51 }
8
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
52
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
53 public void setComboEditor(int eid, SocketChannel channel) {
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
54 // TODO Auto-generated method stub
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
55 rp.setComboEditor(eid, channel);
55
57a16534ba5a change window size
chiaki
parents: 8
diff changeset
56 rp.setTableEditor(eid, channel);
8
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
57 }
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
58
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
59 public void addREPActionListener(REPActionListener listener) {
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
60 // TODO Auto-generated method stub
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
61 rp.REPActionListener(listener);
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
62 }
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
63
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
64 public void setComboSession(int sessionID, String string) {
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
65 // TODO Auto-generated method stub
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
66 rp.setComboSession(sessionID, string);
55
57a16534ba5a change window size
chiaki
parents: 8
diff changeset
67 rp.setTableSession(sessionID, string);
8
b774b87cc2c1 *** empty log message ***
pin
parents: 5
diff changeset
68 }
1
3f5bf0255f5e *** empty log message ***
pin
parents: 0
diff changeset
69 }