Index: trunk/test/atmsdriver/TrafficModelEventDriver.java
===================================================================
--- trunk/test/atmsdriver/TrafficModelEventDriver.java	(revision 194)
+++ trunk/test/atmsdriver/TrafficModelEventDriver.java	(revision 204)
@@ -6,12 +6,9 @@
 import java.io.FileNotFoundException;
 import java.rmi.RemoteException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Scanner;
 import java.util.logging.Level;
@@ -19,9 +16,17 @@
 import javax.swing.JOptionPane;
 import javax.swing.JWindow;
+import tmcsim.cadsimulator.managers.TrafficModelManager;
+import tmcsim.common.SimulationException;
 
 /**
- * Skeleton for ATMS Driver that reads a "batch" file of highway status update
- * commands.  A console display of the highway network is output
+ * Read and process all Traffic Events in a file and show
+ * resulting highway network. 
+ * A console display of the highway network is output
  * for each event.
+ * This application is used by Traffic Event authors to assist
+ * in verifying the correctness of their data file.
+ * Because the output is sent immediately to the console the
+ * author doesn't have to sit through simulation time to
+ * observe dots changing on ATMS client.
  * @author jdalbey
  */
@@ -51,5 +56,5 @@
      *
      */
-    public TrafficModelEventDriver() throws RemoteException
+    public TrafficModelEventDriver() throws RemoteException, SimulationException
     {
         // Initialize the highway model
@@ -57,9 +62,24 @@
         highways = new Highways(
                 "config/vds_data/highways_fullmap.txt",
-                //        "192.168.251.46", 8080);  //IP address of FEP Sim Linux VM
+                // following aren't used by this application
                 "localhost", 8080);
+        final String CONFIG_FILE_NAME = "traffic_model_config.properties";
+        String propertiesFile = "config" + System.getProperty("file.separator") 
+                 + CONFIG_FILE_NAME;
+        Properties props = TrafficModelManager.loadProperties(propertiesFile);
 
-        // READ THE BATCH FILE OF COMMANDS and put in a queue
-        readBatchFile();
+        FileInputStream fis = null;
+        try
+        {
+            fis = new FileInputStream(props.getProperty("Events_File"));
+        } catch (FileNotFoundException ex)
+        {
+            Logger.getLogger(TrafficModelManager.class.getName()).log(Level.SEVERE, null, 
+                    "Missing Traffic Events file " + props.getProperty("Events_File"));
+            System.exit(-1);
+        }
+        Scanner fileScanner = new Scanner(fis);        
+        // Read all lines from the file of events and put in a queue
+        eventQueue = TrafficModelManager.readBatchFile(fileScanner);
     }
     public void run()
@@ -78,57 +98,4 @@
             eventQueue.remove();
         }
-    }
-
-    private void readBatchFile()
-    {
-        FileInputStream fis;
-        try
-        {
-            fis = new FileInputStream("config/vds_data/atmsBatchEvents.txt");
-            eventQueue = new LinkedList<TrafficEvent>();
-            // Read all lines from the file of events
-            Scanner scan = new Scanner(fis);
-            while (scan.hasNext())
-            {
-                // Read a line and add it to the event queue
-                String line = scan.nextLine().trim();
-                if (line.charAt(0) != '#')
-                {
-                    TrafficEvent evt;
-                    try
-                    {
-                        evt = new TrafficEvent(line);
-                        eventQueue.add(evt);
-                        String incident = evt.incident;
-                        // Add the line to the list for the corresponding incident
-                        List evtList;
-                        if (incidents.containsKey(evt.incident))
-                        {
-                            evtList = incidents.get(evt.incident);
-                        }
-                        else
-                        {
-                            evtList = new ArrayList<String>();
-                        }
-                        evtList.add(evt);
-                        // and put it back in the map
-                        incidents.put(incident, evtList);
-                    }
-                    catch (ParseException ex)
-                    {
-                        Logger.getLogger(TrafficModelEventDriver.class.getName()).log(Level.SEVERE, null, ex);
-                        System.out.println("Wrong format data in batch event file: " + line + " \nskipping.");
-                        System.out.println("Skipping badly formatted event.");
-                    }
-                }
-            }
-        }
-        catch (FileNotFoundException ex)
-        {
-            Logger.getLogger(TrafficModelEventDriver.class.getName()).log(Level.SEVERE, null, ex);
-        }
-        System.out.println("Events file read, " + eventQueue.size() + " events queued.");
-        // Put the events in chronological order
-        Collections.sort(eventQueue);
     }
 
