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

import nl.mpi.kinnate.ui.window.DiagramWindowManager;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import nl.mpi.kinnate.KinTermSavePanel;
import nl.mpi.kinnate.kindata.VisiblePanelSetting.PanelType;

/**
 *  Document   : KinTermsMenu
 *  Created on : Apr 1, 2011, 9:32:40 AM
 *  Author     : <NAME>
 */
public class KinTermsMenu extends JMenu {

    DiagramWindowManager diagramWindowManager;
    KinTermSavePanel currentKinTermSavePanel;
    JCheckBoxMenuItem hideShowMenu;
    JMenuItem newMenu;
    JMenuItem exportMenu;
    JMenuItem importMenu;
    JMenuItem deleteMenu;

    public KinTermsMenu(DiagramWindowManager diagramWindowManager) {
        this.diagramWindowManager = diagramWindowManager;
        initMenu();
    }

    public KinTermsMenu() {
        initMenu();
    }

    private void initMenu() {
        hideShowMenu = new JCheckBoxMenuItem("Show");
        newMenu = new JMenuItem("New Kin Term Group");
        exportMenu = new JMenuItem("Export");
        importMenu = new JMenuItem("Import");
        deleteMenu = new JMenuItem("Delete");
        this.setText("Kin Terms");
        this.add(hideShowMenu);
        this.add(newMenu);
        this.add(importMenu);
        this.add(exportMenu);
        this.add(deleteMenu);
        this.addMenuListener(new javax.swing.event.MenuListener() {

            public void menuSelected(javax.swing.event.MenuEvent evt) {<commit_msg>Separated the file menu from the MainFrame class. Created a diagram window manager class and moved relevant code out of the MainFrame into the new class. Added a check for unsaved diagrams on application close. Separated out the edit menu into a different class. Updated the import data menu. Updated the edit menu to use the SavePanel and better handle hot keys. Completed the code to expand the diagram selection to include immediate relations and enabled its menu item in the edit menu. Refactored the menu classes. Created an abstract diagram manager class so that the tabbed pane can be optionally replaced by separate windows or a jdesktop pane. Added a window select menu for when the tab pane is not used.<commit_after>package nl.mpi.kinnate.ui.menu;

import javax.swing.JCheckBoxMenuItem;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import nl.mpi.kinnate.KinTermSavePanel;
import nl.mpi.kinnate.kindata.VisiblePanelSetting.PanelType;
import nl.mpi.kinnate.ui.window.AbstractDiagramManager;

/**
 *  Document   : KinTermsMenu
 *  Created on : Apr 1, 2011, 9:32:40 AM
 *  Author     : <NAME>
 */
public class KinTermsMenu extends JMenu {

    AbstractDiagramManager diagramWindowManager;
    KinTermSavePanel currentKinTermSavePanel;
    JCheckBoxMenuItem hideShowMenu;
    JMenuItem newMenu;
    JMenuItem exportMenu;
    JMenuItem importMenu;
    JMenuItem deleteMenu;

    public KinTermsMenu(AbstractDiagramManager diagramWindowManager) {
        this.diagramWindowManager = diagramWindowManager;
        initMenu();
    }

    public KinTermsMenu() {
        initMenu();
    }

    private void initMenu() {
        hideShowMenu = new JCheckBoxMenuItem("Show");
        newMenu = new JMenuItem("New Kin Term Group");
        exportMenu = new JMenuItem("Export");
        importMenu = new JMenuItem("Import");
        deleteMenu = new JMenuItem("Delete");
        this.setText("Kin Terms");
        this.add(hideShowMenu);
        this.add(newMenu);
        this.add(importMenu);
        this.add(exportMenu);
        this.add(deleteMenu);
        this.addMenuListener(new javax.swing.event.MenuListener() {

            public void menuSelected(javax.swing.event.MenuEvent evt) {
{'fraction_non_alphanumeric': 0.0827027027027027, 'fraction_numerical': 0.005405405405405406, 'mean_word_length': 3.4806295399515736, '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': '6887990', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1020, 'n_words': 295}