<commit_before>package nl.mpi.kinnate.ui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JTabbedPane;

/**
 *  Document   : DocumentNewMenu
 *  Created on : Sep 27, 2011, 10:33:29 AM
 *  Author     : <NAME>
 */
public class DocumentNewMenu extends JMenu implements ActionListener {

    JTabbedPane targetPane;

    public enum DocumentType {

        KinTypeString("Kin Type String"),
        KinTerms("Kin Terms"),
        Query("Kin Type String Query"),
        ArchiveLinker("Archive Data Linker"),
        EntitySearch("Entity Search"),
        CustomQuery("Custom Metadata"),
        Simple("Standard");
        private String displayName;

        private DocumentType(String displayName) {
            this.displayName = displayName;
        }

        public String getDisplayName() {
            return displayName;
        }
    }

    public DocumentNewMenu(JTabbedPane targetPane) {
        this.targetPane = targetPane;
        for (DocumentType documentType : DocumentType.values()) {
            JMenuItem menuItem = new JMenuItem(documentType.getDisplayName());
            menuItem.setActionCommand(documentType.name());
            menuItem.addActionListener(this);
            this.add(menuItem);
        }
    }

    public void actionPerformed(ActionEvent e) {
        DocumentType documentType = DocumentType.valueOf(e.getActionCommand());
        KinDiagramPanel egoSelectionTestPanel = new KinDiagramPanel(documentType);
        targetPane.add("Unsaved " + documentType.getDisplayName() + " Diagram", egoSelectionTestPanel);
        targetPane.setSelectedComponent(egoSelectionTestPanel);
    }
}
<commit_msg>Added error handling and user feedback when an entity identifier on the diagram cannot be read. Moved the kin term panels from the kin term groups panel directly into the right side panel. Updated the menu items for the kin terms and archive menus so the hide show actions work with the layout changes. Handled issues when an older format or non kinship svg file is opened so that the file can then be used as normal. This includes adding the default symbol definitions and the default settings. Added the term freeform diagram to the menu.<commit_after>package nl.mpi.kinnate.ui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JTabbedPane;

/**
 *  Document   : DocumentNewMenu
 *  Created on : Sep 27, 2011, 10:33:29 AM
 *  Author     : <NAME>
 */
public class DocumentNewMenu extends JMenu implements ActionListener {

    JTabbedPane targetPane;

    public enum DocumentType {

        Freeform("Freeform Diagram"),
        KinTerms("Kin Terms Diagram"),
        Query("Kin Type String Query"),
        ArchiveLinker("Archive Data Linker"),
        EntitySearch("Entity Search"),
        CustomQuery("Custom Metadata"),
        Simple("Standard");
        private String displayName;

        private DocumentType(String displayName) {
            this.displayName = displayName;
        }

        public String getDisplayName() {
            return displayName;
        }
    }

    public DocumentNewMenu(JTabbedPane targetPane) {
        this.targetPane = targetPane;
        for (DocumentType documentType : DocumentType.values()) {
            JMenuItem menuItem = new JMenuItem(documentType.getDisplayName());
            menuItem.setActionCommand(documentType.name());
            menuItem.addActionListener(this);
            this.add(menuItem);
        }
    }

    public void actionPerformed(ActionEvent e) {
        DocumentType documentType = DocumentType.valueOf(e.getActionCommand());
        KinDiagramPanel egoSelectionTestPanel = new KinDiagramPanel(documentType);
        targetPane.add("Unsaved " + documentType.getDisplayName() + " Diagram", egoSelectionTestPanel);
        targetPane.setSelectedComponent(egoSelectionTestPanel);
    }
}

{'fraction_non_alphanumeric': 0.08393704721458906, 'fraction_numerical': 0.005995503372470647, 'mean_word_length': 3.1363636363636362, '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': '2367671', 'n_tokens_mistral': 1057, 'n_tokens_neox': 1011, 'n_words': 290}