From 70af06e1bff47a36de9d9106412388b2f5b91f15 Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Wed, 8 Jun 2011 17:46:44 +0200 Subject: LAden und Speichern geht jetzt immer sauber git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@388 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/view/impl/View.java | 60 +++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 24 deletions(-) (limited to 'src/jrummikub/view/impl') diff --git a/src/jrummikub/view/impl/View.java b/src/jrummikub/view/impl/View.java index a3bded6..a6e5efe 100644 --- a/src/jrummikub/view/impl/View.java +++ b/src/jrummikub/view/impl/View.java @@ -114,6 +114,17 @@ public class View extends JFrame implements IView { return saveEvent; } + @Override + public void clearView() { + showScorePanel(false); + showSettingsPanel(false); + getHandPanel().setStones( + Collections.> emptyList()); + getTablePanel().setStoneSets( + Collections.> emptyList()); + setSelectedStones(Collections. emptyList()); + } + private void createFileChooser() { chooser = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter( @@ -208,8 +219,8 @@ public class View extends JFrame implements IView { mainLayer.add(table); playerPanel = new PlayerPanel(); - playerPanel.setBorder(new MatteBorder(PLAYER_PANEL_BORDER_WIDTH, 0, 0, 0, - Color.BLACK)); + playerPanel.setBorder(new MatteBorder(PLAYER_PANEL_BORDER_WIDTH, 0, 0, + 0, Color.BLACK)); mainLayer.add(playerPanel); startTurnPanel = new StartTurnPanel(); @@ -318,24 +329,24 @@ public class View extends JFrame implements IView { @SuppressWarnings("unchecked") private List> createDecorationStones() { - Pair stoneJ = new Pair(new Stone(-'J', - StoneColor.BLACK), new Position(2.5f, 0)); - Pair stoneR = new Pair(new Stone(-'R', - StoneColor.ORANGE), new Position(3.5f, 0)); - Pair stoneu1 = new Pair(new Stone(-'u', - StoneColor.BLUE), new Position(4.5f, 0)); - Pair stonem1 = new Pair(new Stone(-'m', - StoneColor.RED), new Position(5.5f, 0)); - Pair stonem2 = new Pair(new Stone(-'m', - StoneColor.GREEN), new Position(6.5f, 0)); - Pair stonei = new Pair(new Stone(-'i', - StoneColor.VIOLET), new Position(7.5f, 0)); - Pair stonek = new Pair(new Stone(-'k', - StoneColor.AQUA), new Position(8.5f, 0)); - Pair stoneu2 = new Pair(new Stone(-'u', - StoneColor.GRAY), new Position(9.5f, 0)); - Pair stoneb = new Pair(new Stone(-'b', - StoneColor.BLACK), new Position(10.5f, 0)); + Pair stoneJ = new Pair(new Stone( + -'J', StoneColor.BLACK), new Position(2.5f, 0)); + Pair stoneR = new Pair(new Stone( + -'R', StoneColor.ORANGE), new Position(3.5f, 0)); + Pair stoneu1 = new Pair(new Stone( + -'u', StoneColor.BLUE), new Position(4.5f, 0)); + Pair stonem1 = new Pair(new Stone( + -'m', StoneColor.RED), new Position(5.5f, 0)); + Pair stonem2 = new Pair(new Stone( + -'m', StoneColor.GREEN), new Position(6.5f, 0)); + Pair stonei = new Pair(new Stone( + -'i', StoneColor.VIOLET), new Position(7.5f, 0)); + Pair stonek = new Pair(new Stone( + -'k', StoneColor.AQUA), new Position(8.5f, 0)); + Pair stoneu2 = new Pair(new Stone( + -'u', StoneColor.GRAY), new Position(9.5f, 0)); + Pair stoneb = new Pair(new Stone( + -'b', StoneColor.BLACK), new Position(10.5f, 0)); Pair stone1 = new Pair(new Stone( StoneColor.RED), new Position(2, 1)); @@ -350,9 +361,9 @@ public class View extends JFrame implements IView { Pair stone6 = new Pair(new Stone( StoneColor.BLACK), new Position(11, 1)); - return Arrays - .asList(stoneJ, stoneR, stoneu1, stonem1, stonem2, stonei, stonek, - stoneu2, stoneb, stone1, stone2, stone3, stone4, stone5, stone6); + return Arrays.asList(stoneJ, stoneR, stoneu1, stonem1, stonem2, stonei, + stonek, stoneu2, stoneb, stone1, stone2, stone3, stone4, + stone5, stone6); } @Override @@ -363,7 +374,8 @@ public class View extends JFrame implements IView { && type != BottomPanelType.WIN_PANEL); if (type == BottomPanelType.START_GAME_PANEL) { - table.setStoneSets(Collections.> emptyList()); + table.setStoneSets(Collections + .> emptyList()); playerPanel.getHandPanel().setStones(createDecorationStones()); } -- cgit v1.2.3