package boondock.holdem.Server; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; import boondock.holdem.Gui.*; import boondock.holdem.Sound.waveObj; /** * Server Gui for visual interaction with the server controls. * * @author Jonathan O'Keefe * @author Scott Semonian * @author Matt Brinza * @author Hamid R. Tahsildoost * * @author The Boondock Saints * @author No Limit Texas Holdem */ public class ServerGui extends JFrame implements ActionListener{ public void windowOpened(WindowEvent e){} public void windowIconified(WindowEvent e) {} public void windowDeiconified(WindowEvent e) {} public void windowActivated(WindowEvent e) {} public void windowDeactivated(WindowEvent e) {} public void windowGainedFocus(WindowEvent e) {} public void windowLostFocus(WindowEvent e) {} public void windowStateChanged(WindowEvent e) {} public void windowClosed(WindowEvent e) {} public void windowClosing(WindowEvent e) { //server.log.finest("CLOSE"); //messageManager.sendMessage( userName, "COMMAND:DISCONNECT"); //messageManager.disconnect( messageListener ); //SEND MESSAGE TO KILL/CLOSE ALL GUIS?? System.exit( 0 ); } JButton quitServer = new JButton("Quit Server"); JButton aiButton = new JButton("Connect AI Player"); JPanel mainPanel = new JPanel(); boolean aiExists = false; public ServerGui() { //getContentPane().setLayout(null); quitServer.setBounds(new Rectangle(100, 100, 100, 30)); quitServer.addActionListener(this); mainPanel.setMinimumSize(new Dimension(300, 200)); mainPanel.setPreferredSize(new Dimension(300, 200)); aiButton.addActionListener(this); mainPanel.add(aiButton); mainPanel.add(quitServer); mainPanel.setBackground(Color.white); this.getContentPane().setBackground(Color.white); this.getContentPane().add(mainPanel); } public void actionPerformed(ActionEvent e) { waveObj song = new waveObj(); song.play("sounds/ButtonClick.wav"); if(e.getSource() == quitServer) System.exit(0); if(e.getSource() == aiButton) { if(!aiExists) { boondock.holdem.Ai.aiPlayer aiP = new boondock.holdem.Ai.aiPlayer(); aiExists = true; } else { JOptionPane.showMessageDialog(this,"AI player created, watch all the action on this GUI!"); } } } }