Skip to content

Commit

Permalink
Puts the manual estimation panel into the card in OpenGameView
Browse files Browse the repository at this point in the history
Reported-by: bnurbekov
Signed-off-by: Batyrlan Nurbekov <[email protected]>
  • Loading branch information
bnurbekov committed May 4, 2014
1 parent 841c8b2 commit 337e566
Showing 1 changed file with 17 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
******************************************************************************/
package edu.wpi.cs.wpisuitetng.modules.PlanningPoker.views;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
Expand All @@ -38,6 +42,8 @@
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;

import com.sun.awt.AWTUtilities;

import edu.wpi.cs.wpisuitetng.janeway.config.ConfigManager;
import edu.wpi.cs.wpisuitetng.modules.PlanningPoker.controller.AddPlanningPokerVoteController;
import edu.wpi.cs.wpisuitetng.modules.PlanningPoker.controller.GetPlanningPokerGamesController;
Expand Down Expand Up @@ -250,46 +256,19 @@ private void populateWithNoCardDeckPanel() {
textArea.setBorder(BorderFactory.createLineBorder(Color.black, 1));
textArea.setColumns(2);
textArea.setRows(1);
textArea.setOpaque(false);

JPanel card = new CardImgPanel();

card.setPreferredSize(new Dimension(120, 170));
card.setBorder(javax.swing.BorderFactory
.createLineBorder(new java.awt.Color(153, 153, 153)));

PlayingCardJPanel card = new PlayingCardJPanel(
0, false);
////////////////////Bug is here!!!!
cards.add(card);
////////////////////
allCardsPanel.add(card, gridBagConstraints);
card.add(textArea);
card.repaint();
card.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent evt) {
PlayingCardJPanel clickedCard = (PlayingCardJPanel) evt
.getSource();
clickedCard.toggle();
updateEstimateTotal();// Vote value

// Requirement ID
// @TODO: Get selected requirement ID
int requirementID = requirements.get(
requirementList.getSelectedIndex()).getId();

// Game name
String gameName = game.getGameName();

// User name
String userName = ConfigManager.getConfig().getUserName();

// Vote
if (estimateNumberLabel.getText().equals("?")) {
submitButton.setEnabled(false);
} else {
submitButton.setEnabled(true);
ppv = new PlanningPokerVote(gameName, userName, Integer
.parseInt(estimateNumberLabel.getText()),
requirementID);
}
}
});
card.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
card.add(textArea, gbc);

card.repaint();
allCardsPanel.add(card, gridBagConstraints);
}

Expand Down

0 comments on commit 337e566

Please sign in to comment.