Index: trunk/src/tmcsim/client/ClockClient.java
===================================================================
--- trunk/src/tmcsim/client/CADClockDisplay.java	(revision 62)
+++ trunk/src/tmcsim/client/ClockClient.java	(revision 64)
@@ -4,11 +4,8 @@
 import java.awt.event.ActionListener;
 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.concurrent.TimeUnit;
 import java.util.logging.Level;
@@ -18,5 +15,4 @@
 import javax.swing.Timer;
 import javax.swing.UIManager;
-import tmcsim.client.cadclientgui.CADClientGUI;
 import tmcsim.common.SimulationException;
 import tmcsim.interfaces.CADClientInterface;
@@ -24,9 +20,11 @@
 
 /**
- * CADClockDisplay shows the simulation clock time. It operates as a client of
- * the CAD server, using RMI to poll the server every second for the current
+ * ClockClient shows the simulation clock time. It operates as a client of the
+ * CAD server, using RMI to poll the server every second for the current
  * simulation clock time.
+ *
+ * @author jdalbey
  */
-public class CADClockDisplay extends UnicastRemoteObject implements
+public class ClockClient extends UnicastRemoteObject implements
         CADClientInterface
 {
@@ -35,4 +33,10 @@
      */
     private static Logger cadClientLogger = Logger.getLogger("tmcsim.client");
+
+    @Override
+    public void refresh() throws RemoteException
+    {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
 
     /**
@@ -62,15 +66,7 @@
     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;
+     * Instance of the ClockView.
+     */
+    private ClockView theView;
     /**
      * Properties object for the CADClient class.
@@ -95,5 +91,5 @@
      * file containing configuration data.
      */
-    public CADClockDisplay(String propertiesFile) throws SimulationException,
+    public ClockClient(String propertiesFile) throws SimulationException,
             RemoteException
     {
@@ -106,6 +102,6 @@
                 cadClientProp.getProperty(PROPERTIES.CAD_RMI_PORT.name).trim());
 
-        theClientScreenView = new CADClockView();
-        theClientScreenView.setVisible(true);
+        theView = new ClockView();
+        theView.setVisible(true);
 
         // Create a timer that fetches the simulation time every second.
@@ -117,8 +113,8 @@
                 {
                     long simtime = theCoorInt.getCurrentSimulationTime();
-                    theClientScreenView.updateTime("" + formatInterval(simtime));
+                    theView.updateTime("" + formatInterval(simtime));
                 } catch (RemoteException ex)
                 {
-                    Logger.getLogger(CADClockDisplay.class.getName()).log(Level.SEVERE, null, ex);
+                    Logger.getLogger(ClockClient.class.getName()).log(Level.SEVERE, null, ex);
                 }
             }
@@ -199,199 +195,19 @@
         }
 
-        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();
+     * Format a time in seconds as HH:MM:SS
+     *
+     * @param l
+     * @return
+     */
+    private String formatInterval(final long l)
+    {
+        final long hr = TimeUnit.SECONDS.toHours(l);
+        final long min = TimeUnit.SECONDS.toMinutes(l - TimeUnit.HOURS.toSeconds(hr));
+        final long sec = TimeUnit.SECONDS.toSeconds(l - TimeUnit.HOURS.toSeconds(hr) - TimeUnit.MINUTES.toSeconds(min));
+        return String.format("%02d:%02d:%02d", hr, min, sec);
     }
 
@@ -414,15 +230,32 @@
 
     /**
-     * Format a time in seconds as HH:MM:SS
-     *
-     * @param l
-     * @return
-     */
-    private String formatInterval(final long l)
-    {
-        final long hr = TimeUnit.SECONDS.toHours(l);
-        final long min = TimeUnit.SECONDS.toMinutes(l - TimeUnit.HOURS.toSeconds(hr));
-        final long sec = TimeUnit.SECONDS.toSeconds(l - TimeUnit.HOURS.toSeconds(hr) - TimeUnit.MINUTES.toSeconds(min));
-        return String.format("%02d:%02d:%02d", hr, min, sec);
+     * 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 ClockClient(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);
+        }
+
     }
 }
