Index: fedd/abac-src/atnvis/src/com/algomagic/atn/Visualization.java
===================================================================
--- fedd/abac-src/atnvis/src/com/algomagic/atn/Visualization.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/atnvis/src/com/algomagic/atn/Visualization.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,250 @@
+package com.algomagic.atn;
+
+import att.grappa.*;
+
+import java.util.*;
+import java.io.*;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.geom.*;
+import javax.swing.*;
+import javax.swing.border.*;
+import javax.swing.event.*;
+
+
+public class Visualization extends JFrame
+    implements VisualizationConstants {
+
+    private Properties _properties;
+    private VisualizationPanel[] _visPanels;
+
+    private ControlPanel _controls;
+    private ProgressPanel _progress;
+
+    private String[] _names = new String[2];
+    private Collection[] _policies = new Collection[2];
+
+    public void setName( String name, int side ) {
+	_names[side] = name;
+    }
+
+    public void setPolicies( Collection pol, int side ) {
+	_policies[side] = pol;
+    }
+
+
+
+    public void setAutoRaise( boolean state ) {
+	_visPanels[LEFT_SIDE].setAutoRaise( state );
+	if( _visPanels[RIGHT_SIDE] != null ) {
+	    _visPanels[RIGHT_SIDE].setAutoRaise( state );
+	}
+	
+    }
+
+
+    public Visualization( String log1, String log2 ) {
+
+
+
+	addWindowListener( new WindowAdapter( ) {
+		public void windowClosing( WindowEvent we ) {
+		    Window w = we.getWindow( );
+		    w.setVisible( false );
+		    w.dispose( );
+		    System.exit( 0 );
+		}
+	    });
+
+
+	loadProperties( );
+	initializeFrame( log2 != null );
+
+	LogParser parser = null;
+
+	try {
+	    parser = 
+		(LogParser)Class.forName( _properties.getProperty( PARSER_PROP, 
+								   PARSER_DEFAULT ) ).newInstance( );
+	} catch( Exception e ) {
+	    e.printStackTrace( );
+	    System.exit( 1 );
+	}
+
+	
+	java.util.List updates = parser.parse( this, log1, log2 );
+
+	updates = _visPanels[LEFT_SIDE].initialize( updates );
+	_visPanels[LEFT_SIDE].addCredentials( _policies[LEFT_SIDE], 2 );
+	_visPanels[LEFT_SIDE].setName( _names[LEFT_SIDE] );
+
+
+// 	System.out.println( _policies[LEFT_SIDE] );
+// 	System.out.println( _policies[RIGHT_SIDE] );
+
+
+	if( log2 != null ) {
+	    updates = _visPanels[RIGHT_SIDE].initialize(  updates );
+	    _visPanels[RIGHT_SIDE].addCredentials( _policies[RIGHT_SIDE], 2 );
+	    _visPanels[RIGHT_SIDE].setName( _names[RIGHT_SIDE] );
+
+	}
+	
+
+
+	java.util.List l = new ArrayList( );
+
+	for( Iterator i = updates.iterator( ); i.hasNext( ); ) {
+	    Update u = (Update)i.next( );
+	    PanelUpdate pu = null;;
+
+	    if( u.getSide( ) == LEFT_SIDE ) {
+		pu = _visPanels[LEFT_SIDE].apply( u );
+	    } else if( log2 != null ) {
+		pu = _visPanels[RIGHT_SIDE].apply( u );
+	    }
+
+	    if( !pu.isEmpty( ) ) {
+		l.add( pu );
+	    }
+
+	}
+
+
+// 	_visPanels[LEFT_SIDE].reset( updates );
+// 	if( log2 != null ) {
+// 	    _visPanels[RIGHT_SIDE].reset( updates );
+// 	}
+	
+
+	PlayBackController pbc = new PlayBackController( l, _properties );
+	pbc.addObserver( _progress );
+	pbc.addObserver( _visPanels[LEFT_SIDE] );
+	_visPanels[LEFT_SIDE].hideGraph( );
+
+	if( log2 != null ) {
+	    pbc.addObserver( _visPanels[RIGHT_SIDE] );
+	    _visPanels[RIGHT_SIDE].hideGraph( );
+	}
+
+
+	_progress.setMax( l.size( ) );
+	_controls.addObserver( pbc );
+
+
+// // 	Object[] o = getKeyListeners( );
+// 	for( int i = 0; o != null && i<o.length; i++ ) {
+// 	    removeKeyListener( (KeyListener)o[i] );
+// 	}
+
+
+
+// 	addKeyListener( new KeyListener( ) {
+// 		public void keyTyped( KeyEvent e ) {
+// 		    System.out.println( "typed: " + e );
+// 		}
+
+// 		public void keyPressed( KeyEvent e ) {
+// 		    System.out.println( "pressed: " + e );
+// 		}
+
+// 		public void keyReleased( KeyEvent e ) {
+// 		    System.out.println( "released: " + e );
+// 		}
+
+
+// 	    });
+
+
+// 	addFocusListener( new FocusListener( ) {
+// 		public void focusGained( FocusEvent e ) {
+// 		    System.out.println( "focus gained: " + e );
+// 		}
+
+// 		public void focusLost( FocusEvent e ) {
+// 		    System.out.println( "focus lost: " + e ); 
+// // 		    requestFocus( );
+// 		}
+
+
+// 	    });
+		       
+
+
+ 	show( );
+// 	requestFocus( true );
+
+    }
+
+    private void initializeFrame( boolean twoSided ) {
+	JPanel mainPanel = new JPanel( );
+	mainPanel.setLayout( new BoxLayout( mainPanel, BoxLayout.X_AXIS ) );
+
+	_visPanels = new VisualizationPanel[2];
+	_visPanels[LEFT_SIDE] = new VisualizationPanel( LEFT_SIDE, _properties );
+	mainPanel.add( _visPanels[LEFT_SIDE] );
+
+	if( twoSided ) {
+	    _visPanels[RIGHT_SIDE] = new VisualizationPanel( RIGHT_SIDE, _properties );
+	    mainPanel.add( Box.createHorizontalStrut( 10 ) );
+	    mainPanel.add( _visPanels[RIGHT_SIDE] );
+	}
+	
+	_controls = new ControlPanel( _properties, this );
+	_progress = new ProgressPanel( );
+
+	JPanel toolPanel = new JPanel( );
+
+	toolPanel.setMaximumSize( new Dimension( 2000, 50 ) );
+	toolPanel.setPreferredSize( new Dimension( 2000, 50 ) );
+
+
+	toolPanel.setLayout( new BoxLayout( toolPanel, BoxLayout.X_AXIS ) );
+	toolPanel.add( _controls );
+	toolPanel.add( _progress );
+
+	Container contentPane = getContentPane( );
+	contentPane.setLayout( new BoxLayout( contentPane, BoxLayout.Y_AXIS ) );
+	contentPane.add( mainPanel );
+	contentPane.add( toolPanel );
+
+ 	setTitle( _properties.getProperty( WINDOW_TITLE_PROP, WINDOW_TITLE_DEFAULT ) );
+ 	setSize( Integer.parseInt( _properties.getProperty( WINDOW_WIDTH_PROP, WINDOW_WIDTH_DEFAULT ) ),
+ 		 Integer.parseInt( _properties.getProperty( WINDOW_HEIGHT_PROP, WINDOW_HEIGHT_DEFAULT ) ) );
+
+    }
+
+
+
+    private void loadProperties( ) {
+	String propsFileName = System.getProperty( CONFIG_FILE_PROP, CONFIG_FILE_DEFAULT );
+	File file = new File( propsFileName );
+
+	_properties = new Properties( );
+
+	if( file.exists( ) ) {
+	    try {
+		_properties.load( new FileInputStream( file ) );
+	    } catch( Exception e ) { }
+	}
+
+    }
+
+
+    public static void main( String[] args ) {
+	Visualization vis = null;
+
+	if( args.length == 1 ) {
+	    vis = new Visualization( args[0], null );
+	} else if ( args.length == 2 ) {
+	    vis = new Visualization( args[0], args[1] );
+	} else {
+	    System.err.println( "usage: Visualization <log file> [<log file>]" );
+	    System.exit( 1 );
+	}
+
+    }
+
+
+}
