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);
+                }
+
             }
         });
