Index: trunk/nbproject/project.properties
===================================================================
--- trunk/nbproject/project.properties	(revision 144)
+++ trunk/nbproject/project.properties	(revision 145)
@@ -1,3 +1,3 @@
-#Wed Jan 30 11:36:38 PST 2019
+#Mon Nov 04 09:53:02 PST 2019
 excludes=
 javac.deprecation=false
Index: trunk/src/scriptbuilder/structures/TimeSlice.java
===================================================================
--- trunk/src/scriptbuilder/structures/TimeSlice.java	(revision 142)
+++ trunk/src/scriptbuilder/structures/TimeSlice.java	(revision 145)
@@ -56,4 +56,8 @@
     }
 
+    
+    public ScriptIncident getIncident(){
+        return thisIncident;
+    }
     /**
      * Add a new script event to this time slice. Sort events by event type.
@@ -77,4 +81,6 @@
     public int getX()
     {
+//        System.out.println("position: " + seconds / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION
+//                * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK);
         return seconds / ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION
                 * ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK;
@@ -210,4 +216,5 @@
     public String toXML()
     {
+        //eventsCopy2 is used to clear out eventsCopy with one element contained
         ArrayList<I_ScriptEvent> eventsCopy = new ArrayList<I_ScriptEvent>();
         ArrayList<I_ScriptEvent> eventsCopy2 = new ArrayList<I_ScriptEvent>();
Index: trunk/src/scriptbuilder/structures/CadData.java
===================================================================
--- trunk/src/scriptbuilder/structures/CadData.java	(revision 143)
+++ trunk/src/scriptbuilder/structures/CadData.java	(revision 145)
@@ -15,14 +15,31 @@
         locInfo = new ArrayList<Location_Info>();
     }
+    
+    /**
+     * Constructor to add type and location, where TruncLoc is the first 5 letters of the fullloc.
+     * @param Header_Type
+     * @param Header_FullLoc 
+     */
+    public CadData(String Header_Type, String Header_FullLoc)
+    {
+        this.Header_Type = Header_Type;
+        this.Header_FullLoc = Header_FullLoc;
+//        if(Header_FullLoc.length()>10)
+//        {
+//            this.Header_TruncLoc = Header_FullLoc.substring(0,9);
+//        }
+        this.Header_TruncLoc = Header_FullLoc;
+        locInfo = new ArrayList<Location_Info>();
+    }
 
     public TimeSlice tSlice;
 
-    public String Header_Type = "DEFAULT";
+    public String Header_Type = "";
 
     public String Header_Beat = "";
 
-    public String Header_TruncLoc = "Default Location (short)";
-
-    public String Header_FullLoc = "Default Location (long)";
+    public String Header_TruncLoc = "";
+
+    public String Header_FullLoc = "";
 
     public String Master_Inc_Num = "";
@@ -134,6 +151,7 @@
         }
 
-        if (hasHeaderInfo() || true) //checking to see if header info is always necessary
-        {
+        if (hasHeaderInfo()) //checking to see if header info is always necessary
+        {
+            //todo: make this logic trigger only once per incident
             output += XMLWriter.openTag(ELEMENT.HEADER_INFO.tag);
 
Index: trunk/src/scriptbuilder/structures/.directory
===================================================================
--- trunk/src/scriptbuilder/structures/.directory	(revision 145)
+++ trunk/src/scriptbuilder/structures/.directory	(revision 145)
@@ -0,0 +1,5 @@
+[Dolphin]
+Timestamp=2019,10,31,15,57,42
+Version=4
+ViewMode=1
+VisibleRoles=CustomizedDetails,Details_text,Details_size,Details_modificationtime,Details_type,Details_tags,Details_group,Details_permissions
Index: trunk/src/scriptbuilder/structures/ScriptIncident.java
===================================================================
--- trunk/src/scriptbuilder/structures/ScriptIncident.java	(revision 131)
+++ trunk/src/scriptbuilder/structures/ScriptIncident.java	(revision 145)
@@ -46,5 +46,5 @@
      */
     public String description;
-
+    
     /**
      * Length, in seconds, of the incident.
@@ -72,5 +72,5 @@
     public int eventCount = 0;
 
-    SimulationScript script;
+    public SimulationScript script;
 
     /**
@@ -135,4 +135,31 @@
         this.setOffset(offset);
     }
+    
+//    /**
+//     * Constructor with type and location parameters.
+//     * @param color
+//     * @param number
+//     * @param name
+//     * @param description
+//     * @param script
+//     * @param offset
+//     * @param type
+//     * @param location 
+//     */
+//    public ScriptIncident(Color color, int number, String name,
+//            String description, SimulationScript script,
+//            int offset, String type, String location)
+//    {
+//        this.color = color;
+//        this.number = number;
+//        this.name = name;
+//        this.description = description;
+//        this.script = script;
+//        slices = new TreeMap<Integer, TimeSlice>();
+//        this.setOffset(offset);
+//        this.location = location;
+//        this.type = type;
+//        insertCadData(offset, new CadData(type,location));
+//    }
 
     /**
@@ -293,5 +320,5 @@
     }
 
-    void insertCadData(long currentEventTime, CadData cad)
+    public void insertCadData(long currentEventTime, CadData cad)
     {
         int time = (int) currentEventTime;
@@ -305,4 +332,13 @@
         slice = slices.get(time);
         slice.cadData = cad;
+    }
+    
+    public CadData getCadData(long currentEventTime)
+    {
+        int time = (int) currentEventTime;
+        TimeSlice slice;
+        
+        slice = slices.get(time);
+        return slice.cadData;
     }
 
Index: trunk/src/scriptbuilder/structures/units/Unit.java
===================================================================
--- trunk/src/scriptbuilder/structures/units/Unit.java	(revision 46)
+++ trunk/src/scriptbuilder/structures/units/Unit.java	(revision 145)
@@ -102,4 +102,11 @@
         Unit_Status = "";
     }
+    
+    public boolean equals(Unit u){
+        return UnitNum.equals(u.UnitNum);
+    }
+    public boolean equals(String num){
+        return UnitNum.equals(num);
+    }
 
     @Override
Index: trunk/src/scriptbuilder/structures/events/UnitEvent.java
===================================================================
--- trunk/src/scriptbuilder/structures/events/UnitEvent.java	(revision 76)
+++ trunk/src/scriptbuilder/structures/events/UnitEvent.java	(revision 145)
@@ -22,8 +22,11 @@
     /**
      * Constructor.
+     * //TODO: when created, add a unit to the main units list that is contained within SimulationScript
      */
     public UnitEvent()
     {
+        
         super(ScriptEventType.UNIT_EVENT);
+        
     }
 
Index: trunk/src/scriptbuilder/structures/ScriptEvent.java
===================================================================
--- trunk/src/scriptbuilder/structures/ScriptEvent.java	(revision 107)
+++ trunk/src/scriptbuilder/structures/ScriptEvent.java	(revision 145)
@@ -83,5 +83,5 @@
     public int length;
     
-    private TimeSlice slice;
+    public TimeSlice slice;
 
     /**
Index: trunk/src/scriptbuilder/structures/MyScriptHandler.java
===================================================================
--- trunk/src/scriptbuilder/structures/MyScriptHandler.java	(revision 138)
+++ trunk/src/scriptbuilder/structures/MyScriptHandler.java	(revision 145)
@@ -304,5 +304,5 @@
 
         docPosition.push(ELEMENT.byName(qName));
-
+        
         try
         {
@@ -612,4 +612,5 @@
      * SAX Handler method. Executes at the close of each XML element.
      */
+    //todo: interpret this function better so that what is loaded from the XML file is easier to know.
     @Override
     public void endElement(String uri, String localName, String qName)
@@ -670,4 +671,6 @@
             {
                 cad.Header_Type = pcData.remove(currentElement);
+//                //change where the data is loaded in here
+//                currInc.insertCadData((int) currentEventTime, cad);
             }
             else if (currentElement == ELEMENT.Beat && docPosition.peek() == ELEMENT.HEADER_INFO)
Index: trunk/src/scriptbuilder/structures/ELEMENT.java
===================================================================
--- trunk/src/scriptbuilder/structures/ELEMENT.java	(revision 138)
+++ trunk/src/scriptbuilder/structures/ELEMENT.java	(revision 145)
@@ -35,4 +35,5 @@
     LOCATION_INFO,
     NEW_UNIT,
+    //todo: change this paramics to traffic modeler
     PARAMICS,//EVENT
     RADIO_EVALUATION,
Index: trunk/src/scriptbuilder/structures/SimulationScript.java
===================================================================
--- trunk/src/scriptbuilder/structures/SimulationScript.java	(revision 131)
+++ trunk/src/scriptbuilder/structures/SimulationScript.java	(revision 145)
@@ -21,4 +21,5 @@
  *
  * @author Bryan McGuffin <bmcguffi@calpoly.edu>
+ * @author Sebastien Danthinne <sdanthin@calpoly.edu>
  * @version 2017/06/22
  */
@@ -61,8 +62,9 @@
      * The units which participate in Unit events.
      */
-    public List<Unit> units;
+    public List<Unit> units; 
 
     //Somewhere in the code, something assumes that the list of incidents
     //contains exactly 10 items. Until I can find and un-break that, this will do.
+    //todo: this incident fill count error
     private final int INCIDENT_FILL_COUNT = 10;
 
@@ -76,4 +78,6 @@
      */
     private MyScriptHandler sh;
+    
+    public boolean saved;
 
     //TODO: Pretty much everything in this constructor is dummy data.
@@ -89,4 +93,5 @@
         units = new ArrayList<Unit>();
         numberOfIncidents = 0;
+        saved = true;
 
         //Backfill with null incidents
@@ -96,15 +101,47 @@
         }
     }
-
+    
+    /**
+     * checks and sees if this object has the unit passed.
+     * @param unitID
+     * @return does this SimulationScript have unitnum?
+     */
+    public boolean hasUnit(String unitID){
+        boolean indicator = false;
+        if(units.size()!=0){
+            for(Unit u : units){
+               if(unitID.equals(u.UnitNum)){
+                   indicator = true;
+               }
+            }
+        }
+            
+        return indicator;
+    }
+    /**
+     * creates a dummy unit that only has unit number
+     * @param unitNum 
+     */
+    public void addDummyUnit(String unitNum){
+        Unit dummy = new Unit();
+        dummy.UnitNum = unitNum;
+        units.add(dummy);
+    }
     /**
      * Update the script's observers.
-     *
+     * 
      */
     public void update()
     {
         // The script has changed, notify observers
+        //use to rewrite the save indicator
+        //System.out.println("Script changed");
         setChanged();
         notifyObservers(this);
-    }
+        saved = false;
+        
+        
+    }
+    
 
     /**
@@ -154,4 +191,26 @@
         {
             System.out.println("ERROR LOADING SCRIPT");
+            ex.printStackTrace();
+        }
+        System.out.println("H");
+        for(Unit testUnit : units){
+            System.out.println(testUnit.toXML());
+        }
+        this.update();
+    }
+    
+    /**
+     * Load in an existing list of units from an XML file.
+     * @param f the file containing the units
+     */
+    public void loadUnitsFromFile(File f){
+        try
+        {
+            SAXParserFactory.newInstance().newSAXParser().parse(f, sh);
+            units.addAll(sh.getUnits());
+        }
+        catch (Exception ex)
+        {
+            System.out.println("ERROR LOADING UNITS");
             ex.printStackTrace();
         }
@@ -197,4 +256,5 @@
             ex.printStackTrace();
         }
+        saved = true;
     }
 
Index: trunk/src/scriptbuilder/gui/ScriptBuilderFrame.java
===================================================================
--- trunk/src/scriptbuilder/gui/ScriptBuilderFrame.java	(revision 139)
+++ trunk/src/scriptbuilder/gui/ScriptBuilderFrame.java	(revision 145)
@@ -13,6 +13,9 @@
 import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
 import java.io.File;
 import java.io.IOException;
+import java.io.FileNotFoundException;
 import java.net.URI;
 import java.util.Observable;
@@ -38,4 +41,5 @@
 import scriptbuilder.structures.TimeSlice;
 import scriptbuilder.structures.events.I_ScriptEvent;
+import scriptbuilder.structures.CadData;
 
 /**
@@ -152,4 +156,9 @@
         script.addObserver(this);
         initComponents();
+        addCustomListeners();
+        //add to listener helper method
+        
+        
+        
         //We don't currently want the button to be present in this window
         btnAddTime.setVisible(false);
@@ -162,14 +171,6 @@
          */
         // Set listener for scroll pane
-        String t = "Script Builder: ";
-        if (script.saveFile == null)
-        {
-            t += "untitled1.xml";
-        }
-        else
-        {
-            t += script.saveFile.getName();
-        }
-        this.setTitle(t);
+        
+        
         AdjustmentListener listener = new MyAdjustmentListener();
         timelinesScrollPane.getHorizontalScrollBar().addAdjustmentListener(listener);
@@ -177,4 +178,56 @@
         repaint();
 
+    }
+    
+    /**
+     * Put all custom non-generated listeners in this method
+     */
+    private void addCustomListeners(){
+        
+        String fileName = "units.xml";
+        File unitFile = new File(fileName);
+        script.loadUnitsFromFile(unitFile);
+        //listener for window closing
+        this.addWindowListener(new WindowAdapter(){
+            @Override
+            public void windowClosing(WindowEvent e)
+            {
+                //System.out.println("Window is closing!" + saved);
+
+                if(!script.saved){
+                    //System.out.println("window was not saved!");
+                    Object[] options = {"Yes","No","Cancel"};
+                    int result = JOptionPane.showOptionDialog(null,"Would you like to save changes before exiting?",
+                            "Exit",
+                            JOptionPane.YES_NO_CANCEL_OPTION,
+                            JOptionPane.QUESTION_MESSAGE,
+                            null,
+                            options,
+                            options[2]);
+                    switch (result){
+                        //should save script then close
+                        case 0:
+                            fileSaveActionPerformed(null);
+                            //System.exit(0);
+                            break;
+                        // should just exit
+                        case 1:
+                            System.exit(0);
+                            break;
+                        // should do nothing
+                        case 2:
+                            break;
+                        default:
+                            break;
+                    }
+                    
+                    
+                    
+                }else{
+                    //should close current window since it is saved already
+                    System.exit(0);
+                }
+            }
+        });
     }
 
@@ -192,7 +245,8 @@
     public void update(Observable o, Object arg)
     {
-        //Three major update types: whole script, and 2 event updates
+        checkNeedsSave();
         if (arg instanceof SimulationScript)
         {
+            
             script = (SimulationScript) arg;
 
@@ -236,6 +290,8 @@
              * model.addElement(i); } gotoIncident.setModel(model);*
              */
+            
             this.setPreferredSize(this.getSize());
             pack();
+            
         }
         //Mouse has changed focus to a different timeslice
@@ -249,4 +305,7 @@
                 model.addElement(e);
             }
+            
+            
+            
         }
         //Mouse has changed focus to a different incident timeline panel 
@@ -256,4 +315,5 @@
 
             //gotoIncident.setSelectedItem(i);
+            
         }
 
@@ -267,18 +327,11 @@
         //scale the zoom slider such that the most zoomed-out point allows the
         //entire script to be visible at once
+        
+        //todo: interpret these two calls and make them so that they are more accurate to fit the entire window at once
         zoomSlider.setMinimum(((timelineTickPanel.getVisibleRect().width - 20)
                 * ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION)
                 / Math.max(script.absoluteLength(), ScriptBuilderGuiConstants.TICK_TIMELINE_SMALLEST_LENGTH));
         zoomSlider.setMaximum(zoomSlider.getMinimum() + 20);
-        String t = "Script Builder: ";
-        if (script.saveFile == null)
-        {
-            t += "untitled1.xml";
-        }
-        else
-        {
-            t += script.saveFile.getName();
-        }
-        this.setTitle(t);
+        
         repaint();
     }
@@ -291,6 +344,5 @@
     @SuppressWarnings("unchecked")
     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
-    private void initComponents()
-    {
+    private void initComponents() {
 
         incidentPopupMenu = new javax.swing.JPopupMenu();
@@ -333,4 +385,8 @@
         incidentColorField = new javax.swing.JTextField();
         txtIncidentLength = new javax.swing.JLabel();
+        jLabel1 = new javax.swing.JLabel();
+        addIncidentLocation = new javax.swing.JTextField();
+        jLabel2 = new javax.swing.JLabel();
+        addIncidentType = new javax.swing.JTextField();
         addNoiseFrame = new javax.swing.JFrame();
         labelRadioChatter = new javax.swing.JLabel();
@@ -396,4 +452,5 @@
         newIncident = new javax.swing.JMenuItem();
         deleteIncident = new javax.swing.JMenuItem();
+        deleteIncident1 = new javax.swing.JMenuItem();
         jSeparator4 = new javax.swing.JPopupMenu.Separator();
         saveIncident = new javax.swing.JMenuItem();
@@ -401,4 +458,6 @@
         generateNoiseMenu = new javax.swing.JMenu();
         generateNoiseOption = new javax.swing.JMenuItem();
+        helpMenu1 = new javax.swing.JMenu();
+        loadUnits = new javax.swing.JMenuItem();
         helpMenu = new javax.swing.JMenu();
         helpTutorial = new javax.swing.JMenuItem();
@@ -406,22 +465,22 @@
 
         popupDeleteIncident.setText("Delete Incident...");
+        popupDeleteIncident.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                popupDeleteIncidentActionPerformed(evt);
+            }
+        });
         incidentPopupMenu.add(popupDeleteIncident);
 
         cadEvent.setText("CAD Event");
-        cadEvent.addMouseListener(new java.awt.event.MouseAdapter()
-        {
-            public void mousePressed(java.awt.event.MouseEvent evt)
-            {
+        cadEvent.addMouseListener(new java.awt.event.MouseAdapter() {
+            public void mousePressed(java.awt.event.MouseEvent evt) {
                 cadEventMousePressed(evt);
             }
-            public void mouseReleased(java.awt.event.MouseEvent evt)
-            {
+            public void mouseReleased(java.awt.event.MouseEvent evt) {
                 cadEventMouseReleased(evt);
             }
         });
-        cadEvent.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        cadEvent.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 cadEventActionPerformed(evt);
             }
@@ -433,8 +492,6 @@
 
         radioEvent.setText("Radio Event");
-        radioEvent.addMouseListener(new java.awt.event.MouseAdapter()
-        {
-            public void mousePressed(java.awt.event.MouseEvent evt)
-            {
+        radioEvent.addMouseListener(new java.awt.event.MouseAdapter() {
+            public void mousePressed(java.awt.event.MouseEvent evt) {
                 radioEventMousePressed(evt);
             }
@@ -490,8 +547,6 @@
 
         okButton.setText("OK");
-        okButton.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        okButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 okButtonActionPerformed(evt);
             }
@@ -499,8 +554,6 @@
 
         cancelButton.setText("Cancel");
-        cancelButton.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        cancelButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 cancelButtonActionPerformed(evt);
             }
@@ -545,8 +598,6 @@
 
         editEventList.setText("Edit...");
-        editEventList.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        editEventList.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 editEventListActionPerformed(evt);
             }
@@ -578,8 +629,6 @@
 
         incidentOkButton.setText("OK");
-        incidentOkButton.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        incidentOkButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 incidentOkButtonActionPerformed(evt);
             }
@@ -587,13 +636,17 @@
 
         incidentCancelButton.setText("Cancel");
-        incidentCancelButton.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        incidentCancelButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 incidentCancelButtonActionPerformed(evt);
             }
         });
 
-        addIncidentNumber.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(101), Integer.valueOf(101), null, Integer.valueOf(1)));
+        addIncidentNumber.setModel(new javax.swing.SpinnerNumberModel(101, 101, null, 1));
+
+        addIncidentName.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                addIncidentNameActionPerformed(evt);
+            }
+        });
 
         labelIncidentLength.setText("Incident Length in Minutes: ");
@@ -601,11 +654,9 @@
         labelIncidentStart.setText("Incident Start Time in Minutes:");
 
-        addIncidentStart.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));
+        addIncidentStart.setModel(new javax.swing.SpinnerNumberModel(0, 0, null, 1));
 
         btnChooseColor.setText("Choose...");
-        btnChooseColor.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        btnChooseColor.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 btnChooseColorActionPerformed(evt);
             }
@@ -618,4 +669,14 @@
         txtIncidentLength.setText("0");
         txtIncidentLength.setToolTipText("");
+
+        jLabel1.setText("Incident Location:");
+
+        addIncidentLocation.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                addIncidentLocationActionPerformed(evt);
+            }
+        });
+
+        jLabel2.setText("Incident Type:");
 
         javax.swing.GroupLayout incidentFrameLayout = new javax.swing.GroupLayout(incidentFrame.getContentPane());
@@ -623,27 +684,26 @@
         incidentFrameLayout.setHorizontalGroup(
             incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, incidentFrameLayout.createSequentialGroup()
+            .addGroup(incidentFrameLayout.createSequentialGroup()
                 .addContainerGap()
-                .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
-                    .addComponent(incidentPropertiesScrollPane, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)
-                    .addComponent(labelIncidentDescription, javax.swing.GroupLayout.Alignment.LEADING)
-                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, incidentFrameLayout.createSequentialGroup()
+                .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(incidentPropertiesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)
+                    .addGroup(incidentFrameLayout.createSequentialGroup()
                         .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                             .addComponent(labelIncidentNumber)
                             .addComponent(labelIncidentName)
                             .addComponent(labelIncidentColor))
-                        .addGap(18, 18, 18)
+                        .addGap(66, 66, 66)
                         .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                            .addComponent(addIncidentName, javax.swing.GroupLayout.DEFAULT_SIZE, 218, Short.MAX_VALUE)
-                            .addComponent(addIncidentNumber, javax.swing.GroupLayout.DEFAULT_SIZE, 218, Short.MAX_VALUE)
+                            .addComponent(addIncidentName, javax.swing.GroupLayout.DEFAULT_SIZE, 199, Short.MAX_VALUE)
+                            .addComponent(addIncidentNumber, javax.swing.GroupLayout.DEFAULT_SIZE, 199, Short.MAX_VALUE)
                             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, incidentFrameLayout.createSequentialGroup()
-                                .addComponent(incidentColorField, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
+                                .addComponent(incidentColorField, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE)
                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                 .addComponent(btnChooseColor, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE))))
-                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, incidentFrameLayout.createSequentialGroup()
+                    .addGroup(incidentFrameLayout.createSequentialGroup()
                         .addComponent(incidentCancelButton)
                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 188, Short.MAX_VALUE)
                         .addComponent(incidentOkButton, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
-                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, incidentFrameLayout.createSequentialGroup()
+                    .addGroup(incidentFrameLayout.createSequentialGroup()
                         .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                             .addComponent(labelIncidentStart)
@@ -655,5 +715,16 @@
                                 .addComponent(txtIncidentLength, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                 .addGap(22, 22, 22))
-                            .addComponent(addIncidentStart, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE))))
+                            .addComponent(addIncidentStart, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)))
+                    .addGroup(incidentFrameLayout.createSequentialGroup()
+                        .addComponent(jLabel2)
+                        .addGap(93, 93, 93)
+                        .addComponent(addIncidentType))
+                    .addGroup(incidentFrameLayout.createSequentialGroup()
+                        .addComponent(labelIncidentDescription)
+                        .addGap(0, 0, Short.MAX_VALUE))
+                    .addGroup(incidentFrameLayout.createSequentialGroup()
+                        .addComponent(jLabel1)
+                        .addGap(69, 69, 69)
+                        .addComponent(addIncidentLocation)))
                 .addContainerGap())
         );
@@ -675,7 +746,15 @@
                     .addComponent(incidentColorField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(jLabel1)
+                    .addComponent(addIncidentLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(jLabel2)
+                    .addComponent(addIncidentType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(labelIncidentDescription)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(incidentPropertiesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
+                .addComponent(incidentPropertiesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addGroup(incidentFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
@@ -726,8 +805,6 @@
 
         btnCancelNoise.setText("Cancel");
-        btnCancelNoise.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        btnCancelNoise.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 btnCancelNoiseActionPerformed(evt);
             }
@@ -735,8 +812,6 @@
 
         btnGenerateNoise.setText("Generate");
-        btnGenerateNoise.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        btnGenerateNoise.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 btnGenerateNoiseActionPerformed(evt);
             }
@@ -817,5 +892,5 @@
         );
 
-        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
         setTitle("Script Builder");
         setBounds(new java.awt.Rectangle(0, 23, 800, 700));
@@ -1187,8 +1262,6 @@
         zoomSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
         zoomSlider.setFocusable(false);
-        zoomSlider.addChangeListener(new javax.swing.event.ChangeListener()
-        {
-            public void stateChanged(javax.swing.event.ChangeEvent evt)
-            {
+        zoomSlider.addChangeListener(new javax.swing.event.ChangeListener() {
+            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                 zoomSliderStateChanged(evt);
             }
@@ -1197,8 +1270,6 @@
         zoomInIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ZoomIn.png"))); // NOI18N
         zoomInIcon.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
-        zoomInIcon.addMouseListener(new java.awt.event.MouseAdapter()
-        {
-            public void mouseClicked(java.awt.event.MouseEvent evt)
-            {
+        zoomInIcon.addMouseListener(new java.awt.event.MouseAdapter() {
+            public void mouseClicked(java.awt.event.MouseEvent evt) {
                 zoomInIconMouseClicked(evt);
             }
@@ -1207,8 +1278,6 @@
         zoomOutIcon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ZoomOut.png"))); // NOI18N
         zoomOutIcon.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
-        zoomOutIcon.addMouseListener(new java.awt.event.MouseAdapter()
-        {
-            public void mouseClicked(java.awt.event.MouseEvent evt)
-            {
+        zoomOutIcon.addMouseListener(new java.awt.event.MouseAdapter() {
+            public void mouseClicked(java.awt.event.MouseEvent evt) {
                 zoomOutIconMouseClicked(evt);
             }
@@ -1233,9 +1302,17 @@
 
         btnAddTime.setText("+15:00");
-        btnAddTime.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        btnAddTime.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 btnAddTimeActionPerformed(evt);
+            }
+        });
+
+        scriptBuilderMenuBar.addAncestorListener(new javax.swing.event.AncestorListener() {
+            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
+            }
+            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
+                scriptBuilderMenuBarAncestorAdded(evt);
+            }
+            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
             }
         });
@@ -1243,8 +1320,6 @@
         fileMenu.setText("File");
         fileMenu.setMargin(new java.awt.Insets(0, 10, 0, 10));
-        fileMenu.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        fileMenu.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 fileMenuActionPerformed(evt);
             }
@@ -1253,8 +1328,6 @@
         fileNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
         fileNew.setText("New");
-        fileNew.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        fileNew.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 fileNewActionPerformed(evt);
             }
@@ -1265,8 +1338,6 @@
         fileOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
         fileOpen.setText("Open...");
-        fileOpen.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        fileOpen.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 fileOpenActionPerformed(evt);
             }
@@ -1277,8 +1348,6 @@
         fileSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
         fileSave.setText("Save");
-        fileSave.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        fileSave.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 fileSaveActionPerformed(evt);
             }
@@ -1288,8 +1357,6 @@
         fileSaveAs.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
         fileSaveAs.setText("Save as...");
-        fileSaveAs.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        fileSaveAs.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 fileSaveAsActionPerformed(evt);
             }
@@ -1304,8 +1371,6 @@
         generateNotebooks.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
         generateNotebooks.setText("Generate Notebooks...");
-        generateNotebooks.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        generateNotebooks.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 generateNotebooksActionPerformed(evt);
             }
@@ -1315,8 +1380,6 @@
         generateWebNotebook.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
         generateWebNotebook.setText("Generate Web Notebook...");
-        generateWebNotebook.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        generateWebNotebook.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 generateWebNotebookActionPerformed(evt);
             }
@@ -1326,8 +1389,6 @@
         generateScorecards.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
         generateScorecards.setText("Generate Scorecards...");
-        generateScorecards.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        generateScorecards.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 generateScorecardsActionPerformed(evt);
             }
@@ -1337,8 +1398,6 @@
         generateOrganizationChart.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
         generateOrganizationChart.setText("Generate D14 TMC Org Chart...");
-        generateOrganizationChart.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        generateOrganizationChart.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 generateOrganizationChartActionPerformed(evt);
             }
@@ -1349,8 +1408,6 @@
         generateProjectRequirements.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
         generateProjectRequirements.setText("Generate Project Worklist...");
-        generateProjectRequirements.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        generateProjectRequirements.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 generateProjectRequirementsActionPerformed(evt);
             }
@@ -1364,8 +1421,6 @@
 
         newIncident.setText("New Incident...");
-        newIncident.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        newIncident.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 newIncidentActionPerformed(evt);
             }
@@ -1374,19 +1429,23 @@
 
         deleteIncident.setText("Delete Incident");
-        deleteIncident.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        deleteIncident.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 deleteIncidentActionPerformed(evt);
             }
         });
         incidentMenu.add(deleteIncident);
+
+        deleteIncident1.setText("Edit Incident...");
+        deleteIncident1.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                incidentDetailsActionPerformed(evt);
+            }
+        });
+        incidentMenu.add(deleteIncident1);
         incidentMenu.add(jSeparator4);
 
         saveIncident.setText("Save Incident...");
-        saveIncident.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        saveIncident.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 saveIncidentActionPerformed(evt);
             }
@@ -1395,8 +1454,6 @@
 
         loadIncident.setText("Load Incident...");
-        loadIncident.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        loadIncident.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 loadIncidentActionPerformed(evt);
             }
@@ -1409,8 +1466,6 @@
 
         generateNoiseOption.setText("Generate Noise...");
-        generateNoiseOption.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        generateNoiseOption.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 generateNoiseOptionActionPerformed(evt);
             }
@@ -1419,4 +1474,17 @@
 
         scriptBuilderMenuBar.add(generateNoiseMenu);
+
+        helpMenu1.setText("Unit");
+        helpMenu1.setMargin(new java.awt.Insets(0, 10, 0, 10));
+
+        loadUnits.setText("Load Units...");
+        loadUnits.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                loadUnitsActionPerformed(evt);
+            }
+        });
+        helpMenu1.add(loadUnits);
+
+        scriptBuilderMenuBar.add(helpMenu1);
 
         helpMenu.setText("Help");
@@ -1425,8 +1493,6 @@
         helpTutorial.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
         helpTutorial.setText("Tutorial...");
-        helpTutorial.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        helpTutorial.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 helpTutorialActionPerformed(evt);
             }
@@ -1435,8 +1501,6 @@
 
         helpAbout.setText("About...");
-        helpAbout.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        helpAbout.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 helpAboutActionPerformed(evt);
             }
@@ -1574,10 +1638,14 @@
             SimulationScript.incidentColors[indx] = selectedColor;
             // Add the new incident to the list
+            //todo: need to add new data to the ScriptIncident Object here
             script.incidents.add(indx,
                     new ScriptIncident(SimulationScript.incidentColors[indx],
                             (Integer) addIncidentNumber.getValue(), addIncidentName.getText(), addIncidentDescription.getText(),
-                            script));
+                            script,0));
+            
             script.incidents.get(indx).setOffset((Integer) addIncidentStart.getValue() * 60);
+            script.incidents.get(indx).insertCadData((Integer) addIncidentStart.getValue(), new CadData(addIncidentType.getText(),addIncidentLocation.getText()));
             script.numberOfIncidents++;
+            
             IncidentEditorFrame editor = new IncidentEditorFrame(script.incidents.get(indx), this);
 
@@ -1594,4 +1662,6 @@
             //change offset of incident
             script.incidents.get(oldIncidentIndex).setOffset(((int) addIncidentStart.getValue()) * 60);
+            
+            script.incidents.get(oldIncidentIndex).insertCadData((int) addIncidentStart.getValue() * 60, new CadData(addIncidentType.getText(),addIncidentLocation.getText()));
             //update incident number, if it was changed
             if ((int) addIncidentNumber.getValue() == script.incidents.get(oldIncidentIndex).number
@@ -1613,6 +1683,35 @@
         repaint();
     }//GEN-LAST:event_incidentOkButtonActionPerformed
-
-    /**
+    /**
+     * Calling this will check to see if the model has been updated. 
+     * @param save indicated whether or not the file needs to be saved
+     */
+    private void checkNeedsSave(){
+        
+        if(!script.saved){
+            changeFrameTitle("*");
+        }else{
+            changeFrameTitle("");
+        }
+    }
+    /**
+     * 
+     * @param ext changes title by putting ext after current title. 
+     */
+    private void changeFrameTitle(String ext){
+        String t = "Script Builder: ";
+        if (script.saveFile == null)
+        {
+            t += "untitled1.xml";
+        }
+        else
+        {
+            t += script.saveFile.getName();
+        }
+        t+= ext;
+        this.setTitle(t);
+    }
+    /**
+     * 
      * Determine if the given incident number is already present in the script.
      *
@@ -1653,5 +1752,4 @@
 
         addIncidentName.setText("");
-
         int newLogNum = 100;
         boolean found = false;
@@ -1682,4 +1780,6 @@
         selectedColor = Color.BLACK;
         addIncidentDescription.setText("");
+        addIncidentLocation.setText("");
+        addIncidentType.setText("");
 
         incidentFrame.setVisible(true);
@@ -1711,4 +1811,5 @@
             script.saveFile = fc.getSelectedFile();
         }
+        
         this.update(script, script);
         //zoom out all the way so that the whole imported script is visible
@@ -1736,4 +1837,5 @@
             }
             script.saveFile = new File("" + fName + untitledCount + ".xml");
+            
         }
 
@@ -1755,4 +1857,5 @@
             script.saveScriptToFile(new File(filename));
             script.saveFile = new File(filename);
+            
         }
         else
@@ -1763,4 +1866,5 @@
             }
         }
+        
         this.update(script, 0);
     }//GEN-LAST:event_fileSaveAsActionPerformed
@@ -1782,6 +1886,9 @@
         else
         {
+            
             script.saveScriptToFile(script.saveFile);
         }
+        //TODO: TEST TO MAKE SURE THIS DOES NOT CREATE BADDIES
+        this.update(script, 0);
     }//GEN-LAST:event_fileSaveActionPerformed
 
@@ -1809,4 +1916,6 @@
         addIncidentName.setText(i.name);
         addIncidentNumber.setValue(i.number);
+        addIncidentLocation.setText(i.getCadData(i.offset).Header_FullLoc);
+        addIncidentType.setText(i.getCadData(i.offset).Header_Type);
         addIncidentStart.setValue(i.offset / 60);
         txtIncidentLength.setText("" + (i.length / 60));
@@ -2106,4 +2215,7 @@
     {//GEN-HEADEREND:event_fileNewActionPerformed
         script = new SimulationScript();
+        String fileName = "units.xml";
+        File f = new File(fileName);
+        script.loadUnitsFromFile(f);
         script.update();
         this.update(null, script);
@@ -2157,9 +2269,14 @@
                     script.incidents.add(null);
                     script.numberOfIncidents--;
+                    
                 }
             }
         }
+        //since delete is the only method in this class that actually edits the data model, needs .update()
+        script.update();
         //Refresh
         this.update(script, script);
+        
+        
         repaint();
     }//GEN-LAST:event_deleteIncidentActionPerformed
@@ -2220,4 +2337,75 @@
 // TODO add your handling code here:
     }//GEN-LAST:event_helpTutorialActionPerformed
+
+    private void addIncidentLocationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addIncidentLocationActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_addIncidentLocationActionPerformed
+
+    private void addIncidentNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addIncidentNameActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_addIncidentNameActionPerformed
+
+    private void incidentDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_incidentDetailsActionPerformed
+        // TODO add your handling code here:
+        Object[] incidentList = script.incidents.toArray();
+        ScriptIncident i = (ScriptIncident) JOptionPane.showInputDialog(
+                this,
+                "Select Incident:",
+                "Edit Incident",
+                JOptionPane.PLAIN_MESSAGE,
+                null,
+                incidentList,
+                script.incidents.get(0));
+
+        // If a valid incident was selected
+        if (i != null)
+        {
+            editingIncident = true;
+            oldIncidentIndex = script.incidents.indexOf(i);
+
+            addIncidentName.setText(i.name);
+            addIncidentNumber.setValue(i.number);
+            
+            addIncidentLocation.setText(i.getCadData(i.offset).Header_FullLoc);
+            addIncidentType.setText(i.getCadData(i.offset).Header_Type);
+            addIncidentStart.setValue(i.offset / 60);
+            //addIncidentLength.setValue(i.length / 60);
+            incidentColorField.setBackground(i.color);
+            selectedColor = i.color;
+            addIncidentDescription.setText(i.description);
+
+            incidentFrame.setVisible(true);
+        }
+    }//GEN-LAST:event_incidentDetailsActionPerformed
+
+    private void popupDeleteIncidentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_popupDeleteIncidentActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_popupDeleteIncidentActionPerformed
+
+    private void loadUnitsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loadUnitsActionPerformed
+        // TODO: needs to have testing performed
+        JFileChooser fc = new JFileChooser();
+
+        //Search for .xml files
+        fc.setFileFilter(new ExtensionFileFilter("Simulation Script XML (.xml)",
+                new String[]
+                {
+                    "xml"
+                }));
+        if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+        {
+            //load script with values from the selected file
+            script.loadUnitsFromFile(fc.getSelectedFile());
+        }
+    }//GEN-LAST:event_loadUnitsActionPerformed
+
+    private void scriptBuilderMenuBarAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_scriptBuilderMenuBarAncestorAdded
+        //loads in the initial unit file
+//        String fileName = "units.xml";
+//        
+//        File f = new File(fileName);
+//        
+//        script.loadUnitsFromFile(f);
+    }//GEN-LAST:event_scriptBuilderMenuBarAncestorAdded
 
     /**
@@ -2292,7 +2480,9 @@
     private javax.swing.JSlider TMCALSlider;
     private javax.swing.JTextArea addIncidentDescription;
+    private javax.swing.JTextField addIncidentLocation;
     private javax.swing.JTextField addIncidentName;
     private javax.swing.JSpinner addIncidentNumber;
     private javax.swing.JSpinner addIncidentStart;
+    private javax.swing.JTextField addIncidentType;
     private javax.swing.JFrame addNoiseFrame;
     private javax.swing.JSlider backgroundNoiseSlider;
@@ -2306,4 +2496,5 @@
     private javax.swing.JMenuItem deleteEventList;
     private javax.swing.JMenuItem deleteIncident;
+    private javax.swing.JMenuItem deleteIncident1;
     private javax.swing.JMenuItem editEventList;
     private javax.swing.JPopupMenu eventListPopupMenu;
@@ -2324,4 +2515,5 @@
     private javax.swing.JMenuItem helpAbout;
     private javax.swing.JMenu helpMenu;
+    private javax.swing.JMenu helpMenu1;
     private javax.swing.JMenuItem helpTutorial;
     private javax.swing.JButton incidentCancelButton;
@@ -2353,4 +2545,6 @@
     private scriptbuilder.gui.panels.IncidentTimelinePanel incidentTimelinePanel8;
     private scriptbuilder.gui.panels.IncidentTimelinePanel incidentTimelinePanel9;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JLabel jLabel2;
     private javax.swing.JMenuItem jMenuItem2;
     private javax.swing.JMenuItem jMenuItem4;
@@ -2379,4 +2573,5 @@
     private javax.swing.JSlider laneClosuresSlider;
     private javax.swing.JMenuItem loadIncident;
+    private javax.swing.JMenuItem loadUnits;
     private javax.swing.JSlider minorEventsSlider;
     private javax.swing.JMenuItem newIncident;
Index: trunk/src/scriptbuilder/gui/drawers/CursorDrawer.java
===================================================================
--- trunk/src/scriptbuilder/gui/drawers/CursorDrawer.java	(revision 1)
+++ trunk/src/scriptbuilder/gui/drawers/CursorDrawer.java	(revision 145)
@@ -81,5 +81,5 @@
                 + (seconds / 60 % 60 > 9 ? seconds / 60 % 60
                 : "0" + seconds / 60 % 60)
-                + ":00",
+                + ":" + (seconds % 60)/10  + "0",
                 x - ScriptBuilderGuiConstants.CURSOR_TIMESTAMP_TEXT_CENTER,
                 ScriptBuilderGuiConstants.CURSOR_TIMESTAMP_TEXT_TOP_MARGIN);
Index: trunk/src/scriptbuilder/gui/drawers/TimeSliceDrawer.java
===================================================================
--- trunk/src/scriptbuilder/gui/drawers/TimeSliceDrawer.java	(revision 76)
+++ trunk/src/scriptbuilder/gui/drawers/TimeSliceDrawer.java	(revision 145)
@@ -72,5 +72,5 @@
             return;
         }
-
+        //System.out.println("new slice");
         // Draw the slice event icon to show that there are events here
         g2d.drawImage(getSliceEventImage(), slice.getX()
Index: trunk/src/scriptbuilder/gui/ScriptBuilderFrame.form
===================================================================
--- trunk/src/scriptbuilder/gui/ScriptBuilderFrame.form	(revision 129)
+++ trunk/src/scriptbuilder/gui/ScriptBuilderFrame.form	(revision 145)
@@ -13,4 +13,7 @@
             <Property name="text" type="java.lang.String" value="Delete Incident..."/>
           </Properties>
+          <Events>
+            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="popupDeleteIncidentActionPerformed"/>
+          </Events>
         </MenuItem>
       </SubComponents>
@@ -241,9 +244,8 @@
         <DimensionLayout dim="0">
           <Group type="103" groupAlignment="0" attributes="0">
-              <Group type="102" alignment="1" attributes="0">
-                  <EmptySpace max="-2" attributes="0"/>
-                  <Group type="103" groupAlignment="1" attributes="0">
+              <Group type="102" attributes="0">
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="0" attributes="0">
                       <Component id="incidentPropertiesScrollPane" alignment="0" pref="322" max="32767" attributes="0"/>
-                      <Component id="labelIncidentDescription" alignment="0" min="-2" max="-2" attributes="0"/>
                       <Group type="102" alignment="0" attributes="0">
                           <Group type="103" groupAlignment="0" attributes="0">
@@ -252,10 +254,10 @@
                               <Component id="labelIncidentColor" alignment="0" min="-2" max="-2" attributes="0"/>
                           </Group>
-                          <EmptySpace type="separate" max="-2" attributes="0"/>
+                          <EmptySpace min="-2" pref="66" max="-2" attributes="0"/>
                           <Group type="103" groupAlignment="0" attributes="0">
-                              <Component id="addIncidentName" pref="218" max="32767" attributes="0"/>
-                              <Component id="addIncidentNumber" alignment="0" pref="218" max="32767" attributes="0"/>
+                              <Component id="addIncidentName" pref="199" max="32767" attributes="0"/>
+                              <Component id="addIncidentNumber" alignment="0" pref="199" max="32767" attributes="0"/>
                               <Group type="102" alignment="1" attributes="0">
-                                  <Component id="incidentColorField" pref="119" max="32767" attributes="0"/>
+                                  <Component id="incidentColorField" pref="97" max="32767" attributes="0"/>
                                   <EmptySpace max="-2" attributes="0"/>
                                   <Component id="btnChooseColor" min="-2" pref="93" max="-2" attributes="0"/>
@@ -283,4 +285,18 @@
                           </Group>
                       </Group>
+                      <Group type="102" alignment="0" attributes="0">
+                          <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
+                          <EmptySpace min="-2" pref="93" max="-2" attributes="0"/>
+                          <Component id="addIncidentType" max="32767" attributes="0"/>
+                      </Group>
+                      <Group type="102" attributes="0">
+                          <Component id="labelIncidentDescription" min="-2" max="-2" attributes="0"/>
+                          <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+                      </Group>
+                      <Group type="102" alignment="0" attributes="0">
+                          <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
+                          <EmptySpace min="-2" pref="69" max="-2" attributes="0"/>
+                          <Component id="addIncidentLocation" max="32767" attributes="0"/>
+                      </Group>
                   </Group>
                   <EmptySpace max="-2" attributes="0"/>
@@ -308,7 +324,17 @@
                   </Group>
                   <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="3" attributes="0">
+                      <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="addIncidentLocation" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="3" attributes="0">
+                      <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="addIncidentType" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace max="-2" attributes="0"/>
                   <Component id="labelIncidentDescription" min="-2" max="-2" attributes="0"/>
                   <EmptySpace max="-2" attributes="0"/>
-                  <Component id="incidentPropertiesScrollPane" pref="118" max="32767" attributes="0"/>
+                  <Component id="incidentPropertiesScrollPane" pref="130" max="32767" attributes="0"/>
                   <EmptySpace max="-2" attributes="0"/>
                   <Group type="103" groupAlignment="3" attributes="0">
@@ -397,4 +423,7 @@
         </Component>
         <Component class="javax.swing.JTextField" name="addIncidentName">
+          <Events>
+            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addIncidentNameActionPerformed"/>
+          </Events>
         </Component>
         <Component class="javax.swing.JLabel" name="labelIncidentLength">
@@ -437,4 +466,21 @@
             <Property name="toolTipText" type="java.lang.String" value=""/>
           </Properties>
+        </Component>
+        <Component class="javax.swing.JLabel" name="jLabel1">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Incident Location:"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JTextField" name="addIncidentLocation">
+          <Events>
+            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addIncidentLocationActionPerformed"/>
+          </Events>
+        </Component>
+        <Component class="javax.swing.JLabel" name="jLabel2">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Incident Type:"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JTextField" name="addIncidentType">
         </Component>
       </SubComponents>
@@ -641,4 +687,7 @@
     </Component>
     <Menu class="javax.swing.JMenuBar" name="scriptBuilderMenuBar">
+      <Events>
+        <EventHandler event="ancestorAdded" listener="javax.swing.event.AncestorListener" parameters="javax.swing.event.AncestorEvent" handler="scriptBuilderMenuBarAncestorAdded"/>
+      </Events>
       <SubComponents>
         <Menu class="javax.swing.JMenu" name="fileMenu">
@@ -794,4 +843,12 @@
               </Events>
             </MenuItem>
+            <MenuItem class="javax.swing.JMenuItem" name="deleteIncident1">
+              <Properties>
+                <Property name="text" type="java.lang.String" value="Edit Incident..."/>
+              </Properties>
+              <Events>
+                <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="incidentDetailsActionPerformed"/>
+              </Events>
+            </MenuItem>
             <MenuItem class="javax.swing.JPopupMenu$Separator" name="jSeparator4">
             </MenuItem>
@@ -825,4 +882,22 @@
               <Events>
                 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="generateNoiseOptionActionPerformed"/>
+              </Events>
+            </MenuItem>
+          </SubComponents>
+        </Menu>
+        <Menu class="javax.swing.JMenu" name="helpMenu1">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Unit"/>
+            <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
+              <Insets value="[0, 10, 0, 10]"/>
+            </Property>
+          </Properties>
+          <SubComponents>
+            <MenuItem class="javax.swing.JMenuItem" name="loadUnits">
+              <Properties>
+                <Property name="text" type="java.lang.String" value="Load Units..."/>
+              </Properties>
+              <Events>
+                <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="loadUnitsActionPerformed"/>
               </Events>
             </MenuItem>
@@ -862,5 +937,5 @@
   </NonVisualComponents>
   <Properties>
-    <Property name="defaultCloseOperation" type="int" value="3"/>
+    <Property name="defaultCloseOperation" type="int" value="0"/>
     <Property name="title" type="java.lang.String" value="Script Builder"/>
     <Property name="bounds" type="java.awt.Rectangle" editor="org.netbeans.beaninfo.editors.RectangleEditor">
Index: trunk/src/scriptbuilder/gui/ScriptBuilderGuiConstants.java
===================================================================
--- trunk/src/scriptbuilder/gui/ScriptBuilderGuiConstants.java	(revision 32)
+++ trunk/src/scriptbuilder/gui/ScriptBuilderGuiConstants.java	(revision 145)
@@ -16,5 +16,5 @@
 {
     public static int       PIXEL_WIDTH_PER_HORIZONTAL_TICK = 24;
-    public static final int HORIZONTAL_TICK_RESOLUTION = 60,
+    public static final int HORIZONTAL_TICK_RESOLUTION = 20,//changes how wide each tick in the timeline panel is. can add every X seconds
                             TIMELINE_TOP_MARGIN = 25,
                             MAX_NUMBER_OF_SCRIPT_EVENT_ICON = 10,
Index: trunk/src/scriptbuilder/gui/application.properties
===================================================================
--- trunk/src/scriptbuilder/gui/application.properties	(revision 144)
+++ trunk/src/scriptbuilder/gui/application.properties	(revision 145)
@@ -1,7 +1,7 @@
-#Tue, 09 Jan 2018 11:31:37 -0800
+#Thu, 31 Oct 2019 16:04:24 -0700
 
-Application.revision=143
+Application.revision=144
 
-Application.buildnumber=38
+Application.buildnumber=43
 
 Incidents.directory=Incidents
Index: trunk/src/scriptbuilder/gui/IncidentEditorFrame.java
===================================================================
--- trunk/src/scriptbuilder/gui/IncidentEditorFrame.java	(revision 135)
+++ trunk/src/scriptbuilder/gui/IncidentEditorFrame.java	(revision 145)
@@ -264,4 +264,5 @@
         cctvButton.addKeyListener(new TimelineKeyListener());
         chpRadioButton.addKeyListener(new TimelineKeyListener());
+        //todo: change paramics button to Traffic Modeler
         paramicsButton.addKeyListener(new TimelineKeyListener());
         towButton.addKeyListener(new TimelineKeyListener());
@@ -340,4 +341,5 @@
     public void update(Observable o, Object arg)
     {
+        System.out.println("the type of update is: " + arg.getClass());
         //Three possibilities: This is a general script update, or it's one of
         //two different focus updates
@@ -366,4 +368,5 @@
         else if (arg instanceof SliceChangedEvent)
         {
+            System.out.println("you got the hover over a timeslice");
             TimeSlice slice = ((SliceChangedEvent) arg).slice;
 
@@ -1716,6 +1719,9 @@
      * @param evt the mouse event
      */
+    //todo: make the zoom slider more dynamic: when it is at completely zoomed out, show the entire timeline?
     private void zoomInIconMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_zoomInIconMouseClicked
-        zoomSlider.setValue(zoomSlider.getValue() >= 21 ? 21 : zoomSlider.getValue() + 1);
+        //zoomSlider.setValue(zoomSlider.getValue() >= 21 ? 21 : zoomSlider.getValue() + 1);
+        zoomSlider.setValue(zoomSlider.getValue() + 1);
+
     }//GEN-LAST:event_zoomInIconMouseClicked
 
Index: trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java
===================================================================
--- trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java	(revision 133)
+++ trunk/src/scriptbuilder/gui/panels/IncidentTimelinePanel.java	(revision 145)
@@ -202,41 +202,43 @@
          * Determine if the mouse click happened within a valid timeSlice on
          * this incident; if so, activate the Editor window for that timeSlice.
-         *
-         * @param e the mouse event
+         *todo: fix bug where the event editor window appears even when a event type is not selected.
+         * @param clickEvent the mouse event
          */
         @Override
-        public void mouseClicked(MouseEvent e)
-        {
-            Editor ed = null;
-            ScriptBuilderFrame f = null;
-            IncidentEditorFrame g = null;
+        public void mouseClicked(MouseEvent clickEvent)
+        {
+            Editor editor = null;
+            ScriptBuilderFrame scriptBuilderFrameCurrent = null;
+            IncidentEditorFrame incidentEditFrameCurrent = null;
             if (getTopLevelAncestor() instanceof ScriptBuilderFrame)
             {
-                f = (ScriptBuilderFrame) getTopLevelAncestor();
+                scriptBuilderFrameCurrent = (ScriptBuilderFrame) getTopLevelAncestor();
 
             }
             else if (getTopLevelAncestor() instanceof IncidentEditorFrame)
             {
-                g = (IncidentEditorFrame) getTopLevelAncestor();
-                ed = new Editor(g);
-            }
-
-            x = cursorTime = e.getX();
-            y = e.getY();
-
-            if (e.getX() % ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK
+                incidentEditFrameCurrent = (IncidentEditorFrame) getTopLevelAncestor();
+                editor = new Editor(incidentEditFrameCurrent);
+            }
+
+            x = cursorTime = clickEvent.getX();
+            y = clickEvent.getY();
+            //System.out.println(cursorTime);
+            //logic that follows is used to "snap" the cursor location to the lines displayed on the timeline panel
+            if (clickEvent.getX() % ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK
                     > ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK / 2)
             {
                 cursorTime += ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK
-                        - e.getX()
+                        - clickEvent.getX()
                         % ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK;
             }
             else
             {
-                cursorTime -= e.getX()
+                cursorTime -= clickEvent.getX()
                         % ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK;
             }
 
             int newSlice = (cursorTime / ScriptBuilderGuiConstants.PIXEL_WIDTH_PER_HORIZONTAL_TICK);
+            
             newSlice *= ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION;
             /**
@@ -248,48 +250,60 @@
             }
 
-            if (ed != null)
-            {
-                ed.setSlice(incident.slices.get(newSlice));
-            }
+            
 
             /**
-             * Add a new icon if left mouse button was clicked *
+             * Add a new icon if left mouse button was clicked 
              */
-            if (e.getButton() == MouseEvent.BUTTON1)
-            {
-
+            if (clickEvent.getButton() == MouseEvent.BUTTON1)
+            {
+                
                 if (getTopLevelAncestor() instanceof IncidentEditorFrame)
                 {
-                    if (incident.slices.size() == 0 && newSlice != 0)
+                    
+                    if (incidentEditFrameCurrent.currentEventType != null)
                     {
-                        JOptionPane.showMessageDialog(g, "This is the first event in the incident.\n"
-                                + "Therefore, it will be automatically positioned at time 00:00:00,\n"
-                                + "relative to the start of the incident.", "Event will be moved", JOptionPane.INFORMATION_MESSAGE);
-                        newSlice = 0;
-                    }
-                    if (g.currentEventType != null)
-                    {
-                        I_ScriptEvent s = ScriptEvent.factoryByType(g.currentEventType);
-                        if (ed != null)
+                        if ((incident.slices.size() == 0 && newSlice != 0)||(incident.slices.get(0).events.isEmpty()))
                         {
-                            ed.addEvent(eventTypeToPropertyMap.get(g.currentEventType), s);
+                            
+                            JOptionPane.showMessageDialog(incidentEditFrameCurrent, "This is the first event in the incident.\n"
+                                    + "Therefore, it will be automatically positioned at time 00:00:00,\n"
+                                    + "relative to the start of the incident.", "Event will be moved", JOptionPane.INFORMATION_MESSAGE);
+                            newSlice = 0;
                         }
-                        if (incident.slices.get(newSlice) == null)
+                        //add the time of addition to be passed through to the event itself somewhere in here? Stored in newSlice
+                        I_ScriptEvent newScriptEvent = ScriptEvent.factoryByType(incidentEditFrameCurrent.currentEventType);
+//                        if (editor != null)
+//                        {
+//                            //this is not necessary if we just load the slices after we create a new one in the window, creates some extra dummy slice for no reason.
+//                            //this adds a new event to the existing editor window
+//                            editor.addEvent(eventTypeToPropertyMap.get(incidentEditFrameCurrent.currentEventType), newScriptEvent);
+//                        }
+                        if (incident.slices.get(newSlice) == null || incident.slices.get(newSlice).events.isEmpty())
                         {
-                            incident.addNewEvent(s, newSlice);
+                            //if there is no slice at the newSlice time, then create a new event with a new slice at that time
+                            
+                            incident.addNewEvent(newScriptEvent, newSlice);
+                            //find out where the new slice is added and then make it
+                            //possible to 
+                            //editor.setSlice(incident.getSlices().get(newSlice));
                         }
                         else
                         {
-                            incident.slices.get(newSlice).addEvent(s);
+                            //if there is already a slice there, just add the event to the 
+                            incident.slices.get(newSlice).addEvent(newScriptEvent);
                         }
-                        g.update(null, g.getIncident());
+                        incidentEditFrameCurrent.update(null, incidentEditFrameCurrent.getIncident());
                     }
                 }
             }
 
+            if (editor != null)
+            {
+                editor.setSlice(incident.slices.get(newSlice));
+            }
             if (incident.slices.get(newSlice) != null
                     && getTopLevelAncestor() instanceof IncidentEditorFrame)
             {
-                ed.setVisible(true);
+                editor.setVisible(true);
             }
         }
@@ -498,4 +512,5 @@
         if (focused)
         {
+            //System.out.println("Cursor Time: " + cursorTime);
             CursorDrawer.DrawCursor(g2d, cursorTime, false);
             if (this.getTopLevelAncestor() instanceof ScriptBuilderFrame)
Index: trunk/src/event/editor/TelephonePanel.java
===================================================================
--- trunk/src/event/editor/TelephonePanel.java	(revision 130)
+++ trunk/src/event/editor/TelephonePanel.java	(revision 145)
@@ -53,4 +53,5 @@
             public void keyPressed(KeyEvent e)
             {
+                //this needs to be changed to add the instructor role when a new line is created
                 if (e.getKeyCode() == KeyEvent.VK_ENTER)
                 {
@@ -69,7 +70,8 @@
             public void actionPerformed(ActionEvent e)
             {
-                int i = event.roles.size();
-                event.roles.add(txtInstructorRole.getText());
-                event.lines.add("");
+                //this listener was not working as exprected, replaced with netbeans auto generated
+//                int i = event.roles.size();
+//                event.roles.add(txtInstructorRole.getText());
+//                event.lines.add("");
             }
         });
@@ -129,6 +131,5 @@
     @SuppressWarnings("unchecked")
     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
-    private void initComponents()
-    {
+    private void initComponents() {
 
         addStudentButton = new javax.swing.JButton();
@@ -147,7 +148,17 @@
         deleteSelectedButton.setText("Delete Selected Line");
         deleteSelectedButton.setToolTipText("Deletes the selected row in the table");
+        deleteSelectedButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                deleteSelectedButtonActionPerformed(evt);
+            }
+        });
 
         addInstructorButton.setText("Add Instructor Line");
         addInstructorButton.setToolTipText("Adds a row for instructor dialog in the table");
+        addInstructorButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                addInstructorButtonActionPerformed(evt);
+            }
+        });
 
         txtInstructorRole.setToolTipText("Specifies the role the instructor plays");
@@ -157,9 +168,12 @@
         removeButton.setText("Remove");
         removeButton.setToolTipText("Removes this property");
-        removeButton.addMouseListener(new java.awt.event.MouseAdapter()
-        {
-            public void mouseClicked(java.awt.event.MouseEvent evt)
-            {
+        removeButton.addMouseListener(new java.awt.event.MouseAdapter() {
+            public void mouseClicked(java.awt.event.MouseEvent evt) {
                 removeThisProperty(evt);
+            }
+        });
+        removeButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                removeButtonActionPerformed(evt);
             }
         });
@@ -208,4 +222,5 @@
 
     private void removeThisProperty(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_removeThisProperty
+        //linked to remove button - removes the current buton
         if (removeListener != null)
         {
@@ -213,4 +228,20 @@
         }
     }//GEN-LAST:event_removeThisProperty
+
+    private void addInstructorButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addInstructorButtonActionPerformed
+        // TODO add your handling code here:
+        buttonMap.put(addInstructorButton, txtInstructorRole.getText());
+        int i = event.roles.size();
+        event.roles.add(txtInstructorRole.getText());
+        event.lines.add("");
+    }//GEN-LAST:event_addInstructorButtonActionPerformed
+
+    private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_removeButtonActionPerformed
+
+    private void deleteSelectedButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteSelectedButtonActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_deleteSelectedButtonActionPerformed
 
 
Index: trunk/src/event/editor/frame/PropertyModel.java
===================================================================
--- trunk/src/event/editor/frame/PropertyModel.java	(revision 134)
+++ trunk/src/event/editor/frame/PropertyModel.java	(revision 145)
@@ -70,4 +70,5 @@
         try
         {
+            //todo: this is where there are problems with initializing the unit window
             JPanel panel = (JPanel) classMap.get(property).newInstance();
 
@@ -82,5 +83,5 @@
         {
             System.err.println("Could not create panel of type \"" + property + "\"");
-        }
+        }            
     }
     
Index: trunk/src/event/editor/frame/Editor.java
===================================================================
--- trunk/src/event/editor/frame/Editor.java	(revision 134)
+++ trunk/src/event/editor/frame/Editor.java	(revision 145)
@@ -11,4 +11,5 @@
 import scriptbuilder.gui.IncidentEditorFrame;
 import scriptbuilder.gui.ScriptBuilderFrame;
+import scriptbuilder.gui.ScriptBuilderGuiConstants;
 import scriptbuilder.gui.panels.IncidentTimelinePanel;
 import scriptbuilder.structures.ScriptEvent;
@@ -32,5 +33,8 @@
         model.addEventPanel(property, se);
     }
-
+    /**
+     * adds all of the events from the timeslice to the incidentTimelinePanel
+     * @param ts the timeslice to be added
+     */
     public void setSlice(TimeSlice ts)
     {
@@ -42,5 +46,5 @@
             for (I_ScriptEvent se : slice.events)
             {
-
+                
                 this.addEvent(IncidentTimelinePanel.eventTypeToPropertyMap.get(se.getScriptEventType()), se);
 
@@ -52,7 +56,66 @@
             System.out.println("[" + eventTime + "]");
             txtEventStart.setText(eventTime);
+            List<Integer> timesS = timeGenerator(eventTime,"s");
+            List<Integer> timesM = timeGenerator(eventTime,"m");
+            List<Integer> timesH = timeGenerator(eventTime,"h");
+            timeHourComboSelector.setModel(new DefaultComboBoxModel(timesH.toArray()));
+            timeMinuteComboSelector.setModel(new DefaultComboBoxModel(timesM.toArray()));
+            timeSecondComboSelector.setModel(new DefaultComboBoxModel(timesS.toArray()));
+            timeHourComboSelector.setSelectedItem(slice.getTime()/3600);
+            timeMinuteComboSelector.setSelectedItem((slice.getTime()%3600)/60);
+            timeSecondComboSelector.setSelectedItem(slice.getTime()%60);
         }
 
     }
+    
+    private List<Integer> timeGenerator(String time,String type)
+    {
+        List<Integer> times = new ArrayList<Integer>();
+        String[] timeArray = time.split(":");
+        int currTime = 0;
+        switch(type)
+        {
+            case "h":
+            {
+                currTime = Integer.parseInt(timeArray[0]);
+                for(int i = 0;i< ScriptBuilderGuiConstants.MAX_SIMULATION_LENGTH/3600;i++)
+                {
+                    times.add(i);
+                }
+                break;
+            }
+            case "m":
+            {
+                currTime = Integer.parseInt(timeArray[1]);
+                for(int i = 0; i<60;i++)
+                {
+                    times.add(i);
+                }
+                
+                break;
+            }
+            case "s":
+            {
+                //includes times 0,20,40,80
+                currTime = Integer.parseInt(timeArray[2]); 
+                for(int i = 0; i<60;i+=ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION)
+                {
+                    times.add(i);
+                }
+                break;
+            }
+            default:
+            {
+            }
+                
+        }
+        
+        
+        //times.add(time);
+        
+        return times;
+    }
+    
+    
 
     private ActionListener optionalChangeListener = new ActionListener()
@@ -123,5 +186,5 @@
 
         }
-
+        //this eventTime might need to be initialized to the correct time
         String eventTime = "";
 
@@ -159,7 +222,32 @@
                 //If we deleted the first event(s), this will add the offsets,
                 //to ensure that events stay at the correct times
-                model.closePanels();
-            }
-        });
+                Object[] options = {"Yes","Cancel"};
+                    int result = JOptionPane.showOptionDialog(null,"Are you sure you want to exit without saving?",
+                            "Exit",
+                            JOptionPane.YES_NO_OPTION,
+                            JOptionPane.QUESTION_MESSAGE,
+                            null,
+                            options,
+                            options[1]);
+                    switch (result){
+                        //should just close
+                        case 0:
+                            closeWindow();
+                            //this.setVisible(true);
+                            break;
+                        // should do nothing
+                        case 1:
+                            
+                            break;
+                        default:
+                            break;
+                    }
+                //add a do you want to close without saving popup window here
+               
+            }
+        });
+    }
+    private void closeWindow(){
+        this.dispose();
     }
 
@@ -171,11 +259,17 @@
     @SuppressWarnings("unchecked")
     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
-    private void initComponents()
-    {
+    private void initComponents() {
 
         eventTabsPane = new javax.swing.JTabbedPane();
         bottomFramePanel = new javax.swing.JPanel();
         txtEventStart = new javax.swing.JTextField();
+        saveCloseBtn = new javax.swing.JButton();
         btnRemoveCurrentEvent = new javax.swing.JButton();
+        timeSecondComboSelector = new javax.swing.JComboBox<>();
+        timeMinuteComboSelector = new javax.swing.JComboBox<>();
+        timeHourComboSelector = new javax.swing.JComboBox<>();
+        jLabel1 = new javax.swing.JLabel();
+        jLabel2 = new javax.swing.JLabel();
+        jLabel3 = new javax.swing.JLabel();
         editorMenuBar = new javax.swing.JMenuBar();
         menuEvaluations = new javax.swing.JMenu();
@@ -200,5 +294,5 @@
         Witness = new javax.swing.JMenuItem();
 
-        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
         setTitle("Event Editor");
 
@@ -207,21 +301,53 @@
         bottomFramePanelLayout.setHorizontalGroup(
             bottomFramePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
-            .add(0, 613, Short.MAX_VALUE)
+            .add(0, 70, Short.MAX_VALUE)
         );
         bottomFramePanelLayout.setVerticalGroup(
             bottomFramePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
-            .add(0, 34, Short.MAX_VALUE)
+            .add(0, 45, Short.MAX_VALUE)
         );
 
         txtEventStart.setText("00:00:00");
+        txtEventStart.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                txtEventStartActionPerformed(evt);
+            }
+        });
+
+        saveCloseBtn.setText("Save and Close");
+        saveCloseBtn.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                saveCloseBtnActionPerformed(evt);
+            }
+        });
 
         btnRemoveCurrentEvent.setText("Remove This Event");
-        btnRemoveCurrentEvent.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        btnRemoveCurrentEvent.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 btnRemoveCurrentEventActionPerformed(evt);
             }
         });
+
+        timeSecondComboSelector.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Second" }));
+        timeSecondComboSelector.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                timeSecondComboSelectorActionPerformed(evt);
+            }
+        });
+
+        timeMinuteComboSelector.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Minute" }));
+        timeMinuteComboSelector.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                timeMinuteComboSelectorActionPerformed(evt);
+            }
+        });
+
+        timeHourComboSelector.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Hour" }));
+
+        jLabel1.setText("Hour");
+
+        jLabel2.setText("Minute");
+
+        jLabel3.setText("Second");
 
         menuEvaluations.setText("Evaluations");
@@ -230,8 +356,6 @@
         ATMS.setText("ATMS");
         ATMS.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ATMSEval.png"))); // NOI18N
-        ATMS.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        ATMS.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 multipleChange(evt);
             }
@@ -242,8 +366,6 @@
         ActivityLog.setText("Activity Log");
         ActivityLog.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ActivityLogEval.png"))); // NOI18N
-        ActivityLog.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        ActivityLog.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 multipleChange(evt);
             }
@@ -254,8 +376,6 @@
         CAD.setText("CAD");
         CAD.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CADEval.png"))); // NOI18N
-        CAD.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        CAD.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 multipleChange(evt);
             }
@@ -266,15 +386,11 @@
         CMS.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CMSEval.png"))); // NOI18N
         CMS.setText("CMS");
-        CMS.addMouseListener(new java.awt.event.MouseAdapter()
-        {
-            public void mouseClicked(java.awt.event.MouseEvent evt)
-            {
+        CMS.addMouseListener(new java.awt.event.MouseAdapter() {
+            public void mouseClicked(java.awt.event.MouseEvent evt) {
                 multipleChangeListener(evt);
             }
         });
-        CMS.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        CMS.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 multipleChange(evt);
             }
@@ -285,8 +401,6 @@
         Facilitator.setText("Facilitator");
         Facilitator.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/FacilitatorEval.png"))); // NOI18N
-        Facilitator.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        Facilitator.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 optionalChange(evt);
             }
@@ -297,8 +411,6 @@
         Radio.setText("Radio");
         Radio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/RadioEval.png"))); // NOI18N
-        Radio.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        Radio.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 optionalChange(evt);
             }
@@ -313,8 +425,6 @@
         MaintenanceRadio.setText("Maintenance Radio");
         MaintenanceRadio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/MaintenanceRadio.png"))); // NOI18N
-        MaintenanceRadio.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        MaintenanceRadio.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 optionalChange(evt);
             }
@@ -325,8 +435,6 @@
         TMTRadio.setText("TMT Radio");
         TMTRadio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/TMTRadio.png"))); // NOI18N
-        TMTRadio.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        TMTRadio.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 optionalChange(evt);
             }
@@ -337,8 +445,6 @@
         Telephone.setText("Telephone");
         Telephone.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Telephone.png"))); // NOI18N
-        Telephone.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        Telephone.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 optionalChange(evt);
             }
@@ -353,8 +459,6 @@
         Audio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Audio.png"))); // NOI18N
         Audio.setText("Audio");
-        Audio.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        Audio.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 AudioActionPerformed(evt);
             }
@@ -375,8 +479,6 @@
         CHPRadio.setText("CHP Radio");
         CHPRadio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CHPRadio.png"))); // NOI18N
-        CHPRadio.addActionListener(new java.awt.event.ActionListener()
-        {
-            public void actionPerformed(java.awt.event.ActionEvent evt)
-            {
+        CHPRadio.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
                 optionalChange(evt);
             }
@@ -417,7 +519,21 @@
                 .add(txtEventStart, 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(jLabel1)
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(timeHourComboSelector, 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(jLabel2)
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(timeMinuteComboSelector, 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(jLabel3)
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(timeSecondComboSelector, 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(bottomFramePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                 .add(btnRemoveCurrentEvent, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 226, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+                .add(saveCloseBtn)
                 .addContainerGap())
         );
@@ -426,10 +542,19 @@
             .add(layout.createSequentialGroup()
                 .addContainerGap()
-                .add(eventTabsPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
+                .add(eventTabsPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 523, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                     .add(bottomFramePanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
-                    .add(txtEventStart, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
-                    .add(btnRemoveCurrentEvent)))
+                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+                        .add(txtEventStart, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+                        .add(timeSecondComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+                        .add(timeMinuteComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+                        .add(timeHourComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+                        .add(jLabel1)
+                        .add(jLabel2)
+                        .add(jLabel3))
+                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+                        .add(saveCloseBtn)
+                        .add(btnRemoveCurrentEvent))))
         );
 
@@ -471,11 +596,42 @@
     }//GEN-LAST:event_AudioActionPerformed
 
+    private void saveCloseBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveCloseBtnActionPerformed
+        // TODO add your handling code here:
+        //closes the current frame
+        
+        //updateEventTime();
+        if(!txtEventStart.getText().equals(""))
+        {
+            updateEventTime();
+        }
+        model.closePanels();
+        closeWindow();
+        //this.dispatchEvent(new WindowEvent(this,WindowEvent.WINDOW_CLOSING));
+    }//GEN-LAST:event_saveCloseBtnActionPerformed
+
+    private void timeSecondComboSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeSecondComboSelectorActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_timeSecondComboSelectorActionPerformed
+
+    private void timeMinuteComboSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeMinuteComboSelectorActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_timeMinuteComboSelectorActionPerformed
+
+    private void txtEventStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtEventStartActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_txtEventStartActionPerformed
+
     private void updateEventTime()
     {
-        String[] tokens = txtEventStart.getText().split(":");
-
-        int hrs = Integer.parseInt(tokens[0]);
-        int mins = Integer.parseInt(tokens[1]);
-        int secs = Integer.parseInt(tokens[2]);
+        
+//        String[] tokens = txtEventStart.getText().split(":");
+//        
+//        int hrs = Integer.parseInt(tokens[0]);
+//        int mins = Integer.parseInt(tokens[1]);
+//        int secs = Integer.parseInt(tokens[2]);
+        int hrs = Integer.parseInt(timeHourComboSelector.getSelectedItem().toString());
+        int mins = Integer.parseInt(timeMinuteComboSelector.getSelectedItem().toString());
+        int secs = Integer.parseInt(timeSecondComboSelector.getSelectedItem().toString());
+        
 
         int newTime = (3600 * hrs) + (60 * mins) + secs;
@@ -493,8 +649,8 @@
 
             }
-            SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
-            df.setTimeZone(TimeZone.getTimeZone("GMT"));
-            String eventTime = df.format(new Date(slice.getTime() * 1000));
-            txtEventStart.setText(eventTime);
+//            SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
+//            df.setTimeZone(TimeZone.getTimeZone("GMT"));
+//            String eventTime = df.format(new Date(slice.getTime() * 1000));
+//            txtEventStart.setText(eventTime);
         }
     }
@@ -538,7 +694,14 @@
     private javax.swing.JMenuBar editorMenuBar;
     private javax.swing.JTabbedPane eventTabsPane;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JLabel jLabel2;
+    private javax.swing.JLabel jLabel3;
     private javax.swing.JMenu menuAutoData;
     private javax.swing.JMenu menuEvaluations;
     private javax.swing.JMenu menuInstructor;
+    private javax.swing.JButton saveCloseBtn;
+    private javax.swing.JComboBox<String> timeHourComboSelector;
+    private javax.swing.JComboBox<String> timeMinuteComboSelector;
+    private javax.swing.JComboBox<String> timeSecondComboSelector;
     private javax.swing.JTextField txtEventStart;
     // End of variables declaration//GEN-END:variables
Index: trunk/src/event/editor/frame/Editor.form
===================================================================
--- trunk/src/event/editor/frame/Editor.form	(revision 134)
+++ trunk/src/event/editor/frame/Editor.form	(revision 145)
@@ -251,5 +251,5 @@
   </NonVisualComponents>
   <Properties>
-    <Property name="defaultCloseOperation" type="int" value="2"/>
+    <Property name="defaultCloseOperation" type="int" value="0"/>
     <Property name="title" type="java.lang.String" value="Event Editor"/>
   </Properties>
@@ -279,7 +279,21 @@
               <Component id="txtEventStart" min="-2" max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
+              <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="timeHourComboSelector" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="timeMinuteComboSelector" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="timeSecondComboSelector" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
               <Component id="bottomFramePanel" max="32767" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
               <Component id="btnRemoveCurrentEvent" min="-2" pref="226" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="saveCloseBtn" min="-2" max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
           </Group>
@@ -290,10 +304,21 @@
           <Group type="102" alignment="0" attributes="0">
               <EmptySpace max="-2" attributes="0"/>
-              <Component id="eventTabsPane" pref="534" max="32767" attributes="0"/>
+              <Component id="eventTabsPane" min="-2" pref="523" max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
               <Group type="103" groupAlignment="0" attributes="0">
                   <Component id="bottomFramePanel" min="-2" max="-2" attributes="0"/>
-                  <Component id="txtEventStart" min="-2" max="-2" attributes="0"/>
-                  <Component id="btnRemoveCurrentEvent" min="-2" max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="3" attributes="0">
+                      <Component id="txtEventStart" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="timeSecondComboSelector" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="timeMinuteComboSelector" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="timeHourComboSelector" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <Group type="103" groupAlignment="3" attributes="0">
+                      <Component id="saveCloseBtn" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="btnRemoveCurrentEvent" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
               </Group>
           </Group>
@@ -311,10 +336,10 @@
         <DimensionLayout dim="0">
           <Group type="103" groupAlignment="0" attributes="0">
-              <EmptySpace min="0" pref="613" max="32767" attributes="0"/>
+              <EmptySpace min="0" pref="70" max="32767" attributes="0"/>
           </Group>
         </DimensionLayout>
         <DimensionLayout dim="1">
           <Group type="103" groupAlignment="0" attributes="0">
-              <EmptySpace min="0" pref="34" max="32767" attributes="0"/>
+              <EmptySpace min="0" pref="45" max="32767" attributes="0"/>
           </Group>
         </DimensionLayout>
@@ -325,4 +350,15 @@
         <Property name="text" type="java.lang.String" value="00:00:00"/>
       </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtEventStartActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JButton" name="saveCloseBtn">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Save and Close"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveCloseBtnActionPerformed"/>
+      </Events>
     </Component>
     <Component class="javax.swing.JButton" name="btnRemoveCurrentEvent">
@@ -334,4 +370,61 @@
       </Events>
     </Component>
+    <Component class="javax.swing.JComboBox" name="timeSecondComboSelector">
+      <Properties>
+        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
+          <StringArray count="1">
+            <StringItem index="0" value="Second"/>
+          </StringArray>
+        </Property>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="timeSecondComboSelectorActionPerformed"/>
+      </Events>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
+      </AuxValues>
+    </Component>
+    <Component class="javax.swing.JComboBox" name="timeMinuteComboSelector">
+      <Properties>
+        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
+          <StringArray count="1">
+            <StringItem index="0" value="Minute"/>
+          </StringArray>
+        </Property>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="timeMinuteComboSelectorActionPerformed"/>
+      </Events>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
+      </AuxValues>
+    </Component>
+    <Component class="javax.swing.JComboBox" name="timeHourComboSelector">
+      <Properties>
+        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
+          <StringArray count="1">
+            <StringItem index="0" value="Hour"/>
+          </StringArray>
+        </Property>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
+      </AuxValues>
+    </Component>
+    <Component class="javax.swing.JLabel" name="jLabel1">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Hour"/>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JLabel" name="jLabel2">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Minute"/>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JLabel" name="jLabel3">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Second"/>
+      </Properties>
+    </Component>
   </SubComponents>
 </Form>
Index: trunk/src/event/editor/WitnessPanel.java
===================================================================
--- trunk/src/event/editor/WitnessPanel.java	(revision 140)
+++ trunk/src/event/editor/WitnessPanel.java	(revision 145)
@@ -42,4 +42,5 @@
 
         txtPhoneNumber.setText("" + event.witnessNum);
+        System.out.println("you just loaded a new witness event into the editor");
 
         txtAddress.setText(event.witnessAddress);
@@ -79,6 +80,5 @@
     @SuppressWarnings("unchecked")
     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
-    private void initComponents()
-    {
+    private void initComponents() {
 
         jLabel1 = new javax.swing.JLabel();
@@ -100,4 +100,10 @@
 
         txtPhoneNumber.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("(###)###-####"))));
+        txtPhoneNumber.setFocusLostBehavior(javax.swing.JFormattedTextField.PERSIST);
+        txtPhoneNumber.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                txtPhoneNumberActionPerformed(evt);
+            }
+        });
 
         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
@@ -147,4 +153,8 @@
     }// </editor-fold>//GEN-END:initComponents
 
+    private void txtPhoneNumberActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPhoneNumberActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_txtPhoneNumberActionPerformed
+
 
     // Variables declaration - do not modify//GEN-BEGIN:variables
Index: trunk/src/event/editor/UnitPanel.form
===================================================================
--- trunk/src/event/editor/UnitPanel.form	(revision 92)
+++ trunk/src/event/editor/UnitPanel.form	(revision 145)
@@ -23,15 +23,4 @@
                   <Group type="102" alignment="0" attributes="0">
                       <Group type="103" groupAlignment="0" attributes="0">
-                          <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
-                          <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
-                      </Group>
-                      <EmptySpace max="-2" attributes="0"/>
-                      <Group type="103" groupAlignment="0" attributes="0">
-                          <Component id="StatusDropdown" pref="475" max="32767" attributes="0"/>
-                          <Component id="txtUnitNumber" alignment="0" pref="475" max="32767" attributes="0"/>
-                      </Group>
-                  </Group>
-                  <Group type="102" alignment="0" attributes="0">
-                      <Group type="103" groupAlignment="0" attributes="0">
                           <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
                           <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
@@ -41,4 +30,21 @@
                           <Component id="ActiveDropdown" alignment="0" pref="475" max="32767" attributes="0"/>
                           <Component id="PrimaryDropdown" alignment="0" pref="475" max="32767" attributes="0"/>
+                      </Group>
+                  </Group>
+                  <Group type="102" alignment="0" attributes="0">
+                      <Group type="103" groupAlignment="0" attributes="0">
+                          <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
+                          <Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
+                      </Group>
+                      <EmptySpace min="-2" pref="54" max="-2" attributes="0"/>
+                      <Group type="103" groupAlignment="0" attributes="0">
+                          <Group type="102" attributes="0">
+                              <Component id="StatusDropdown" pref="419" max="32767" attributes="0"/>
+                              <EmptySpace min="-2" pref="57" max="-2" attributes="0"/>
+                          </Group>
+                          <Group type="102" alignment="0" attributes="0">
+                              <Component id="unitSelector" min="-2" max="-2" attributes="0"/>
+                              <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+                          </Group>
                       </Group>
                   </Group>
@@ -51,10 +57,10 @@
       <Group type="103" groupAlignment="0" attributes="0">
           <Group type="102" alignment="0" attributes="0">
-              <EmptySpace min="-2" pref="47" max="-2" attributes="0"/>
+              <EmptySpace min="-2" pref="82" max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
-                  <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
-                  <Component id="txtUnitNumber" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="unitSelector" alignment="3" min="-2" max="-2" attributes="0"/>
               </Group>
-              <EmptySpace type="unrelated" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
               <Group type="103" groupAlignment="3" attributes="0">
                   <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -71,5 +77,5 @@
                   <Component id="ActiveDropdown" alignment="3" min="-2" max="-2" attributes="0"/>
               </Group>
-              <EmptySpace pref="128" max="32767" attributes="0"/>
+              <EmptySpace pref="100" max="32767" attributes="0"/>
               <Component id="help" min="-2" pref="20" max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
@@ -79,15 +85,4 @@
   </Layout>
   <SubComponents>
-    <Component class="javax.swing.JLabel" name="jLabel1">
-      <Properties>
-        <Property name="text" type="java.lang.String" value="Unit Number"/>
-      </Properties>
-    </Component>
-    <Component class="javax.swing.JFormattedTextField" name="txtUnitNumber">
-      <Properties>
-        <Property name="text" type="java.lang.String" value="  -  "/>
-        <Property name="toolTipText" type="java.lang.String" value=""/>
-      </Properties>
-    </Component>
     <Component class="javax.swing.JLabel" name="jLabel2">
       <Properties>
@@ -138,4 +133,24 @@
     <Component class="javax.swing.JLabel" name="help">
     </Component>
+    <Component class="javax.swing.JLabel" name="jLabel5">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Unit"/>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JComboBox" name="unitSelector">
+      <Properties>
+        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
+          <StringArray count="0"/>
+        </Property>
+      </Properties>
+      <Events>
+        <EventHandler event="ancestorAdded" listener="javax.swing.event.AncestorListener" parameters="javax.swing.event.AncestorEvent" handler="unitSelectorAncestorAdded"/>
+        <EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="unitSelectorMouseEntered"/>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="unitSelectorActionPerformed"/>
+      </Events>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
+      </AuxValues>
+    </Component>
   </SubComponents>
 </Form>
Index: trunk/src/event/editor/TelephonePanel.form
===================================================================
--- trunk/src/event/editor/TelephonePanel.form	(revision 1)
+++ trunk/src/event/editor/TelephonePanel.form	(revision 145)
@@ -84,4 +84,7 @@
         <Property name="toolTipText" type="java.lang.String" value="Deletes the selected row in the table"/>
       </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteSelectedButtonActionPerformed"/>
+      </Events>
     </Component>
     <Component class="javax.swing.JButton" name="addInstructorButton">
@@ -90,4 +93,7 @@
         <Property name="toolTipText" type="java.lang.String" value="Adds a row for instructor dialog in the table"/>
       </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addInstructorButtonActionPerformed"/>
+      </Events>
     </Component>
     <Component class="javax.swing.JTextField" name="txtInstructorRole">
@@ -108,4 +114,5 @@
       <Events>
         <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="removeThisProperty"/>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="removeButtonActionPerformed"/>
       </Events>
     </Component>
Index: trunk/src/event/editor/WitnessPanel.form
===================================================================
--- trunk/src/event/editor/WitnessPanel.form	(revision 92)
+++ trunk/src/event/editor/WitnessPanel.form	(revision 145)
@@ -103,5 +103,9 @@
           <Format format="(###)###-####" subtype="-1" type="0"/>
         </Property>
+        <Property name="focusLostBehavior" type="int" value="3"/>
       </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPhoneNumberActionPerformed"/>
+      </Events>
     </Component>
   </SubComponents>
Index: trunk/src/event/editor/UnitPanel.java
===================================================================
--- trunk/src/event/editor/UnitPanel.java	(revision 140)
+++ trunk/src/event/editor/UnitPanel.java	(revision 145)
@@ -3,5 +3,10 @@
 import java.awt.event.*;
 import java.util.Observable;
+import java.util.List;
+import java.util.ArrayList;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.ComboBoxModel;
 import scriptbuilder.structures.events.I_ScriptEvent;
+import scriptbuilder.structures.units.Unit;
 import scriptbuilder.structures.events.UnitEvent;
 
@@ -9,4 +14,6 @@
  *
  * @author nathaniellehrer
+ * 
+ * 
  */
 public class UnitPanel extends javax.swing.JPanel implements I_ScriptEventEditorPanel
@@ -15,5 +22,7 @@
     private ActionListener removeListener;
     private UnitEvent event;
-
+    private List<Unit> units;
+    
+    List<String> names = new ArrayList<String>();
     /**
      * Creates new form UnitPanel
@@ -22,26 +31,20 @@
     {
         initComponents();
-
-        txtUnitNumber.addFocusListener(new FocusListener()
-        {
-
-            public void focusGained(FocusEvent e)
-            {
-                help.setText("Unit number is formatted as #-#\t\tExample: 5-5");
-            }
-
-            public void focusLost(FocusEvent e)
-            {
-                help.setText("");
-            }
-
-        });
-    }
-
+        
+        //units = event.slice.getIncident().script.units;
+        
+    }
+
+    /**
+     * Loads the event information into the event editor window.
+     * @param sei  Scriptevent that is being loaded in
+     */
     @Override
     public void getEventObject(I_ScriptEvent sei)
     {
+        
         event = (UnitEvent) sei;
-        txtUnitNumber.setText(event.unitNum);
+        //loads the current unit list into the combobox on re-opening of unit event
+        loadSelector();
         for (int i = 0; i < ActiveDropdown.getItemCount(); i++)
         {
@@ -49,4 +52,17 @@
             {
                 ActiveDropdown.setSelectedIndex(i);
+            }
+        }
+        
+        //for each name in the names list
+        for (int i = 0; i < names.size(); i++)
+        {
+            //which event equals which index in the names list?
+            if (event.unitNum.equalsIgnoreCase((String) names.get(i)))
+            {
+                
+                //set the unit selector to the data model value
+                unitSelector.setSelectedIndex(i);
+                
             }
         }
@@ -80,4 +96,5 @@
     public void update(Observable o, Object arg)
     {
+        //todo: make supported
         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
     }
@@ -90,14 +107,74 @@
         return true;
     }
+    
+    
+    private void loadSelector(){
+        //checks if the event is exist
+        if(event != null)
+        {
+            //loads the names list from the top data model
+            loadNames();
+            //asks if the unitselector already has some units added into it
+            
+            if(unitSelector.getModel().equals(new DefaultComboBoxModel(names.toArray())) || (unitSelector.getModel().getSize() == 0))
+            {
+                //if combobox empty, load combobox
+                unitSelector.setModel(new DefaultComboBoxModel(names.toArray()));
+            }
+            
+            
+            
+        }
+        
+    }
+    
+    /**
+     * Loads the unit names from the unit list in SimulationScript
+     */
+    private void loadNames(){
+        //checks if the event is exist
+        if(event!=null)
+        {
+            //this sucks! try to change it sometime
+            //grabs the unit list from the top of the SimulationScript and 
+            //appends them to the names list
+            units = event.slice.getIncident().script.units;
+            
+            for(Unit u : units)
+            {
+                names.add(u.UnitNum);
+            }
+        }
+    }
 
     @Override
+    /**
+     * when window is closed, these values are set.
+     */
     public void uponClose()
     {
-        if (event != null)
-        {
-            event.unitNum = txtUnitNumber.getText();
+        
+        if (event != null && unitSelector.getItemCount() != 0)
+        {
+            event.unitNum = unitSelector.getSelectedItem().toString();
             event.unitActive = ActiveDropdown.getSelectedItem().toString();
             event.unitPrimary = PrimaryDropdown.getSelectedItem().toString();
             event.unitStatus = StatusDropdown.getSelectedItem().toString();
+                
+            //old logic for creating dummy unit
+            /*if(event.slice.getIncident().script.hasUnit(txtUnitNumber.getText())){
+                //checks to see if there is already a unit selected there
+                //event.unitNum = (txtUnitNumber.getText());
+                
+            }else{
+                //Creates a dummy unit here
+                event.slice.getIncident().script.addDummyUnit(txtUnitNumber.getText());
+                //event.unitNum = (txtUnitNumber.getText());
+                event.unitActive = ActiveDropdown.getSelectedItem().toString();
+                event.unitPrimary = PrimaryDropdown.getSelectedItem().toString();
+                event.unitStatus = StatusDropdown.getSelectedItem().toString();
+                //System.out.println("invalid unit number");
+            }*/
+            
         }
     }
@@ -110,9 +187,6 @@
     @SuppressWarnings("unchecked")
     // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
-    private void initComponents()
-    {
-
-        jLabel1 = new javax.swing.JLabel();
-        txtUnitNumber = new javax.swing.JFormattedTextField();
+    private void initComponents() {
+
         jLabel2 = new javax.swing.JLabel();
         StatusDropdown = new javax.swing.JComboBox();
@@ -122,9 +196,6 @@
         ActiveDropdown = new javax.swing.JComboBox();
         help = new javax.swing.JLabel();
-
-        jLabel1.setText("Unit Number");
-
-        txtUnitNumber.setText("  -  ");
-        txtUnitNumber.setToolTipText("");
+        jLabel5 = new javax.swing.JLabel();
+        unitSelector = new javax.swing.JComboBox<>();
 
         jLabel2.setText("Status");
@@ -139,4 +210,26 @@
 
         ActiveDropdown.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "True", "False" }));
+
+        jLabel5.setText("Unit");
+
+        unitSelector.addAncestorListener(new javax.swing.event.AncestorListener() {
+            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
+            }
+            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
+                unitSelectorAncestorAdded(evt);
+            }
+            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
+            }
+        });
+        unitSelector.addMouseListener(new java.awt.event.MouseAdapter() {
+            public void mouseEntered(java.awt.event.MouseEvent evt) {
+                unitSelectorMouseEntered(evt);
+            }
+        });
+        unitSelector.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                unitSelectorActionPerformed(evt);
+            }
+        });
 
         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
@@ -150,12 +243,4 @@
                     .add(layout.createSequentialGroup()
                         .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
-                            .add(jLabel1)
-                            .add(jLabel2))
-                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
-                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
-                            .add(StatusDropdown, 0, 475, Short.MAX_VALUE)
-                            .add(txtUnitNumber, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 475, Short.MAX_VALUE)))
-                    .add(layout.createSequentialGroup()
-                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                             .add(jLabel3)
                             .add(jLabel4))
@@ -163,5 +248,17 @@
                         .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                             .add(ActiveDropdown, 0, 475, Short.MAX_VALUE)
-                            .add(PrimaryDropdown, 0, 475, Short.MAX_VALUE))))
+                            .add(PrimaryDropdown, 0, 475, Short.MAX_VALUE)))
+                    .add(layout.createSequentialGroup()
+                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+                            .add(jLabel2)
+                            .add(jLabel5))
+                        .add(54, 54, 54)
+                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+                            .add(layout.createSequentialGroup()
+                                .add(StatusDropdown, 0, 419, Short.MAX_VALUE)
+                                .add(57, 57, 57))
+                            .add(layout.createSequentialGroup()
+                                .add(unitSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+                                .add(0, 0, Short.MAX_VALUE)))))
                 .addContainerGap())
         );
@@ -169,9 +266,9 @@
             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
             .add(layout.createSequentialGroup()
-                .add(47, 47, 47)
+                .add(82, 82, 82)
                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
-                    .add(jLabel1)
-                    .add(txtUnitNumber, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
-                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
+                    .add(jLabel5)
+                    .add(unitSelector, 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(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                     .add(jLabel2)
@@ -185,9 +282,22 @@
                     .add(jLabel4)
                     .add(ActiveDropdown, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
-                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 128, Short.MAX_VALUE)
+                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 100, Short.MAX_VALUE)
                 .add(help, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                 .addContainerGap())
         );
     }// </editor-fold>//GEN-END:initComponents
+
+    private void unitSelectorAncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_unitSelectorAncestorAdded
+        //loads the unitSelector on the initialization of the window
+        loadSelector();
+    }//GEN-LAST:event_unitSelectorAncestorAdded
+
+    private void unitSelectorMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_unitSelectorMouseEntered
+        
+    }//GEN-LAST:event_unitSelectorMouseEntered
+
+    private void unitSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_unitSelectorActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_unitSelectorActionPerformed
 
 
@@ -197,9 +307,9 @@
     private javax.swing.JComboBox StatusDropdown;
     private javax.swing.JLabel help;
-    private javax.swing.JLabel jLabel1;
     private javax.swing.JLabel jLabel2;
     private javax.swing.JLabel jLabel3;
     private javax.swing.JLabel jLabel4;
-    private javax.swing.JFormattedTextField txtUnitNumber;
+    private javax.swing.JLabel jLabel5;
+    private javax.swing.JComboBox<String> unitSelector;
     // End of variables declaration//GEN-END:variables
 
Index: trunk/units.xml
===================================================================
--- trunk/units.xml	(revision 145)
+++ trunk/units.xml	(revision 145)
@@ -0,0 +1,200 @@
+<TMC_SCRIPT title="Full Simulation"><SCRIPT_DATA><NEW_UNIT UnitNum="14-14"><STATUS>10-8</STATUS>
+<CURR_LOC>55 at Dyer Rd</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>14-Santa Maria</AREA>
+<BADGE_NUM>011234</BADGE_NUM>
+<OFFICER>John Carrie</OFFICER>
+<OFFICE>Santa Maria Area</OFFICE>
+<TIMER>9796</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>14-14</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="14-17"><STATUS>10-8</STATUS>
+<CURR_LOC>405 MacArthur Boulevard</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>14-Santa Maria</AREA>
+<BADGE_NUM>011304</BADGE_NUM>
+<OFFICER>James Hill</OFFICER>
+<OFFICE>Santa Maria Area</OFFICE>
+<TIMER>15053</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>14-17</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="14-9"><STATUS>10-8</STATUS>
+<CURR_LOC>55 Edinger Avenue</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>14-Santa Maria</AREA>
+<BADGE_NUM>012454</BADGE_NUM>
+<OFFICER>Bobby Hey</OFFICER>
+<OFFICE>Santa Maria Area</OFFICE>
+<TIMER>6394</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>14-9</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="9-9"><STATUS>10-8</STATUS>
+<CURR_LOC>I405 IRVINE CTR</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>9-Templeton</AREA>
+<BADGE_NUM>011596</BADGE_NUM>
+<OFFICER>Harry Jackson</OFFICER>
+<OFFICE>Templeton Area</OFFICE>
+<TIMER>10606</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>9-9</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="14-S3"><STATUS>10-8</STATUS>
+<CURR_LOC>73 Bear Street</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>14-Santa Maria</AREA>
+<BADGE_NUM>011250</BADGE_NUM>
+<OFFICER>James Tuchman</OFFICER>
+<OFFICE>Santa Maria Area</OFFICE>
+<TIMER>19005</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>14-S3</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="9-15"><STATUS>10-8</STATUS>
+<CURR_LOC>55 4th street</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>9-Templeton</AREA>
+<BADGE_NUM>013282</BADGE_NUM>
+<OFFICER>Sam Spellicy</OFFICER>
+<OFFICE>Templeton Area</OFFICE>
+<TIMER>23786</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>9-15</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="9-19"><STATUS>10-8</STATUS>
+<CURR_LOC>405 Culver</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>9-Templeton</AREA>
+<BADGE_NUM>012495</BADGE_NUM>
+<OFFICER>Michael Bay</OFFICER>
+<OFFICE>Templeton Area</OFFICE>
+<TIMER>15760</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>9-19</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="28-24"><STATUS>10-8</STATUS>
+<CURR_LOC>I-405 IRVINE CNTR</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>28-San Luis Obispo</AREA>
+<BADGE_NUM>011194</BADGE_NUM>
+<OFFICER>Greg Johnson</OFFICER>
+<OFFICE>San Luis Obispo Area</OFFICE>
+<TIMER>16987</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>28-24</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="28-19"><STATUS>10-8</STATUS>
+<CURR_LOC>I-5 / Sand Canyon</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>28-San Luis Obispo</AREA>
+<BADGE_NUM>013181</BADGE_NUM>
+<OFFICER>Andre Muller</OFFICER>
+<OFFICE>San Luis Obispo Area</OFFICE>
+<TIMER>18685</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>28-19</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="28-13"><STATUS>10-8</STATUS>
+<CURR_LOC>I-5 / 133</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>28-San Luis Obispo</AREA>
+<BADGE_NUM>015283</BADGE_NUM>
+<OFFICER>Craig O'Neil</OFFICER>
+<OFFICE>San Luis Obispo Area</OFFICE>
+<TIMER>14069</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>28-13</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="28-11"><STATUS>10-8</STATUS>
+<CURR_LOC>SR55 AT DYER</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>28-San Luis Obispo</AREA>
+<BADGE_NUM>012555</BADGE_NUM>
+<OFFICER>Alex Carlton</OFFICER>
+<OFFICE>San Luis Obispo Area</OFFICE>
+<TIMER>15860</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>28-11</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="28-07"><STATUS>10-8</STATUS>
+<CURR_LOC>I405 / CULVER OFFR</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>28-San Luis Obispo</AREA>
+<BADGE_NUM>013606</BADGE_NUM>
+<OFFICER>Gary Schmidt</OFFICER>
+<OFFICE>San Luis Obispo Area</OFFICE>
+<TIMER>14999</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>28-7</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="28-S4"><STATUS>10-8</STATUS>
+<CURR_LOC></CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>28-San Luis Obispo</AREA>
+<BADGE_NUM>013565</BADGE_NUM>
+<OFFICER>Daniel Pierce</OFFICER>
+<OFFICE>San Luis Obispo Area</OFFICE>
+<TIMER>10606</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>28-S4</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="9-22"><STATUS>10-8</STATUS>
+<CURR_LOC>57 / Chapman</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>9-Templeton</AREA>
+<BADGE_NUM>012345</BADGE_NUM>
+<OFFICER>Victor Percival</OFFICER>
+<OFFICE>Templeton Area</OFFICE>
+<TIMER>24203</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>9-22</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="9-23"><STATUS>10-8</STATUS>
+<CURR_LOC>22 / Euclid Avenue</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>9-Templeton</AREA>
+<BADGE_NUM>011860</BADGE_NUM>
+<OFFICER>Michael Rocker</OFFICER>
+<OFFICE>Templeton Area</OFFICE>
+<TIMER>20184</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>9-23</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="9-26"><STATUS>10-8</STATUS>
+<CURR_LOC>57 / 91</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>9-Templeton Area</AREA>
+<BADGE_NUM>011480</BADGE_NUM>
+<OFFICER>Patrick King</OFFICER>
+<OFFICE>Templeton Area</OFFICE>
+<TIMER>14023</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>9-26</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="17-14"><STATUS>10-8</STATUS>
+<CURR_LOC>405 / Euclid</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>14-Santa Maria</AREA>
+<BADGE_NUM>017935</BADGE_NUM>
+<OFFICER>William Bond</OFFICER>
+<OFFICE>Santa Maria Area</OFFICE>
+<TIMER>29877</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>17-14</ALIAS>
+</NEW_UNIT>
+<NEW_UNIT UnitNum="17-16"><STATUS>10-8</STATUS>
+<CURR_LOC>S-405 / Euclid</CURR_LOC>
+<DESTINATION></DESTINATION>
+<AREA>14-Santa Maria</AREA>
+<BADGE_NUM>015839</BADGE_NUM>
+<OFFICER>Matthew McCarmick</OFFICER>
+<OFFICE>Santa Maria Area</OFFICE>
+<TIMER>23998</TIMER>
+<AGY>CHP</AGY>
+<ALIAS>17-16</ALIAS>
+</NEW_UNIT>
+</SCRIPT_DATA>
+</TMC_SCRIPT>
