From ebacf1ae7494abc3a80cf1ec242a6202d6438323 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 14 Jun 2011 04:55:24 +0200 Subject: Implement joining games git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@434 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/view/impl/GameListPanel.java | 7 +++++-- src/jrummikub/view/impl/SettingsPanel.java | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/jrummikub/view/impl') diff --git a/src/jrummikub/view/impl/GameListPanel.java b/src/jrummikub/view/impl/GameListPanel.java index 7324559..2d07f2e 100644 --- a/src/jrummikub/view/impl/GameListPanel.java +++ b/src/jrummikub/view/impl/GameListPanel.java @@ -72,8 +72,11 @@ class GameListPanel extends JPanel implements IGameListPanel { joinButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - // TODO Auto-generated method stub - // joinEvent.emit(); + Object data = gameList.getSelectedValue(); + + if (data instanceof GameData) { + joinEvent.emit((GameData) data); + } } }); diff --git a/src/jrummikub/view/impl/SettingsPanel.java b/src/jrummikub/view/impl/SettingsPanel.java index 8ec9d3e..c7b6387 100644 --- a/src/jrummikub/view/impl/SettingsPanel.java +++ b/src/jrummikub/view/impl/SettingsPanel.java @@ -373,7 +373,8 @@ class SettingsPanel extends JPanel implements ISettingsPanel { private void addPlayerSettingsPanel(int i, PlayerSettings settings, List choices) { PlayerSettingsPanel panel = new PlayerSettingsPanel(i, settings, choices, - settingsMode != SettingsMode.NETWORK_OFFER); + settingsMode != SettingsMode.NETWORK_OFFER + && settingsMode != SettingsMode.NETWORK_JOIN); playerSettingsPanels.add(panel); playerSettingsViewport.add(panel, playerSettingsViewport.getComponentCount() - 1); @@ -765,6 +766,10 @@ class SettingsPanel extends JPanel implements ISettingsPanel { addNetworkOfferButtons(); enableOptions(false); break; + case NETWORK_JOIN: + // addNetworkJoinButtons(); + enableOptions(false); + break; } } -- cgit v1.2.3