Index: trunk/test/tmcsim/cadsimulator/GetCadDataUnitValueTest.java
===================================================================
--- trunk/test/tmcsim/cadsimulator/GetCadDataUnitValueTest.java	(revision 54)
+++ trunk/test/tmcsim/cadsimulator/GetCadDataUnitValueTest.java	(revision 54)
@@ -0,0 +1,73 @@
+
+package tmcsim.cadsimulator;
+
+import java.io.File;
+import java.util.LinkedList;
+import java.util.Observer;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.Vector;
+import javax.swing.table.DefaultTableModel;
+import junit.framework.TestCase;
+import tmcsim.cadmodels.CADRoutedMessage;
+import tmcsim.cadmodels.CMSInfo;
+import tmcsim.cadmodels.IncidentInquiryModel_obj;
+import tmcsim.client.cadclientgui.data.CADData;
+import tmcsim.client.cadclientgui.data.CardfileList;
+import tmcsim.client.cadclientgui.data.ChangeLog;
+import tmcsim.client.cadclientgui.data.Incident;
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+import tmcsim.client.cadclientgui.data.Unit;
+import tmcsim.client.cadclientgui.enums.CADDataEnums;
+import tmcsim.client.cadclientgui.enums.CADScriptTags;
+import tmcsim.client.cadclientgui.enums.IncidentEnums;
+import tmcsim.client.cadclientgui.enums.UnitStatusEnums;
+import tmcsim.common.CADEnums;
+import tmcsim.interfaces.CADClientInterface;
+import tmcsim.interfaces.SimulationManagerInterface;
+
+/**
+ *
+ * @author jdalbey
+ */
+public class GetCadDataUnitValueTest extends TestCase
+{
+    
+    public GetCadDataUnitValueTest(String testName)
+    {
+        super(testName);
+    }
+    
+    @Override
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+    }
+
+
+
+    public void testSetCadDataUnitValue() throws Exception
+    {
+        System.out.println("setCadDataUnitValue");
+        String unitNum = "14-13";
+        CADScriptTags.UNIT_TAGS tag = CADScriptTags.UNIT_TAGS.OFFICER;
+        Object value = "Joe Friday";
+        Coordinator instance = new Coordinator(null);
+        CADData myData = new CADData();
+        Unit unit1 = new Unit("14-13");
+        unit1.setStatus("10-8");
+        unit1.setOfficer("Joe Friday");
+        Vector<Unit> units = new Vector<Unit>();
+        units.add(unit1);
+        
+        myData.setUnitsFromXML(units);
+        instance.setCadData(myData);
+        instance.setCadDataUnitValue(unitNum, tag, value);
+        String result = (String) instance.getCadDataUnitValue(unitNum, tag);
+        assertEquals(value, result);
+        result = (String) instance.getCadDataUnitValue("", tag);
+        assertTrue(result.length() == 0);
+        
+    }
+
+}
Index: trunk/config/testConfig/cad_simulator_logging.properties
===================================================================
--- trunk/config/testConfig/cad_simulator_logging.properties	(revision 32)
+++ trunk/config/testConfig/cad_simulator_logging.properties	(revision 54)
@@ -14,2 +14,3 @@
 # Set the default formatter for new ConsoleHandler instances
 java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
Index: trunk/src/tmcsim/application.properties
===================================================================
--- trunk/src/tmcsim/application.properties	(revision 52)
+++ trunk/src/tmcsim/application.properties	(revision 54)
@@ -1,5 +1,5 @@
-#Sun, 03 Jul 2016 08:10:42 -0700
+#Tue, 14 Mar 2017 17:07:19 -0700
 
-Application.revision=51
+Application.revision=49
 
-Application.buildnumber=21
+Application.buildnumber=24
Index: trunk/src/tmcsim/client/CADClockView.java
===================================================================
--- trunk/src/tmcsim/client/CADClockView.java	(revision 54)
+++ trunk/src/tmcsim/client/CADClockView.java	(revision 54)
@@ -0,0 +1,141 @@
+package tmcsim.client;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.util.Observable;
+import java.util.Observer;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTextPane;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import tmcsim.cadmodels.BlankScreenModel;
+import tmcsim.cadmodels.CADScreenModel;
+import tmcsim.cadmodels.IncidentBoardModel;
+import tmcsim.cadmodels.IncidentInquiryModel;
+import tmcsim.cadmodels.IncidentSummaryModel;
+import tmcsim.cadmodels.RoutedMessageModel;
+import tmcsim.client.cadscreens.IB_IncidentBoard;
+import tmcsim.client.cadscreens.II_IncidentInquiry;
+import tmcsim.client.cadscreens.SA_IncidentSummary;
+import tmcsim.client.cadscreens.TO_RoutedMessage;
+import tmcsim.client.cadscreens.view.CADCommandLineView;
+import tmcsim.client.cadscreens.view.CADFooterView;
+import tmcsim.client.cadscreens.view.CADMainView;
+import tmcsim.common.ObserverMessage;
+import tmcsim.common.CADEnums.ARROW;
+import tmcsim.common.CADEnums.CADScreenNum;
+import tmcsim.common.CADEnums.CAD_ERROR;
+import tmcsim.common.CADEnums.CAD_KEYS;
+import tmcsim.common.CADProtocol.CAD_CLIENT_CMD;
+
+/**
+ * The CADClientView class is the view component to the CAD Client application.
+ *
+ * This view class observers the CADClientModel, listening for updates
+ * from the CAD Simulator.  Updates includes the current 
+ * CAD time  */
+@SuppressWarnings("serial")
+public class CADClockView extends JFrame implements KeyListener, Observer {
+    
+    /** Error Logger. */
+    private static Logger cadLogger = Logger.getLogger("tmcsim.client");
+    
+    /** Reference to the CADClient model object. */
+    private CADClientModel theModel = null;
+              
+    /** Current CAD Screen number. */
+    private CADScreenNum currentScreenNum = null;
+    
+
+    /**
+     * Constructor. Build panes, add key listeners, and set up observer
+     * relationship between the footer and main panes.
+     * 
+     * @param position
+     *            The CAD position for this client terminal.
+     */
+    public CADClockView(CADClientModel mod) {
+        super("CAD Client");
+        theModel = mod;
+        
+    }
+
+    /**
+     * Observable update method.  The CADClientView class is an observer of the 
+     * CADClientModel.  If the model sends a null object, it is signifying that
+     * it has shut down.  In this case, an error message should be shown to prompt
+     * the user to restart the CAD Client.  If the update object is an
+     * ObserverMessage object, the following actions are to be taken:
+     * 
+     *<table cellpadding="2" cellspacing="2" border="1"
+     * style="text-align: left; width: 250px;">
+     *  <tbody>
+     *    <tr>
+     *      <th>Message Type</th>
+     *      <th>Message Data</th>
+     *      <th>Action Taken</th>
+     *    </tr>
+     *    <tr>
+     *      <td>TIME_UPDATE<br></td>
+     *      <td>Time String<br></td>
+     *      <td>Update the footer pane with the new time.</td>
+     *    </tr>
+     *  </tbody>
+     *</table>
+     */
+    public void update(Observable o, Object arg) {
+        
+        
+        if(arg == null) 
+        {
+            JOptionPane.showMessageDialog(this, 
+                    "Connection to the CAD Simulator has been lost.  " +
+                    "Restart the CAD Client.", "Connection Error", 
+                    JOptionPane.ERROR_MESSAGE); 
+            return;
+        }
+        
+        ObserverMessage oMessage = (ObserverMessage)arg;
+    
+        switch(oMessage.type) {
+            case TIME_UPDATE:
+                System.out.println("CAD time is now" + (String)oMessage.value);           
+                break;
+        }           
+    }
+
+    @Override
+    public void keyTyped(KeyEvent e)
+    {
+        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+    }
+
+    @Override
+    public void keyPressed(KeyEvent e)
+    {
+        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+    }
+
+    @Override
+    public void keyReleased(KeyEvent e)
+    {
+        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+    }
+    
+   
+    
+}    
Index: trunk/src/tmcsim/client/CADClockDisplay.java
===================================================================
--- trunk/src/tmcsim/client/CADClockDisplay.java	(revision 54)
+++ trunk/src/tmcsim/client/CADClockDisplay.java	(revision 54)
@@ -0,0 +1,514 @@
+package tmcsim.client;
+
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.rmi.Naming;
+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;
+import java.util.Properties;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+import javax.swing.JWindow;
+import javax.swing.UIManager;
+
+import tmcsim.client.cadclientgui.CADClientGUI;
+import tmcsim.client.cadclientgui.CardfileReader;
+import tmcsim.client.cadclientgui.GUIScriptReader;
+import tmcsim.client.cadclientgui.data.CADData;
+import tmcsim.client.cadclientgui.screens.Login;
+import tmcsim.client.cadclientgui.screens.ScreenManager;
+import tmcsim.common.CADEnums;
+import tmcsim.common.SimulationException;
+import tmcsim.interfaces.CADClientInterface;
+import tmcsim.interfaces.CoordinatorInterface;
+
+/**
+ * CADClient is the main class for the CAD Client application. The main method
+ * instantiates an instance of the CADClient object with the default properties
+ * file "..\config\CADClient.properties" or the first argument fom the command
+ * line invocation. Properties data values are used to bind socket communication
+ * between the CAD Client and the CAD Simulator. The CADClientModel object is
+ * instantiated and the CAD Client registers itself with the CAD Simulator.
+ * Finally, the CADClockView is initialized, the model-view and observer
+ * relationships are established, and the view is shown.<br>
+ * <br>
+ * The properties file contains the following data: <br>
+ * <code>
+ * -----------------------------------------------------------------------------<br>
+ * Host Name     The host name where the CAD Simulator is located.<br>
+ * Port Number   The port number that the CAD Simulator is bound on.<br>
+ * CAD Position  The integer (>= 0) position for this CAD Client.<br>
+ * CAD User ID   The unique user id for this CAD Client.<br>
+ * Error File    Filename of error logging file.<br>
+ * -----------------------------------------------------------------------------<br>
+ * Example File: <br>
+ * CADSimulatorHost       = localhost<br>
+ * CADSimulatorSocketPort = 4444<br>
+ * CADPosition = 1 <br>
+ * CADUserID   = A12345<br>
+ * ErrorFile   = cad_client_err.txt<br>
+ * </code>
+ * 
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2009/04/17 16:27:47 $ $Revision: 1.8 $
+ */
+
+public class CADClockDisplay extends UnicastRemoteObject implements
+        CADClientInterface {
+
+    /** Error logger. */
+    private static Logger cadClientLogger = Logger.getLogger("tmcsim.client");
+
+    /**
+     * Enumeration containing properties name values. See CADClient class
+     * description for more information.
+     * 
+     * @author Matthew Cechini
+     * @see CADClient
+     */
+    private static enum PROPERTIES {
+        CAD_SIM_HOST("CADSimulatorHost"), CAD_SIM_PORT("CADSimulatorSocketPort"), CAD_RMI_PORT(
+                "CADRmiPort"), CLIENT_CAD_POS("CADPosition"), CLIENT_USER_ID(
+                "CADUserID"), KEYBOARD_TYPE("KeyboardType"), DISPLAY_TYPE(
+                "DisplayType");
+
+        public String name;
+
+        private PROPERTIES(String n) {
+            name = n;
+        }
+    }
+
+    /**
+     * CADClientSocket Object to handle socket communication between the Client
+     * and CAD Simulator.
+     */
+    private CADClientSocket theClientSocket;
+
+    /** Instance of the CADClientModel. */
+    private CADClientModel theClientScreenModel;
+
+    /** Instance of the CADClockView. */
+    private CADClockView theClientScreenView;
+
+    /**
+     * Instance of the CADCLientGUI Replaces CADClockView
+     */
+    private CADClientGUI theClientGUI;
+
+    /** Properties object for the CADClient class. */
+    private Properties cadClientProp;
+
+    /** RMI interface for communication with the remote Coordinator. */
+    private static CoordinatorInterface theCoorInt;
+
+    /** reference to itself to be used for disconnecting from CADSimulator */
+    private CADClientInterface client = this;
+
+    private static final String CONFIG_FILE_NAME = "cad_client_config.properties";
+    
+    /**
+     * Constructor. Initialize data from parsed properties file. Create a socket
+     * connection to the CADSimulator. The ClientScreenModel is initialized with
+     * the input and output I/O streams for socket communication. The
+     * ClientScreenModel registers with the CAD Simulator, using CAD position
+     * and userID read in from the properties file. The ClientScreenView is then
+     * created and initialized and set as an observer of the model.
+     * 
+     * A thread is created with the runnable ClientScreenModel and is started.
+     * When this thread is no longer alive, or the ClientScrenView and
+     * CADClientSocket are closed. The program then exits.
+     * 
+     * @param propertiesFile
+     *            File path (absolute or relative) to the properties file
+     *            containing configuration data.
+     */
+    public CADClockDisplay(String propertiesFile) throws SimulationException,
+            RemoteException {
+        if (!verifyProperties(propertiesFile))
+            System.exit(0);
+
+        connect(cadClientProp.getProperty(PROPERTIES.CAD_SIM_HOST.name).trim(),
+                cadClientProp.getProperty(PROPERTIES.CAD_RMI_PORT.name).trim());
+
+        // Instantiate the Socket and Model Objects.
+        theClientSocket = new CADClientSocket(cadClientProp.getProperty(
+                PROPERTIES.CAD_SIM_HOST.name).trim(),
+                Integer.parseInt(cadClientProp.getProperty(
+                        PROPERTIES.CAD_SIM_PORT.name).trim()));
+        theClientScreenModel = new CADClientModel();
+        theClientScreenModel.initializeScreen(theClientSocket.getInputStream(),
+                theClientSocket.getOutputStream());
+
+        // Register this CAD Client with the Simulation Manager
+        theClientScreenModel.register(Integer.parseInt(cadClientProp
+                .getProperty(PROPERTIES.CLIENT_CAD_POS.name)), cadClientProp
+                .getProperty(PROPERTIES.CLIENT_USER_ID.name));
+
+        // Instantiate the CADScreenView and set up the model-view observer
+        // relationship.
+        theClientScreenView = new CADClockView(theClientScreenModel);
+        theClientScreenView.setVisible(false);
+
+        // TODO: set up model-view relationship similar to ClientView and
+        // ScreenView
+        // Can repurpose the old model, but may be better to copy over and
+        // modify in parallel
+        // This is required to perform powerline commands on the data
+//        theClientGUI = new CADClientGUI();
+
+        // Each screen of the UI should have a reference to either it's parent
+        // object or the main client
+        // This ensures they all have access to each other and the data model
+//        theClientGUI.screen = new ScreenManager(theCoorInt);
+//        theClientGUI.login = new Login();
+//        theClientGUI.client = this;
+
+        // setup keyboard settings for CAD Client
+//        if (cadClientProp.getProperty(PROPERTIES.KEYBOARD_TYPE.name).trim()
+//                .equals("CAD")) {
+//            CADEnums.CAD_KEYS.setupCADKeyboard();
+//        }
+//        // STD
+//        else {
+//            CADEnums.CAD_KEYS.setupStandardKeyboard();
+//        }
+//
+//        theClientScreenModel.addObserver(theClientScreenView);
+//
+//        // Initialize the display
+//        if (cadClientProp.getProperty(PROPERTIES.DISPLAY_TYPE.name).equals(
+//                "FULL_SCREEN")) {
+//
+//            theClientScreenView.addWindowListener(new WindowListener() {
+//                public void windowClosed(WindowEvent e) {
+//                }
+//
+//                public void windowOpened(WindowEvent e) {
+//                }
+//
+//                public void windowIconified(WindowEvent e) {
+//                }
+//
+//                public void windowDeiconified(WindowEvent e) {
+//                }
+//
+//                public void windowActivated(WindowEvent e) {
+//                }
+//
+//                public void windowDeactivated(WindowEvent e) {
+//                }
+//
+//                public void windowClosing(WindowEvent e) {
+//
+//                    try {
+//                        theClientSocket.closeSocket();
+//                    } catch (SimulationException se) {
+//                    }
+//
+//                    System.exit(0);
+//                }
+//            });
+//
+//            theClientScreenView.initWindow();
+//            theClientScreenView.setVisible(false);
+//        } else {
+//            JFrame cadFrame = new JFrame("CAD Client");
+//            cadFrame.add(theClientScreenView.initBox());
+//            cadFrame.setSize(800, 600);
+//
+//            cadFrame.addWindowListener(new WindowListener() {
+//                public void windowClosed(WindowEvent e) {
+//                }
+//
+//                public void windowOpened(WindowEvent e) {
+//                }
+//
+//                public void windowIconified(WindowEvent e) {
+//                }
+//
+//                public void windowDeiconified(WindowEvent e) {
+//                }
+//
+//                public void windowActivated(WindowEvent e) {
+//                }
+//
+//                public void windowDeactivated(WindowEvent e) {
+//                }
+//
+//                public void windowClosing(WindowEvent e) {
+//
+//                    try {
+//                        theClientSocket.closeSocket();
+//                    } catch (SimulationException se) {
+//                    }
+//
+//                    System.exit(0);
+//                }
+//            });
+//
+//            cadFrame.setVisible(true);
+//        }
+//
+//        // Create the CAD Client thread to run the CADClientModel Object.
+//        Thread clientThread = new Thread(theClientScreenModel);
+//        clientThread.start();
+
+        ensureProperShutdown();
+    }
+
+    /**
+     * Connect to the Coordinator's RMI object, and register this object for
+     * callback with the Coordinator.
+     * 
+     * @param hostname
+     *            Host name of the CAD Simulator.
+     * @param portNumber
+     *            Port number of the CAD Simulator RMI communication.
+     * @throws SimulationException
+     *             if there is an error creating the RMI connection.
+     */
+    protected void connect(String hostname, String portNumber)
+            throws SimulationException {
+
+        String coorIntURL = "";
+
+        try {
+            coorIntURL = "rmi://" + hostname + ":" + portNumber
+                    + "/coordinator";
+            theCoorInt = (CoordinatorInterface) Naming.lookup(coorIntURL);
+            theCoorInt.registerForCallback(this);
+        } catch (Exception e) {
+            throw new SimulationException(SimulationException.CAD_SIM_CONNECT,
+                    e);
+        }
+    }
+
+    /**
+     * This method verifies that the CAD Simulator Host and Port values are not
+     * null. Also, if a CAD Position or User ID do not exist in the properties
+     * file, the user is prompted to enter values. These values are written to
+     * the properties file. If the user cancels the process of entering these
+     * values, the verification fails.
+     * 
+     * @param propertiesFile
+     *            File path (absolute or relative) to the properties file
+     *            containing configuration data.
+     * @return True if the properties file is valid, false if not.
+     * @throws SimulationException
+     *             if there is an exception in verifying the properties file, or
+     *             if the user cancels input.
+     */
+    private boolean verifyProperties(String propertiesFile)
+            throws SimulationException {
+
+        // Load the properties file.
+        try {
+            cadClientProp = new Properties();
+            cadClientProp.load(new FileInputStream(propertiesFile));
+        } catch (Exception e) {
+            cadClientLogger.logp(Level.SEVERE, "SimulationManager",
+                    "Constructor", "Exception in reading properties file.", e);
+
+            throw new SimulationException(SimulationException.INITIALIZE_ERROR,
+                    e);
+        }
+        
+
+        // Ensure that the properties file does not have null values for the
+        // CAD Simulator's connection information.
+        if (cadClientProp.getProperty(PROPERTIES.CAD_SIM_HOST.name) == null
+                || cadClientProp.getProperty(PROPERTIES.CAD_SIM_PORT.name) == null) {
+            cadClientLogger.logp(Level.SEVERE, "SimulationManager",
+                    "Constructor", "Null value in properties file.");
+            throw new SimulationException(SimulationException.INITIALIZE_ERROR);
+        }
+
+        try {
+            // If the properties file does not specify a CAD position, prompt
+            // the
+            // user to select one. If the user selects a position, write the
+            // new properties values to the file. If the user cancels, else
+            // throw an exception.
+            if (cadClientProp.getProperty(PROPERTIES.CLIENT_CAD_POS.name) == null) {
+                if (getCADPosition())
+                    cadClientProp.store(new FileOutputStream(propertiesFile),
+                            "");
+                else
+                    throw new SimulationException(
+                            SimulationException.INITIALIZE_ERROR);
+            }
+
+            // If the properties file does not specifiy a CAD User ID, prompt
+            // the
+            // user to enter a value. If the user enters a valid ID, write the
+            // new properties values to the file. If the user cancels, else
+            // throw an exception.
+            if (cadClientProp.getProperty(PROPERTIES.CLIENT_USER_ID.name) == null) {
+                if (getUserID())
+                    cadClientProp.store(new FileOutputStream(propertiesFile),
+                            "");
+                else
+                    throw new SimulationException(
+                            SimulationException.INITIALIZE_ERROR);
+            }
+        } catch (IOException ioe) {
+            cadClientLogger.logp(Level.SEVERE, "SimulationManager",
+                    "Constructor",
+                    "Exception in writing to the properties file.");
+            throw new SimulationException(SimulationException.INITIALIZE_ERROR);
+        }
+
+        // Ensure that the properties file has a valid display type
+        if (cadClientProp.getProperty(PROPERTIES.DISPLAY_TYPE.name) == null
+                || (!cadClientProp.getProperty(PROPERTIES.DISPLAY_TYPE.name)
+                        .equals("FULL_SCREEN") && !cadClientProp.getProperty(
+                        PROPERTIES.DISPLAY_TYPE.name).equals("FRAME"))) {
+            cadClientLogger.logp(Level.SEVERE, "SimulationManager",
+                    "Constructor", "Invalid display type.");
+            throw new SimulationException(SimulationException.INITIALIZE_ERROR);
+        }
+
+        return true;
+    }
+
+    /**
+     * This method prompts the user to select a value for the CAD position. If
+     * the user cancels the method returns false, else the Properties object is
+     * updated and true is returned.
+     * 
+     * @return True if the user successfully selected a CAD position, false if
+     *         not.
+     */
+    private boolean getCADPosition() {
+
+        Vector<Integer> positions = new Vector<Integer>();
+        for (int i = 0; i < 10; i++)
+            positions.add(i);
+
+        Object cadPos = null;
+
+        while (true) {
+            cadPos = JOptionPane.showInputDialog(null,
+                    "Please assign this workstation a CAD position number.",
+                    "CAD Position Asignment", JOptionPane.QUESTION_MESSAGE,
+                    null, positions.toArray(), positions.get(0));
+
+            // If the user pressed cancel, confirm the exit and return false.
+            if (cadPos == null) {
+                if (JOptionPane
+                        .showConfirmDialog(
+                                null,
+                                "CAD Client cannot load until a valid CAD "
+                                        + "position has been selected.  Do you wish to "
+                                        + "cancel loading the CAD Client?",
+                                "Confirm Exit", JOptionPane.YES_NO_OPTION,
+                                JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
+                    return false;
+            }
+            // Else the user selected a CAD position, exit the loop.
+            else {
+                break;
+            }
+        }
+
+        cadClientProp.setProperty(PROPERTIES.CLIENT_CAD_POS.name,
+                cadPos.toString());
+        return true;
+    }
+
+    /**
+     * This method prompts the user to enter a 5-character User ID. If the user
+     * cancels the method returns false, else the Properties object is updated
+     * and true is returned.
+     * 
+     * @return True if the user successfully selected a CAD position, false if
+     *         not.
+     */
+    private boolean getUserID() {
+        String cadUID = null;
+
+        while (true) {
+            cadUID = JOptionPane.showInputDialog(null,
+                    "Please assign this workstation a 6-character CAD "
+                            + "User ID.", "CAD User ID Asignment",
+                    JOptionPane.QUESTION_MESSAGE);
+
+            // /If the user pressed cancel, confirm the exit and return false.
+            if (cadUID == null) {
+                if (JOptionPane.showConfirmDialog(null,
+                        "CAD Client cannot load until a valid User ID "
+                                + "has been entered.  Do you wish to "
+                                + "cancel loading the CAD Client?",
+                        "Confirm Exit", JOptionPane.YES_NO_OPTION,
+                        JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
+                    return false;
+            }
+            // If the user does not enter a valid User ID, notify and reprompt.
+            else if (cadUID.length() != 6) {
+                JOptionPane.showMessageDialog(null,
+                        "The User ID must be 6 characters.", "Invalid User ID",
+                        JOptionPane.WARNING_MESSAGE);
+            }
+            // Else the user entered a valid value, exit the loop.
+            else {
+                break;
+            }
+        }
+
+        cadClientProp.setProperty(PROPERTIES.CLIENT_USER_ID.name, cadUID);
+        return true;
+    }
+
+    /**
+     * Construct the CADClient with the properties file path, either from the
+     * command line arguments or default.
+     * 
+     * @param args
+     *            Command line arguments.
+     */
+    public static void main(String[] args) {
+    	if(System.getProperty("CONFIG_DIR") == null){
+        	System.setProperty("CONFIG_DIR", "config");
+        }
+
+        try {
+            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+            new CADClockDisplay(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME);
+         
+        } catch (Exception e) {
+            cadClientLogger.logp(Level.SEVERE, "SimulationManager", "Main",
+                    "Error initializing application.");
+
+            JOptionPane.showMessageDialog(new JWindow(), e.getMessage(),
+                    "Error - Program Exiting", JOptionPane.ERROR_MESSAGE);
+
+            System.exit(-1);
+        }
+
+    }
+
+    public void refresh() {
+        theClientGUI.screen.refreshScreens();
+    }
+
+    public void ensureProperShutdown() {
+        Runtime.getRuntime().addShutdownHook(new Thread() {
+            public void run() {
+                try {
+                    theCoorInt.unregisterForCallback(client);
+                } catch (RemoteException e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+    }
+
+}
Index: trunk/src/tmcsim/cadsimulator/Coordinator.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/Coordinator.java	(revision 44)
+++ trunk/src/tmcsim/cadsimulator/Coordinator.java	(revision 54)
@@ -38,4 +38,5 @@
 import tmcsim.client.cadclientgui.data.Incident;
 import tmcsim.client.cadclientgui.data.IncidentEvent;
+import tmcsim.client.cadclientgui.data.Unit;
 import tmcsim.client.cadclientgui.enums.CADDataEnums.CARDFILE;
 import tmcsim.client.cadclientgui.enums.CADDataEnums.EditCommand;
@@ -87,5 +88,4 @@
         implements CoordinatorInterface
 {
-
     /**
      * Error logger.
@@ -133,4 +133,10 @@
     }
 
+    /** Dependency Injection for testing */
+    void setCadData(CADData theData)
+    {
+        cadData = theData;
+    }
+    
     public void registerForCallback(CADClientInterface client) throws RemoteException
     {
@@ -914,5 +920,7 @@
         if (tag.equals(INC_TABLE.COMMENTS_NOTES))
         {
-            return cadData.getIncident(incidentId).getCommentsNotesTable();
+            Incident myIncident = cadData.getIncident(incidentId);
+            if (myIncident == null) return new DefaultTableModel();
+            return myIncident.getCommentsNotesTable();
         }
         return null;
@@ -955,43 +963,51 @@
     public Object getCadDataIncVal(INC_VAL tag, int incidentId) throws RemoteException
     {
-        if (tag.equals(INC_VAL.LOG_NUM))
-        {
-            return cadData.getIncident(incidentId).getLogNum();
-        }
-        else if (tag.equals(INC_VAL.MASTER_INC))
-        {
-            return cadData.getIncident(incidentId).getMasterInc();
-        }
-        else if (tag.equals(INC_VAL.OAU))
-        {
-            return cadData.getIncident(incidentId).getOau();
-        }
-        else if (tag.equals(INC_VAL.P))
-        {
-            return cadData.getIncident(incidentId).getP();
-        }
-        else if (tag.equals(INC_VAL.DESCRIPTION))
-        {
-            return cadData.getIncident(incidentId).getDescription();
-        }
-        else if (tag.equals(INC_VAL.RP))
-        {
-            return cadData.getIncident(incidentId).getRp();
-        }
-        else if (tag.equals(INC_VAL.RP_TYPE))
-        {
-            return cadData.getIncident(incidentId).getRpType();
-        }
-        else if (tag.equals(INC_VAL.ALI))
-        {
-            return cadData.getIncident(incidentId).getAli();
-        }
-        else if (tag.equals(INC_VAL.MEDIA))
-        {
-            return cadData.getIncident(incidentId).getMedia();
-        }
-        else
-        {
-            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncVal");
+        Incident current = cadData.getIncident(incidentId);
+        if (current != null)
+        {
+            if (tag.equals(INC_VAL.LOG_NUM))
+            {
+                return current.getLogNum();
+            }
+            else if (tag.equals(INC_VAL.MASTER_INC))
+            {
+                return current.getMasterInc();
+            }
+            else if (tag.equals(INC_VAL.OAU))
+            {
+                return current.getOau();
+            }
+            else if (tag.equals(INC_VAL.P))
+            {
+                return current.getP();
+            }
+            else if (tag.equals(INC_VAL.DESCRIPTION))
+            {
+                return current.getDescription();
+            }
+            else if (tag.equals(INC_VAL.RP))
+            {
+                return current.getRp();
+            }
+            else if (tag.equals(INC_VAL.RP_TYPE))
+            {
+                return current.getRpType();
+            }
+            else if (tag.equals(INC_VAL.ALI))
+            {
+                return current.getAli();
+            }
+            else if (tag.equals(INC_VAL.MEDIA))
+            {
+                return current.getMedia();
+            }
+            else
+            {
+                throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncVal");
+            }
+        }
+        else
+        {
+            return null;
         }
     }
@@ -1049,75 +1065,83 @@
     public String getCadDataIncLoc(INC_LOC tag, int incidentId) throws RemoteException
     {
-        if (tag.equals(INC_LOC.ADDRESS))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getAddress();
-        }
-        else if (tag.equals(INC_LOC.LOC))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getLoc();
-        }
-        else if (tag.equals(INC_LOC.CITY))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getCity();
-        }
-        else if (tag.equals(INC_LOC.COUNTY))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getCounty();
-        }
-        else if (tag.equals(INC_LOC.STATE))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getState();
-        }
-        else if (tag.equals(INC_LOC.ZIP))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getZip();
-        }
-        else if (tag.equals(INC_LOC.BEAT))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getBeat();
-        }
-        else if (tag.equals(INC_LOC.AREA))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getArea();
-        }
-        else if (tag.equals(INC_LOC.SECTOR))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getSector();
-        }
-        else if (tag.equals(INC_LOC.SECTOR_CODE))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getSectorCode();
-        }
-        else if (tag.equals(INC_LOC.DIVISION))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getDivision();
-        }
-        else if (tag.equals(INC_LOC.APT))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getApt();
-        }
-        else if (tag.equals(INC_LOC.BUILDING))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getBuilding();
-        }
-        else if (tag.equals(INC_LOC.CROSS_ST))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getCrossSt();
-        }
-        else if (tag.equals(INC_LOC.LAW))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getLaw();
-        }
-        else if (tag.equals(INC_LOC.FIRE))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getFire();
-        }
-        else if (tag.equals(INC_LOC.EMS))
-        {
-            return cadData.getIncident(incidentId).getIncidentLocation().getEms();
-        }
-        else
-        {
-            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncLoc");
+        Incident current = cadData.getIncident(incidentId);
+        if (current != null)
+        {
+            if (tag.equals(INC_LOC.ADDRESS))
+            {
+                return current.getIncidentLocation().getAddress();
+            }
+            else if (tag.equals(INC_LOC.LOC))
+            {
+                return current.getIncidentLocation().getLoc();
+            }
+            else if (tag.equals(INC_LOC.CITY))
+            {
+                return current.getIncidentLocation().getCity();
+            }
+            else if (tag.equals(INC_LOC.COUNTY))
+            {
+                return current.getIncidentLocation().getCounty();
+            }
+            else if (tag.equals(INC_LOC.STATE))
+            {
+                return current.getIncidentLocation().getState();
+            }
+            else if (tag.equals(INC_LOC.ZIP))
+            {
+                return current.getIncidentLocation().getZip();
+            }
+            else if (tag.equals(INC_LOC.BEAT))
+            {
+                return current.getIncidentLocation().getBeat();
+            }
+            else if (tag.equals(INC_LOC.AREA))
+            {
+                return current.getIncidentLocation().getArea();
+            }
+            else if (tag.equals(INC_LOC.SECTOR))
+            {
+                return current.getIncidentLocation().getSector();
+            }
+            else if (tag.equals(INC_LOC.SECTOR_CODE))
+            {
+                return current.getIncidentLocation().getSectorCode();
+            }
+            else if (tag.equals(INC_LOC.DIVISION))
+            {
+                return current.getIncidentLocation().getDivision();
+            }
+            else if (tag.equals(INC_LOC.APT))
+            {
+                return current.getIncidentLocation().getApt();
+            }
+            else if (tag.equals(INC_LOC.BUILDING))
+            {
+                return current.getIncidentLocation().getBuilding();
+            }
+            else if (tag.equals(INC_LOC.CROSS_ST))
+            {
+                return current.getIncidentLocation().getCrossSt();
+            }
+            else if (tag.equals(INC_LOC.LAW))
+            {
+                return current.getIncidentLocation().getLaw();
+            }
+            else if (tag.equals(INC_LOC.FIRE))
+            {
+                return current.getIncidentLocation().getFire();
+            }
+            else if (tag.equals(INC_LOC.EMS))
+            {
+                return current.getIncidentLocation().getEms();
+            }
+            else
+            {
+                throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncLoc");
+            }
+        }
+        else
+        {
+            return "";
         }
     }
@@ -1132,75 +1156,83 @@
     public void setCadDataIncLoc(INC_LOC tag, int incidentId, String value) throws RemoteException
     {
-        if (tag.equals(INC_LOC.ADDRESS))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setAddress(value);
-        }
-        else if (tag.equals(INC_LOC.LOC))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setLoc(value);
-        }
-        else if (tag.equals(INC_LOC.CITY))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setCity(value);
-        }
-        else if (tag.equals(INC_LOC.COUNTY))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setCounty(value);
-        }
-        else if (tag.equals(INC_LOC.STATE))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setState(value);
-        }
-        else if (tag.equals(INC_LOC.ZIP))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setZip(value);
-        }
-        else if (tag.equals(INC_LOC.BEAT))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setBeat(value);
-        }
-        else if (tag.equals(INC_LOC.AREA))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setArea(value);
-        }
-        else if (tag.equals(INC_LOC.SECTOR))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setSector(value);
-        }
-        else if (tag.equals(INC_LOC.SECTOR_CODE))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setSectorCode(value);
-        }
-        else if (tag.equals(INC_LOC.DIVISION))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setDivision(value);
-        }
-        else if (tag.equals(INC_LOC.APT))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setApt(value);
-        }
-        else if (tag.equals(INC_LOC.BUILDING))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setBuilding(value);
-        }
-        else if (tag.equals(INC_LOC.CROSS_ST))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setCrossSt(value);
-        }
-        else if (tag.equals(INC_LOC.LAW))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setLaw(value);
-        }
-        else if (tag.equals(INC_LOC.FIRE))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setFire(value);
-        }
-        else if (tag.equals(INC_LOC.EMS))
-        {
-            cadData.getIncident(incidentId).getIncidentLocation().setEms(value);
-        }
-        else
-        {
-            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncLoc");
+        Incident current = cadData.getIncident(incidentId);
+        if (current != null)
+        {
+            if (tag.equals(INC_LOC.ADDRESS))
+            {
+                current.getIncidentLocation().setAddress(value);
+            }
+            else if (tag.equals(INC_LOC.LOC))
+            {
+                current.getIncidentLocation().setLoc(value);
+            }
+            else if (tag.equals(INC_LOC.CITY))
+            {
+                current.getIncidentLocation().setCity(value);
+            }
+            else if (tag.equals(INC_LOC.COUNTY))
+            {
+                current.getIncidentLocation().setCounty(value);
+            }
+            else if (tag.equals(INC_LOC.STATE))
+            {
+                current.getIncidentLocation().setState(value);
+            }
+            else if (tag.equals(INC_LOC.ZIP))
+            {
+                current.getIncidentLocation().setZip(value);
+            }
+            else if (tag.equals(INC_LOC.BEAT))
+            {
+                current.getIncidentLocation().setBeat(value);
+            }
+            else if (tag.equals(INC_LOC.AREA))
+            {
+                current.getIncidentLocation().setArea(value);
+            }
+            else if (tag.equals(INC_LOC.SECTOR))
+            {
+                current.getIncidentLocation().setSector(value);
+            }
+            else if (tag.equals(INC_LOC.SECTOR_CODE))
+            {
+                current.getIncidentLocation().setSectorCode(value);
+            }
+            else if (tag.equals(INC_LOC.DIVISION))
+            {
+                current.getIncidentLocation().setDivision(value);
+            }
+            else if (tag.equals(INC_LOC.APT))
+            {
+                current.getIncidentLocation().setApt(value);
+            }
+            else if (tag.equals(INC_LOC.BUILDING))
+            {
+                current.getIncidentLocation().setBuilding(value);
+            }
+            else if (tag.equals(INC_LOC.CROSS_ST))
+            {
+                current.getIncidentLocation().setCrossSt(value);
+            }
+            else if (tag.equals(INC_LOC.LAW))
+            {
+                current.getIncidentLocation().setLaw(value);
+            }
+            else if (tag.equals(INC_LOC.FIRE))
+            {
+                current.getIncidentLocation().setFire(value);
+            }
+            else if (tag.equals(INC_LOC.EMS))
+            {
+                current.getIncidentLocation().setEms(value);
+            }
+            else
+            {
+                throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncLoc");
+            }
+        }
+        else
+        {
+            return;
         }
     }
@@ -2076,5 +2108,25 @@
     public UnitStatusEnums getCadDataUnitStatus(String unitNum) throws RemoteException
     {
-        return cadData.getUnit(unitNum).getUnitStatus();
+        // Validate input parameter
+        if (unitNum.equals(""))
+        {
+            coorLogger.logp(Level.INFO, "Coordinator", "getCadDataUnitStatus",
+                        "Unitnum parameter is blank.", "Error");
+            return UnitStatusEnums.NotAssignable;
+        }
+        else
+        {
+            Unit desiredUnit = cadData.getUnit(unitNum);
+            // If it exists
+            if (desiredUnit != null)
+            {
+                // Fetch and return its status (an enum)
+                return desiredUnit.getUnitStatus();
+            }
+            else
+            {
+                return UnitStatusEnums.NotAssignable;
+            }
+        }
     }
 
@@ -2089,71 +2141,84 @@
     public String getCadDataUnitValue(String unitNum, UNIT_TAGS tag) throws RemoteException
     {
-        if (tag.equals(UNIT_TAGS.MASTER_INC_NUM))
-        {
-            return cadData.getUnit(unitNum).getMasterInc();
-        }
-        else if (tag.equals(UNIT_TAGS.STATUS))
-        {
-            return cadData.getUnit(unitNum).getStatus();
-        }
-        else if (tag.equals(UNIT_TAGS.OOS))
-        {
-            return cadData.getUnit(unitNum).getOos();
-        }
-        else if (tag.equals(UNIT_TAGS.TYPE))
-        {
-            return cadData.getUnit(unitNum).getType();
-        }
-        else if (tag.equals(UNIT_TAGS.CURR_LOC))
-        {
-            return cadData.getUnit(unitNum).getCurrentLocation();
-        }
-        else if (tag.equals(UNIT_TAGS.DESTINATION))
-        {
-            return cadData.getUnit(unitNum).getDestination();
-        }
-        else if (tag.equals(UNIT_TAGS.MISC_INFO))
-        {
-            return cadData.getUnit(unitNum).getMisc();
-        }
-        else if (tag.equals(UNIT_TAGS.STACK))
-        {
-            return cadData.getUnit(unitNum).getStack();
-        }
-        else if (tag.equals(UNIT_TAGS.AREA))
-        {
-            return cadData.getUnit(unitNum).getArea();
-        }
-        else if (tag.equals(UNIT_TAGS.OFFICER))
-        {
-            return cadData.getUnit(unitNum).getOfficer();
-        }
-        else if (tag.equals(UNIT_TAGS.BADGE_NUM))
-        {
-            return cadData.getUnit(unitNum).getBadge();
-        }
-        else if (tag.equals(UNIT_TAGS.TIMER))
-        {
-            return cadData.getUnit(unitNum).getTimerInString();
-        }
-        else if (tag.equals(UNIT_TAGS.OFFICE))
-        {
-            return cadData.getUnit(unitNum).getOffice();
-        }
-        else if (tag.equals(UNIT_TAGS.P))
-        {
-            return cadData.getUnit(unitNum).getP();
-        }
-        else if (tag.equals(UNIT_TAGS.AGY))
-        {
-            return cadData.getUnit(unitNum).getAgy();
-        }
-        else if (tag.equals(UNIT_TAGS.ALIAS))
-        {
-            return cadData.getUnit(unitNum).getAlias();
-        }
-        else
-        {
-            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataUnitValue");
+        // Fetch unit, given it's string representation
+        Unit desiredUnit = cadData.getUnit(unitNum);
+        // If it exists
+        if (desiredUnit != null)
+        {
+            if (tag.equals(UNIT_TAGS.MASTER_INC_NUM))
+            {
+                return desiredUnit.getMasterInc();
+            }
+            else if (tag.equals(UNIT_TAGS.STATUS))
+            {
+                return desiredUnit.getStatus();
+            }
+            else if (tag.equals(UNIT_TAGS.OOS))
+            {
+                return desiredUnit.getOos();
+            }
+            else if (tag.equals(UNIT_TAGS.TYPE))
+            {
+                return desiredUnit.getType();
+            }
+            else if (tag.equals(UNIT_TAGS.CURR_LOC))
+            {
+                return desiredUnit.getCurrentLocation();
+            }
+            else if (tag.equals(UNIT_TAGS.DESTINATION))
+            {
+                return desiredUnit.getDestination();
+            }
+            else if (tag.equals(UNIT_TAGS.MISC_INFO))
+            {
+                return desiredUnit.getMisc();
+            }
+            else if (tag.equals(UNIT_TAGS.STACK))
+            {
+                return desiredUnit.getStack();
+            }
+            else if (tag.equals(UNIT_TAGS.AREA))
+            {
+                return desiredUnit.getArea();
+            }
+            else if (tag.equals(UNIT_TAGS.OFFICER))
+            {
+                return desiredUnit.getOfficer();
+            }
+            else if (tag.equals(UNIT_TAGS.BADGE_NUM))
+            {
+                return desiredUnit.getBadge();
+            }
+            else if (tag.equals(UNIT_TAGS.TIMER))
+            {
+                return desiredUnit.getTimerInString();
+            }
+            else if (tag.equals(UNIT_TAGS.OFFICE))
+            {
+                return desiredUnit.getOffice();
+            }
+            else if (tag.equals(UNIT_TAGS.P))
+            {
+                return desiredUnit.getP();
+            }
+            else if (tag.equals(UNIT_TAGS.AGY))
+            {
+                return desiredUnit.getAgy();
+            }
+            else if (tag.equals(UNIT_TAGS.ALIAS))
+            {
+                return desiredUnit.getAlias();
+            }
+            else
+            {
+                throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataUnitValue");
+            }
+        }
+        else
+        {
+            coorLogger.logp(Level.INFO, "Coordinator", "getCadDataUnitValue",
+                    "Desired unit not found: " + unitNum
+                    + ". Proceeding with empty string value.", "Error");
+            return "";
         }
     }
