diff options
Diffstat (limited to 'src/jrummikub/view/impl/HandPanel.java')
-rw-r--r-- | src/jrummikub/view/impl/HandPanel.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/jrummikub/view/impl/HandPanel.java b/src/jrummikub/view/impl/HandPanel.java index c07bee0..ebe4f54 100644 --- a/src/jrummikub/view/impl/HandPanel.java +++ b/src/jrummikub/view/impl/HandPanel.java @@ -140,6 +140,9 @@ class HandPanel extends AbstractStonePanel implements IHandPanel { playerPanel.updateButtons(); } + /** + * Updates panel after visible row changed + */ void rowUp() { currentRow--; repaintAll = true; @@ -148,6 +151,9 @@ class HandPanel extends AbstractStonePanel implements IHandPanel { playerPanel.updateButtons(); } + /** + * Updates panel after visible row changed + */ void rowDown() { currentRow++; repaintAll = true; @@ -163,10 +169,20 @@ class HandPanel extends AbstractStonePanel implements IHandPanel { playerPanel.updateButtons(); } + /** + * Is there a higher row than the current row + * + * @return higher row present + */ boolean canRowUp() { return (currentRow > 0); } + /** + * Is there a lower row than the current row + * + * @return higher row present + */ boolean canRowDown() { return (currentRow < maxRow); } @@ -188,6 +204,13 @@ class HandPanel extends AbstractStonePanel implements IHandPanel { repaint(); } + /** + * Rescales the hand panel according to window size + * + * @param height + * of hand panel + * @return width of hand panel + */ int rescale(int height) { Insets insets = getInsets(); int size = (height - insets.top - insets.bottom) / HEIGHT; |