From 66b4094d176a4ce40c28cad59f8f447badacdc72 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 31 May 2011 04:45:28 +0200 Subject: Add bling git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@344 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/view/impl/PlayerPanel.java | 6 ++++- src/jrummikub/view/impl/StonePainter.java | 2 +- src/jrummikub/view/impl/View.java | 39 ++++++++++++++++++++++++------- 3 files changed, 36 insertions(+), 11 deletions(-) (limited to 'src/jrummikub') diff --git a/src/jrummikub/view/impl/PlayerPanel.java b/src/jrummikub/view/impl/PlayerPanel.java index 5b7eb90..e07da5f 100644 --- a/src/jrummikub/view/impl/PlayerPanel.java +++ b/src/jrummikub/view/impl/PlayerPanel.java @@ -379,7 +379,9 @@ class PlayerPanel extends JPanel implements IPlayerPanel { timeBar.setVisible(show); if (!show) { + handRowDownButton.setForeground(Color.GRAY); handRowDownButton.setEnabled(false); + handRowUpButton.setForeground(Color.GRAY); handRowUpButton.setEnabled(false); endTurnButton.setVisible(false); redealButton.setVisible(false); @@ -394,8 +396,10 @@ class PlayerPanel extends JPanel implements IPlayerPanel { setEndTurnMode(false, false); endTurnButton.setText("
Computer denkt nach"); hand.setStones(Collections.>emptyList()); + handRowDownButton.setForeground(Color.GRAY); handRowDownButton.setEnabled(false); - handRowDownButton.setEnabled(false); + handRowUpButton.setForeground(Color.GRAY); + handRowUpButton.setEnabled(false); } endTurnButton.setEnabled(enable); redealButton.setEnabled(enable); diff --git a/src/jrummikub/view/impl/StonePainter.java b/src/jrummikub/view/impl/StonePainter.java index e2dae24..c644ea1 100644 --- a/src/jrummikub/view/impl/StonePainter.java +++ b/src/jrummikub/view/impl/StonePainter.java @@ -311,7 +311,7 @@ class StonePainter { g.setFont(new Font("SansSerif", Font.BOLD, r.height / 4)); FontMetrics fm = g.getFontMetrics(); - String value = Integer.toString(v); + String value = (v > 0) ? Integer.toString(v) : Character.toString((char)(-v)); Rectangle2D stringRect = fm.getStringBounds(value, g); if (scale > 1) { diff --git a/src/jrummikub/view/impl/View.java b/src/jrummikub/view/impl/View.java index 8c9bc9f..75b2fc6 100644 --- a/src/jrummikub/view/impl/View.java +++ b/src/jrummikub/view/impl/View.java @@ -97,8 +97,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(); @@ -222,20 +222,41 @@ 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 stone1 = new Pair(new Stone( - StoneColor.RED), new Position(3.5f, 0)); + StoneColor.RED), new Position(2, 1)); Pair stone2 = new Pair(new Stone(13, - StoneColor.BLACK), new Position(5, 0)); + StoneColor.BLACK), new Position(5, 1)); Pair stone3 = new Pair(new Stone(13, - StoneColor.ORANGE), new Position(6, 0)); + StoneColor.ORANGE), new Position(6, 1)); Pair stone4 = new Pair(new Stone(13, - StoneColor.BLUE), new Position(7, 0)); + StoneColor.BLUE), new Position(7, 1)); Pair stone5 = new Pair(new Stone(13, - StoneColor.RED), new Position(8, 0)); + StoneColor.RED), new Position(8, 1)); Pair stone6 = new Pair(new Stone( - StoneColor.BLACK), new Position(9.5f, 0)); + StoneColor.BLACK), new Position(11, 1)); - return Arrays.asList(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 -- cgit v1.2.3