Mercurial > hg > RemoteEditor > REPSessionManager
view rep/SessionManagerGUI.java @ 217:4deaaaa6354e
*** empty log message ***
author | kono |
---|---|
date | Sun, 31 Aug 2008 00:26:35 +0900 |
parents | ff3fcdcccc85 |
children | 18d6a7140fa3 |
line wrap: on
line source
package rep; import java.awt.Container; import java.awt.event.ComponentListener; import java.util.LinkedList; import javax.swing.JFrame; import rep.channel.REPSocketChannel; public class SessionManagerGUI implements Runnable{ private SessionManager manager; public static void main(String[] args){ SessionManagerGUI gui = new SessionManagerGUI(); Thread th = new Thread( gui ); th.start(); } public SessionManagerGUI(SessionManager manager) { this.manager = manager; rp = new RPanel(manager); } public SessionManagerGUI() { // TODO Auto-generated constructor stub } private RPanel rp; //private ConnectionPanel rp; private JFrame frame; public void run() { frame = new JFrame("SessionManager"); frame.setBounds(100, 100, 600, 300); //rp = new ConnectionPanel(); Container cont = frame.getContentPane(); cont.add(rp); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } public void addConnectionListener(ConnectionListener listener) { //System.out.println(rp.toString()); System.out.print("waiting for launching GUI."); while(rp == null){ System.out.print("."); try { Thread.sleep(200); } catch (InterruptedException e) { e.printStackTrace(); } } System.out.println(""); rp.addConnectionListener(listener); } public void setComboEditor(int eid, REPSocketChannel channel) { rp.setComboEditor(eid, channel); //rp.setTableEditor(eid, channel); } public void addREPActionListener(REPActionListener<REPCommand> listener) { rp.addREPActionListener(listener); } public void setComboSession(int sessionID, String string) { rp.setComboSession(sessionID, string); //rp.setTableSession(sessionID, string); } public void update(LinkedList<Session> list, LinkedList<Editor> list2) { rp.setTableSession(list); rp.setTableEditor(list2); } }