diff options
Diffstat (limited to 'src/jrummikub')
-rw-r--r-- | src/jrummikub/control/TurnControl.java | 18 | ||||
-rw-r--r-- | src/jrummikub/view/IPlayerPanel.java | 5 | ||||
-rw-r--r-- | src/jrummikub/view/IView.java | 5 | ||||
-rw-r--r-- | src/jrummikub/view/impl/PlayerPanel.java | 3 | ||||
-rw-r--r-- | src/jrummikub/view/impl/View.java | 6 |
5 files changed, 21 insertions, 16 deletions
diff --git a/src/jrummikub/control/TurnControl.java b/src/jrummikub/control/TurnControl.java index 4652ea7..4140b57 100644 --- a/src/jrummikub/control/TurnControl.java +++ b/src/jrummikub/control/TurnControl.java @@ -98,15 +98,15 @@ public class TurnControl { } })); - view.getPlayerPanel().getHandPanel().setStones(hand.clone()); - view.getPlayerPanel().getHandPanel().resetCurrentRow(); + view.getHandPanel().setStones(hand.clone()); + view.getHandPanel().resetCurrentRow(); view.enableStartTurnPanel(false); timer.startTimer(); } private void addHandPanelHandlers() { - connections.add(view.getPlayerPanel().getHandPanel().getClickEvent() + connections.add(view.getHandPanel().getClickEvent() .add(new IListener1<Position>() { @Override public void handle(Position pos) { @@ -114,7 +114,7 @@ public class TurnControl { } })); - connections.add(view.getPlayerPanel().getHandPanel().getStoneClickEvent() + connections.add(view.getHandPanel().getStoneClickEvent() .add(new IListener2<Stone, Boolean>() { @Override @@ -123,7 +123,7 @@ public class TurnControl { } })); - connections.add(view.getPlayerPanel().getHandPanel().getRangeClickEvent() + connections.add(view.getHandPanel().getRangeClickEvent() .add(new IListener2<Stone, Boolean>() { @Override @@ -227,7 +227,7 @@ public class TurnControl { i++; } view.setSelectedStones(selectedStones); - view.getPlayerPanel().getHandPanel().setStones(hand); + view.getHandPanel().setStones(hand); } private void sortStones(Comparator<Stone> comparator) { @@ -250,7 +250,7 @@ public class TurnControl { } } - view.getPlayerPanel().getHandPanel().setStones(hand); + view.getHandPanel().setStones(hand); } private void sortByRuns() { @@ -307,7 +307,7 @@ public class TurnControl { selectedStones.clear(); view.getTablePanel().setStoneSets(table); - view.getPlayerPanel().getHandPanel().setStones(hand); + view.getHandPanel().setStones(hand); view.setSelectedStones(selectedStones); } @@ -433,7 +433,7 @@ public class TurnControl { selectedStones.clear(); view.getTablePanel().setStoneSets(table); - view.getPlayerPanel().getHandPanel().setStones(hand); + view.getHandPanel().setStones(hand); view.setSelectedStones(selectedStones); } diff --git a/src/jrummikub/view/IPlayerPanel.java b/src/jrummikub/view/IPlayerPanel.java index 86c1440..3fb8709 100644 --- a/src/jrummikub/view/IPlayerPanel.java +++ b/src/jrummikub/view/IPlayerPanel.java @@ -7,11 +7,6 @@ import jrummikub.util.IEvent; */ public interface IPlayerPanel { /** - * @return the board where the players hand stones are displayed - */ - public IHandPanel getHandPanel(); - - /** * Sets the time the player has left for his turn * * @param time diff --git a/src/jrummikub/view/IView.java b/src/jrummikub/view/IView.java index d69d942..5828edd 100644 --- a/src/jrummikub/view/IView.java +++ b/src/jrummikub/view/IView.java @@ -17,6 +17,11 @@ public interface IView { public ITablePanel getTablePanel(); /** + * @return the board where the players hand stones are displayed + */ + public IHandPanel getHandPanel(); + + /** * Returns the player panel * * @return the playerPanel diff --git a/src/jrummikub/view/impl/PlayerPanel.java b/src/jrummikub/view/impl/PlayerPanel.java index 20fb05a..8d0719a 100644 --- a/src/jrummikub/view/impl/PlayerPanel.java +++ b/src/jrummikub/view/impl/PlayerPanel.java @@ -49,8 +49,7 @@ class PlayerPanel extends JPanel implements IPlayerPanel { private Event sortByRunsEvent = new Event(); private Event endTurnEvent = new Event(); - @Override - public HandPanel getHandPanel() { + HandPanel getHandPanel() { return hand; } diff --git a/src/jrummikub/view/impl/View.java b/src/jrummikub/view/impl/View.java index 869f4cd..9290b60 100644 --- a/src/jrummikub/view/impl/View.java +++ b/src/jrummikub/view/impl/View.java @@ -11,6 +11,7 @@ import javax.swing.border.MatteBorder; import jrummikub.model.Stone; import jrummikub.util.IEvent; +import jrummikub.view.IHandPanel; import jrummikub.view.IPlayerPanel; import jrummikub.view.ITablePanel; import jrummikub.view.IView; @@ -39,6 +40,11 @@ public class View extends JFrame implements IView { } @Override + public IHandPanel getHandPanel() { + return playerPanel.getHandPanel(); + } + + @Override public IPlayerPanel getPlayerPanel() { return playerPanel; } |