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

import java.awt.BorderLayout;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import nl.mpi.arbil.data.ArbilDataNode;
import nl.mpi.arbil.data.ArbilDataNodeLoader;
import nl.mpi.arbil.ui.ArbilTree;
import nl.mpi.arbil.util.ArbilBugCatcher;
import nl.mpi.kinnate.entityindexer.EntityCollection;

/**
 *  Document   : EntitySearchPanel
 *  Created on : Mar 14, 2011, 4:01:11 PM
 *  Author     : <NAME>
 */
public class EntitySearchPanel extends JPanel {

    private EntityCollection entityCollection;
    private ArbilTree leftTree;
    private JTextArea resultsArea = new JTextArea();
    private JTextField searchField;

    public EntitySearchPanel(EntityCollection entityCollectionLocal) {
        entityCollection = entityCollectionLocal;
        this.setLayout(new BorderLayout());
        leftTree = new ArbilTree();
        leftTree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Test Tree"), true));
//                ArrayList<URI> allEntityUris = new ArrayList<URI>();
//        String[] treeNodesArray = LinorgSessionStorage.getSingleInstance().loadStringArray("KinGraphTree");
//        if (treeNodesArray != null) {
//            ArrayList<ArbilTreeObject> tempArray = new ArrayList<ArbilTreeObject>();
//            for (String currentNodeString : treeNodesArray) {
//                try {
//                    ArbilTreeObject currentArbilNode = ArbilLoader.getSingleInstance().getArbilObject(null, new URI(currentNodeString));
//                    tempArray.add(currentArbilNode);
//                    allEntityUris.add(currentArbilNode.getURI());
//                } catch (URISyntaxException exception) {
//                    GuiHelper.linorgBugCatcher.logError(exception);
//                }
//            }
//            ArbilTreeObject[] allEntities = tempArray.toArray(new ArbilTreeObject[]{});
//            leftTree.rootNodeChildren = allEntities;
//            imdiTableModel.removeAllArbilRows();
//            imdiTableModel.addArbilObjects(leftTree.rootNodeChildren);
//        } //else {
//        //   leftTree.rootNodeChildren = new ArbilTreeObject[]{graphPanel.imdiNode};
//        // }
        leftTree.requestResort();
        JLabel searchLabel = new JLabel("Search Entity Names");
        searchField = new JTextField();
        searchField.addKeyListener(new KeyAdapter() {

            @Override
            public void keyReleased(KeyEvent e) {
                if (e.getKeyCode() == KeyEvent.VK_ENTER) {
                    EntitySearchPanel.this.performSearch();
                }
                super.keyReleased(e);
            }
        });
        JButton searchButton = new JButton("Search");<commit_msg>Tidied up the graph entity selection actions and drag interactions.<commit_after>package nl.mpi.kinnate.ui;

import java.awt.BorderLayout;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import nl.mpi.arbil.data.ArbilDataNode;
import nl.mpi.arbil.data.ArbilDataNodeLoader;
import nl.mpi.arbil.ui.ArbilTree;
import nl.mpi.arbil.util.ArbilBugCatcher;
import nl.mpi.kinnate.entityindexer.EntityCollection;

/**
 *  Document   : EntitySearchPanel
 *  Created on : Mar 14, 2011, 4:01:11 PM
 *  Author     : <NAME>
 */
public class EntitySearchPanel extends JPanel {

    private EntityCollection entityCollection;
    private ArbilTree leftTree;
    private JTextArea resultsArea = new JTextArea();
    private JTextField searchField;

    public EntitySearchPanel(EntityCollection entityCollectionLocal) {
        entityCollection = entityCollectionLocal;
        this.setLayout(new BorderLayout());
        leftTree = new ArbilTree();
        leftTree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Test Tree"), true));
//                ArrayList<URI> allEntityUris = new ArrayList<URI>();
//        String[] treeNodesArray = LinorgSessionStorage.getSingleInstance().loadStringArray("KinGraphTree");
//        if (treeNodesArray != null) {
//            ArrayList<ArbilTreeObject> tempArray = new ArrayList<ArbilTreeObject>();
//            for (String currentNodeString : treeNodesArray) {
//                try {
//                    ArbilTreeObject currentArbilNode = ArbilLoader.getSingleInstance().getArbilObject(null, new URI(currentNodeString));
//                    tempArray.add(currentArbilNode);
//                    allEntityUris.add(currentArbilNode.getURI());
//                } catch (URISyntaxException exception) {
//                    GuiHelper.linorgBugCatcher.logError(exception);
//                }
//            }
//            ArbilTreeObject[] allEntities = tempArray.toArray(new ArbilTreeObject[]{});
//            leftTree.rootNodeChildren = allEntities;
//            imdiTableModel.removeAllArbilRows();
//            imdiTableModel.addArbilObjects(leftTree.rootNodeChildren);
//        } //else {
//        //   leftTree.rootNodeChildren = new ArbilTreeObject[]{graphPanel.imdiNode};
//        // }
        leftTree.setRootVisible(false);
        leftTree.requestResort();
        JLabel searchLabel = new JLabel("Search Entity Names");
        searchField = new JTextField();
        searchField.addKeyListener(new KeyAdapter() {

            @Override
            public void keyReleased(KeyEvent e) {
                if (e.getKeyCode() == KeyEvent.VK_ENTER) {
                    EntitySearchPanel.this.performSearch();
                }
                super.keyReleased(e);
            }
        });
        JButton searchButton = new JButton("Search");
{'fraction_non_alphanumeric': 0.10710854947166186, 'fraction_numerical': 0.0035222542427153377, 'mean_word_length': 2.7791893526920752, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '1213199', 'n_tokens_mistral': 1767, 'n_tokens_neox': 1708, 'n_words': 315}