summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/view/impl')
-rw-r--r--src/jrummikub/view/impl/Board.java3
-rw-r--r--src/jrummikub/view/impl/CustomBorder.java43
-rw-r--r--src/jrummikub/view/impl/View.java5
3 files changed, 5 insertions, 46 deletions
diff --git a/src/jrummikub/view/impl/Board.java b/src/jrummikub/view/impl/Board.java
index 864b764..b6d92a8 100644
--- a/src/jrummikub/view/impl/Board.java
+++ b/src/jrummikub/view/impl/Board.java
@@ -14,6 +14,7 @@ import java.util.Collections;
import java.util.Map;
import javax.swing.ImageIcon;
+import javax.swing.border.MatteBorder;
import jrummikub.model.Position;
import jrummikub.model.Stone;
@@ -39,7 +40,7 @@ class Board extends StonePanel implements IBoard {
private Collection<Stone> selectedStones = Collections.emptyList();
Board() {
- setBorder(new CustomBorder(Color.DARK_GRAY, 0, 1, 0, 1));
+ setBorder(new MatteBorder(0, 1, 0, 1, Color.DARK_GRAY));
addComponentListener(new ComponentAdapter() {
diff --git a/src/jrummikub/view/impl/CustomBorder.java b/src/jrummikub/view/impl/CustomBorder.java
deleted file mode 100644
index eae0589..0000000
--- a/src/jrummikub/view/impl/CustomBorder.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package jrummikub.view.impl;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-
-import javax.swing.border.Border;
-
-class CustomBorder implements Border {
- private Color color;
- private int top, left, bottom, right;
-
- public CustomBorder(Color color, int top, int left, int bottom, int right) {
- this.color = color;
- this.top = top;
- this.left = left;
- this.bottom = bottom;
- this.right = right;
- }
-
- @Override
- public Insets getBorderInsets(Component c) {
- return new Insets(top, left, bottom, right);
- }
-
- @Override
- public boolean isBorderOpaque() {
- return true;
- }
-
- @Override
- public void paintBorder(Component c, Graphics g, int x, int y, int width,
- int height) {
- g.setColor(color);
-
- g.fillRect(x, y, width, top);
- g.fillRect(x, y + height - bottom, width, bottom);
- g.fillRect(x, y, left, height);
- g.fillRect(x + width - right, y, right, height);
- }
-
-}
diff --git a/src/jrummikub/view/impl/View.java b/src/jrummikub/view/impl/View.java
index 0eabd43..2d09b05 100644
--- a/src/jrummikub/view/impl/View.java
+++ b/src/jrummikub/view/impl/View.java
@@ -7,6 +7,7 @@ import java.awt.event.ComponentEvent;
import java.util.Collection;
import javax.swing.JFrame;
+import javax.swing.border.MatteBorder;
import jrummikub.model.Stone;
import jrummikub.view.IPlayerPanel;
@@ -45,8 +46,8 @@ public class View extends JFrame implements IView {
add(table);
playerPanel = new PlayerPanel();
- playerPanel.setBorder(new CustomBorder(Color.BLACK,
- PLAYER_PANEL_BORDER_WIDTH, 0, 0, 0));
+ playerPanel.setBorder(new MatteBorder(PLAYER_PANEL_BORDER_WIDTH, 0, 0, 0,
+ Color.BLACK));
add(playerPanel);
addComponentListener(new ComponentAdapter() {