Index: /trunk/config/svn-version.txt
===================================================================
--- /trunk/config/svn-version.txt	(revision 17)
+++ /trunk/config/svn-version.txt	(revision 19)
@@ -1,3 +1,3 @@
-15:16M
+18M
 
         # Do not edit. This file is autogenerated by the Ant build script #
Index: /trunk/scripts/one-incident.xml
===================================================================
--- /trunk/scripts/one-incident.xml	(revision 19)
+++ /trunk/scripts/one-incident.xml	(revision 19)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<TMC_SCRIPT title="One Incident Simulation">
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:00:00</TIME_INDEX>
+		<INCIDENT LogNum="100">Media Log</INCIDENT>		
+		
+		<CAD_DATA>
+			<HEADER_INFO>
+				<Type>Media</Type>
+				<Beat>
+				</Beat>
+				<TruncLoc>
+				</TruncLoc>
+				<FullLoc>
+				</FullLoc>
+			</HEADER_INFO>			
+			
+			<CAD_INCIDENT_EVENT>	
+			</CAD_INCIDENT_EVENT>		
+			
+		</CAD_DATA>				
+		
+	</SCRIPT_EVENT>	
+</TMC_SCRIPT>
Index: /trunk/src/tmcsim/cadsimulator/viewer/SimulationStatusPanel.java
===================================================================
--- /trunk/src/tmcsim/cadsimulator/viewer/SimulationStatusPanel.java	(revision 5)
+++ /trunk/src/tmcsim/cadsimulator/viewer/SimulationStatusPanel.java	(revision 19)
@@ -9,5 +9,4 @@
 import java.util.logging.LogRecord;
 import java.util.logging.Logger;
-
 import javax.swing.BorderFactory;
 import javax.swing.Box;
@@ -20,12 +19,11 @@
 import javax.swing.border.EtchedBorder;
 import javax.swing.border.TitledBorder;
-
 import tmcsim.common.CADEnums.PARAMICS_STATUS;
 import tmcsim.common.CADEnums.SCRIPT_STATUS;
 
 /**
- * SimulationStatusPanel is a GUI object used for displaying information
- * for the current simulation.  This information includes:
- * 
+ * SimulationStatusPanel is a GUI object used for displaying information for the
+ * current simulation. This information includes:
+ *
  * <ul>
  * <li>Current simulation time.</li>
@@ -38,57 +36,73 @@
  * <li>Error log messages</li>
  * </ul>
- * 
+ *
  * @author Matthew Cechini
  * @version
  */
 @SuppressWarnings("serial")
-public class SimulationStatusPanel extends JPanel {
-
-    /**
-     * Logging Handler to listen for Information and Error
-     * messages logged for the CAD Simulator.  Received LogRecords
-     * are displayed in the info or error message Text Area.
-     * 
+public class SimulationStatusPanel extends JPanel
+{
+
+    /**
+     * Logging Handler to listen for Information and Error messages logged for
+     * the CAD Simulator. Received LogRecords are displayed in the info or error
+     * message Text Area.
+     *
      * @author Matthew Cechini
      */
-    private class SimulatorErrorHandler extends Handler {
-        public void close() throws SecurityException { } 
-        public void flush() { }
-        public void publish(LogRecord rec) {
+    private class SimulatorErrorHandler extends Handler
+    {
+
+        public void close() throws SecurityException
+        {
+        }
+
+        public void flush()
+        {
+        }
+
+        public void publish(LogRecord rec)
+        {
             StringBuffer msgBuffer = new StringBuffer();
 
-            msgBuffer.append(rec.getSourceClassName() + "." + 
-                rec.getSourceMethodName() + " = " + 
-                rec.getMessage());
-            
-            if(rec.getLevel() == Level.INFO)
-                infoMessagesTA.setText(infoMessagesTA.getText() + 
-                    msgBuffer.toString() + "\n");
-            else 
-                errorMessagesTA.setText(errorMessagesTA.getText() + 
-                        msgBuffer.toString() + "\n");
-        }
-    }
-    
-    /** Count of how many CAD clients have connected. */
+            msgBuffer.append(rec.getSourceClassName() + "."
+                    + rec.getSourceMethodName() + " = "
+                    + rec.getMessage());
+
+            if (rec.getLevel() == Level.INFO)
+            {
+                infoMessagesTA.setText(infoMessagesTA.getText()
+                        + msgBuffer.toString() + "\n");
+            } else
+            {
+                errorMessagesTA.setText(errorMessagesTA.getText()
+                        + msgBuffer.toString() + "\n");
+            }
+        }
+    }
+    /**
+     * Count of how many CAD clients have connected.
+     */
     private int numClientsConnected = 0;
-    
-    /** Logging ErrorHandler. */
+    /**
+     * Logging ErrorHandler.
+     */
     private SimulatorErrorHandler errorHandler;
-    
-    /**
-     * Constructor.  Initialize GUI Objects.  Register the logging handler
-     * to listen for log records from all loggers that exist in the
+
+    /**
+     * Constructor. Initialize GUI Objects. Register the logging handler to
+     * listen for log records from all loggers that exist in the
      * "tmcsim.cadsimulator" package structure.
-     */ 
-    public SimulationStatusPanel() {
-        
+     */
+    public SimulationStatusPanel()
+    {
+
         initTimeAndStatus();
-        initAdditionalInfo();   
+        initAdditionalInfo();
         initMessagesPanes();
-        
-        errorHandler = new SimulatorErrorHandler();     
-        Logger.getLogger("tmcsim.cadsimulator").addHandler(errorHandler);       
-        
+
+        errorHandler = new SimulatorErrorHandler();
+        Logger.getLogger("tmcsim.cadsimulator").addHandler(errorHandler);
+
         CADSimulatorViewerBox = Box.createVerticalBox();
         CADSimulatorViewerBox.add(simulationTimeAndStatusBox);
@@ -96,31 +110,35 @@
         CADSimulatorViewerBox.add(infoMessagesPane);
         CADSimulatorViewerBox.add(errorMessagesPane);
-        
-        add(CADSimulatorViewerBox); 
-    }   
-
-    /** 
-     * Method is called when a CAD Client disconnects from the CAD Simulator.  
+
+        add(CADSimulatorViewerBox);
+    }
+
+    /**
+     * Method is called when a CAD Client disconnects from the CAD Simulator.
      * The displayed number of connected clients is incremented by one.
      */
-    public void connectClient() {
-        
+    public void connectClient()
+    {
+
         numClientsConnected++;
-                    
-        termConnectedTF.setText(String.valueOf(numClientsConnected));       
-    }
-    
-    /** 
-     * Method is called when a CAD Client disconnects from the CAD Simulator.  
+
+        termConnectedTF.setText(String.valueOf(numClientsConnected));
+    }
+
+    /**
+     * Method is called when a CAD Client disconnects from the CAD Simulator.
      * The displayed number of connected clients is decremented by one.
      */
-    public void disconnectClient() {
-        
-        if(numClientsConnected > 0)
+    public void disconnectClient()
+    {
+
+        if (numClientsConnected > 0)
+        {
             numClientsConnected--;
-                    
+        }
+
         termConnectedTF.setText(String.valueOf(numClientsConnected));
     }
-    
+
     /**
      * Method is called when Simulation Manager connects or disconnects.
@@ -128,113 +146,131 @@
      * @param connection True if simulation manager is connected, false if not.
      */
-    public void setSimManagerStatus(boolean connection) {
-        
-        if(connection) 
-            managerConnectedTF.setText("Yes");      
-        else
+    public void setSimManagerStatus(boolean connection)
+    {
+
+        if (connection)
+        {
+            managerConnectedTF.setText("Yes");
+        } else
+        {
             managerConnectedTF.setText("No");
-        
-    }
-    
-    /**
-     * Method called to convert current simulation time (parameter long value) to
-     * a string of format H:MM:SS. Time is then updated on GUI.
+        }
+
+    }
+
+    /**
+     * Method called to convert current simulation time (parameter long value)
+     * to a string of format H:MM:SS. Time is then updated on GUI.
      *
      * @param seconds Long value of current time
      */
-    public void setTime(long seconds) {     
-        String time = new String();     
-        long timeSegment;   
-        
+    public void setTime(long seconds)
+    {
+        String time = new String();
+        long timeSegment;
+
         timeSegment = seconds / 3600;
-        time += String.valueOf(timeSegment) + ":";      
-        
+        time += String.valueOf(timeSegment) + ":";
+
         seconds = seconds % 3600;
-        
+
         timeSegment = seconds / 60;
-        if(timeSegment < 10)
+        if (timeSegment < 10)
+        {
             time += "0";
-        
-        time += String.valueOf(timeSegment) + ":";      
-        seconds = seconds % 60; 
-        
+        }
+
+        time += String.valueOf(timeSegment) + ":";
+        seconds = seconds % 60;
+
         timeSegment = seconds;
-        if(timeSegment < 10)
+        if (timeSegment < 10)
+        {
             time += "0";
-        
+        }
+
         time += String.valueOf(timeSegment);
-        
-        simulationClockLabel.setText(time);     
-        
-    }
-    
-    /**
-     * This method is called within the CADSimulator whenever an error occurs.  The message
-     * is then displayed to the user in the "Error Messages" portion of the CAD Simulator Viewer.
-     * Invoke method with null parameter to clear messages.
+
+        simulationClockLabel.setText(time);
+
+    }
+
+    /**
+     * This method is called within the CADSimulator whenever an error occurs.
+     * The message is then displayed to the user in the "Error Messages" portion
+     * of the CAD Simulator Viewer. Invoke method with null parameter to clear
+     * messages.
      *
      * @param errorMessage String message that will be displayed
      */
-    protected void displayError(String errorMessage) {
-        if(errorMessage == null)
+    protected void displayError(String errorMessage)
+    {
+        if (errorMessage == null)
+        {
             errorMessagesTA.setText("");
-        else 
-            errorMessagesTA.append(errorMessage + "\n");    
-    }
-    
+        } else
+        {
+            errorMessagesTA.append(errorMessage + "\n");
+        }
+    }
+
     /**
      * Method is called to display the current status of the simulation.
      *
-     * @param newStatus Current status of simulation.  The following table describes
-     * each possible status and what is displayed.  Each status code is found
-     * as a public static int in the Coordinator Class.
-     *
-     *<table cellpadding="2" cellspacing="2" border="1"
-     * style="text-align: left; width: 250px;">
-     *  <tbody>
-     *    <tr>
-     *      <th>Status<br></th>
-     *      <th>Actions Taken<br></th>
-     *    </tr>
-     *    <tr>
-     *      <td>NO_SCRIPT<br></td>
-     *      <td>Set the simulation status text to a black "No Script".  <br></td>
-     *    </tr>
-     *    <tr>
-     *      <td>SCRIPT_STOPPED_NOT_STARTED<br></td>
-     *      <td>Set the simulation status text to a red "Ready".  <br></td>
-     *    </tr>
-     *    <tr>
-     *      <td>SCRIPT_PAUSED_STARTED<br></td>
-     *      <td>Set the simulation status text to a red "Paused".  <br></td>
-     *    </tr>
-     *    <tr>
-     *      <td>SCRIPT_RUNNING<br></td>
-     *      <td>Set the simulation status text to a green "Running".  <br></td>
-     *    </tr>
-     *    <tr>
-     *      <td>ATMS_SYNCHRONIZATION<br></td>
-     *      <td>Set the simulation status text to an orange "Synchronizing".  <br></td>
-     *    </tr>
-     *  </tbody>
-     *</table>     */
-    public void setScriptStatus(SCRIPT_STATUS newStatus) {
-        
-        switch(newStatus) {     
+     * @param newStatus Current status of simulation. The following table
+     * describes each possible status and what is displayed. Each status code is
+     * found as a public static int in the Coordinator Class.
+     *
+     * <table cellpadding="2" cellspacing="2" border="1" style="text-align:
+     * left; width: 250px;">
+     * <tbody>
+     * <tr>
+     * <th>Status<br></th>
+     * <th>Actions Taken<br></th>
+     * </tr>
+     * <tr>
+     * <td>NO_SCRIPT<br></td>
+     * <td>Set the simulation status text to a black "No Script". <br></td>
+     * </tr>
+     * <tr>
+     * <td>SCRIPT_STOPPED_NOT_STARTED<br></td>
+     * <td>Set the simulation status text to a red "Ready". <br></td>
+     * </tr>
+     * <tr>
+     * <td>SCRIPT_PAUSED_STARTED<br></td>
+     * <td>Set the simulation status text to a red "Paused". <br></td>
+     * </tr>
+     * <tr>
+     * <td>SCRIPT_RUNNING<br></td>
+     * <td>Set the simulation status text to a green "Running". <br></td>
+     * </tr>
+     * <tr>
+     * <td>ATMS_SYNCHRONIZATION<br></td>
+     * <td>Set the simulation status text to an orange "Synchronizing".
+     * <br></td>
+     * </tr>
+     * </tbody>
+     * </table>
+     */
+    public void setScriptStatus(SCRIPT_STATUS newStatus)
+    {
+
+        switch (newStatus)
+        {
             case NO_SCRIPT:
                 simulationStatusText.setText("No Script");
-                simulationStatusText.setForeground(Color.BLACK);                                            
-                break;          
-                
+                simulationStatusText.setForeground(Color.BLACK);
+                break;
+
             case SCRIPT_STOPPED_NOT_STARTED:
                 simulationStatusText.setText("Ready");
-                simulationStatusText.setForeground(Color.RED);          
-                break;          
-                
+                simulationStatusText.setForeground(Color.RED);
+                break;
+
             case SCRIPT_PAUSED_STARTED:
                 simulationStatusText.setText("Paused");
                 simulationStatusText.setForeground(Color.RED);
                 break;
-                
+
             case SCRIPT_RUNNING:
                 simulationStatusText.setText("Running");
@@ -245,26 +281,28 @@
                 simulationStatusText.setForeground(Color.ORANGE);
                 break;
-            
-        }   
-    }
-    
+
+        }
+    }
+
     /**
      * Method is called when a connection to paramics is made or dropped.
      *
-     * @param newStatus The status denoting whether a connection has been
-     * made or dropped.
-     */
-    public void setParamicsStatus(PARAMICS_STATUS newStatus) {
-        
-        switch(newStatus) {
+     * @param newStatus The status denoting whether a connection has been made
+     * or dropped.
+     */
+    public void setParamicsStatus(PARAMICS_STATUS newStatus)
+    {
+
+        switch (newStatus)
+        {
             case CONNECTED:
                 paramicsConnectedTF.setText("Yes");
                 break;
             case DISCONNECTED:
-                paramicsConnectedTF.setText("No");          
-                break;
-        }
-    }
-    
+                paramicsConnectedTF.setText("No");
+                break;
+        }
+    }
+
     /**
      * Method is called when a paramics network is loaded.
@@ -272,43 +310,47 @@
      * @param networkID Unique ID for Paramics network that has been loaded.
      */
-    public void setParamicsNetworkLoaded(String networkID) {
+    public void setParamicsNetworkLoaded(String networkID)
+    {
         networkLoadedTF.setText(networkID);
-    }    
-    
-        
-    /** Initialize Time and Status GUI Components */
-    private void initTimeAndStatus() {
-        
-        simulationTime        = new JPanel();
-        simulationClock      = new JPanel();
-        simulationStatus     = new JLabel("Simulation Status");
+    }
+
+    /**
+     * Initialize Time and Status GUI Components
+     */
+    private void initTimeAndStatus()
+    {
+
+        simulationTime = new JPanel();
+        simulationClock = new JPanel();
+        simulationStatus = new JLabel("Simulation Status");
         simulationStatusText = new JLabel("No Script");
-        
-        simulationTime.setLayout(new BorderLayout());       
+
+        simulationTime.setLayout(new BorderLayout());
         simulationClock.setPreferredSize(new Dimension(100, 60));
         simulationTimeAndStatusBox = new Box(BoxLayout.X_AXIS);
-        simulationStatusBox = new Box(BoxLayout.Y_AXIS);        
-        simulationTimeBox   = new Box(BoxLayout.Y_AXIS);
-        simulationClockBox  = new Box(BoxLayout.X_AXIS);
-        
+        simulationStatusBox = new Box(BoxLayout.Y_AXIS);
+        simulationTimeBox = new Box(BoxLayout.Y_AXIS);
+        simulationClockBox = new Box(BoxLayout.X_AXIS);
+
         simulationStatus.setAlignmentX(Box.CENTER_ALIGNMENT);
         simulationStatusText.setAlignmentX(Box.CENTER_ALIGNMENT);
         simulationStatusText.setName("simulationStatusText");
-        
+
         TitledBorder title = BorderFactory.createTitledBorder(
                 BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Status");
         title.setTitleJustification(TitledBorder.LEFT);
         simulationStatusBox.setBorder(title);
-        
+
         simulationStatusBox.setMaximumSize(new Dimension(140, 60));
-        simulationStatusBox.setAlignmentX(Box.CENTER_ALIGNMENT);                    
-        
+        simulationStatusBox.setAlignmentX(Box.CENTER_ALIGNMENT);
+
         simulationStatusBox.add(Box.createHorizontalStrut(120));
         simulationStatusBox.add(Box.createVerticalGlue());
         simulationStatusBox.add(simulationStatusText);
         simulationStatusBox.add(Box.createVerticalGlue());
-        
+
         simulationClockLabel = new JLabel("0:00:00");
         simulationClockLabel.setFont(new Font("Geneva", Font.BOLD, 70));
+        simulationClockLabel.setName("simulationClockLabel");
         simulationClockLabel.setForeground(Color.BLACK);
         simulationClockLabel.setBackground(Color.BLACK);
@@ -316,78 +358,85 @@
         simulationClockBox.setBackground(Color.BLACK);
         simulationClockBox.add(simulationClockLabel);
-        simulationClockBox.setAlignmentX(Box.CENTER_ALIGNMENT); 
+        simulationClockBox.setAlignmentX(Box.CENTER_ALIGNMENT);
         simulationTimeBox.add(simulationClockBox);
-                
-        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20));              
+
+        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20));
         simulationTimeAndStatusBox.add(simulationTimeBox);
         simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20));
-        simulationTimeAndStatusBox.add(simulationStatusBox);        
-        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20));          
-    }
-    
-    
-    /** Initialize Additional Info Label GUI Components */
-    private void initAdditionalInfo() {
-        
+        simulationTimeAndStatusBox.add(simulationStatusBox);
+        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20));
+    }
+
+    /**
+     * Initialize Additional Info Label GUI Components
+     */
+    private void initAdditionalInfo()
+    {
+
         terminalsConnectedLabel = new JLabel("Connected CAD Terminals: ");
-        termConnectedTF  = new JTextField("   " + String.valueOf(numClientsConnected));
+        termConnectedTF = new JTextField("   " + String.valueOf(numClientsConnected));
         termConnectedTF.setEditable(false);
         termConnectedTF.setName("termConnectedTF");
-        
+
         termConnectedBox = new Box(BoxLayout.X_AXIS);
         termConnectedBox.add(terminalsConnectedLabel);
         termConnectedBox.add(Box.createHorizontalGlue());
         termConnectedBox.add(termConnectedTF);
-        
-        
-        managerConnectedLabel     = new JLabel("Simulation Manager Connected: ");
+
+
+        managerConnectedLabel = new JLabel("Simulation Manager Connected: ");
         managerConnectedTF = new JTextField("  No");
         managerConnectedTF.setEditable(false);
         managerConnectedTF.setName("managerConnectedTF");
-                
+
         managerConnectedBox = new Box(BoxLayout.X_AXIS);
         managerConnectedBox.add(managerConnectedLabel);
         managerConnectedBox.add(Box.createHorizontalGlue());
         managerConnectedBox.add(managerConnectedTF);
-        
-        
-        paramicsConnectedLabel     = new JLabel("Connected to Paramics: ");
+
+
+        paramicsConnectedLabel = new JLabel("Connected to Paramics: ");
         paramicsConnectedTF = new JTextField("  No");
         paramicsConnectedTF.setEditable(false);
-                
+        paramicsConnectedTF.setName("paramicsConnectedTF");
+
         paramicsConnectedBox = new Box(BoxLayout.X_AXIS);
         paramicsConnectedBox.add(paramicsConnectedLabel);
         paramicsConnectedBox.add(Box.createHorizontalGlue());
         paramicsConnectedBox.add(paramicsConnectedTF);
-        
-        
-        networkLoadedLabel     = new JLabel("Network Loaded: ");
-        networkLoadedTF = new JTextField("None");       
+
+
+        networkLoadedLabel = new JLabel("Network Loaded: ");
+        networkLoadedTF = new JTextField("None");
         networkLoadedTF.setEditable(false);
-                
+        networkLoadedTF.setName("networkLoadedTF");
+
         networkLoadedBox = new Box(BoxLayout.X_AXIS);
         networkLoadedBox.add(networkLoadedLabel);
         networkLoadedBox.add(Box.createHorizontalGlue());
         networkLoadedBox.add(networkLoadedTF);
-        
+
 
         additionalInfoBox = new Box(BoxLayout.Y_AXIS);
-        additionalInfoBox.setMinimumSize(new Dimension(300, 150));      
-        
+        additionalInfoBox.setMinimumSize(new Dimension(300, 150));
+
         additionalInfoBox.add(Box.createVerticalStrut(10));
-        additionalInfoBox.add(termConnectedBox);    
+        additionalInfoBox.add(termConnectedBox);
         additionalInfoBox.add(Box.createVerticalStrut(10));
-        additionalInfoBox.add(managerConnectedBox); 
+        additionalInfoBox.add(managerConnectedBox);
         additionalInfoBox.add(Box.createVerticalStrut(10));
-        additionalInfoBox.add(paramicsConnectedBox);    
+        additionalInfoBox.add(paramicsConnectedBox);
         additionalInfoBox.add(Box.createVerticalStrut(10));
-        additionalInfoBox.add(networkLoadedBox);    
-        additionalInfoBox.add(Box.createVerticalStrut(20)); 
-        
-            
-    }
-    
-    /**  Initialize Info & Error Messages GUI Components */
-    private void initMessagesPanes() {
+        additionalInfoBox.add(networkLoadedBox);
+        additionalInfoBox.add(Box.createVerticalStrut(20));
+
+
+    }
+
+    /**
+     * Initialize Info & Error Messages GUI Components
+     */
+    private void initMessagesPanes()
+    {
 
         infoMessagesTA = new JTextArea(6, 30);
@@ -396,51 +445,45 @@
         infoMessagesPane = new JScrollPane(infoMessagesTA);
         infoMessagesPane.setPreferredSize(new Dimension(300, 100));
-        
+        infoMessagesPane.setName("infoMessagesPane");
         infoMessagesPane.setBorder(BorderFactory.createTitledBorder(
-                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Info Messages"));  
+                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Info Messages"));
         infoMessagesPane.setName("infoMessagesPane");
-        
+
         errorMessagesTA = new JTextArea(6, 30);
         errorMessagesTA.setForeground(Color.RED);
         errorMessagesTA.setEditable(false);
+        errorMessagesTA.setName("errorMessagesTA");
         errorMessagesPane = new JScrollPane(errorMessagesTA);
         errorMessagesPane.setPreferredSize(new Dimension(300, 150));
-        
+        errorMessagesPane.setName("errorMessagesPane");
         errorMessagesPane.setBorder(BorderFactory.createTitledBorder(
-                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Error Messages")); 
-    
-    }
-    
-        
+                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Error Messages"));
+
+    }
     private Box additionalInfoBox;
-    private Box termConnectedBox;   
-    private Box managerConnectedBox;    
+    private Box termConnectedBox;
+    private Box managerConnectedBox;
     private Box paramicsConnectedBox;
-    private Box networkLoadedBox;   
+    private Box networkLoadedBox;
     private Box CADSimulatorViewerBox;
     private Box simulationTimeAndStatusBox;
-    private Box simulationStatusBox;        
+    private Box simulationStatusBox;
     private Box simulationTimeBox;
     private Box simulationClockBox;
-    
     private JLabel managerConnectedLabel;
-    private JLabel paramicsConnectedLabel;  
+    private JLabel paramicsConnectedLabel;
     private JLabel simulationStatus;
     private JLabel simulationClockLabel;
     private JLabel simulationStatusText;
-    private JLabel terminalsConnectedLabel; 
+    private JLabel terminalsConnectedLabel;
     private JLabel networkLoadedLabel;
-    
     private JPanel simulationTime;
-    private JPanel simulationClock;     
-        
+    private JPanel simulationClock;
     private JTextField managerConnectedTF;
     private JTextField paramicsConnectedTF;
     private JTextField termConnectedTF;
     private JTextField networkLoadedTF;
-        
     private JScrollPane infoMessagesPane;
     private JScrollPane errorMessagesPane;
-
     private JTextArea infoMessagesTA;
     private JTextArea errorMessagesTA;
Index: /trunk/test/tmcsim/cadsimulator/CADSimulatorGUITest.java
===================================================================
--- /trunk/test/tmcsim/cadsimulator/CADSimulatorGUITest.java	(revision 19)
+++ /trunk/test/tmcsim/cadsimulator/CADSimulatorGUITest.java	(revision 19)
@@ -0,0 +1,180 @@
+package tmcsim.cadsimulator;
+
+import java.io.File;
+import java.rmi.RemoteException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.fail;
+import static org.mockito.Mockito.*;
+import org.uispec4j.*;
+import org.uispec4j.interception.WindowInterceptor;
+import tmcsim.cadsimulator.managers.ParamicsSimulationManager;
+import tmcsim.common.CADEnums;
+import tmcsim.common.ScriptException;
+import tmcsim.common.SimulationException;
+import tmcsim.interfaces.CADClientInterface;
+import tmcsim.interfaces.SimulationManagerInterface;
+
+/**
+ * Test of CADSimulator GUI
+ *
+ * @author jdalbey
+ */
+public class CADSimulatorGUITest extends UISpecTestCase
+{
+
+    static final String configData =
+            "CADClientPort          = 4444 \n"
+            + "CoordinatorRMIPort     = 4445 \n"
+            + "CADRmiPort             = 4446 \n"
+            + "UserInterface          = tmcsim.cadsimulator.viewer.CADSimulatorViewer\n"
+            + "ParamicsProperties     = pconfig.txt\n"
+            + "ATMSProperties         = empty.txt\n"
+            + "MediaProperties        = empty.txt\n";
+
+    public CADSimulatorGUITest(String testName)
+    {
+        super(testName);
+    }
+
+    @Override
+    public void tearDown() throws java.io.IOException
+    {
+        File removeMe = new File("config.txt");
+        removeMe.delete();
+        removeMe = new File("pconfig.txt");
+        removeMe.delete();
+        removeMe = new File("empty.txt");
+        removeMe.delete();
+    }
+
+    /**
+     * Test of getCADTime method, of class CADSimulator.
+     */
+    public void testGetCADTime()
+    {
+        System.out.println("getCADTime");
+        String result = CADSimulator.getCADTime();
+        // Just test length for now
+        assertEquals(4, result.length());
+    }
+
+    /**
+     * Test of getCADDate method, of class CADSimulator.
+     */
+    public void testGetCADDate()
+    {
+        System.out.println("getCADDate");
+        String result = CADSimulator.getCADDate();
+        // Just test length for now
+        assertEquals(6, result.length());
+    }
+    /**
+     * Test of main method, of class CADSimulator.
+     */
+    CADSimulator app;
+
+    public void testConstructor() throws SimulationException, RemoteException, ScriptException
+    {
+        CADSimulatorFixture.writeConfigData();
+        CADSimulatorFixture.writedata("config.txt", configData);
+        System.out.println("CADSimulator constructor");
+        System.setProperty("CAD_SIM_PROPERTIES", "config.txt");
+        Window cadwindow = null;
+        if (System.getProperty("CAD_SIM_PROPERTIES") != null)
+        {
+            cadwindow = WindowInterceptor.run(new Trigger()
+            {
+                public void run()
+                {
+                    try
+                    {
+                        app = new CADSimulator(System.getProperty("CAD_SIM_PROPERTIES"));
+                    } catch (Exception e)
+                    {
+                        fail("Couldn't launch CADSimulator" + e.getMessage());
+                    }
+                }
+            });
+        } else
+        {
+            fail("CAD_SIM_PROPERTIES system property not defined.");
+        }
+        assertEquals("CAD Simulator", cadwindow.getTitle());
+        Panel mainPanel = cadwindow.getPanel("contentPane");
+        TextBox txtStatus = mainPanel.getTextBox("simulationStatus");
+        assertEquals("No Script", txtStatus.getText());
+        TextBox terminals = mainPanel.getTextBox("termConnectedTF");
+        assertEquals("0", terminals.getText().trim());
+        assertEquals("No", mainPanel.getTextBox("managerConnectedTF").getText().trim());
+        assertEquals("0:00:00", mainPanel.getTextBox("simulationClockLabel").getText());
+
+        CADClientInterface ci = new FakeClient();
+        app.theCoordinator.registerForCallback(ci);
+        assertEquals("1", terminals.getText().trim());
+        app.theCoordinator.registerForCallback(ci);
+        assertEquals("2", terminals.getText().trim());
+
+        SimulationManagerInterface si = mock(SimulationManagerInterface.class);
+        app.theCoordinator.registerForCallback(si);
+        assertEquals("Yes", mainPanel.getTextBox("managerConnectedTF").getText().trim());
+
+        Logger cadSimLogger = Logger.getLogger("tmcsim.cadsimulator");
+        cadSimLogger.logp(Level.INFO, "", "", "Sample Info Message.");
+
+        Panel infoPane = mainPanel.getPanel("infoMessagesPane");
+        TextBox infoText = infoPane.getTextBox("infoMessagesTA");
+        assertEquals(". = Sample Info Message.", infoText.getText().trim());
+
+        cadSimLogger.logp(Level.SEVERE, "", "", "Sample Error Message.");
+
+        Panel errPane = mainPanel.getPanel("errorMessagesPane");
+        TextBox errText = errPane.getTextBox("errorMessagesTA");
+        assertEquals(". = Sample Error Message.", errText.getText().trim());
+
+        app.theCoordinator.setParamicsStatus(CADEnums.PARAMICS_STATUS.CONNECTED);
+        CADSimulatorFixture.pause(500);
+        assertEquals("Yes", mainPanel.getTextBox("paramicsConnectedTF").getText().trim());
+        assertEquals("None", mainPanel.getTextBox("networkLoadedTF").getText().trim());
+
+//        app.theCoordinator.setScriptStatus(CADEnums.SCRIPT_STATUS.SCRIPT_RUNNING);
+//        assertEquals("Running", mainPanel.getTextBox("simulationStatus").getText().trim());
+
+        // Load a script file
+        String autoloadScriptname = "scripts/one-incident.xml";
+        app.theCoordinator.loadScriptFile(new File(autoloadScriptname));
+        // The status should now say Ready
+        assertEquals("Ready", mainPanel.getTextBox("simulationStatus").getText().trim());
+
+        app.theCoordinator.startSimulation();
+        CADSimulatorFixture.pause(500);
+        assertEquals("Running", mainPanel.getTextBox("simulationStatus").getText().trim());
+        assertEquals("0:00:01", mainPanel.getTextBox("simulationClockLabel").getText());
+
+        ParamicsSimulationManager psm = mock(ParamicsSimulationManager.class);
+        when(psm.isConnected()).thenReturn(Boolean.TRUE);
+        app.theParamicsSimMgr = psm;
+        app.theCoordinator.loadParamicsNetwork(1);
+
+//        app.theViewer.dispose();
+//        Window confirmPopup = null;
+//        confirmPopup = WindowInterceptor.run(new Trigger()
+//        {
+//            public void run()
+//            {
+//                app.theViewer.closeViewer();
+//            }
+//        });
+//        confirmPopup.getButton("OK").click();
+    }
+
+    class FakeClient implements CADClientInterface
+    {
+
+        @Override
+        public void refresh() throws RemoteException
+        {
+        }
+    }
+}
Index: /trunk/test/tmcsim/cadsimulator/CADSimulatorFixture.java
===================================================================
--- /trunk/test/tmcsim/cadsimulator/CADSimulatorFixture.java	(revision 19)
+++ /trunk/test/tmcsim/cadsimulator/CADSimulatorFixture.java	(revision 19)
@@ -0,0 +1,146 @@
+package tmcsim.cadsimulator;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Scanner;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import static tmcsim.cadsimulator.CADSimulatorFixture.bos;
+
+/**
+ * Note: This test requires an internet connection, for building data files from
+ * a master copy at pastebin.
+ *
+ * @author jdalbey
+ */
+public class CADSimulatorFixture
+{
+
+    static CADSimulator app;
+    static ByteArrayOutputStream bos;
+    static PrintStream ps;
+    static final String configData =
+            "CADClientPort          = 4444 \n"
+            + "CoordinatorRMIPort     = 4445 \n"
+            + "CADRmiPort             = 4446 \n"
+            + "UserInterface          = tmcsim.cadsimulator.viewer.CADConsoleViewer\n"
+            + "ParamicsProperties     = pconfig.txt\n"
+            + "ATMSProperties         = empty.txt\n"
+            + "MediaProperties        = empty.txt\n";
+    static final String paramicsData = "ParamicsCommHost       = 192.168.251.45\n"
+            + "ParamicsCommPort       = 4450\n"
+            + "IncidentUpdateInterval = 30\n"
+            + "IncidentUpdateFile     = exchange.xml\n"
+            + "ParamicsStatusInterval = 15\n"
+            + "ParamicsStatusFile     = paramics_status.xml\n"
+            + "CameraStatusInterval   = 30\n"
+            + "CameraStatusFile       = camera_status.xml\n";
+    static final String cardfileURL = "http://pastebin.com/raw/Yr26nfp7";
+    static final String smallXMLURL = "http://pastebin.com/raw/Eqj2N5qD";
+    /*
+     * Creating instance of app must be done only once or you get registry
+     * bind problems, and code Written in Constructor is Executed
+     * before each Test Method
+     */
+
+    public static void writeConfigData()
+    {
+        // Declare a stream to the output
+        bos = new ByteArrayOutputStream();
+        ps = new PrintStream(bos);
+        // Redirect the standard output
+        System.setOut(ps);
+        writedata("config.txt", configData);
+        writedata("pconfig.txt", paramicsData);
+        writedata("empty.txt", "");
+        writeScriptfiles();
+    }
+
+    public static void writeScriptfiles()
+    {
+        writeFileFromURL("scripts/Cardfile.xml", cardfileURL);
+        writeFileFromURL("scripts/one-incident.xml", smallXMLURL);
+    }
+
+    private static void writeFileFromURL(String filename, String urlstring)
+    {
+        File cardFile = new File(filename);
+        // If a cardfile exists, leave it
+        if (!cardFile.exists())
+        {
+            // if cardfile doesn't exist, copy from our special pastebin
+            java.io.File dir = new java.io.File("scripts");
+            dir.mkdir();
+            URL url = null;
+            try
+            {
+                url = new URL(urlstring);
+            } catch (MalformedURLException ex)
+            {
+                Logger.getLogger(CADSimulatorFixture.class.getName()).log(Level.SEVERE, null, ex);
+            }
+            try
+            {
+                Scanner in = null;
+                in = new Scanner(url.openStream()).useDelimiter("\\A");
+                String out = in.next();
+                writedata(filename, out);
+            } catch (IOException ex)
+            {
+                Logger.getLogger(CADSimulatorFixture.class.getName()).log(Level.SEVERE, null, ex);
+            }
+        }
+    }
+
+    public static void startCADSim()
+    {
+        // This will set the desired property as long as you don't call the main() method.
+        System.setProperty("CAD_SIM_PROPERTIES", "config.txt");
+        if (System.getProperty("CAD_SIM_PROPERTIES") != null)
+        {
+            try
+            {
+                app = new CADSimulator(System.getProperty("CAD_SIM_PROPERTIES"));
+            } catch (Exception ex)
+            {
+                ex.printStackTrace();
+                junit.framework.TestCase.fail("Couldn't launch CADSimulator");
+            }
+        } else
+        {
+            junit.framework.TestCase.fail("CAD_SIM_PROPERTIES system property not defined.");
+        }
+    }
+    // Write the test data to a file
+
+    public static void writedata(String filename, String data)
+    {
+        PrintWriter writer = null;
+        try
+        {
+            writer = new PrintWriter(new FileWriter(filename));
+            writer.println(data);
+            writer.close();
+        } catch (Exception ex)
+        {
+            ex.printStackTrace();
+        }
+    }
+
+    public static void pause(int millis)
+    {
+        try
+        {
+            Thread.sleep(millis);
+        } catch (InterruptedException ex)
+        {
+            ex.printStackTrace();
+        }
+    }
+}
Index: /trunk/IDE_metadata/NetBeans/TMCSim/nbproject/project.properties
===================================================================
--- /trunk/IDE_metadata/NetBeans/TMCSim/nbproject/project.properties	(revision 16)
+++ /trunk/IDE_metadata/NetBeans/TMCSim/nbproject/project.properties	(revision 19)
@@ -28,4 +28,5 @@
 endorsed.classpath=
 excludes=
+file.reference.mockito-1.10.19.jar=../../../lib/mockito-1.10.19.jar
 file.reference.mp3plugin.jar=../../../lib/mp3plugin.jar
 file.reference.tmc-simulator-src=../../../src
@@ -38,5 +39,6 @@
     ${file.reference.xercesImpl.jar}:\
     ${file.reference.uispec4j-jdk17.jar}:\
-    ${file.reference.mp3plugin.jar}
+    ${file.reference.mp3plugin.jar}:\
+    ${file.reference.mockito-1.10.19.jar}
 # Space-separated list of extra javac options
 javac.compilerargs=
@@ -49,5 +51,6 @@
     ${javac.classpath}:\
     ${build.classes.dir}:\
-    ${libs.junit.classpath}
+    ${libs.junit.classpath}:\
+    ${libs.junit_4.classpath}
 javac.test.processorpath=\
     ${javac.test.classpath}
