package etomica.graphics;
import etomica.DataSource;
import etomica.data.DataSourceCountTime;
import etomica.integrator.IntegratorMD;
import etomica.units.Picosecond;
import etomica.units.PrefixedUnit;

/** 
 * DisplayBox to present the elapsed time in a
 * molecular dynamics simulation.
 */
public class DisplayTimer extends DisplayBox {

    public DisplayTimer(IntegratorMD integrator) {
        this(new DataSourceCountTime(integrator));
    }
    public DisplayTimer(DataSource dataSource) {
        super(dataSource);
        this.setUnit(new PrefixedUnit(Picosecond.UNIT));
        this.setPrecision(7);
        graphic().setSize(100,60);
    }
}

@@ -34,26 +34,29 @@
 etomica.
-DataSource
+data.DataPump
 ;%0Aimport
@@ -130,16 +130,65 @@
 atorMD;%0A
+import etomica.integrator.IntervalActionAdapter;%0A
 import e
@@ -333,16 +333,63 @@
 ulation.
+  Designed for use with%0A * a single integrator.
 %0A */%0Apub
@@ -497,12 +497,15 @@
    t
-his(
+imer = 
 new 
@@ -539,90 +539,175 @@
 tor)
-)
 ;%0A    
-%7D%0A
     
-public DisplayTimer(DataSource dataSource) %7B%0A        super(dataSource
+DataPump dataPump = new DataPump(timer, this);%0A        intervalActionAdapter = new IntervalActionAdapter(dataPump, integrator);%0A        setUpdateInterval(100
 );%0A 
@@ -833,10 +833,682 @@
 ;%0A    %7D%0A
+    %0A    /**%0A     * Sets the period for updating the display.  Number of integrator %0A     * interval events between updates.  Does not have any effect on the%0A     * value displayed; affects only how often it is updated.%0A     */%0A    public void setUpdateInterval(int interval) %7B%0A        intervalActionAdapter.setActionInterval(interval);%0A    %7D%0A%0A    /**%0A     * Returns the data source used to count the time, to permit%0A     * access to its methods for reset, etc.  %0A     * @return%0A     */%0A    public DataSourceCountTime getTimer() %7B%0A        return timer;%0A    %7D%0A    %0A    private final IntervalActionAdapter intervalActionAdapter;%0A    private final DataSourceCountTime timer;%0A
 %7D%0A

fix for change to data handlers