<commit_before>package org.helioviewer.jhv.plugins.swek.view;

import java.util.HashMap;
import java.util.Map;

import javax.swing.Icon;
import javax.swing.ImageIcon;

import org.helioviewer.jhv.plugins.swek.SWEKPlugin;

/**
 * An Icon bank for the SWEK plugin.
 * 
 * @author <NAME> (<EMAIL>)
 * 
 */
public class SWEKIconBank {
    /** The instance of the SWEK icon bank */
    private static SWEKIconBank singletonInstance;

    /** the icon bank */
    private final Map<String, Icon> iconBank;

    /**
     * Private default constructor.
     */
    private SWEKIconBank() {
        iconBank = new HashMap<String, Icon>();
        initIconBank();
    }

    /**
     * Gets the singleton instance of the SWEK icon bank.
     * 
     * @return the instance of the SWEK icon bank
     */
    public static SWEKIconBank getSingletonInstance() {
        if (singletonInstance == null) {
            singletonInstance = new SWEKIconBank();
        }
        return singletonInstance;
    }

    /**
     * Adds a new Icon to the icon bank.
     * 
     * @param eventType
     *            the event type for which an icon was added
     * @param icon
     *            the icon corresponding to the event
     */
    public void addIcon(String eventType, ImageIcon icon) {
        iconBank.put(eventType, icon);
    }

    /**
     * Initializes the icon bank. Adds all the standard icons to the iconbank.
     */
    private void initIconBank() {
        iconBank.put("ActiveRegion", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/ar_icon.png")));
        iconBank.put("CoronalDimming", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/cd_icon.png")));
        iconBank.put("CME", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/ce_icon.png")));
        iconBank.put("CoronalHole", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/ch_icon.png")));
        iconBank.put("CoronalWave", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/cw_icon.png")));
        iconBank.put("EmergingFlux", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/ef_icon.png")));
        iconBank.put("FilamentActivation", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/fa_icon.png")));
        iconBank.put("FilamentEruption", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/fe_icon.png")));
        iconBank.put("Filament", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/fi_icon.png")));
        iconBank.put("Flare", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/fl_icon.png")));
        iconBank.put("Loop", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/lp_icon.png")));
        iconBank.put("NothingReported", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/nr_icon.png")));
        iconBank.put("Oscillation", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/os_icon.png")));
        iconBank.put("Other", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/ot_icon.png")));
        iconBank.put("Sigmoid", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/sg_icon.png")));
        iconBank.put("SpraySurge", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/sp_icon.png")));
        iconBank.put("SunSpot", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/ss_icon.png")));
    }
}<commit_msg>Added eruption icon and get method<commit_after>package org.helioviewer.jhv.plugins.swek.view;

import java.util.HashMap;
import java.util.Map;

import javax.swing.Icon;
import javax.swing.ImageIcon;

import org.helioviewer.jhv.plugins.swek.SWEKPlugin;

/**
 * An Icon bank for the SWEK plugin.
 * 
 * @author <NAME> (<EMAIL>)
 * 
 */
public class SWEKIconBank {
    /** The instance of the SWEK icon bank */
    private static SWEKIconBank singletonInstance;

    /** the icon bank */
    private final Map<String, Icon> iconBank;

    /**
     * Private default constructor.
     */
    private SWEKIconBank() {
        iconBank = new HashMap<String, Icon>();
        initIconBank();
    }

    /**
     * Gets the singleton instance of the SWEK icon bank.
     * 
     * @return the instance of the SWEK icon bank
     */
    public static SWEKIconBank getSingletonInstance() {
        if (singletonInstance == null) {
            singletonInstance = new SWEKIconBank();
        }
        return singletonInstance;
    }

    /**
     * Adds a new Icon to the icon bank.
     * 
     * @param eventType
     *            the event type for which an icon was added
     * @param icon
     *            the icon corresponding to the event
     */
    public void addIcon(String eventType, ImageIcon icon) {
        iconBank.put(eventType, icon);
    }

    /**
     * Gets the Icon for the given icon name.
     * 
     * @param iconName
     *            the name of the icon.
     * @return the icon corresponding with the given name or the "other" icon if
     *         the name was not known.
     */
    public Icon getIcon(String iconName) {
        Icon tempIcon = iconBank.get(iconName);
        if (tempIcon == null) {
            return iconBank.get("Other");
        } else {
            return tempIcon;
        }
    }

    /**
     * Initializes the icon bank. Adds all the standard icons to the iconbank.
     */
    private void initIconBank() {
        iconBank.put("ActiveRegion", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/ar_icon.png")));
        iconBank.put("CoronalDimming", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/cd_icon.png")));
        iconBank.put("CME", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/ce_icon.png")));
        iconBank.put("CoronalHole", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/ch_icon.png")));
        iconBank.put("CoronalWave", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/cw_icon.png")));
        iconBank.put("EmergingFlux", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/ef_icon.png")));
        iconBank.put("Eruption", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/er_small.gif")));
        iconBank.put("FilamentActivation", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/fa_icon.png")));
        iconBank.put("FilamentEruption", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/fe_icon.png")));
        iconBank.put("Filament", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/fi_icon.png")));
        iconBank.put("Flare", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/fl_icon.png")));
        iconBank.put("Loop", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/lp_icon.png")));
        iconBank.put("NothingReported", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/nr_icon.png")));
        iconBank.put("Oscillation", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/os_icon.png")));
        iconBank.put("Other", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/ot_icon.png")));
        iconBank.put("Plage", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/pg_icon.png")));
        iconBank.put("Sigmoid", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/sg_icon.png")));
        iconBank.put("SpraySurge", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/sp_icon.png")));
        iconBank.put("SunSpot", new ImageIcon(SWEKPlugin.class.getResource("/images/EventIcons/ss_icon.png")));
    }
}
{'fraction_non_alphanumeric': 0.13365029054410987, 'fraction_numerical': 0.0, 'mean_word_length': 3.3101878201479793, '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': '6651080', 'n_tokens_mistral': 2380, 'n_tokens_neox': 2366, 'n_words': 427}