<commit_before>import java.applet.Applet;
import java.applet.AppletContext;

import javax.swing.JTree;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;

import netscape.javascript.JSObject;
import edu.wustl.catissuecore.tissuesite.TissueSiteTreeNode;
import edu.wustl.catissuecore.util.global.Constants;


/**
 * @author gautam_shetty
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class TissueSiteTreeNodeListener implements TreeSelectionListener
{
    /**
     * Corresponds to an applet environment.
     */
    private AppletContext appletContext = null;
    
    /**
     * @return Returns the appletContext.
     */
    public AppletContext getAppletContext()
    {
        return appletContext;
    }
    
    /**
     * @param appletContext The appletContext to set.
     */
    public void setAppletContext(AppletContext appletContext)
    {
        this.appletContext = appletContext;
    }
    
    /**
     * (non-Javadoc)
     * @see javax.swing.event.TreeSelectionListener#valueChanged(javax.swing.event.TreeSelectionEvent)
     */
    public void valueChanged(TreeSelectionEvent event)
    {
        Object object = event.getSource();
        JTree tree = null;

        if (object instanceof JTree)
        {
            tree = (JTree) object;
            DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree
                    .getLastSelectedPathComponent();
            TissueSiteTreeNode  treeNode = (TissueSiteTreeNode) node
                    .getUserObject();
            
            //Set the values in the parent window.
            Applet applet = this.appletContext.getApplet(Constants.TREE_APPLET_NAME);
            JSObject window = JSObject.getWindow(applet);
            String propertyName = applet.getParameter(Constants.PROPERTY_NAME);
            String setValue = "setParentWindowValue('"+propertyName+"','"+treeNode.toString()+"')";
            window.eval(setValue);
            window.eval("closeWindow()");
        }
    }

}<commit_msg>Implemented MouseInputLIstener for double click.<commit_after>import java.applet.Applet;
import java.applet.AppletContext;
import java.awt.Component;
import java.awt.event.MouseEvent;

import javax.swing.JOptionPane;
import javax.swing.JTree;
import javax.swing.event.MouseInputListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;

import netscape.javascript.JSObject;
import edu.wustl.catissuecore.tissuesite.TissueSiteTreeNode;
import edu.wustl.catissuecore.util.global.Constants;


/**
 * @author gautam_shetty
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class TissueSiteTreeNodeListener implements MouseInputListener
{
    /**
     * Corresponds to an applet environment.
     */
    private AppletContext appletContext = null;
    
    /**
     * @return Returns the appletContext.
     */
    public AppletContext getAppletContext()
    {
        return appletContext;
    }
    
    /**
     * @param appletContext The appletContext to set.
     */
    public void setAppletContext(AppletContext appletContext)
    {
        this.appletContext = appletContext;
    }
    
    public void mouseClicked(MouseEvent e) {
		// TODO Auto-generated method stub
    	if(e.getClickCount()==2)
        {
    		Object object = e.getSource();
    		JTree tree = null;

    		if (object instanceof JTree)
    		{
    			tree = (JTree) object;
    			
    			DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree
                     .getLastSelectedPathComponent();

    			TissueSiteTreeNode  treeNode = (TissueSiteTreeNode) node
                     .getUserObject();
             
    			//Set the values in the parent window.
    			Applet applet = this.appletContext.getApplet(Constants.TREE_APPLET_NAME);
    			JSObject window = JSObject.getWindow(applet);
    			//commented as this will set in MouseClick
    			String propertyName = applet.getParameter(Constants.PROPERTY_NAME);

    			// if 'Tissue Site' Root node selected then do nothing
    			if(treeNode.toString().equals(Constants.TISSUE_SITE))
    			{
    				return;
    			}
    			String setValue = "setParentWindowValue('"+propertyName+"','"+treeNode.toString()+"')";
             
    			//commented as this will set in MouseClick
    			window.eval(setValue);
    			window.eval("closeWindow()");
    		}
        }
		
	}

	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub

	}

	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub

	}

	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub

	}

	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub

	}

	public void mouseDragged(MouseEvent e) {
		// TODO Auto-generated method stub

	}

	public void mouseMoved(MouseEvent e) {
		// TODO Auto-generated method stub

	}
}
{'fraction_non_alphanumeric': 0.09061426936283862, 'fraction_numerical': 0.00019076688286913393, 'mean_word_length': 2.7855595667870037, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5820325', 'n_tokens_mistral': 1572, 'n_tokens_neox': 1517, 'n_words': 341}