Index: trunk/src/tmcsim/client/ATMSBatchDriver.java
===================================================================
--- trunk/src/tmcsim/client/ATMSBatchDriver.java	(revision 180)
+++ trunk/src/tmcsim/client/ATMSBatchDriver.java	(revision 183)
@@ -1,9 +1,7 @@
 package tmcsim.client;
 
-import atmsdriver.ATMSDriver;
 import atmsdriver.ConsoleTrafficDriver;
-import atmsdriver.ExchangeInfo;
 import atmsdriver.model.Highways;
-import atmsdriver.model.Station;
+import atmsdriver.model.TrafficEvent;
 import atmsdriver.model.LoopDetector.DOTCOLOR;
 import java.awt.event.ActionEvent;
@@ -17,12 +15,11 @@
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.InputMismatchException;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import java.util.Queue;
 import java.util.Scanner;
 import java.util.concurrent.TimeUnit;
@@ -33,5 +30,4 @@
 import javax.swing.Timer;
 import javax.swing.UIManager;
-import tmcsim.cadsimulator.CADServer;
 import tmcsim.common.SimulationException;
 import tmcsim.interfaces.CADClientInterface;
@@ -39,14 +35,11 @@
 
 /**
- * Skeleton for ATMS Driver that reads a "batch" file of highway
- * status update commands. 
- * It operates as a client of the
- * CAD server, using RMI to poll the server every second for the current
- * simulation clock time.  It uses the simulation clock time
- * to fire update commands at the desired time.
- * Note: Sim Mgr must be running before starting this application.
- * TODO: We probably want to be able to "override" a command, to force 
- * clearing an incident.
-
+ * Skeleton for ATMS Driver that reads a "batch" file of highway status update
+ * commands. It operates as a client of the CAD server, using RMI to poll the
+ * server every second for the current simulation clock time. It uses the
+ * simulation clock time to fire update commands at the desired time. Note: Sim
+ * Mgr must be running before starting this application. TODO: We probably want
+ * to be able to "override" a command, to force clearing an incident.
+ *
  * @author jdalbey
  */
@@ -54,4 +47,5 @@
         CADClientInterface
 {
+
     private static final String CONFIG_FILE_NAME = "cad_client_config.properties";
     private final static int ONE_SECOND = 1000;
@@ -79,7 +73,7 @@
     {
         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");
+                "CADRmiPort"), CLIENT_CAD_POS("CADPosition"), CLIENT_USER_ID(
+                "CADUserID"), KEYBOARD_TYPE("KeyboardType"), DISPLAY_TYPE(
+                "DisplayType");
         public String name;
 
@@ -112,20 +106,24 @@
      */
     final private Highways highways;
-    
-    /** 
-     * Queue of batch events
-     */
-    private Queue<String> eventQueue;
+
+    /**
+     * LinkedList of batch events
+     */
+    private LinkedList<TrafficEvent> eventQueue;
     /**
      * Map of incidents to events
      */
-    private Map<String, List<String>> incidents;
-    
-    /** Instance of ConsoleTrafficDriver that contains the highway model */
+    private Map<String, List<TrafficEvent>> incidents;
+
+    /**
+     * Instance of ConsoleTrafficDriver that contains the highway model
+     */
     private ConsoleTrafficDriver console;
-    
-    /** GUI for this driver */
+
+    /**
+     * GUI for this driver
+     */
     private ATMSBatchViewer theView;
-    
+
     /**
      * Constructor. Initialize data from parsed properties file. Create a socket
@@ -143,12 +141,12 @@
         }
         // Initialize the highway model
-        incidents = new HashMap<String, List<String>> ();
+        incidents = new HashMap<String, List<TrafficEvent>>();
         highways = new Highways(
-        "config/vds_data/lds.txt",
-        "config/vds_data/loop.txt",
-        "config/vds_data/highwaysMeta.txt",
-//        "192.168.251.46", 8080);  //IP address of FEP Sim Linux VM
-       "localhost", 8080);
-        
+                "config/vds_data/lds.txt",
+                "config/vds_data/loop.txt",
+                "config/vds_data/highwaysMeta.txt",
+                //        "192.168.251.46", 8080);  //IP address of FEP Sim Linux VM
+                "localhost", 8080);
+
         connect(cadClientProp.getProperty(PROPERTIES.CAD_SIM_HOST.name).trim(),
                 cadClientProp.getProperty(PROPERTIES.CAD_RMI_PORT.name).trim());
@@ -169,5 +167,5 @@
                 String currentClock = "";
                 String currentATMStime = "";
-                Date simClock = new Date();                
+                Date simClock = new Date();
                 // Obtain the simulation time from the CAD server
                 try
@@ -179,13 +177,17 @@
 //                    Date atmsdate = new Date(ATMStime);
 //                    currentATMStime = formatter.format(atmsdate);
-                    try {
+                    try
+                    {
                         simClock = formatter.parse(currentClock);
-                    } catch (ParseException ex) {
+                    }
+                    catch (ParseException ex)
+                    {
                         Logger.getLogger(ATMSBatchDriver.class.getName()).log(Level.SEVERE, null, ex);
                         System.out.println("Invalid simulation clock time found in ATMSDriverClient");
                         System.exit(-1);
-                    }                    
+                    }
                     //System.out.println("Current clock: " + currentClock);
-                } catch (RemoteException ex)
+                }
+                catch (RemoteException ex)
                 {
                     System.out.println("Remote Exception reading sim or ATMS clock time");
@@ -196,17 +198,6 @@
                 {
                     // Get the time to launch the next event
-                    String nextEvent = eventQueue.peek();
-//                    String eventTimeField = nextEvent.substring(0,8);
-                    Scanner evtScan = new Scanner(nextEvent);
-                    String inci = evtScan.next();      
-                    String eventTimeField = evtScan.next();
-                    Date eventTime = new Date();
-                    try {
-                        eventTime = formatter.parse(eventTimeField);
-                    } catch (ParseException ex) {
-                        Logger.getLogger(ATMSBatchDriver.class.getName()).log(Level.WARNING, null, ex);
-                        System.out.println("Unable to parse event time: " + nextEvent + " skipping.");
-                        eventQueue.remove();
-                    }
+                    TrafficEvent nextEvent = eventQueue.peek();
+                    Date eventTime = nextEvent.eventDate;
                     //System.out.println("Next event will be launched at: " + formatter.format(eventTime));
                     // Check the queue of events to see if the first
@@ -215,28 +206,12 @@
                     if (eventTime.before(simClock) || eventTime.equals(simClock))
                     {
-                        System.out.println("LAUNCHING EVENT at " + nextEvent );
-                        // Extract fields from event and prepare them 
-                        Scanner lineScan = new Scanner(nextEvent);
-                        try
-                        {
-                        lineScan.next(); // skip incident number field
-                        lineScan.next(); // skip time field
-                        int routeNumber = lineScan.nextInt();
-                        Station.DIRECTION dir = Station.DIRECTION.toDirection(lineScan.next());
-                        double postmile = lineScan.nextDouble();
-                        double range = lineScan.nextDouble();
-                        DOTCOLOR dotcolor = DOTCOLOR.toDotColor(lineScan.next());
+                        System.out.println("LAUNCHING EVENT: " + nextEvent.toString());
                         // apply colorization to highways
-                        highways.applyColorToHighwayStretch(routeNumber, dir, postmile, range, dotcolor);
+                        highways.applyColorToHighwayStretch(nextEvent.routeNumber, nextEvent.dir,
+                                nextEvent.postmile, nextEvent.range, nextEvent.color);
                         // Remove this event from the queue, we're done with it.
                         eventQueue.remove();
-                        }
-                        catch (InputMismatchException ex)
-                        {
-                            System.out.println("Wrong format data in batch event file: " + nextEvent + " \nskipping.");
-                            eventQueue.remove();
-                        }
-                    }
-                    
+                    }
+
                     theView.update(currentClock, currentATMStime, eventQueue);
                 }
@@ -255,7 +230,8 @@
     {
         FileInputStream fis;
-        try {
+        try
+        {
             fis = new FileInputStream("config/vds_data/atmsBatchEvents.txt");
-            eventQueue = new LinkedList<String>();
+            eventQueue = new LinkedList<TrafficEvent>();
             // Read all lines from the file of events
             Scanner scan = new Scanner(fis);
@@ -263,34 +239,49 @@
             {
                 // Read a line and add it to the event queue
-                String line = scan.nextLine();
+                String line = scan.nextLine().trim();
                 if (line.charAt(0) != '#')
                 {
-                    eventQueue.add(line);
-                    // Parse the incident from the line
-                    Scanner lineScan = new Scanner(line);
-                    String incident = lineScan.next();
-                    // Add the line to the list for the corresponding incident
-                    List evtList;
-                    if (incidents.containsKey(incident))
-                    {
-                        evtList = incidents.get(incident);
-                    }
-                    else
-                    {
-                        evtList = new ArrayList<String>();
-                    }               
-                    evtList.add(line);
-                    // and put it back in the map
-                    incidents.put(incident, evtList);
+                    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(ATMSBatchDriver.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) {
+        }
+        catch (FileNotFoundException ex)
+        {
             Logger.getLogger(ATMSBatchDriver.class.getName()).log(Level.SEVERE, null, ex);
         }
         System.out.println("Events file read, " + eventQueue.size() + " events queued.");
-    }
-    
-    /** Clear an incident.  For each event associated with an incident,
-     * turn the dots in its range Green and remove it from the event queue.
+        // Put the events in chronological order
+        Collections.sort(eventQueue);
+    }
+
+    /**
+     * Clear an incident. For each event associated with an incident, turn the
+     * dots in its range Green and remove it from the event queue.
+     *
      * @param incidentNumber incident to be cleared.
      */
@@ -298,5 +289,5 @@
     {
         boolean ok = incidents.containsKey(incidentNumber);
-        if (!ok) 
+        if (!ok)
         {
             System.out.println("Sorry, that incident number isn't found.");
@@ -304,33 +295,20 @@
         }
         System.out.println("Clearing incident " + incidentNumber);
-        List<String> events = incidents.get(incidentNumber);
+        List<TrafficEvent> events = incidents.get(incidentNumber);
         // Process each event associated with this incident 
-        for (String event: events)
+        for (TrafficEvent event : events)
         {
             System.out.println("Event: " + event + " cleared.");
             eventQueue.remove(event);
-            // Extract fields from event and prepare them 
-            Scanner lineScan = new Scanner(event);
-            try
-            {
-                lineScan.next(); // skip incident number field
-                lineScan.next(); // skip time field
-                int routeNumber = lineScan.nextInt();
-                Station.DIRECTION dir = Station.DIRECTION.toDirection(lineScan.next());
-                double postmile = lineScan.nextDouble();
-                double range = lineScan.nextDouble();
-                // apply colorization to highways, forcing to green, indicating cleared
-                highways.applyColorToHighwayStretch(routeNumber, dir, postmile, range, DOTCOLOR.GREEN);
-            }
-            catch (InputMismatchException ex)
-            {
-                System.out.println("Internal error, please report to programmers." + event);
-            }
-            
+
+            // apply colorization to highways, forcing to green, indicating cleared
+            highways.applyColorToHighwayStretch(event.routeNumber, event.dir,
+                    event.postmile, event.range, DOTCOLOR.GREEN);
+
         }
         // Now refresh the view with the updated queue of events
         theView.update("0:00", "0:00", eventQueue);
     }
-    
+
     /**
      * Connect to the Coordinator's RMI object, and register this object for
@@ -354,9 +332,10 @@
             theCoorInt = (CoordinatorInterface) Naming.lookup(coorIntURL);
             theCoorInt.registerForCallback(this);
-        } catch (Exception e)
+        }
+        catch (Exception e)
         {
             throw new SimulationException(SimulationException.CAD_SIM_CONNECT,
                     e);
-            
+
         }
     }
@@ -384,5 +363,6 @@
             cadClientProp = new Properties();
             cadClientProp.load(new FileInputStream(propertiesFile));
-        } catch (Exception e)
+        }
+        catch (Exception e)
         {
             cadClientLogger.logp(Level.SEVERE, "SimulationManager",
@@ -392,5 +372,4 @@
                     e);
         }
-
 
         // Ensure that the properties file does not have null values for the
@@ -430,5 +409,6 @@
                 {
                     theCoorInt.unregisterForCallback(client);
-                } catch (RemoteException e)
+                }
+                catch (RemoteException e)
                 {
                     e.printStackTrace();
@@ -456,5 +436,6 @@
             new ATMSBatchDriver(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME);
 
-        } catch (Exception e)
+        }
+        catch (Exception e)
         {
             cadClientLogger.logp(Level.SEVERE, "SimulationManager", "Main",
@@ -478,8 +459,10 @@
             while (true)
             {
-                try {
+                try
+                {
                     // Write the highway network status to the FEP Simulator
                     highways.writeToFEP();
-                } catch (SimulationException ex) 
+                }
+                catch (SimulationException ex)
                 {
                     // Ask user if they want to proceed without FEP Sim connection
@@ -487,5 +470,5 @@
                     if (reply == JOptionPane.NO_OPTION)
                     {
-                      System.exit(0);
+                        System.exit(0);
                     }
                     System.out.println("Skipping writeToFEP...");
Index: trunk/src/tmcsim/client/ATMSBatchViewer.java
===================================================================
--- trunk/src/tmcsim/client/ATMSBatchViewer.java	(revision 168)
+++ trunk/src/tmcsim/client/ATMSBatchViewer.java	(revision 183)
@@ -1,17 +1,13 @@
-
 package tmcsim.client;
 
+import atmsdriver.model.TrafficEvent;
+import java.text.ParseException;
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Queue;
-import java.util.Set;
-import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.swing.AbstractListModel;
-import javax.swing.JLabel;
-import javax.swing.JList;
 import javax.swing.JOptionPane;
-import tmcsim.cadsimulator.CADServer;
 
 /**
@@ -19,40 +15,64 @@
  * @author jdalbey
  */
-public class ATMSBatchViewer extends javax.swing.JFrame 
+public class ATMSBatchViewer extends javax.swing.JFrame
 {
-    /** Reference to the driver associated with this GUI */
-    private ATMSBatchDriver driver; 
+
+    /**
+     * Reference to the driver associated with this GUI
+     */
+    private ATMSBatchDriver driver;
     private final List<String> incidents;
+
     /**
      * Creates new form ATMSBatchViewer.
+     *
      * @param incidents a list of incidents to show in a list.
      */
-    public ATMSBatchViewer(ATMSBatchDriver driver, List<String> incidentList) 
+    public ATMSBatchViewer(ATMSBatchDriver driver, List<String> incidentList)
     {
         initComponents();
-        this.driver = driver; 
+        this.driver = driver;
         this.incidents = incidentList;
         lstIncidents.setModel(new javax.swing.AbstractListModel<String>()
         {
-            public int getSize() { return incidents.size(); }
-            public String getElementAt(int i) { return incidents.get(i); }
-        });        
+            public int getSize()
+            {
+                return incidents.size();
+            }
+
+            public String getElementAt(int i)
+            {
+                return incidents.get(i);
+            }
+        });
     }
 
-    public void update(String currentTime, String atmsTime, Queue<String> events)
+    public void update(String currentTime, String atmsTime, List<TrafficEvent> events)
     {
         lstEvents.setModel(new MyListModel(events));
-        txtClockTime.setText(currentTime + " / " +atmsTime);
+        txtClockTime.setText(currentTime + " / " + atmsTime);
     }
+
     class MyListModel extends AbstractListModel<String>
     {
-            String[] strings = { "item 1", "item 2" };
-            public MyListModel(Queue<String> events)
-            {
-                strings = events.toArray(new String[events.size()]);               
-            }
-            public int getSize() { return strings.length; }
-            public String getElementAt(int i) { return strings[i]; }        
+
+        TrafficEvent[] strings;// = { "item 1", "item 2" };
+
+        public MyListModel(List<TrafficEvent> events)
+        {
+            strings = events.toArray(new TrafficEvent[events.size()]);
+        }
+
+        public int getSize()
+        {
+            return strings.length;
+        }
+
+        public String getElementAt(int i)
+        {
+            return strings[i].rawString;
+        }
     }
+
     /**
      * This method is called from within the constructor to initialize the form.
@@ -70,7 +90,7 @@
         txtClockTime = new javax.swing.JLabel();
         pnlIncidents = new javax.swing.JPanel();
-        btnClear = new javax.swing.JButton();
         jScrollPane1 = new javax.swing.JScrollPane();
         lstIncidents = new javax.swing.JList<>();
+        btnClear = new javax.swing.JButton();
 
         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
@@ -112,4 +132,14 @@
         );
 
+        lstIncidents.setFont(new java.awt.Font("Noto Mono", 0, 15)); // NOI18N
+        lstIncidents.setModel(new javax.swing.AbstractListModel<String>()
+        {
+            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
+            public int getSize() { return strings.length; }
+            public String getElementAt(int i) { return strings[i]; }
+        });
+        lstIncidents.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+        jScrollPane1.setViewportView(lstIncidents);
+
         btnClear.setText("Clear Incident");
         btnClear.addActionListener(new java.awt.event.ActionListener()
@@ -126,5 +156,7 @@
             pnlIncidentsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(pnlIncidentsLayout.createSequentialGroup()
-                .addComponent(btnClear)
+                .addGroup(pnlIncidentsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(btnClear)
+                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE))
                 .addGap(0, 0, Short.MAX_VALUE))
         );
@@ -132,18 +164,10 @@
             pnlIncidentsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlIncidentsLayout.createSequentialGroup()
-                .addGap(185, 185, 185)
+                .addContainerGap()
+                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(btnClear)
                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
         );
-
-        lstIncidents.setFont(new java.awt.Font("Noto Mono", 0, 15)); // NOI18N
-        lstIncidents.setModel(new javax.swing.AbstractListModel<String>()
-        {
-            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
-            public int getSize() { return strings.length; }
-            public String getElementAt(int i) { return strings[i]; }
-        });
-        lstIncidents.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
-        jScrollPane1.setViewportView(lstIncidents);
 
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
@@ -152,12 +176,11 @@
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(layout.createSequentialGroup()
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
-                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
-                        .addContainerGap()
-                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGap(1, 1, 1)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(12, 12, 12)
                         .addComponent(pnlIncidents, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                     .addComponent(pnlEvents, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
-                .addGap(0, 27, Short.MAX_VALUE))
+                .addGap(0, 26, Short.MAX_VALUE))
         );
         layout.setVerticalGroup(
@@ -166,9 +189,5 @@
                 .addComponent(pnlEvents, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addComponent(pnlIncidents, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                    .addGroup(layout.createSequentialGroup()
-                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
-                        .addGap(0, 0, Short.MAX_VALUE)))
+                .addComponent(pnlIncidents, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                 .addContainerGap())
         );
@@ -179,5 +198,5 @@
     private void btnClearActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnClearActionPerformed
     {//GEN-HEADEREND:event_btnClearActionPerformed
-        String selectedItem =  lstIncidents.getSelectedValue();
+        String selectedItem = lstIncidents.getSelectedValue();
         if (selectedItem == null)
         {
@@ -187,5 +206,8 @@
         {
             System.out.println("Clicked Incident:" + selectedItem);
-            if (driver != null) driver.clearIncident(selectedItem);
+            if (driver != null)
+            {
+                driver.clearIncident(selectedItem);
+            }
             lstIncidents.clearSelection();
             // Remove selectedItem from list model;
@@ -201,5 +223,6 @@
      * @param args the command line arguments
      */
-    public static void main(String args[]) {
+    public static void main(String args[])
+    {
         /* Set the Nimbus look and feel */
         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
@@ -207,18 +230,29 @@
          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
          */
-        try {
-            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
-                if ("Nimbus".equals(info.getName())) {
+        try
+        {
+            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
+            {
+                if ("Nimbus".equals(info.getName()))
+                {
                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
                     break;
                 }
             }
-        } catch (ClassNotFoundException ex) {
+        }
+        catch (ClassNotFoundException ex)
+        {
             java.util.logging.Logger.getLogger(ATMSBatchViewer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
-        } catch (InstantiationException ex) {
+        }
+        catch (InstantiationException ex)
+        {
             java.util.logging.Logger.getLogger(ATMSBatchViewer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
-        } catch (IllegalAccessException ex) {
+        }
+        catch (IllegalAccessException ex)
+        {
             java.util.logging.Logger.getLogger(ATMSBatchViewer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
-        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+        }
+        catch (javax.swing.UnsupportedLookAndFeelException ex)
+        {
             java.util.logging.Logger.getLogger(ATMSBatchViewer.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
         }
@@ -226,15 +260,28 @@
 
         /* Create and display the form */
-        java.awt.EventQueue.invokeLater(new Runnable() {
-            public void run() {
-                Queue<String> sample = new LinkedList<String>();
-                sample.add("Greetings");
-                sample.add("Earthling");
-                List<String> items = new ArrayList<String>();
-                items.add("Able"); items.add("Baker");
-                ATMSBatchViewer view = new ATMSBatchViewer(null,items);
-                view.setVisible(true);
-                view.update("01", "02", sample);
-                
+        java.awt.EventQueue.invokeLater(new Runnable()
+        {
+            public void run()
+            {
+                try
+                {
+                    TrafficEvent alpha = new TrafficEvent("181 00:01:30 405 S 0.6 11.0 G");
+                    TrafficEvent beta = new TrafficEvent("183 00:12:30 405 S 0.6 11.0 G");
+                    TrafficEvent charly = new TrafficEvent("181 00:22:00 5 S 0.6 11.0 G");
+                    LinkedList<TrafficEvent> sample = new LinkedList<TrafficEvent>();
+                    sample.add(alpha);
+                    sample.add(beta);
+                    List<String> items = new ArrayList<String>();
+                    items.add("180");
+                    items.add("1291");
+                    ATMSBatchViewer view = new ATMSBatchViewer(null, items);
+                    view.setVisible(true);
+                    view.update("01", "02", sample);
+                }
+                catch (ParseException ex)
+                {
+                    Logger.getLogger(ATMSBatchViewer.class.getName()).log(Level.SEVERE, null, ex);
+                }
+
             }
         });
Index: trunk/src/tmcsim/client/ATMSBatchViewer.form
===================================================================
--- trunk/src/tmcsim/client/ATMSBatchViewer.form	(revision 168)
+++ trunk/src/tmcsim/client/ATMSBatchViewer.form	(revision 183)
@@ -26,14 +26,13 @@
       <Group type="103" groupAlignment="0" attributes="0">
           <Group type="102" alignment="0" attributes="0">
-              <Group type="103" groupAlignment="1" max="-2" attributes="0">
-                  <Group type="102" alignment="0" attributes="0">
-                      <EmptySpace max="-2" attributes="0"/>
-                      <Component id="jScrollPane1" min="-2" pref="211" max="-2" attributes="0"/>
-                      <EmptySpace max="-2" attributes="0"/>
+              <EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" max="-2" attributes="0">
+                  <Group type="102" attributes="0">
+                      <EmptySpace min="12" pref="12" max="-2" attributes="0"/>
                       <Component id="pnlIncidents" max="32767" attributes="0"/>
                   </Group>
                   <Component id="pnlEvents" min="-2" max="-2" attributes="0"/>
               </Group>
-              <EmptySpace min="0" pref="27" max="32767" attributes="0"/>
+              <EmptySpace min="0" pref="26" max="32767" attributes="0"/>
           </Group>
       </Group>
@@ -44,11 +43,5 @@
               <Component id="pnlEvents" min="-2" max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
-              <Group type="103" groupAlignment="0" attributes="0">
-                  <Component id="pnlIncidents" max="32767" attributes="0"/>
-                  <Group type="102" attributes="0">
-                      <Component id="jScrollPane1" min="-2" pref="179" max="-2" attributes="0"/>
-                      <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
-                  </Group>
-              </Group>
+              <Component id="pnlIncidents" max="32767" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
           </Group>
@@ -130,5 +123,8 @@
           <Group type="103" groupAlignment="0" attributes="0">
               <Group type="102" attributes="0">
-                  <Component id="btnClear" min="-2" max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Component id="btnClear" min="-2" max="-2" attributes="0"/>
+                      <Component id="jScrollPane1" min="-2" pref="211" max="-2" attributes="0"/>
+                  </Group>
                   <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
               </Group>
@@ -138,5 +134,7 @@
           <Group type="103" groupAlignment="0" attributes="0">
               <Group type="102" alignment="1" attributes="0">
-                  <EmptySpace min="-2" pref="185" max="-2" attributes="0"/>
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Component id="jScrollPane1" min="-2" pref="179" max="-2" attributes="0"/>
+                  <EmptySpace max="-2" attributes="0"/>
                   <Component id="btnClear" min="-2" max="-2" attributes="0"/>
                   <EmptySpace max="32767" attributes="0"/>
@@ -146,4 +144,33 @@
       </Layout>
       <SubComponents>
+        <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+          <AuxValues>
+            <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+          </AuxValues>
+
+          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+          <SubComponents>
+            <Component class="javax.swing.JList" name="lstIncidents">
+              <Properties>
+                <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+                  <Font name="Noto Mono" size="15" style="0"/>
+                </Property>
+                <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
+                  <StringArray count="5">
+                    <StringItem index="0" value="Item 1"/>
+                    <StringItem index="1" value="Item 2"/>
+                    <StringItem index="2" value="Item 3"/>
+                    <StringItem index="3" value="Item 4"/>
+                    <StringItem index="4" value="Item 5"/>
+                  </StringArray>
+                </Property>
+                <Property name="selectionMode" type="int" value="0"/>
+              </Properties>
+              <AuxValues>
+                <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
+              </AuxValues>
+            </Component>
+          </SubComponents>
+        </Container>
         <Component class="javax.swing.JButton" name="btnClear">
           <Properties>
@@ -156,33 +183,4 @@
       </SubComponents>
     </Container>
-    <Container class="javax.swing.JScrollPane" name="jScrollPane1">
-      <AuxValues>
-        <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
-      </AuxValues>
-
-      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
-      <SubComponents>
-        <Component class="javax.swing.JList" name="lstIncidents">
-          <Properties>
-            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
-              <Font name="Noto Mono" size="15" style="0"/>
-            </Property>
-            <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
-              <StringArray count="5">
-                <StringItem index="0" value="Item 1"/>
-                <StringItem index="1" value="Item 2"/>
-                <StringItem index="2" value="Item 3"/>
-                <StringItem index="3" value="Item 4"/>
-                <StringItem index="4" value="Item 5"/>
-              </StringArray>
-            </Property>
-            <Property name="selectionMode" type="int" value="0"/>
-          </Properties>
-          <AuxValues>
-            <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
-          </AuxValues>
-        </Component>
-      </SubComponents>
-    </Container>
   </SubComponents>
 </Form>
