From b62babba458c703c4a7597bf4640a936227d734a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 21 Jun 2011 03:52:25 +0200 Subject: Disable pause function in network mode git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@536 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/view/impl/View.java | 86 ++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 42 deletions(-) (limited to 'src/jrummikub/view/impl/View.java') diff --git a/src/jrummikub/view/impl/View.java b/src/jrummikub/view/impl/View.java index a9dc46f..69d0d25 100644 --- a/src/jrummikub/view/impl/View.java +++ b/src/jrummikub/view/impl/View.java @@ -193,8 +193,7 @@ public class View extends JFrame implements IView { showSettingsPanel(false); showLoginPanel(false); showGameListPanel(false); - getHandPanel().setStones( - Collections.> emptyList()); + getHandPanel().setStones(Collections.> emptyList()); getTablePanel().setStoneSets( Collections.> emptyList()); setSelectedStones(Collections. emptyList()); @@ -321,6 +320,7 @@ public class View extends JFrame implements IView { public void componentResized(ComponentEvent e) { rescale(); } + @Override public void componentMoved(ComponentEvent e) { quitWarningFrame.setLocationRelativeTo(View.this); @@ -355,10 +355,10 @@ public class View extends JFrame implements IView { quitWarningFrame.add(quitWarningPanel); quitWarningFrame.setAlwaysOnTop(true); quitWarningFrame.setUndecorated(true); - - //layeredPane.setLayer(quitWarningPanel, JLayeredPane.POPUP_LAYER); - //layeredPane.add(quitWarningPanel); - //quitWarningPanel.setVisible(true); + + // layeredPane.setLayer(quitWarningPanel, JLayeredPane.POPUP_LAYER); + // layeredPane.add(quitWarningPanel); + // quitWarningPanel.setVisible(true); scorePanel = new ScorePanel(); scorePanel.setVisible(false); layeredPane.setLayer(scorePanel, JLayeredPane.POPUP_LAYER); @@ -390,8 +390,7 @@ public class View extends JFrame implements IView { table = new TablePanel(); mainLayer.add(table); - table.setBorder(new MatteBorder(0, 0, TABLE_BORDER_WIDTH, 0, - Color.BLACK)); + table.setBorder(new MatteBorder(0, 0, TABLE_BORDER_WIDTH, 0, Color.BLACK)); playerPanel = new PlayerPanel(); mainLayer.add(playerPanel); @@ -411,9 +410,14 @@ public class View extends JFrame implements IView { sidePanel = new SidePanel(); sidePanel.setVisible(false); mainLayer.add(sidePanel); - sidePanel.setBorder(new CompoundBorder(new MatteBorder(0, 0, 0, 1, - Color.BLACK), new MatteBorder(0, 0, TABLE_BORDER_WIDTH, 0, - Color.GRAY))); + sidePanel + .setBorder(new CompoundBorder(new MatteBorder(0, 0, 0, 1, Color.BLACK), + new MatteBorder(0, 0, TABLE_BORDER_WIDTH, 0, Color.GRAY))); + } + + @Override + public void setMayPause(boolean mayPause) { + playerPanel.setMayPause(mayPause); } @Override @@ -525,15 +529,14 @@ public class View extends JFrame implements IView { public void showQuitWarningPanel(boolean show) { quitWarningFrame.setLocationRelativeTo(this); quitWarningFrame.setVisible(show); - + setEnabled(!show); - /*mainLayer.setEnabled(!show); - menuBar.setEnabled(!show); - settingsPanel.setEnabled(!show); - loginPanel.setEnabled(!show); - scorePanel.setEnabled(!show); - gameListPanel.setEnabled(!show); - connectPanel.setEnabled(!show);*/ + /* + * mainLayer.setEnabled(!show); menuBar.setEnabled(!show); + * settingsPanel.setEnabled(!show); loginPanel.setEnabled(!show); + * scorePanel.setEnabled(!show); gameListPanel.setEnabled(!show); + * connectPanel.setEnabled(!show); + */ } @Override @@ -597,24 +600,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)); @@ -629,9 +632,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 @@ -650,8 +653,7 @@ public class View extends JFrame implements IView { && type != BottomPanelType.WIN_PANEL && type != null); if (type == BottomPanelType.START_GAME_PANEL) { - table.setStoneSets(Collections - .> emptyList()); + table.setStoneSets(Collections.> emptyList()); playerPanel.getHandPanel().setStones(createDecorationStones()); } -- cgit v1.2.3