Index: fedd/abac-src/atnvis/src/com/algomagic/atn/ControlPanel.java
===================================================================
--- fedd/abac-src/atnvis/src/com/algomagic/atn/ControlPanel.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/atnvis/src/com/algomagic/atn/ControlPanel.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,199 @@
+package com.algomagic.atn;
+
+import java.util.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.geom.*;
+import javax.swing.*;
+import javax.swing.border.*;
+import javax.swing.event.*;
+
+
+public class ControlPanel 
+    extends JPanel 
+    implements ActionListener, VisualizationConstants
+{
+
+    JButton _play, _pause, _stepForward, _stepBack, _rewind, _fastForward, _stop;
+    InternalObservable _observable;
+    Visualization _vis;
+
+
+    public ControlPanel( Properties properties, Visualization vis ) {
+	super( );
+
+	_vis = vis;
+	_observable = new InternalObservable( );
+	Class clazz = this.getClass( );
+
+	_play = new JButton( new ImageIcon( clazz.getResource( "/resources/Play24.gif" ), "play" ) );
+	_play.setActionCommand( "play" );
+	_play.addActionListener( this );
+	_play.setEnabled( true );
+
+	_pause = new JButton( new ImageIcon( clazz.getResource( "/resources/Pause24.gif" ), "pause" ) );
+	_pause.setActionCommand( "pause" );
+	_pause.addActionListener( this );
+	_pause.setEnabled( false );
+
+	_stepForward = new JButton( new ImageIcon( clazz.getResource( "/resources/StepForward24.gif" ), "step forward" ) );
+	_stepForward.setActionCommand( "stepf" );
+	_stepForward.addActionListener( this );
+	_stepForward.setEnabled( true );
+	_stepForward.setMnemonic( 70 );
+
+
+	_stepBack = new JButton( new ImageIcon( clazz.getResource( "/resources/StepBack24.gif" ), "step back" ) );
+	_stepBack.setActionCommand( "stepb" );
+	_stepBack.addActionListener( this );
+	_stepBack.setEnabled( true );
+	_stepBack.setMnemonic( 66 );
+
+
+	_rewind = new JButton( new ImageIcon( clazz.getResource( "/resources/Rewind24.gif" ), "rewind" ) );
+	_rewind.setActionCommand( "rewind" );
+	_rewind.addActionListener( this );
+	_rewind.setEnabled( true );
+	
+
+
+	_fastForward = new JButton( new ImageIcon( clazz.getResource( "/resources/FastForward24.gif" ), "fast forward" ) );
+	_fastForward.setActionCommand( "ff" );
+	_fastForward.addActionListener( this );
+	_fastForward.setEnabled( true );
+
+
+	setStyle( _play );
+	setStyle( _pause );
+	setStyle( _stepForward );
+	setStyle( _stepBack );
+	setStyle( _rewind );
+	setStyle( _fastForward );
+
+	setLayout( new BoxLayout( this, BoxLayout.X_AXIS ) );
+	add( _rewind );
+	add( _stepBack );
+	add( _play );
+	add( _pause );
+	add( _stepForward );
+	add( _fastForward );
+
+	JCheckBox loop = 
+	    new JCheckBox( "loop", (new Boolean( properties.getProperty( LOOP_PROP, LOOP_DEFAULT ) )).booleanValue( ) );
+
+	loop.addItemListener( new ItemListener( ) {
+		public void itemStateChanged( ItemEvent e ) {
+		    int s = e.getStateChange( );
+		    Boolean state = Boolean.TRUE;
+
+		    if( s == ItemEvent.DESELECTED ) {
+			state = Boolean.FALSE;
+		    }
+			
+		    _observable.notify( state );
+
+		}
+	    } );
+
+
+	add( Box.createHorizontalStrut( 10 ) );
+	add( loop );
+
+
+	JCheckBox raise = 
+	    new JCheckBox( "auto raise", true );
+	raise.addItemListener( new ItemListener( ) {
+
+		public void itemStateChanged( ItemEvent e ) {
+		    int s = e.getStateChange( );
+		    boolean state = true;
+
+		    if( s == ItemEvent.DESELECTED ) {
+			state = false;
+		    }
+		    
+		    _vis.setAutoRaise( state );
+		}
+
+
+
+	    } );
+
+
+	add( Box.createHorizontalStrut( 10 ) );
+	add( raise );
+
+
+
+	JSpinner spinner = 
+	    new JSpinner( new SpinnerNumberModel( Integer.parseInt( properties.getProperty( DELAY_PROP, DELAY_DEFAULT ) ), 
+						  0, 
+						  5000, 
+						  100 ) );
+
+
+	JLabel spinnerLabel = new JLabel( "delay (msec)" );
+
+	spinner.addChangeListener( new ChangeListener( ) {
+		public void stateChanged( ChangeEvent e ) {
+		    _observable.notify( e.getSource( ) );
+		}
+	    } );
+
+
+	add( spinner );
+	add( Box.createHorizontalStrut( 5 ) );
+	add( spinnerLabel );
+
+
+	PanelHelper.setBorder( this, "Controls" );
+    }
+
+
+    public void addObserver( Observer o ) {
+	_observable.addObserver( o );
+    }
+
+
+    private void setStyle( JButton b ) {
+	b.setMinimumSize( new Dimension( 24, 24 ) );
+	b.setMaximumSize( new Dimension( 24, 24 ) );
+	b.setPreferredSize( new Dimension( 24, 24 ) );
+	    
+	b.setBorderPainted( false );
+    }
+
+    public void actionPerformed( ActionEvent e ) {
+	String cmd = e.getActionCommand( );
+	if( cmd.equals( "play" ) ) {
+	    _stepForward.setEnabled( false );
+	    _stepBack.setEnabled( false );
+	    _rewind.setEnabled( false );
+	    _fastForward.setEnabled( false );
+	    _play.setEnabled( false );
+	    _pause.setEnabled( true );
+	}
+
+	else if( cmd.equals( "pause" ) ) {
+	    _stepForward.setEnabled( true );
+	    _stepBack.setEnabled( true );
+	    _rewind.setEnabled( true );
+	    _fastForward.setEnabled( true );
+	    _play.setEnabled( true );
+	    _pause.setEnabled( false );
+	}
+
+
+	_observable.notify( e.getActionCommand( ) );
+    }
+
+
+    private class InternalObservable extends Observable {
+	public void notify( Object arg ) {
+	    setChanged( );
+	    notifyObservers( arg );
+	}
+    }
+
+}
+
