Mercurial > hg > RemoteEditor > REPSessionManager
view rep/gui/SessionManagerGUIimpl.java @ 382:4b87f89b3afd
REP Session Manager (Java version)
new structure
author | one@firefly.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Mon, 10 Nov 2008 22:07:45 +0900 |
parents | |
children |
line wrap: on
line source
package rep.gui; import java.awt.Container; import java.util.LinkedList; import javax.swing.JFrame; import javax.swing.SwingUtilities; import rep.Session; import rep.handler.REPNode; public class SessionManagerGUIimpl implements Runnable, SessionManagerGUI { public static void main(String[] args){ SessionManagerGUIimpl gui = new SessionManagerGUIimpl(new SessionManagerEventListener() { public void buttonPressed(SessionManagerEvent event) { } public void closeSession(SessionManagerEvent event) { } public void selectSession(SelectButtonEvent selectButtonEvent) { } }); Thread th = new Thread( gui ); th.start(); } public SessionManagerGUIimpl(SessionManagerEventListener manager) { rp = new RPanel(); rp.addREPActionListener(manager); Thread th = new Thread(this); th.start(); } private RPanel rp; private JFrame frame; public void run() { frame = new JFrame("SessionManager"); frame.setBounds(100, 100, 600, 300); Container cont = frame.getContentPane(); cont.add(rp); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } /* (non-Javadoc) * @see rep.SessionManagerGUIint#update(java.util.LinkedList, java.util.LinkedList) */ public void update(LinkedList<Session> slist, LinkedList<REPNode> elist) { rp.setTableSession(slist); rp.setTableEditor(elist); } public void invokeLater(Runnable doRun) { SwingUtilities.invokeLater(doRun); } }