/*
 * ModSelect.java
 *
 * Created on November 9, 2006, 3:23 PM
 */

package xomo.deliverable.julian.gui;

//import java.awt.HeadlessException;
import javax.swing.*;
import javax.swing.tree.*;
import java.util.*;
import javax.swing.event.*;
import java.awt.*;
import java.io.*;
//import java.awt.Toolkit;
//import java.awt.EventQueue;

/**
 *
 * @author  oelrawas
 */
public class ModSelect extends javax.swing.JFrame {
    
    private TreePath Mod;
    private cocoNode currNode;
    private cocoNode Project;
    private DefaultTreeModel projectTreeModel;
    
    /** Creates new form ModSelect */
    
    public ModSelect() {
        initComponents();
    }
    
    public void populate() {
       
        cocoNode Module1, Module2, Module3;
        
        Module1 = addObject(null, "1");
        Module2 = addObject(null, "2");
        Module3 = addObject(null, "3");
        
        addObject(Module2, "1.1");
        addObject(Module2, "1.2", true);
        
    }
    
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        modParam = new javax.swing.JFrame();
        modParam.setSize(575,575);
        AL = new javax.swing.JLabel();
        BL = new javax.swing.JLabel();
        KSLOCL = new javax.swing.JLabel();
        ACAPL = new javax.swing.JLabel();
        APEXL = new javax.swing.JLabel();
        CPLXL = new javax.swing.JLabel();
        DATAL = new javax.swing.JLabel();
        DOCUL = new javax.swing.JLabel();
        FLEXL = new javax.swing.JLabel();
        LTEXL = new javax.swing.JLabel();
        PCAPL = new javax.swing.JLabel();
        PLEXL = new javax.swing.JLabel();
        PMATL = new javax.swing.JLabel();
        PRECL = new javax.swing.JLabel();
        PVOLL = new javax.swing.JLabel();
        RELYL = new javax.swing.JLabel();
        RESLL = new javax.swing.JLabel();
        RUSEL = new javax.swing.JLabel();
        SCEDL = new javax.swing.JLabel();
        SITEL = new javax.swing.JLabel();
        STORL = new javax.swing.JLabel();
        TEAML = new javax.swing.JLabel();
        PCONL = new javax.swing.JLabel();
        TIMEL = new javax.swing.JLabel();
        TOOLL = new javax.swing.JLabel();
        loadPreset = new javax.swing.JLabel();
        preset = new javax.swing.JComboBox();
        A = new javax.swing.JTextField();
        B = new javax.swing.JTextField();
        KSLOC = new javax.swing.JTextField();
        ACAP = new javax.swing.JComboBox();
        APEX = new javax.swing.JComboBox();
        CPLX = new javax.swing.JComboBox();
        DATA = new javax.swing.JComboBox();
        DOCU = new javax.swing.JComboBox();
        FLEX = new javax.swing.JComboBox();
        LTEX = new javax.swing.JComboBox();
        PCAP = new javax.swing.JComboBox();
        PCON = new javax.swing.JComboBox();
        TOOL = new javax.swing.JComboBox();
        PLEX = new javax.swing.JComboBox();
        PMAT = new javax.swing.JComboBox();
        PREC = new javax.swing.JComboBox();
        PVOL = new javax.swing.JComboBox();
        RELY = new javax.swing.JComboBox();
        RESL = new javax.swing.JComboBox();
        RUSE = new javax.swing.JComboBox();
        SCED = new javax.swing.JComboBox();
        SITE = new javax.swing.JComboBox();
        STOR = new javax.swing.JComboBox();
        TEAM = new javax.swing.JComboBox();
        TIME = new javax.swing.JComboBox();
        SubmitAtt = new javax.swing.JButton();
        Cancel = new javax.swing.JButton();
        LdDef = new javax.swing.JButton();
        Load = new javax.swing.JButton();
        CocomoIIL = new javax.swing.JLabel();
        CoqualmoL = new javax.swing.JLabel();
        AUTOMATED_ANALYSISL = new javax.swing.JLabel();
        AUTOMATED_ANALYSIS = new javax.swing.JComboBox();
        PEER_REVIEWSL = new javax.swing.JLabel();
        PEER_REVIEWS = new javax.swing.JComboBox();
        EXECUTION_TESTING_AND_TOOLSL = new javax.swing.JLabel();
        EXECUTION_TESTING_AND_TOOLS = new javax.swing.JComboBox();
        Import = new javax.swing.JButton();
        ExportMItem = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JSeparator();
        GenEstimate = new javax.swing.JButton();
        Export = new javax.swing.JButton();
        ProjectPane = new javax.swing.JScrollPane();

        Project = new cocoNode("Project");
        projectTreeModel = new DefaultTreeModel (Project);
        projectTreeModel.addTreeModelListener(new MyTreeModelListener());
        projectTree = new JTree(projectTreeModel);
        populate();
        ModAtt = new javax.swing.JButton();
        Select = new javax.swing.JLabel();
        Add = new javax.swing.JButton();
        Remove = new javax.swing.JButton();
        Clear = new javax.swing.JButton();
        canMod = new javax.swing.JLabel();
        Rename = new javax.swing.JButton();
        Run = new javax.swing.JButton();
        MainBar = new javax.swing.JMenuBar();
        FileMenu = new javax.swing.JMenu();
        ExitMItem = new javax.swing.JMenuItem();
        EditMenu = new javax.swing.JMenu();
        AddMItem = new javax.swing.JMenuItem();
        RemoveMItem = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JSeparator();
        RenameMItem = new javax.swing.JMenuItem();
        ModifyMItem = new javax.swing.JMenuItem();
        jSeparator3 = new javax.swing.JSeparator();
        ClearMItem = new javax.swing.JMenuItem();
        ExecuteMenu = new javax.swing.JMenu();
        RunMItem = new javax.swing.JMenuItem();
        HelpMenu = new javax.swing.JMenu();
        AboutMItem = new javax.swing.JMenuItem();

        modParam.setResizable(false);
        modParam.addWindowFocusListener(new java.awt.event.WindowFocusListener() {
            public void windowGainedFocus(java.awt.event.WindowEvent evt) {
            }
            public void windowLostFocus(java.awt.event.WindowEvent evt) {
                modParamWindowLostFocus(evt);
            }
        });

        AL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        AL.setText("A");

        BL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        BL.setText("B");

        KSLOCL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        KSLOCL.setText("KSLOC");

        ACAPL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        ACAPL.setText("ACAP");

        APEXL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        APEXL.setText("APEX");

        CPLXL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        CPLXL.setText("CPLX");

        DATAL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        DATAL.setText("DATA");

        DOCUL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        DOCUL.setText("DOCU");

        FLEXL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        FLEXL.setText("FLEX");

        LTEXL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        LTEXL.setText("LTEX");

        PCAPL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        PCAPL.setText("PCAP");

        PLEXL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        PLEXL.setText("PLEX");

        PMATL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        PMATL.setText("PMAT");

        PRECL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        PRECL.setText("PREC");

        PVOLL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        PVOLL.setText("PVOL");

        RELYL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        RELYL.setText("RELY");

        RESLL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        RESLL.setText("RESL");

        RUSEL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        RUSEL.setText("RUSE");

        SCEDL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        SCEDL.setText("SCED");

        SITEL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        SITEL.setText("SITE");

        STORL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        STORL.setText("STOR");

        TEAML.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        TEAML.setText("TEAM");

        PCONL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        PCONL.setText("PCON");

        TIMEL.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        TIMEL.setText("TIME");

        TOOLL.setText("TOOL");

        loadPreset.setText("Preset Project Attributes");

        preset.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Project 1", "Project 2", "Project 3" }));

        A.setEditable(false);
        A.setText("3.0");

        B.setEditable(false);
        B.setText("1.0");

        ACAP.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "vh", "h", "n", "l", "vl", "?" }));

        APEX.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "vh", "h", "n", "l", "vl", "?" }));

        CPLX.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "l", "vl", "?" }));

        DATA.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "vh", "h", "n", "l", "?" }));

        DOCU.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "vh", "h", "n", "l", "vl", "?" }));

        FLEX.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "l", "vl", "?" }));

        LTEX.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "vh", "h", "n", "l", "vl", "?" }));

        PCAP.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "vh", "h", "n", "l", "vl", "?" }));

        PCON.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "vh", "h", "n", "l", "vl", "?" }));

        TOOL.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "vh", "h", "n", "l", "vl", "?" }));

        PLEX.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "vh", "h", "n", "l", "vl", "?" }));

        PMAT.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "l", "vl", "?" }));

        PREC.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "l", "vl", "?" }));

        PVOL.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "vh", "h", "n", "l", "?" }));

        RELY.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "vh", "h", "n", "l", "vl", "?" }));

        RESL.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "l", "vl", "?" }));

        RUSE.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "l", "?" }));

        SCED.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "vh", "h", "n", "l", "vl", "?" }));

        SITE.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "l", "vl", "?" }));

        STOR.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "?" }));

        TEAM.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "l", "vl", "?" }));

        TIME.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "?" }));

        SubmitAtt.setFont(new java.awt.Font("Dialog", 1, 14));
        SubmitAtt.setText("Submit");
        SubmitAtt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SubmitAttActionPerformed(evt);
            }
        });

        Cancel.setFont(new java.awt.Font("Dialog", 1, 14));
        Cancel.setText("Cancel");
        Cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CancelActionPerformed(evt);
            }
        });

        LdDef.setText("Load Defaults");
        LdDef.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LdDefActionPerformed(evt);
            }
        });

        Load.setText("Load");
        Load.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LoadActionPerformed(evt);
            }
        });

        CocomoIIL.setFont(new java.awt.Font("Dialog", 1, 20));
        CocomoIIL.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        CocomoIIL.setText("Cocomo II Attributes");

        CoqualmoL.setFont(new java.awt.Font("Dialog", 1, 20));
        CoqualmoL.setText("Coqualmo Attributes");

        AUTOMATED_ANALYSISL.setText("AUTOMATED_ANALYSIS");

        AUTOMATED_ANALYSIS.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "l", "vl", "?" }));

        PEER_REVIEWSL.setText("PEER_REVIEWS");

        PEER_REVIEWS.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "l", "vl", "?" }));

        EXECUTION_TESTING_AND_TOOLSL.setText("EXECUTION_TESTING_AND_TOOLS");

        EXECUTION_TESTING_AND_TOOLS.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "xh", "vh", "h", "n", "l", "vl", "?" }));

        Import.setText("Import from File");
        Import.setEnabled(false);

        org.jdesktop.layout.GroupLayout modParamLayout = new org.jdesktop.layout.GroupLayout(modParam.getContentPane());
        modParam.getContentPane().setLayout(modParamLayout);
        modParamLayout.setHorizontalGroup(
            modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(modParamLayout.createSequentialGroup()
                .addContainerGap()
                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(modParamLayout.createSequentialGroup()
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(CocomoIIL)
                            .add(modParamLayout.createSequentialGroup()
                                .add(EXECUTION_TESTING_AND_TOOLSL)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(EXECUTION_TESTING_AND_TOOLS, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(modParamLayout.createSequentialGroup()
                                .add(PEER_REVIEWSL)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(PEER_REVIEWS, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(modParamLayout.createSequentialGroup()
                                .add(AUTOMATED_ANALYSISL)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(AUTOMATED_ANALYSIS, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(CoqualmoL)
                            .add(modParamLayout.createSequentialGroup()
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                    .add(CPLXL)
                                    .add(DATAL)
                                    .add(APEXL)
                                    .add(ACAPL)
                                    .add(KSLOCL)
                                    .add(BL)
                                    .add(AL))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                                    .add(B)
                                    .add(KSLOC)
                                    .add(APEX, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .add(CPLX, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .add(DATA, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .add(A)
                                    .add(ACAP, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(modParamLayout.createSequentialGroup()
                                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                            .add(RESLL)
                                            .add(RELYL))
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(RESL, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(RELY, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                                    .add(modParamLayout.createSequentialGroup()
                                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                            .add(PVOLL)
                                            .add(PRECL)
                                            .add(PMATL)
                                            .add(PLEXL))
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(PVOL, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(PMAT, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(PLEX, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(PREC, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                    .add(RUSEL)
                                    .add(SCEDL)
                                    .add(SITEL)
                                    .add(STORL)
                                    .add(TEAML)
                                    .add(TIMEL))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(TIME, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(TEAM, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(STOR, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(SITE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(SCED, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(RUSE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(PCAPL)
                            .add(LTEXL)
                            .add(FLEXL)
                            .add(PCONL)
                            .add(TOOLL)
                            .add(DOCUL))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(PCON, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(PCAP, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(DOCU, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(FLEX, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(LTEX, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(TOOL, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 67, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                        .add(org.jdesktop.layout.GroupLayout.TRAILING, modParamLayout.createSequentialGroup()
                            .add(Import)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(Cancel)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(SubmitAtt, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 162, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
                        .add(org.jdesktop.layout.GroupLayout.TRAILING, modParamLayout.createSequentialGroup()
                            .add(loadPreset)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(preset, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(14, 14, 14)
                            .add(Load)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                            .add(LdDef, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 121, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(33, Short.MAX_VALUE))
        );

        modParamLayout.linkSize(new java.awt.Component[] {ACAPL, AL, APEXL, BL, CPLXL, DATAL, DOCUL, FLEXL, KSLOCL, LTEXL, PCAPL, PCONL}, org.jdesktop.layout.GroupLayout.HORIZONTAL);

        modParamLayout.linkSize(new java.awt.Component[] {AUTOMATED_ANALYSIS, DATA, EXECUTION_TESTING_AND_TOOLS, PEER_REVIEWS, PLEX, PMAT, PREC, PVOL, RELY, RESL, RUSE, SCED, SITE, STOR, TEAM, TIME, TOOL}, org.jdesktop.layout.GroupLayout.HORIZONTAL);

        modParamLayout.linkSize(new java.awt.Component[] {PLEXL, PMATL, PRECL, PVOLL, RELYL, RESLL, RUSEL, SCEDL, SITEL, STORL, TEAML, TIMEL}, org.jdesktop.layout.GroupLayout.HORIZONTAL);

        modParamLayout.linkSize(new java.awt.Component[] {CocomoIIL, CoqualmoL}, org.jdesktop.layout.GroupLayout.HORIZONTAL);

        modParamLayout.setVerticalGroup(
            modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(modParamLayout.createSequentialGroup()
                .addContainerGap()
                .add(CocomoIIL)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(modParamLayout.createSequentialGroup()
                        .add(6, 6, 6)
                        .add(PLEXL))
                    .add(modParamLayout.createSequentialGroup()
                        .add(4, 4, 4)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(AL)
                            .add(A, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(BL)
                            .add(B, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(KSLOCL)
                            .add(KSLOC, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(ACAPL)
                            .add(ACAP, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(APEXL)
                            .add(APEX, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(CPLXL)
                            .add(CPLX, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(DATAL)
                            .add(DATA, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(modParamLayout.createSequentialGroup()
                        .add(RUSE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(modParamLayout.createSequentialGroup()
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(PMAT, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(PMATL))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(PREC, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(PRECL))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(PVOL, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(PVOLL))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(RELYL)
                                    .add(RELY, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(RESLL)
                                    .add(RESL, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                            .add(modParamLayout.createSequentialGroup()
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(SCEDL)
                                    .add(SCED, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(SITEL)
                                    .add(SITE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(STORL)
                                    .add(STOR, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(TEAML)
                                    .add(TEAM, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(TIMEL)
                                    .add(TIME, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))))
                    .add(modParamLayout.createSequentialGroup()
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(DOCU, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(DOCUL))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(FLEXL)
                            .add(FLEX, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(LTEXL)
                            .add(LTEX, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(PCAPL)
                            .add(PCAP, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(PCONL)
                            .add(PCON, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(TOOLL)
                            .add(TOOL, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(PLEX, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(modParamLayout.createSequentialGroup()
                        .add(5, 5, 5)
                        .add(RUSEL)))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(CoqualmoL)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(AUTOMATED_ANALYSIS, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(AUTOMATED_ANALYSISL))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(PEER_REVIEWSL)
                    .add(PEER_REVIEWS, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(EXECUTION_TESTING_AND_TOOLS, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(EXECUTION_TESTING_AND_TOOLSL))
                .add(45, 45, 45)
                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(preset, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(loadPreset)
                    .add(Load)
                    .add(LdDef))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(Import)
                    .add(modParamLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                        .add(Cancel)
                        .add(SubmitAtt)))
                .add(60, 60, 60))
        );

        modParamLayout.linkSize(new java.awt.Component[] {Load, preset}, org.jdesktop.layout.GroupLayout.VERTICAL);

        modParamLayout.linkSize(new java.awt.Component[] {Cancel, Import}, org.jdesktop.layout.GroupLayout.VERTICAL);

        ExportMItem.setText("Export");
        ExportMItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ExportMItemActionPerformed(evt);
            }
        });

        GenEstimate.setText("Estimate");
        GenEstimate.setEnabled(false);
        GenEstimate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GenEstimateActionPerformed(evt);
            }
        });

        Export.setText("Export");
        Export.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ExportActionPerformed(evt);
            }
        });

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Project Tree");
        setResizable(false);
        projectTree.setSelectionPath(projectTree.getAnchorSelectionPath());
        projectTree.setShowsRootHandles(true);
        projectTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
            public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {
                projectTreeValueChanged(evt);
            }
        });
        projectTree.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                projectTreeMouseClicked(evt);
            }
        });

        ProjectPane.setViewportView(projectTree);

        ModAtt.setText("Modify Attributes");
        ModAtt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ModAttActionPerformed(evt);
            }
        });

        Select.setText("Select the project Module/Submodule");

        Add.setText("+");
        Add.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddActionPerformed(evt);
            }
        });

        Remove.setText("-");
        Remove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RemoveActionPerformed(evt);
            }
        });

        Clear.setText("Clear");
        Clear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ClearActionPerformed(evt);
            }
        });

        canMod.setText("(You may also modify the project tree)");

        Rename.setText("Rename");
        Rename.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RenameActionPerformed(evt);
            }
        });

        Run.setText("Export & Run");
        Run.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RunActionPerformed(evt);
            }
        });

        FileMenu.setText("File");
        ExitMItem.setText("Exit");
        ExitMItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ExitMItemActionPerformed(evt);
            }
        });

        FileMenu.add(ExitMItem);

        MainBar.add(FileMenu);

        EditMenu.setText("Edit");
        AddMItem.setText("Add Module");
        AddMItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddMItemActionPerformed(evt);
            }
        });

        EditMenu.add(AddMItem);

        RemoveMItem.setText("Remove Module");
        RemoveMItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RemoveMItemActionPerformed(evt);
            }
        });

        EditMenu.add(RemoveMItem);

        EditMenu.add(jSeparator2);

        RenameMItem.setText("Rename Module");
        RenameMItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RenameMItemActionPerformed(evt);
            }
        });

        EditMenu.add(RenameMItem);

        ModifyMItem.setText("Modify Module Attributes");
        ModifyMItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ModifyMItemActionPerformed(evt);
            }
        });

        EditMenu.add(ModifyMItem);

        EditMenu.add(jSeparator3);

        ClearMItem.setText("Clear Project");
        ClearMItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ClearMItemActionPerformed(evt);
            }
        });

        EditMenu.add(ClearMItem);

        MainBar.add(EditMenu);

        ExecuteMenu.setText("Execute");
        RunMItem.setText("Export & Run");
        RunMItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RunMItemActionPerformed(evt);
            }
        });

        ExecuteMenu.add(RunMItem);

        MainBar.add(ExecuteMenu);

        HelpMenu.setText("Help");
        AboutMItem.setText("About");
        HelpMenu.add(AboutMItem);

        MainBar.add(HelpMenu);

        setJMenuBar(MainBar);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(Select)
                    .add(canMod)
                    .add(layout.createSequentialGroup()
                        .add(ProjectPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 278, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(Clear)
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, Add, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 64, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, Remove, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)))
                    .add(layout.createSequentialGroup()
                        .add(Rename, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 106, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(ModAtt, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, Run, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE))
                .addContainerGap())
        );

        layout.linkSize(new java.awt.Component[] {Add, Clear, Remove}, org.jdesktop.layout.GroupLayout.HORIZONTAL);

        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(Select)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(canMod)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(layout.createSequentialGroup()
                        .add(Add, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 47, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(Remove, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(Clear, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(ProjectPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 154, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(Rename, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 33, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(ModAtt))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(Run)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        layout.linkSize(new java.awt.Component[] {ModAtt, Rename, Run}, org.jdesktop.layout.GroupLayout.VERTICAL);

        layout.linkSize(new java.awt.Component[] {Add, Clear, Remove}, org.jdesktop.layout.GroupLayout.VERTICAL);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-384)/2, (screenSize.height-348)/2, 384, 348);
    }// </editor-fold>//GEN-END:initComponents

    private void RunMItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RunMItemActionPerformed
        this.RunActionPerformed(evt);
    }//GEN-LAST:event_RunMItemActionPerformed

    private void ClearMItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ClearMItemActionPerformed
        this.ClearActionPerformed(evt);
    }//GEN-LAST:event_ClearMItemActionPerformed

    private void ModifyMItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ModifyMItemActionPerformed
        this.ModAttActionPerformed(evt);
    }//GEN-LAST:event_ModifyMItemActionPerformed

    private void RenameMItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RenameMItemActionPerformed
        this.RenameActionPerformed(evt);
    }//GEN-LAST:event_RenameMItemActionPerformed

    private void RemoveMItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RemoveMItemActionPerformed
        this.RemoveActionPerformed(evt);
    }//GEN-LAST:event_RemoveMItemActionPerformed

    private void AddMItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddMItemActionPerformed
        this.AddActionPerformed(evt);
    }//GEN-LAST:event_AddMItemActionPerformed

    private void ExportMItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExportMItemActionPerformed
        this.ExportActionPerformed(evt);
    }//GEN-LAST:event_ExportMItemActionPerformed

    private void RunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RunActionPerformed
        
        try {
            this.Export();      
            this.RunXomo();
        } 
        catch (Exception ex) {   
            JOptionPane.showMessageDialog(null,"Please select a module to run xomo on", "No Selection Error", JOptionPane.ERROR_MESSAGE);
        } 
    }//GEN-LAST:event_RunActionPerformed

    private void ExitMItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExitMItemActionPerformed
        System.exit(0);
    }//GEN-LAST:event_ExitMItemActionPerformed

    private void ExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExportActionPerformed
        try {
            this.Export();
        }
        catch (Exception ioe) { 
            JOptionPane.showMessageDialog(null,"Please select a module to export", "No Selection Error", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_ExportActionPerformed

    private void RenameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RenameActionPerformed
        try {
            this.Rename();
        } catch (Exception e) {
              JOptionPane.showMessageDialog(null,"Please select a module to rename", "No Selection Error", JOptionPane.ERROR_MESSAGE);     
        }
    }//GEN-LAST:event_RenameActionPerformed

    private void projectTreeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_projectTreeMouseClicked
        if (evt.getClickCount()==2 && evt.getButton()!=evt.BUTTON2 && evt.getButton()!=evt.BUTTON3) {
            try {
                this.ModAtt();
            } catch (Exception e) {}
        }
        
        else if (evt.getButton()==evt.BUTTON3) {
            try {
                this.Rename();
            } catch (Exception e) {}
            
        }
    }//GEN-LAST:event_projectTreeMouseClicked

    private void modParamWindowLostFocus(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_modParamWindowLostFocus
        if (!modParam.isVisible())
            this.setEnabled(true);
    }//GEN-LAST:event_modParamWindowLostFocus
    
    private void ClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ClearActionPerformed
        this.clear();
    }//GEN-LAST:event_ClearActionPerformed
    
    private void RemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RemoveActionPerformed
        this.removeCurrentNode();
    }//GEN-LAST:event_RemoveActionPerformed
    
    private void AddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddActionPerformed
        this.AddModule();
    }//GEN-LAST:event_AddActionPerformed
    
    private void LdDefActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LdDefActionPerformed
        currNode.defaultSet();
        this.refresh();
    }//GEN-LAST:event_LdDefActionPerformed
    
    private void CancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CancelActionPerformed
        this.setEnabled(true);
        modParam.setVisible(false);
    }//GEN-LAST:event_CancelActionPerformed
    
    private void LoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LoadActionPerformed
        loadPresets(preset.getSelectedIndex());
    }//GEN-LAST:event_LoadActionPerformed
    
    private void SubmitAttActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SubmitAttActionPerformed
        currNode.coco.set("A",new CocValue(3.0));
        currNode.coco.set("B",new CocValue(1.0));
        currNode.coco.set("KSLOC",new CocValue(Float.valueOf(KSLOC.getText())));
        currNode.coco.set("PREC",new CocValue(PREC.getSelectedIndex()+1));
        currNode.coco.set("RESL",new CocValue(RESL.getSelectedIndex()+1));
        currNode.coco.set("TEAM",new CocValue(TEAM.getSelectedIndex()+1));
        currNode.coco.set("PMAT",new CocValue(PMAT.getSelectedIndex()+1));
        currNode.coco.set("FLEX",new CocValue(FLEX.getSelectedIndex()+1));
        currNode.coco.set("RELY",new CocValue(RELY.getSelectedIndex()+2));
        currNode.coco.set("DATA",new CocValue(DATA.getSelectedIndex()+2));
        currNode.coco.set("DOCU",new CocValue(DOCU.getSelectedIndex()+2));
        currNode.coco.set("CPLX",new CocValue(CPLX.getSelectedIndex()+1));
        currNode.coco.set("RUSE",new CocValue(RUSE.getSelectedIndex()+1));
        currNode.coco.set("TIME",new CocValue(TIME.getSelectedIndex()+1));
        currNode.coco.set("STOR",new CocValue(STOR.getSelectedIndex()+1));
        currNode.coco.set("PVOL",new CocValue(PVOL.getSelectedIndex()+2));
        currNode.coco.set("ACAP",new CocValue(ACAP.getSelectedIndex()+2));
        currNode.coco.set("APEX",new CocValue(APEX.getSelectedIndex()+2));
        currNode.coco.set("PCAP",new CocValue(PCAP.getSelectedIndex()+2));
        currNode.coco.set("PLEX",new CocValue(PLEX.getSelectedIndex()+2));
        currNode.coco.set("LTEX",new CocValue(LTEX.getSelectedIndex()+2));
        currNode.coco.set("PCON",new CocValue(PCON.getSelectedIndex()+2));
        currNode.coco.set("TOOL",new CocValue(TOOL.getSelectedIndex()+2));
        currNode.coco.set("SCED",new CocValue(SCED.getSelectedIndex()+2));
        currNode.coco.set("SITE",new CocValue(SITE.getSelectedIndex()+1));
        currNode.coco.set("AUTOMATED_ANALYSIS",new CocValue(AUTOMATED_ANALYSIS.getSelectedIndex()+1));
        currNode.coco.set("PEER_REVIEWS",new CocValue(PEER_REVIEWS.getSelectedIndex()+1));
        currNode.coco.set("EXECUTION_TESTING_AND_TOOLS",new CocValue(EXECUTION_TESTING_AND_TOOLS.getSelectedIndex()+1));
        
//        double acap_l=currNode.coco.lookup("TIME");
//	  System.out.println(acap_l);
//        
//        String look = new String("DATA : ");
//        System.out.println(look + (7-currNode.coco.getAttVal("DATA")));
//        
//        look = new String("STOR : ");
//        System.out.println(look + (7-currNode.coco.stor()));
//        
//        look = new String("DOCU : ");
//        System.out.println(look + (7-currNode.coco.docu()));
//        
//        look = new String("CPLX : ");
//        System.out.println(look + (7-currNode.coco.cplx()));
//        
//        look = new String("EXECUTION_TESTING_AND_TOOLS : ");
//        System.out.println(look + (7-currNode.coco.execution_testing_and_tools()));
        
        currNode.coco.name = currNode.origName;            
        projectTreeModel.reload();
        for (int i=0; i<projectTree.getRowCount(); i++)
            projectTree.expandRow(i); 
        
        this.setEnabled(true);
        
        modParam.setVisible(false);
        
    }//GEN-LAST:event_SubmitAttActionPerformed
    
    /** this is broken for now */
    private void GenEstimateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GenEstimateActionPerformed
//        try {
//
//            float est = (float)currNode.coco.estimate();
//            currNode.coco.name = currNode.origName + "(KSLOC=" + (float)currNode.coco.ksloc() + " / Cocomo II=" + est + ")";            
//            projectTreeModel.reload();
//            for (int i=0; i<projectTree.getRowCount(); i++)
//                projectTree.expandRow(i); 
//            
//            JOptionPane.showMessageDialog(null, "The Cocomo Estimate is " + est, "COCOMO II estimate", JOptionPane.INFORMATION_MESSAGE);
//            
//        } catch (Exception ex) {
//            JOptionPane.showMessageDialog(null,"Please select a module to Produce the estimate for", "No Selection Error", JOptionPane.ERROR_MESSAGE);
//        }
    }//GEN-LAST:event_GenEstimateActionPerformed
    
    
    private void projectTreeValueChanged(javax.swing.event.TreeSelectionEvent evt) {//GEN-FIRST:event_projectTreeValueChanged
        try {
            currNode = (cocoNode)projectTree.getSelectionPath().getLastPathComponent();
        } catch (Exception e) {}
        
    }//GEN-LAST:event_projectTreeValueChanged
    
    private void ModAttActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ModAttActionPerformed
        try {
            this.ModAtt();            
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null,"Please select a module to modify", "No Selection Error", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_ModAttActionPerformed
    
    public void refresh() {
        KSLOC.setText(String.valueOf(currNode.coco.ksloc()));
        PREC.setSelectedIndex(currNode.coco.prec()-1);
        RESL.setSelectedIndex(currNode.coco.resl()-1);
        TEAM.setSelectedIndex(currNode.coco.team()-1);
        PMAT.setSelectedIndex(currNode.coco.pmat()-1);
        FLEX.setSelectedIndex(currNode.coco.flex()-1);
        RELY.setSelectedIndex(currNode.coco.rely()-2);
        DATA.setSelectedIndex(currNode.coco.data()-2);
        DOCU.setSelectedIndex(currNode.coco.docu()-2);
        CPLX.setSelectedIndex(currNode.coco.cplx()-1);
        RUSE.setSelectedIndex(currNode.coco.ruse()-1);
        TIME.setSelectedIndex(currNode.coco.time()-1);
        STOR.setSelectedIndex(currNode.coco.stor()-1);
        PVOL.setSelectedIndex(currNode.coco.pvol()-2);
        ACAP.setSelectedIndex(currNode.coco.acap()-2);
        APEX.setSelectedIndex(currNode.coco.apex()-2);
        PCAP.setSelectedIndex(currNode.coco.pcap()-2);
        PLEX.setSelectedIndex(currNode.coco.plex()-2);
        LTEX.setSelectedIndex(currNode.coco.ltex()-2);
        PCON.setSelectedIndex(currNode.coco.pcon()-2);
        TOOL.setSelectedIndex(currNode.coco.tool()-2);
        SCED.setSelectedIndex(currNode.coco.sced()-2);
        SITE.setSelectedIndex(currNode.coco.site()-1);
        AUTOMATED_ANALYSIS.setSelectedIndex(currNode.coco.automated_analysis()-1);
        PEER_REVIEWS.setSelectedIndex(currNode.coco.peer_reviews()-1);
        EXECUTION_TESTING_AND_TOOLS.setSelectedIndex(currNode.coco.execution_testing_and_tools()-1);
    }
    
    
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ModSelect().setVisible(true);
            }
        });
    }
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField A;
    private javax.swing.JComboBox ACAP;
    private javax.swing.JLabel ACAPL;
    private javax.swing.JLabel AL;
    private javax.swing.JComboBox APEX;
    private javax.swing.JLabel APEXL;
    private javax.swing.JComboBox AUTOMATED_ANALYSIS;
    private javax.swing.JLabel AUTOMATED_ANALYSISL;
    private javax.swing.JMenuItem AboutMItem;
    private javax.swing.JButton Add;
    private javax.swing.JMenuItem AddMItem;
    private javax.swing.JTextField B;
    private javax.swing.JLabel BL;
    private javax.swing.JComboBox CPLX;
    private javax.swing.JLabel CPLXL;
    private javax.swing.JButton Cancel;
    private javax.swing.JButton Clear;
    private javax.swing.JMenuItem ClearMItem;
    private javax.swing.JLabel CocomoIIL;
    private javax.swing.JLabel CoqualmoL;
    private javax.swing.JComboBox DATA;
    private javax.swing.JLabel DATAL;
    private javax.swing.JComboBox DOCU;
    private javax.swing.JLabel DOCUL;
    private javax.swing.JComboBox EXECUTION_TESTING_AND_TOOLS;
    private javax.swing.JLabel EXECUTION_TESTING_AND_TOOLSL;
    private javax.swing.JMenu EditMenu;
    private javax.swing.JMenu ExecuteMenu;
    private javax.swing.JMenuItem ExitMItem;
    private javax.swing.JButton Export;
    private javax.swing.JMenuItem ExportMItem;
    private javax.swing.JComboBox FLEX;
    private javax.swing.JLabel FLEXL;
    private javax.swing.JMenu FileMenu;
    private javax.swing.JButton GenEstimate;
    private javax.swing.JMenu HelpMenu;
    private javax.swing.JButton Import;
    private javax.swing.JTextField KSLOC;
    private javax.swing.JLabel KSLOCL;
    private javax.swing.JComboBox LTEX;
    private javax.swing.JLabel LTEXL;
    private javax.swing.JButton LdDef;
    private javax.swing.JButton Load;
    private javax.swing.JMenuBar MainBar;
    private javax.swing.JButton ModAtt;
    private javax.swing.JMenuItem ModifyMItem;
    private javax.swing.JComboBox PCAP;
    private javax.swing.JLabel PCAPL;
    private javax.swing.JComboBox PCON;
    private javax.swing.JLabel PCONL;
    private javax.swing.JComboBox PEER_REVIEWS;
    private javax.swing.JLabel PEER_REVIEWSL;
    private javax.swing.JComboBox PLEX;
    private javax.swing.JLabel PLEXL;
    private javax.swing.JComboBox PMAT;
    private javax.swing.JLabel PMATL;
    private javax.swing.JComboBox PREC;
    private javax.swing.JLabel PRECL;
    private javax.swing.JComboBox PVOL;
    private javax.swing.JLabel PVOLL;
    private javax.swing.JScrollPane ProjectPane;
    private javax.swing.JComboBox RELY;
    private javax.swing.JLabel RELYL;
    private javax.swing.JComboBox RESL;
    private javax.swing.JLabel RESLL;
    private javax.swing.JComboBox RUSE;
    private javax.swing.JLabel RUSEL;
    private javax.swing.JButton Remove;
    private javax.swing.JMenuItem RemoveMItem;
    private javax.swing.JButton Rename;
    private javax.swing.JMenuItem RenameMItem;
    private javax.swing.JButton Run;
    private javax.swing.JMenuItem RunMItem;
    private javax.swing.JComboBox SCED;
    private javax.swing.JLabel SCEDL;
    private javax.swing.JComboBox SITE;
    private javax.swing.JLabel SITEL;
    private javax.swing.JComboBox STOR;
    private javax.swing.JLabel STORL;
    private javax.swing.JLabel Select;
    private javax.swing.JButton SubmitAtt;
    private javax.swing.JComboBox TEAM;
    private javax.swing.JLabel TEAML;
    private javax.swing.JComboBox TIME;
    private javax.swing.JLabel TIMEL;
    private javax.swing.JComboBox TOOL;
    private javax.swing.JLabel TOOLL;
    private javax.swing.JLabel canMod;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JLabel loadPreset;
    private javax.swing.JFrame modParam;
    private javax.swing.JComboBox preset;
    private javax.swing.JTree projectTree;
    // End of variables declaration//GEN-END:variables
         
    
    public void loadPresets(int index) {
        switch (index) {
            case 0:
                KSLOC.setText("22.4");
                ACAP.setSelectedIndex(3);
                APEX.setSelectedIndex(2);
                PCAP.setSelectedIndex(3);
                //LTEX.setSelectedIndex(0);
                //dev sys exp
                //target sys exp
                //prac and methods exp
                //Modern Dev prac use
                TOOL.setSelectedIndex(1);
                //Logon thru hardcp
                //Term response time
                SITE.setSelectedIndex(3);
                //resource dedication
                //resource and support Loc
                //dev system vol
                //Process volatility
                //requirements volitility
                RELY.setSelectedIndex(1);
                //test level
                //Qual. assurance
                //rehost from development to target
                RUSE.setSelectedIndex(3);
                //Lang typ complexity
                //dev system complexity
                CPLX.setSelectedIndex(3);
                //process impv.
                //special disp requirements
                STOR.setSelectedIndex(3);
                TIME.setSelectedIndex(2);
                //Real Time code
                //Target sys Complexity
                PVOL.setSelectedIndex(3);
                //security require
                break;
                
            case 1:
                KSLOC.setText("28.0");
                ACAP.setSelectedIndex(2);
                APEX.setSelectedIndex(1);
                PCAP.setSelectedIndex(2);
                //LTEX.setSelectedIndex(0);
                //dev sys exp
                //target sys exp
                //prac and methods exp
                //Modern Dev prac use
                TOOL.setSelectedIndex(1);
                //Logon thru hardcp
                //Term response time
                SITE.setSelectedIndex(3);
                //resource dedication
                //resource and support Loc
                //dev system vol
                //Process volatility
                //requirements volitility
                RELY.setSelectedIndex(0);
                //test level
                //Qual. assurance
                //rehost from development to target
                RUSE.setSelectedIndex(3);
                //Lang typ complexity
                //dev system complexity
                CPLX.setSelectedIndex(2);
                //process impv.
                //special disp requirements
                STOR.setSelectedIndex(2);
                TIME.setSelectedIndex(1);
                //Real Time code
                //Target sys Complexity
                PVOL.setSelectedIndex(3);
                //security require
                break;
                
            case 2:
                KSLOC.setText("33.6");
                ACAP.setSelectedIndex(1);
                APEX.setSelectedIndex(0);
                PCAP.setSelectedIndex(1);
                //LTEX.setSelectedIndex(0);
                //dev sys exp
                //target sys exp
                //prac and methods exp
                //Modern Dev prac use
                TOOL.setSelectedIndex(1);
                //Logon thru hardcp
                //Term response time
                SITE.setSelectedIndex(3);
                //resource dedication
                //resource and support Loc
                //dev system vol
                //Process volatility
                //requirements volitility
                RELY.setSelectedIndex(0);
                //test level
                //Qual. assurance
                //rehost from development to target
                RUSE.setSelectedIndex(3);
                //Lang typ complexity
                //dev system complexity
                CPLX.setSelectedIndex(2);
                //process impv.
                //special disp requirements
                STOR.setSelectedIndex(1);
                TIME.setSelectedIndex(0);
                //Real Time code
                //Target sys Complexity
                PVOL.setSelectedIndex(2);
                //security require
                break;
        }
        
    }
    
    public void clear() {
        int selection = JOptionPane.showConfirmDialog(null,"Are you sure you want to delete all the project tree?","Deletion Confirmation", JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
        if (selection == 0) {
            Project.removeAllChildren();
            projectTreeModel.reload();
        }
        return;
    }

    public void removeCurrentNode() {     
        try {
            currNode = (cocoNode)projectTree.getSelectionPath().getLastPathComponent();
            cocoNode parent = (cocoNode)(currNode.getParent());
            if (parent != null) {
                int selection = JOptionPane.showConfirmDialog(null,"Are you sure you want to delete this module/submodule and all its children?","Deletion Confirmation", JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE);
                if (selection == 0) projectTreeModel.removeNodeFromParent(currNode);
                return;
            }            
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null,"Please select a module to remove", "No Selection Error", JOptionPane.ERROR_MESSAGE);
        }
    }
    
    public cocoNode addObject(String child) {
        cocoNode parentNode = null;
        TreePath parentPath = projectTree.getSelectionPath();
        
        if (parentPath == null) {
            parentNode = Project;
        } else {
            parentNode = (cocoNode)
            (parentPath.getLastPathComponent());
        }
        
        return addObject(parentNode, child, true);
    }
    
    public cocoNode addObject(cocoNode parent, String child) {
        return addObject(parent, child, false);
    }
    
    public cocoNode addObject(cocoNode parent, String child, boolean shouldBeVisible) {
        cocoNode childNode = new cocoNode(child);
        
        if (parent == null) {
            parent = Project;
        }
        
        projectTreeModel.insertNodeInto(childNode, parent,
                parent.getChildCount());
        
        if (shouldBeVisible) {
            projectTree.scrollPathToVisible(new TreePath(childNode.getPath()));
        }
        return childNode;
    }
    
    class MyTreeModelListener implements TreeModelListener {
        public void treeNodesChanged(TreeModelEvent e) {
            cocoNode node;
            node = (cocoNode)(e.getTreePath().getLastPathComponent());
            
            try {
                int index = e.getChildIndices()[0];
                node = (cocoNode)(node.getChildAt(index));
            } catch (NullPointerException exc) {} 
        }
        public void treeNodesInserted(TreeModelEvent e) {
        }
        public void treeNodesRemoved(TreeModelEvent e) {
        }
        public void treeStructureChanged(TreeModelEvent e) {
        }
    }
    
    public void Export () throws Exception {
            currNode = (cocoNode)projectTree.getSelectionPath().getLastPathComponent();
            PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("outPro")));
            
            String outBuff = new String("");
            int val = -1;
            
            out.print("# /* filetype=sh : */ # -*- sh -*- \n" +
                    "\n" +
                    "Tmp=`mktemp -d`\n" +
                    "trap \"cd; rm -rf $Tmp\" 0 1 2 3 15\n" +  
                    "Here=`pwd`\n" +
//                    "cd $Tmp\n" +
                    "eden() {\n" +
                    "\t\tcat <<-EOF\n" +
                    "\t\tsystem with autonomy\n" +
                    "\t\tautonomy with 0\n");        
            
            for (String att : currNode.coco.COCOMOATTRS) {
                if (att.equals("A"))
                    outBuff = new String (String.valueOf(currNode.coco.a()));
                else if (att.equals("B"))
                    outBuff = new String (String.valueOf(currNode.coco.b()));
                else if (att.equals("KSLOC"))
                    outBuff = new String (String.valueOf(currNode.coco.ksloc()));
                else {
                    val = currNode.coco.getAttVal(att);
                    val = 7-val;
                    outBuff = new String (String.valueOf(val));
                }                
                
                if (val != 1 && (att.equalsIgnoreCase("DATA") || att.equalsIgnoreCase("RUSE") || att.equalsIgnoreCase("PVOL"))) {
//                    System.out.println("1- " + att);
                    out.print("\t\t\t" + att.toLowerCase() + " = " + outBuff + "\n");
                }
                else if (val != 2 && (att.equalsIgnoreCase("TIME") || att.equalsIgnoreCase("STOR"))) {
//                    System.out.println("2- " + att);
                    out.print("\t\t\t" + att.toLowerCase() + " = " + outBuff + "\n");
                }
                else if ( val != 0 && !(att.equalsIgnoreCase("DATA") || att.equalsIgnoreCase("RUSE") || att.equalsIgnoreCase("PVOL") || att.equalsIgnoreCase("TIME") || att.equalsIgnoreCase("STOR"))) {
//                    System.out.println("3- " + att);
                    if (att.equals("A") || att.equals("B"))
                        out.print("\t\t\t" + att.toUpperCase() + " = " + outBuff + "\n");
                    else 
                        out.print("\t\t\t" + att.toLowerCase() + " = " + outBuff + "\n");
                }
//                out.print("test\n");
//                System.out.println(currNode.coco.lookup(att));
            }
            
            out.print("EOF\n" +
                    "}\n" +
                    "eden > $Tmp/project.dat\n" +
                    "./xomo -S $RANDOM -l -R 1000 -d defaults.dat -p $Tmp/project.dat -P 0  -s '<$defects,<$effort,<$risk,?$A,?$B,$ksloc'\n");

            out.close();        

    }

    public void RunXomo() throws Exception {
        currNode = (cocoNode)projectTree.getSelectionPath().getLastPathComponent();
        String sh = "/bin/sh";
        String cop = "-c";       

        Process P;
        
        P = Runtime.getRuntime().exec("./initRun " + currNode.coco.name);
        P.waitFor();
            
        for (int i=0; i<5; i++) {
            String cmd = "./6 " + currNode.coco.name + " " + (i+1) + "| ./fetchtreatment.awk";
            String[] exe = new String[] {sh, cop, cmd};
            
            System.out.println((i+1));
            P = Runtime.getRuntime().exec("chmod +rwx outPro");
            P.waitFor();
            P = Runtime.getRuntime().exec(exe);
            P.waitFor();
//            Thread.sleep(200);
        } 
        
        P = Runtime.getRuntime().exec("./plotSh " + currNode.coco.name);
        P = Runtime.getRuntime().exec("rm -f outPro");
        P.waitFor();
    }

    public void Rename() throws Exception {
        currNode = (cocoNode)projectTree.getSelectionPath().getLastPathComponent();
        String mName = JOptionPane.showInputDialog("Enter the desired module name: ", "Rename Module");
        if (mName!=null && !mName.equals("Rename Module") && !mName.equals("")) {
            currNode.origName = new String(mName);
            currNode.coco.name = currNode.origName;
            projectTreeModel.reload();
            for (int i=0; i<projectTree.getRowCount(); i++)
                projectTree.expandRow(i);
            //projectTree.scrollPathToVisible(new TreePath(currNode.getPath()));
        } else if (mName != null) JOptionPane.showMessageDialog(null,"Please enter a valid name", "Invalid Module Name", JOptionPane.ERROR_MESSAGE);

    }

    public void AddModule() {
        String mName = JOptionPane.showInputDialog("Enter the desired module name: ", "New Module");
        if (mName!=null && !mName.equals("New Module") && !mName.equals(""))
            addObject(mName);
        else if (mName!=null) JOptionPane.showMessageDialog(null,"Please enter a valid name", "Invalid Module Name", JOptionPane.ERROR_MESSAGE);
    }

    public void ModAtt() throws Exception {
        currNode = (cocoNode)projectTree.getSelectionPath().getLastPathComponent();
        modParam.setTitle("Module <<" + currNode.coco.name + ">> Attributes");
        this.setEnabled(false);
        modParam.setVisible(true);
        
        refresh();
    }

}

class cocoNode extends DefaultMutableTreeNode{ //this class will be the object in each node of the tree
    
    public Cocomo coco;
    
    public String origName;
    
    public cocoNode(String n) {
        coco = new Cocomo(n);
        coco.defaultTunings();
        defaultSet();
        origName = new String(n);
    }
    
    public cocoNode(String n, Cocomo cocoIn) {
        coco = new Cocomo(n, cocoIn.attrs);
        origName = new String(n);
    }
    
    public String toString() {
        return coco.name;
    }
            
    public void defaultSet() {
//        coco.set("A",new CocValue(3.0));
//        coco.set("B",new CocValue(1.0));
        coco.set("KSLOC",new CocValue(10.0));
        coco.set("PREC",new CocValue(7.0));
        coco.set("RESL",new CocValue(7.0));
        coco.set("TEAM",new CocValue(7.0));
        coco.set("PMAT",new CocValue(7.0));
        coco.set("FLEX",new CocValue(7.0));
        coco.set("RELY",new CocValue(7.0));
        coco.set("DATA",new CocValue(6.0));
        coco.set("DOCU",new CocValue(7.0));
        coco.set("CPLX",new CocValue(7.0));
        coco.set("RUSE",new CocValue(6.0));
        coco.set("TIME",new CocValue(5.0));
        coco.set("STOR",new CocValue(5.0));
        coco.set("PVOL",new CocValue(6.0));
        coco.set("ACAP",new CocValue(7.0));
        coco.set("APEX",new CocValue(7.0));
        coco.set("PCAP",new CocValue(7.0));
        coco.set("PLEX",new CocValue(7.0));
        coco.set("LTEX",new CocValue(7.0));
        coco.set("PCON",new CocValue(7.0));
        coco.set("TOOL",new CocValue(7.0));
        coco.set("SCED",new CocValue(7.0));
        coco.set("SITE",new CocValue(7.0));
        coco.set("AUTOMATED_ANALYSIS",new CocValue(7.0));
        coco.set("PEER_REVIEWS",new CocValue(7.0));
        coco.set("EXECUTION_TESTING_AND_TOOLS",new CocValue(7.0));
    }    
    
}


