summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-04-30 21:50:26 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-04-30 21:50:26 +0200
commite45610ece685de5bcb35b9f49d03f1de2719370a (patch)
tree069f0c3bfa9de9e3c719ddba935ea02882ff5bfe
parent1b15b71a54932a28343917aeeade66d9fc17a550 (diff)
downloadJRummikub-e45610ece685de5bcb35b9f49d03f1de2719370a.tar
JRummikub-e45610ece685de5bcb35b9f49d03f1de2719370a.zip
Move paintStoneSet from StonePainter to Table
It's only used there, and highlighting stones is easier like this. git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@35 72836036-5685-4462-b002-a69064685172
-rw-r--r--src/jrummikub/view/impl/StonePainter.java11
-rw-r--r--src/jrummikub/view/impl/Table.java12
2 files changed, 11 insertions, 12 deletions
diff --git a/src/jrummikub/view/impl/StonePainter.java b/src/jrummikub/view/impl/StonePainter.java
index c1b6d2c..fa039f7 100644
--- a/src/jrummikub/view/impl/StonePainter.java
+++ b/src/jrummikub/view/impl/StonePainter.java
@@ -205,15 +205,4 @@ class StonePainter {
paintCircle(g, x, y, width, height);
}
-
-
- public void paintStoneSet(Graphics2D g, StoneSet stoneSet, Position pos) {
- float x = pos.getX();
-
- for(Stone stone : stoneSet){
- paintStone(g, stone, new Position(x, pos.getY()));
- x++;
- }
-
- }
}
diff --git a/src/jrummikub/view/impl/Table.java b/src/jrummikub/view/impl/Table.java
index 23ce19d..a8c513e 100644
--- a/src/jrummikub/view/impl/Table.java
+++ b/src/jrummikub/view/impl/Table.java
@@ -16,6 +16,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel;
import jrummikub.model.Position;
+import jrummikub.model.Stone;
import jrummikub.model.StoneSet;
import jrummikub.util.Event1;
import jrummikub.util.IEvent1;
@@ -94,6 +95,15 @@ public class Table extends JPanel implements ITable {
});
}
+ public void paintStoneSet(Graphics2D g, StoneSet stoneSet, Position pos) {
+ float x = pos.getX();
+
+ for(Stone stone : stoneSet){
+ stonePainter.paintStone(g, stone, new Position(x, pos.getY()));
+ x++;
+ }
+ }
+
@Override
protected void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
@@ -108,7 +118,7 @@ public class Table extends JPanel implements ITable {
RenderingHints.VALUE_ANTIALIAS_ON);
for (Map.Entry<StoneSet, Position> stoneSet : stoneSets.entrySet()) {
- stonePainter.paintStoneSet(g, stoneSet.getKey(), stoneSet.getValue());
+ paintStoneSet(g, stoneSet.getKey(), stoneSet.getValue());
}
}
}