summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/impl/PlayerPanel.java
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-06-09 00:11:26 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-06-09 00:11:26 +0200
commit8c2e4a7d594028207f0bbf48890710856445c2b8 (patch)
tree438c9101a5f31c6925978caf334fd15ad64d3ae3 /src/jrummikub/view/impl/PlayerPanel.java
parent45d5b3ae10ed8cfbecb5489636093c6fb0576970 (diff)
downloadJRummikub-8c2e4a7d594028207f0bbf48890710856445c2b8.tar
JRummikub-8c2e4a7d594028207f0bbf48890710856445c2b8.zip
Man kann den Timer einstellen
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@391 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/view/impl/PlayerPanel.java')
-rw-r--r--src/jrummikub/view/impl/PlayerPanel.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/jrummikub/view/impl/PlayerPanel.java b/src/jrummikub/view/impl/PlayerPanel.java
index d69323f..77a493c 100644
--- a/src/jrummikub/view/impl/PlayerPanel.java
+++ b/src/jrummikub/view/impl/PlayerPanel.java
@@ -69,7 +69,7 @@ class PlayerPanel extends JPanel implements IPlayerPanel {
* Sets the current player name
*
* @param playerName
- * the player name
+ * the player name
*/
void setCurrentPlayerName(String playerName) {
currentPlayerNameLabel.setText(playerName);
@@ -88,7 +88,8 @@ class PlayerPanel extends JPanel implements IPlayerPanel {
}
@Override
- public void setTimeLeft(int time) {
+ public void setTime(int time, int totalTime) {
+ timeBar.setMaximum(totalTime);
timeBar.setValue(time);
timeBar.setString(Integer.toString(time / 60) + ":"
+ secondFormat.format(time % 60));
@@ -140,7 +141,8 @@ class PlayerPanel extends JPanel implements IPlayerPanel {
leftPanel.add(hasLaidOutLabel);
sortByGroupsButton = createButton(leftPanel,
- "<html><center>Nach Sammlungen sortieren", new ActionListener() {
+ "<html><center>Nach Sammlungen sortieren",
+ new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
sortByGroupsEvent.emit();
@@ -161,8 +163,8 @@ class PlayerPanel extends JPanel implements IPlayerPanel {
private void createRightPanel() {
rightPanel = new JPanel();
rightPanel.setLayout(null);
- rightPanel.setBorder(new EmptyBorder(SIDE_PANEL_INSET, SIDE_PANEL_INSET,
- SIDE_PANEL_INSET, SIDE_PANEL_INSET));
+ rightPanel.setBorder(new EmptyBorder(SIDE_PANEL_INSET,
+ SIDE_PANEL_INSET, SIDE_PANEL_INSET, SIDE_PANEL_INSET));
handRowUpButton = createButton(rightPanel, "<html><center>\u25B2",
new ActionListener() {
@@ -234,7 +236,8 @@ class PlayerPanel extends JPanel implements IPlayerPanel {
private void rescale() {
Insets insets = getInsets();
int x = insets.left, y = insets.top, width = getWidth() - insets.left
- - insets.right, height = getHeight() - insets.top - insets.bottom;
+ - insets.right, height = getHeight() - insets.top
+ - insets.bottom;
int boardWidth = hand.getWidth();
int handButtonWidth = (int) (width * HAND_ROW_BUTTON_RATIO);
int meanPanelWidth = (width - boardWidth) / 2;
@@ -243,8 +246,8 @@ class PlayerPanel extends JPanel implements IPlayerPanel {
leftPanel.setBounds(x, y, leftPanelWidth, height);
hand.setBounds(x + leftPanelWidth, y, boardWidth, height);
- rightPanel.setBounds(x + leftPanelWidth + boardWidth, y, rightPanelWidth,
- height);
+ rightPanel.setBounds(x + leftPanelWidth + boardWidth, y,
+ rightPanelWidth, height);
leftPanel.validate();
rightPanel.validate();
@@ -252,7 +255,8 @@ class PlayerPanel extends JPanel implements IPlayerPanel {
void updateButtons() {
handRowUpButton.setEnabled(hand.canRowUp());
- handRowUpButton.setForeground(hand.canRowUp() ? Color.BLACK : Color.GRAY);
+ handRowUpButton.setForeground(hand.canRowUp() ? Color.BLACK
+ : Color.GRAY);
handRowDownButton.setEnabled(hand.canRowDown());
handRowDownButton.setForeground(hand.canRowDown() ? Color.BLACK
: Color.GRAY);