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

import nl.mpi.kinnate.ui.menu.KinTermsMenu;
import nl.mpi.kinnate.ui.menu.FileMenu;
import nl.mpi.kinnate.ui.menu.EditMenu;
import nl.mpi.kinnate.ui.menu.DiagramPanelsMenu;
import nl.mpi.kinnate.ui.menu.ArchiveMenu;
import nl.mpi.kinnate.ui.window.DiagramWindowManager;
import nl.mpi.arbil.ArbilIcons;
import nl.mpi.arbil.ui.ArbilWindowManager;
import nl.mpi.arbil.util.ApplicationVersionManager;
import nl.mpi.kinnate.KinOathVersion;
import nl.mpi.kinnate.ui.menu.WindowMenu;

/*
 *  Document   : MainFrame
 *  Author     : <NAME>
 *  Created on : Aug 16, 2010, 5:20:20 PM
 */
public class MainFrame extends javax.swing.JFrame {

    DiagramWindowManager diagramWindowManager;

    /** Creates new form MainFrame */
    public MainFrame() {
        initComponents();
        diagramWindowManager = new DiagramWindowManager(this);
        final ApplicationVersionManager versionManager = new ApplicationVersionManager(new KinOathVersion());
        nl.mpi.kinnate.KinnateArbilInjector.injectHandlers(versionManager);
        diagramWindowManager.newDiagram();
        jMenuBar1.add(new FileMenu(diagramWindowManager));
        jMenuBar1.add(new EditMenu(diagramWindowManager));
        jMenuBar1.add(new DiagramPanelsMenu(diagramWindowManager));
        jMenuBar1.add(new KinTermsMenu(diagramWindowManager));
        jMenuBar1.add(new ArchiveMenu(diagramWindowManager));
        jMenuBar1.add(new WindowMenu(diagramWindowManager));
        this.doLayout();
        this.pack();
        ArbilWindowManager.getSingleInstance().setMessagesCanBeShown(true);
        setTitle(versionManager.getApplicationVersion().applicationTitle + " " + versionManager.getApplicationVersion().compileDate);
        // set the icon for the application (if this is still required for the various OSs). This is not required for Mac but might be needed for windows or linux.
        setIconImage(ArbilIcons.getSingleInstance().linorgIcon.getImage());
//	if (arbilMenuBar.checkNewVersionAtStartCheckBoxMenuItem.isSelected()) {
        // todo: Ticket #1066 add the check for updates and check now menu items
        versionManager.checkForUpdate();
//	}
    }

    public void loadAllTrees() {
        diagramWindowManager.loadAllTrees();
    }
<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;

import nl.mpi.kinnate.ui.menu.KinTermsMenu;
import nl.mpi.kinnate.ui.menu.FileMenu;
import nl.mpi.kinnate.ui.menu.EditMenu;
import nl.mpi.kinnate.ui.menu.DiagramPanelsMenu;
import nl.mpi.kinnate.ui.menu.ArchiveMenu;
import nl.mpi.arbil.ArbilIcons;
import nl.mpi.arbil.ui.ArbilWindowManager;
import nl.mpi.arbil.util.ApplicationVersionManager;
import nl.mpi.kinnate.KinOathVersion;
import nl.mpi.kinnate.ui.menu.WindowMenu;
import nl.mpi.kinnate.ui.window.AbstractDiagramManager;
import nl.mpi.kinnate.ui.window.LayeredDiagramManager;

/*
 *  Document   : MainFrame
 *  Author     : <NAME>
 *  Created on : Aug 16, 2010, 5:20:20 PM
 */
public class MainFrame extends javax.swing.JFrame {

    AbstractDiagramManager abstractDiagramManager;

    /** Creates new form MainFrame */
    public MainFrame() {
        initComponents();
//        diagramWindowManager = new DiagramWindowManager(this);
        abstractDiagramManager = new LayeredDiagramManager(this);
        final ApplicationVersionManager versionManager = new ApplicationVersionManager(new KinOathVersion());
        nl.mpi.kinnate.KinnateArbilInjector.injectHandlers(versionManager);
        abstractDiagramManager.newDiagram();
        jMenuBar1.add(new FileMenu(abstractDiagramManager));
        jMenuBar1.add(new EditMenu(abstractDiagramManager));
        jMenuBar1.add(new DiagramPanelsMenu(abstractDiagramManager));
        jMenuBar1.add(new KinTermsMenu(abstractDiagramManager));
        jMenuBar1.add(new ArchiveMenu(abstractDiagramManager));
        jMenuBar1.add(new WindowMenu(abstractDiagramManager));
        this.doLayout();
        this.pack();
        ArbilWindowManager.getSingleInstance().setMessagesCanBeShown(true);
        setTitle(versionManager.getApplicationVersion().applicationTitle + " " + versionManager.getApplicationVersion().compileDate);
        // set the icon for the application (if this is still required for the various OSs). This is not required for Mac but might be needed for windows or linux.
        setIconImage(ArbilIcons.getSingleInstance().linorgIcon.getImage());
//	if (arbilMenuBar.checkNewVersionAtStartCheckBoxMenuItem.isSelected()) {
        // todo: Ticket #1066 add the check for updates and check now menu items
        versionManager.checkForUpdate();
//	}
    }

    public void loadAllTrees() {
        abstractDiagramManager.loadAllTrees();
    }

{'fraction_non_alphanumeric': 0.0893088753010932, 'fraction_numerical': 0.007782101167315175, 'mean_word_length': 4.12630579297246, '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': '1884958', 'n_tokens_mistral': 1606, 'n_tokens_neox': 1562, 'n_words': 380}