<commit_before>import java.awt.*;
import java.awt.event.*;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.sound.sampled.*;
import java.io.*;

/** GameOverMenu opens a JFrame diplays the Game Over Screen and prompts the user(s) to play again
    @author <NAME>
    @author <NAME>
    @author <NAME>
    @author <NAME>
    @version 1.0
*/


public class GameOverMenu{
    JFrame jf;
    String name;
    // Two buttons on game over menu
    public PlayMenu playMenu;


    public GameOverMenu(Player p)
    {
	jf = new JFrame("Game Over!");
	setUpBackgroundImage( "./levSelResources/game_over02.jpg" );
	addMainButtonPanel();

	name = p.getName();

	jf.setSize(600, 600);
	
	
	jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	jf.setVisible(true);
    }
    
    // adds Tanks background
    public void setUpBackgroundImage( String file )
    {
	try{
	    jf.add( new menuBackground( file ) );
	}catch( IOException ioe ){
	    ioe.printStackTrace();
	}
    }
    
    // The two buttons on the game over menu: play again and back to main menu
    private void addMainButtonPanel() {

	JPanel mainButtonPanel = new JPanel();

	// play button
	JButton playBtn = new JButton( "Play Again!" );
	JButton quitBtn = new JButton( "Close!" );
	JLabel loserNameBtn = new JLabel(name + " LOSES!");
	mainButtonPanel.add(playBtn);
	mainButtonPanel.add(loserNameBtn);
	mainButtonPanel.add(quitBtn);
	playBtn.setFocusable( false );
	playBtn.addActionListener( new PlayAgainListener() );
	quitBtn.addActionListener( new QuitListener() );

	// how to play button
/*	JButton quitBtn = new JButton( "Back to Main Menu" );
	mainButtonPanel.add(htpBtn);
	htpBtn.setFocusable( false );
	htpBtn.addActionListener( new BackToMainListener() );
*/
	jf.add( mainButtonPanel, BorderLayout.SOUTH );

    }

 
    // Play Button action
    class PlayAgainListener implements ActionListener{
	public void actionPerformed( ActionEvent ae ){
		if( playMenu == null )
			{
		    playMenu = new PlayMenu();
			jf.dispose();
			}
		else
			{
			playMenu.setToVisible();
			jf.dispose();
			}
	}
    }
	
	//Quit Action
	class QuitListener implements ActionListener{
	public void actionPerformed ( ActionEvent ae){
		System.exit(0);
		}
	}
/*    
    // BackToMainMenuListener Button action
    class BackToMainMenuListener implements ActionListener{
	public void actionPerformed( ActionEvent ae ){
	    	jf.setVisible(false);
	}
    }
*/
}


<commit_msg>javadoc included in source files<commit_after>import java.awt.*;
import java.awt.event.*;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.sound.sampled.*;
import java.io.*;

/** GameOverMenu opens a JFrame diplays the Game Over Screen and prompts the user(s) to play again
    @author <NAME>
    @author <NAME>
    @author <NAME>
    @author <NAME>
    @version 1.0
*/


public class GameOverMenu{
    JFrame jf;
    String name;
    // Two buttons on game over menu
    public PlayMenu playMenu;

    /** constructor
	@param p Winning Player's name
    */
    public GameOverMenu(Player p)
    {
	jf = new JFrame("Game Over!");
	setUpBackgroundImage( "./levSelResources/game_over02.jpg" );
	addMainButtonPanel();

	name = p.getName();

	jf.setSize(600, 600);
	
	
	jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	jf.setVisible(true);
    }
    
    /**
	Retrieves background image to be displayed on panel
    */

    public void setUpBackgroundImage( String file )
    {
	try{
	    jf.add( new menuBackground( file ) );
	}catch( IOException ioe ){
	    ioe.printStackTrace();
	}
    }
    
    /**
	Puts two buttons on the game over menu: play again and back to main menu
    */
    private void addMainButtonPanel() {

	JPanel mainButtonPanel = new JPanel();

	// play button
	JButton playBtn = new JButton( "Play Again!" );
	JButton quitBtn = new JButton( "Close!" );
	JLabel loserNameBtn = new JLabel(name + " LOSES!");
	mainButtonPanel.add(playBtn);
	mainButtonPanel.add(loserNameBtn);
	mainButtonPanel.add(quitBtn);
	playBtn.setFocusable( false );
	playBtn.addActionListener( new PlayAgainListener() );
	quitBtn.addActionListener( new QuitListener() );

	jf.add( mainButtonPanel, BorderLayout.SOUTH );

    }

 
    // Play Button action
    class PlayAgainListener implements ActionListener{

    /**
	Called when Play Again! button is pressed
	Calls playMenu so the player can play again
    */
	public void actionPerformed( ActionEvent ae ){
		if( playMenu == null )
			{
		    playMenu = new PlayMenu();
			jf.dispose();
			}
		else
			{
			playMenu.setToVisible();
			jf.dispose();
			}
	}
    }
	
	//Quit Action
     class QuitListener implements ActionListener{

    /**
	Called when Close! button is pressed
	Terminates program
    */
	public void actionPerformed ( ActionEvent ae){
		System.exit(0);
	}
     }
}



{'fraction_non_alphanumeric': 0.11136648558295027, 'fraction_numerical': 0.00459674049310489, 'mean_word_length': 3.2779267202859694, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1185140', 'n_tokens_mistral': 1644, 'n_tokens_neox': 1528, 'n_words': 419}