summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-06-14 04:55:24 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-06-14 04:55:24 +0200
commitebacf1ae7494abc3a80cf1ec242a6202d6438323 (patch)
tree9052767ea3cc2dcdbf20926c47224f1304ae1585 /src/jrummikub/view
parent4879b7b93eaff1f80056d78e19271d6418ec6534 (diff)
downloadJRummikub-ebacf1ae7494abc3a80cf1ec242a6202d6438323.tar
JRummikub-ebacf1ae7494abc3a80cf1ec242a6202d6438323.zip
Implement joining games
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@434 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/view')
-rw-r--r--src/jrummikub/view/ISettingsPanel.java4
-rw-r--r--src/jrummikub/view/impl/GameListPanel.java7
-rw-r--r--src/jrummikub/view/impl/SettingsPanel.java7
3 files changed, 14 insertions, 4 deletions
diff --git a/src/jrummikub/view/ISettingsPanel.java b/src/jrummikub/view/ISettingsPanel.java
index c2bd766..279526a 100644
--- a/src/jrummikub/view/ISettingsPanel.java
+++ b/src/jrummikub/view/ISettingsPanel.java
@@ -268,6 +268,8 @@ public interface ISettingsPanel {
/** */
NETWORK_SETUP,
/** */
- NETWORK_OFFER
+ NETWORK_OFFER,
+ /** */
+ NETWORK_JOIN
}
} \ No newline at end of file
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<Type> 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;
}
}