<commit_before>package gui;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import com.sun.org.glassfish.gmbal.ManagedAttribute;

import model.Direction;
import model.Game;

/**
 * Announces the winner of each hand and allows the players to move on to the next hand.
 * @author <NAME>
 * @version April 13, 2015
 *
 */
public class NextHandGUI extends JPanel {

	private GameGUI gameGUI;

	private Game game;
	
	private JLabel winnerLabel ;

	public NextHandGUI(GameGUI gameGUI , Game game) {

		this.gameGUI = gameGUI;

		this.game = game;
		
		JPanel mainPanel = new JPanel() ;

		BoxLayout boxLayout = new BoxLayout(mainPanel, BoxLayout.Y_AXIS) ;
		
		mainPanel.setLayout(boxLayout);
		
		// add the JLabel that shows who the winners of the last hand are
		winnerLabel = GUIUtilities.createTitleLabel("Hand won by...");
		
		mainPanel.add(winnerLabel) ;
		
		// add vertical glue before the buttons
		mainPanel.add(Box.createRigidArea(new Dimension(500, 100)));
		mainPanel.add(Box.createVerticalGlue());
		
		mainPanel.add(createNextHandButton()) ;
		
		add(mainPanel, BorderLayout.CENTER) ;
	}

	/**
	 * Returns a String announcing the winners of the last hand
	 * @return A String announcing the winners of the last hand
	 */
	private String getWinnerText() {

		// ask game who the winners are
		String winnerText = "Hand is won by ";
		
		System.out.println("game is null " + game);

		game.determineHandWinner();

		Direction winner = game.getLastHandWinner();

		try {

			// figure out what the text should be
			if (winner.equals(Direction.NORTH)
					|| winner.equals(Direction.SOUTH)) {

				winnerText += "North and South";
<commit_msg>Tried to add sound. Not working.<commit_after>package gui;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import audio.SoundManager;

import com.sun.org.glassfish.gmbal.ManagedAttribute;

import model.Direction;
import model.Game;

/**
 * Announces the winner of each hand and allows the players to move on to the next hand.
 * @author <NAME>
 * @version April 13, 2015
 *
 */
public class NextHandGUI extends JPanel {

	private GameGUI gameGUI;

	private Game game;
	
	private JLabel winnerLabel ;

	public NextHandGUI(GameGUI gameGUI , Game game) {

		this.gameGUI = gameGUI;

		this.game = game;
		
		JPanel mainPanel = new JPanel() ;

		BoxLayout boxLayout = new BoxLayout(mainPanel, BoxLayout.Y_AXIS) ;
		
		mainPanel.setLayout(boxLayout);
		
		// add the JLabel that shows who the winners of the last hand are
		winnerLabel = GUIUtilities.createTitleLabel("Hand won by...");
		
		mainPanel.add(winnerLabel) ;
		
		// add vertical glue before the buttons
		mainPanel.add(Box.createRigidArea(new Dimension(500, 100)));
		mainPanel.add(Box.createVerticalGlue());
		
		mainPanel.add(createNextHandButton()) ;
		
		add(mainPanel, BorderLayout.CENTER) ;
	}

	/**
	 * Returns a String announcing the winners of the last hand
	 * @return A String announcing the winners of the last hand
	 */
	private String getWinnerText() {

		// ask game who the winners are
		String winnerText = "Hand is won by ";
		
		System.out.println("game is null " + game);

		game.determineHandWinner();

		Direction winner = game.getLastHandWinner();
		
		// TODO : add sound here
		
//		SoundManager soundManager = SoundManager.getInstance() ;
//		
//		soundManager.addSound(filename);

		try {

			// figure out what the text should be
			if (winner.equals(Direction.NORTH)
					|| winner.equals(Direction.SOUTH)) {

				winnerText += "North and South";

{'fraction_non_alphanumeric': 0.1015330485046494, 'fraction_numerical': 0.006031666247800955, 'mean_word_length': 3.7779111644657863, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1518550', 'n_tokens_mistral': 1380, 'n_tokens_neox': 1194, 'n_words': 361}