summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/impl/StoneCollection.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/view/impl/StoneCollection.java')
-rw-r--r--src/jrummikub/view/impl/StoneCollection.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/jrummikub/view/impl/StoneCollection.java b/src/jrummikub/view/impl/StoneCollection.java
index 95813da..a374dd2 100644
--- a/src/jrummikub/view/impl/StoneCollection.java
+++ b/src/jrummikub/view/impl/StoneCollection.java
@@ -13,6 +13,9 @@ import jrummikub.model.Position;
import jrummikub.model.Stone;
import jrummikub.view.IStoneCollection;
+/**
+ * Implementation of the stone collection (selection)
+ */
@SuppressWarnings("serial")
class StoneCollection extends StonePanel implements IStoneCollection {
private final static int INSET = 7;
@@ -20,6 +23,9 @@ class StoneCollection extends StonePanel implements IStoneCollection {
private Collection<Stone> selectedStones = Collections.emptyList();
+ /**
+ * Creates a new StoneCollection instance
+ */
StoneCollection() {
super(STONE_SCALE);
@@ -28,6 +34,12 @@ class StoneCollection extends StonePanel implements IStoneCollection {
setBorder(new EmptyBorder(INSET, INSET, INSET, INSET));
}
+ /**
+ * Sets the stones to be shown in the collection
+ *
+ * @param stones
+ * the selected stones
+ */
void setSelectedStones(Collection<Stone> stones) {
selectedStones = stones;
@@ -56,8 +68,7 @@ class StoneCollection extends StonePanel implements IStoneCollection {
float xpos = 0;
for (Stone stone : selectedStones) {
- getStonePainter().paintStone(g, stone, new Position(xpos, 0),
- false);
+ getStonePainter().paintStone(g, stone, new Position(xpos, 0), false);
xpos++;
}
}