summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jrummikub/view/impl/PlayerPanel.java6
-rw-r--r--src/jrummikub/view/impl/StonePainter.java2
-rw-r--r--src/jrummikub/view/impl/View.java39
3 files changed, 36 insertions, 11 deletions
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("<html><center>Computer denkt nach");
hand.setStones(Collections.<Pair<Stone,Position>>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<Pair<Stone, Position>> createDecorationStones() {
+ Pair<Stone, Position> stoneJ = new Pair<Stone, Position>(new Stone(-'J',
+ StoneColor.BLACK), new Position(2.5f, 0));
+ Pair<Stone, Position> stoneR = new Pair<Stone, Position>(new Stone(-'R',
+ StoneColor.ORANGE), new Position(3.5f, 0));
+ Pair<Stone, Position> stoneu1 = new Pair<Stone, Position>(new Stone(-'u',
+ StoneColor.BLUE), new Position(4.5f, 0));
+ Pair<Stone, Position> stonem1 = new Pair<Stone, Position>(new Stone(-'m',
+ StoneColor.RED), new Position(5.5f, 0));
+ Pair<Stone, Position> stonem2 = new Pair<Stone, Position>(new Stone(-'m',
+ StoneColor.GREEN), new Position(6.5f, 0));
+ Pair<Stone, Position> stonei = new Pair<Stone, Position>(new Stone(-'i',
+ StoneColor.VIOLET), new Position(7.5f, 0));
+ Pair<Stone, Position> stonek = new Pair<Stone, Position>(new Stone(-'k',
+ StoneColor.AQUA), new Position(8.5f, 0));
+ Pair<Stone, Position> stoneu2 = new Pair<Stone, Position>(new Stone(-'u',
+ StoneColor.GRAY), new Position(9.5f, 0));
+ Pair<Stone, Position> stoneb = new Pair<Stone, Position>(new Stone(-'b',
+ StoneColor.BLACK), new Position(10.5f, 0));
+
Pair<Stone, Position> stone1 = new Pair<Stone, Position>(new Stone(
- StoneColor.RED), new Position(3.5f, 0));
+ StoneColor.RED), new Position(2, 1));
Pair<Stone, Position> stone2 = new Pair<Stone, Position>(new Stone(13,
- StoneColor.BLACK), new Position(5, 0));
+ StoneColor.BLACK), new Position(5, 1));
Pair<Stone, Position> stone3 = new Pair<Stone, Position>(new Stone(13,
- StoneColor.ORANGE), new Position(6, 0));
+ StoneColor.ORANGE), new Position(6, 1));
Pair<Stone, Position> stone4 = new Pair<Stone, Position>(new Stone(13,
- StoneColor.BLUE), new Position(7, 0));
+ StoneColor.BLUE), new Position(7, 1));
Pair<Stone, Position> stone5 = new Pair<Stone, Position>(new Stone(13,
- StoneColor.RED), new Position(8, 0));
+ StoneColor.RED), new Position(8, 1));
Pair<Stone, Position> stone6 = new Pair<Stone, Position>(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