<commit_before>package gameEngine.view.store;

import gameEngine.model.TowerInfo;
import gameEngine.view.Panel;
import gameEngine.view.StyleConstants;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.border.Border;


/**
 * Panel that displays tower information
 * when user hovers over a tower option
 * 
 * @author <NAME>
 * 
 */
public class TowerInfoPanel extends Panel {

    private JList<String> myList;
    private DefaultListModel<String> myListModel;

    public TowerInfoPanel () {
        super();

        Border valuePanelBorder =
                BorderFactory.createTitledBorder(StyleConstants.resourceBundle
                        .getString("TowerInfo"));
        setBorder(valuePanelBorder);

        initializeContents();

    }

    /**
     * Initlizes JList contents and adds
     */
    private void initializeContents () {
        myListModel = new DefaultListModel<String>();
        myList = new JList<String>(myListModel);

        JScrollPane listScrollPane = new JScrollPane(myList);
        listScrollPane.setSize(10, 10);
        add(listScrollPane);

    }

    @Override
    /** A method that is called by the Mediator to 
     * update the information this panel displays
     */
    public void displayTowerInfo (TowerInfo tower) {
        // ImageIcon icon = new ImageIcon(tower.getImage());
        myListModel.clear();
        myListModel.addElement(TowerInfoFields.NAME + tower.getName());
        myListModel.addElement(TowerInfoFields.COST + Integer.toString(tower.getCost()));
        myListModel.addElement(TowerInfoFields.DESCRIPTION + tower.getDescription());

    }

}<commit_msg>Fixed bug in info panel<commit_after>package gameEngine.view.store;

import gameEngine.model.TowerInfo;
import gameEngine.view.Panel;
import gameEngine.view.StyleConstants;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.border.Border;


/**
 * Panel that displays tower information
 * when user hovers over a tower option
 * 
 * @author <NAME>
 * 
 */
public class TowerInfoPanel extends Panel {

    private JList myList;
    private DefaultListModel myListModel;

    public TowerInfoPanel () {
        super();

        Border valuePanelBorder =
                BorderFactory.createTitledBorder(StyleConstants.resourceBundle
                        .getString("TowerInfo"));
        setBorder(valuePanelBorder);

        initializeContents();

    }

    /**
     * Initlizes JList contents and adds
     */
    private void initializeContents () {
        myListModel = new DefaultListModel();
        myList = new JList(myListModel);

        JScrollPane listScrollPane = new JScrollPane(myList);
        listScrollPane.setSize(10, 10);
        add(listScrollPane);

    }

    @Override
    /** A method that is called by the Mediator to 
     * update the information this panel displays
     */
    public void displayTowerInfo (TowerInfo tower) {
        // ImageIcon icon = new ImageIcon(tower.getImage());
        myListModel.clear();
        myListModel.addElement(TowerInfoFields.NAME + tower.getName());
        myListModel.addElement(TowerInfoFields.COST + Integer.toString(tower.getCost()));
        myListModel.addElement(TowerInfoFields.DESCRIPTION + tower.getDescription());

    }

}
{'fraction_non_alphanumeric': 0.09329446064139942, 'fraction_numerical': 0.0023323615160349854, 'mean_word_length': 3.079667063020214, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7382689', 'n_tokens_mistral': 957, 'n_tokens_neox': 911, 'n_words': 214}