Index: trunk/src/atmsdriver/GoogleMapAnimator.java
===================================================================
--- trunk/src/atmsdriver/TrafficEventsAnimator.java	(revision 232)
+++ trunk/src/atmsdriver/GoogleMapAnimator.java	(revision 245)
@@ -5,4 +5,5 @@
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.io.PrintWriter;
 import java.rmi.RemoteException;
 import java.util.ArrayList;
@@ -20,13 +21,12 @@
 
 /**
- * Read and process all Traffic Events in a file and show
- * resulting highway network. 
- * A snapshot of the highway model after each event is saved in a buffer
- * and a graphical display allows the user to scroll through the history. 
+ * Read and process all Traffic Events in a file and output 
+ * a snapshot of the highway model after each event to a json file. 
+ * This file can be read by Google maps. 
  * This application is used by Traffic Event authors to assist
  * in verifying the correctness of their data file.
  * @author jdalbey
  */
-public class TrafficEventsAnimator extends javax.swing.JPanel
+public class GoogleMapAnimator extends javax.swing.JPanel
 {
     /**
@@ -53,7 +53,11 @@
     private List<String> history;
     /**
+     * name of events file obtained from properties
+     */
+    private String events_file = ""; 
+    /**
      * Creates the JPanel and builds the highways and events. 
      */
-    public TrafficEventsAnimator() throws RemoteException, SimulationException
+    public GoogleMapAnimator() throws RemoteException, SimulationException
     {
         initComponents();
@@ -69,13 +73,13 @@
                  + CONFIG_FILE_NAME;
         Properties props = TrafficModelManager.loadProperties(propertiesFile);
-
+        events_file = props.getProperty("Events_File");
         FileInputStream fis = null;
         try
         {
-            fis = new FileInputStream(props.getProperty("Events_File"));
+            fis = new FileInputStream(events_file);
         } catch (FileNotFoundException ex)
         {
             Logger.getLogger(TrafficModelManager.class.getName()).log(Level.SEVERE, null, 
-                    "Missing Traffic Events file " + props.getProperty("Events_File"));
+                    "Missing Traffic Events file " + events_file);
             System.exit(-1);
         }
@@ -87,5 +91,5 @@
     public void load()
     {
-        txtDisplay.setText("Loading ...");
+        txtDisplay.setText("Loading traffic events from: " + events_file);
         history = new ArrayList<String>();
         // If we have any events left to process
@@ -98,5 +102,30 @@
             highways.applyColorToHighwayStretch(nextEvent.routeNumber, nextEvent.dir,
                     nextEvent.postmile, nextEvent.range, nextEvent.color);
-            history.add(highways.toString()+"\n"+nextEvent.eventTime);
+            //history.add(highways.toString()+"\n"+nextEvent.eventTime);
+            
+            // Output the highway model 
+            String geojson = highways.toJson();
+            //System.out.println(geojson); // diagnostic
+            PrintWriter out;
+            try
+            {
+                out = new PrintWriter("highways.json");
+                out.print(geojson);
+                out.close();
+            }
+            catch (FileNotFoundException ex)
+            {
+                Logger.getLogger(GoogleMapAnimator.class.getName()).log(Level.SEVERE, null, ex);
+            }
+            
+            // Sleep 10 sec for the javascript page to load the file
+            try
+            {
+                Thread.sleep(10000); // pause 10 seconds
+            }
+            catch (InterruptedException ex)
+            {
+                Logger.getLogger(GoogleMapAnimator.class.getName()).log(Level.SEVERE, null, ex);
+            }
             // Remove this event from the queue, we're done with it.
             eventQueue.remove();
@@ -120,4 +149,6 @@
         txtDisplay = new javax.swing.JTextArea();
 
+        setPreferredSize(new java.awt.Dimension(151, 92));
+
         scrollBar.addAdjustmentListener(new java.awt.event.AdjustmentListener()
         {
@@ -140,10 +171,10 @@
                 .addComponent(scrollBar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE))
+                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 421, Short.MAX_VALUE))
         );
         layout.setVerticalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
             .addComponent(scrollBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
         );
     }// </editor-fold>//GEN-END:initComponents
@@ -167,5 +198,5 @@
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setSize(1050,450);
-        TrafficEventsAnimator display = new TrafficEventsAnimator();
+        GoogleMapAnimator display = new GoogleMapAnimator();
         frame.add(display);
         frame.setVisible(true);
