summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-05-31 05:00:22 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-05-31 05:00:22 +0200
commit0e9bf5c52d9542208bd8f23e57901b1d3844dd68 (patch)
treeb4115613bc9fbc5d50359a81b10ecf7e8f75b6a7 /src/jrummikub/view
parent061e7ab305cd6eb16b8ea35987b30a838386ddee (diff)
downloadJRummikub-0e9bf5c52d9542208bd8f23e57901b1d3844dd68.tar
JRummikub-0e9bf5c52d9542208bd8f23e57901b1d3844dd68.zip
Remove color toggle button margins
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@347 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/view')
-rw-r--r--src/jrummikub/view/impl/SettingsPanel.java1
-rw-r--r--src/jrummikub/view/impl/StonePainter.java15
2 files changed, 10 insertions, 6 deletions
diff --git a/src/jrummikub/view/impl/SettingsPanel.java b/src/jrummikub/view/impl/SettingsPanel.java
index 3f577cc..4374640 100644
--- a/src/jrummikub/view/impl/SettingsPanel.java
+++ b/src/jrummikub/view/impl/SettingsPanel.java
@@ -330,6 +330,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
private void createColorButton(final StoneColor color) {
JToggleButton button = new JToggleButton(ImageUtil.createColorIcon(
StonePainter.getColor(color), 12, 1));
+ button.setMargin(new Insets(0, 0, 0, 0));
button.addChangeListener(new ChangeListener() {
@Override
diff --git a/src/jrummikub/view/impl/StonePainter.java b/src/jrummikub/view/impl/StonePainter.java
index 6b7e402..09b6dcc 100644
--- a/src/jrummikub/view/impl/StonePainter.java
+++ b/src/jrummikub/view/impl/StonePainter.java
@@ -159,8 +159,8 @@ class StonePainter {
return img;
}
- private BufferedImage getStoneImage(StoneColor color, int value, boolean selected,
- boolean hovered) {
+ private BufferedImage getStoneImage(StoneColor color, int value,
+ boolean selected, boolean hovered) {
Map<StoneColor, Map<Integer, BufferedImage>> stoneMap;
if (selected) {
@@ -311,7 +311,8 @@ class StonePainter {
g.setFont(new Font("SansSerif", Font.BOLD, r.height / 4));
FontMetrics fm = g.getFontMetrics();
- String value = (v > 0) ? Integer.toString(v) : Character.toString((char)(-v));
+ String value = (v > 0) ? Integer.toString(v) : Character
+ .toString((char) (-v));
Rectangle2D stringRect = fm.getStringBounds(value, g);
if (scale > 1) {
@@ -359,10 +360,12 @@ class StonePainter {
int x = Math.round(p.getX() * width), y = Math.round(p.getY() * height);
if (stone.isJoker()) {
- g.drawImage(getStoneImage(stone.getColor(), 0, selected, hovered), x, y, null);
- } else {
- g.drawImage(getStoneImage(stone.getColor(), stone.getValue(), selected, hovered), x, y,
+ g.drawImage(getStoneImage(stone.getColor(), 0, selected, hovered), x, y,
null);
+ } else {
+ g.drawImage(
+ getStoneImage(stone.getColor(), stone.getValue(), selected, hovered),
+ x, y, null);
}
}
}