<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>src/mytime/app/models/DocumentModel.java</filename>
    </added>
    <added>
      <filename>src/mytime/app/models/IValueModel.java</filename>
    </added>
    <added>
      <filename>src/mytime/app/models/ValueHolder.java</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,6 +2,11 @@ package mytime.test;
 
 import static org.mockito.Matchers.*;
 import static org.mockito.Mockito.*;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Date;
+
 import junit.framework.TestCase;
 import mytime.app.AppMainWindow;
 import mytime.app.AppRoot;
@@ -148,4 +153,29 @@ public class MyTimeTestCase extends TestCase {
 	verify(_mockUIMainWindow, times(2)).setVisibility(false);
 	verify(_mockUITrayIcon, times(2)).setWindowsVisible(false);
     }
+
+    public void testShowCurrentActivityInWindow() {
+	_appTrayIcon.doToggleWindows();
+
+	AppMainWindow appMainWindow = _appRoot.getAppMainWindow();
+	PropertyChangeListener _mockPCL = mock(PropertyChangeListener.class);
+	appMainWindow.getStartTimeModel().addPropertyChangeListener(_mockPCL);
+	assertEquals(null, appMainWindow.getStartTimeModel().getValue());
+
+	Date date1 = new Date(&quot;27 dec 2008 09:00&quot;);
+	when(_mockUIRoot.getTime()).thenReturn(date1);
+
+	appMainWindow.userPerformsStartTimer();
+
+	verify(_mockPCL).propertyChange(isA(PropertyChangeEvent.class));
+	assertEquals(date1, appMainWindow.getStartTimeModel().getValue());
+
+	Date date2 = new Date(System.currentTimeMillis()); // new Date(&quot;27 dec 2008 09:15&quot;);
+	when(_mockUIRoot.getTime()).thenReturn(date2);
+
+	appMainWindow.userPerformsPauseTimer();
+
+	assertEquals(date2, appMainWindow.getStartTimeModel().getValue());
+	verify(_mockPCL, times(2)).propertyChange(isA(PropertyChangeEvent.class));
+    }
 }</diff>
      <filename>src-test/mytime/test/MyTimeTestCase.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,10 @@
 package mytime.app;
 
+import java.util.Date;
+
 import javax.swing.ButtonModel;
 
+import mytime.app.models.IValueModel;
 import mytime.app.models.NegatedButtonModel;
 
 public class AppMainWindow {
@@ -61,4 +64,8 @@ public class AppMainWindow {
     void destroy() {
 	_uiMainWindow.destroy();
     }
+
+    public IValueModel&lt;Date&gt; getStartTimeModel() {
+	return _appRoot.getStartTimeModel();
+    }
 }</diff>
      <filename>src/mytime/app/AppMainWindow.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,10 @@
 package mytime.app;
 
+import java.util.Date;
+
+import mytime.app.models.IValueModel;
 import mytime.app.models.ToggleButtonModel;
+import mytime.app.models.ValueHolder;
 
 /**
  * 
@@ -14,6 +18,7 @@ public class AppRoot {
     private final AppTrayIcon _appTrayIcon;
     private ToggleButtonModel _isRunningModel;
     private AppMainWindow _appMainWindow;
+    private final ValueHolder&lt;Date&gt; _startTimeModel;
 
     /**
      * Starts the application, and connects it to the UI (i.e., the {@link IUIRoot} object).
@@ -29,6 +34,7 @@ public class AppRoot {
 	_uiRoot = uiRoot;
 
 	_isRunningModel = new ToggleButtonModel();
+	_startTimeModel = new ValueHolder&lt;Date&gt;(null);
 
 	// create application facade and UI...
 	_appTrayIcon = new AppTrayIcon(this);
@@ -43,6 +49,7 @@ public class AppRoot {
 
     public void toggleTimer() {
 	_isRunningModel.toggle();
+	_startTimeModel.setValue(_uiRoot.getTime());
     }
 
     public void toggleWindows() {
@@ -91,4 +98,8 @@ public class AppRoot {
     public AppMainWindow getAppMainWindow() {
 	return _appMainWindow;
     }
+
+    public IValueModel&lt;Date&gt; getStartTimeModel() {
+	return _startTimeModel;
+    }
 }</diff>
      <filename>src/mytime/app/AppRoot.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,7 @@
 package mytime.app;
 
+import java.util.Date;
+
 /**
  * This interface represents the UI of the application as a whole, as the application facade see it.
  */
@@ -23,8 +25,14 @@ public interface IUIRoot {
     IUIMainWindow showMainWindow(AppMainWindow appMainWindow);
 
     /**
+     * Returns the current time.
+     * 
+     * @return a Date object representing 'now'.
+     */
+    Date getTime();
+
+    /**
      * Instructs the UI to exit.
      */
     void exit();
-
 }</diff>
      <filename>src/mytime/app/IUIRoot.java</filename>
    </modified>
    <modified>
      <diff>@@ -6,14 +6,17 @@ import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
+import java.util.Date;
 
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
 import javax.swing.JFrame;
 import javax.swing.JPanel;
+import javax.swing.JTextField;
 
 import mytime.app.AppMainWindow;
 import mytime.app.IUIMainWindow;
+import mytime.app.models.DocumentModel;
 
 /**
  * The UI for the main window.
@@ -24,6 +27,7 @@ public class SwingUIMainWindow extends JFrame implements IUIMainWindow {
     private AppMainWindow _appMainWindow;
     private JButton _jStartButton;
     private JButton _jPauseButton;
+    private JTextField _jStartTime;
 
     /**
      * Create and show the main window.
@@ -47,6 +51,12 @@ public class SwingUIMainWindow extends JFrame implements IUIMainWindow {
 	JPanel pane = new JPanel();
 	getContentPane().add(pane);
 
+	_jStartTime = new JTextField();
+	_jStartTime.setPreferredSize(new Dimension(200, 20));
+	pane.add(_jStartTime);
+	_jStartTime.setEditable(false);
+	_jStartTime.setFocusable(false);
+
 	_jStartButton = new JButton(new ImageIcon(getClass().getResource(&quot;icons/aesthetica/play.png&quot;)));
 	pane.add(_jStartButton);
 	_jStartButton.setEnabled(false);
@@ -84,6 +94,7 @@ public class SwingUIMainWindow extends JFrame implements IUIMainWindow {
     }
 
     private void connectModels() {
+	_jStartTime.setDocument(new DocumentModel&lt;Date&gt;(_appMainWindow.getStartTimeModel()));
 	_jStartButton.setModel(_appMainWindow.getStartButtonModel());
 	_jPauseButton.setModel(_appMainWindow.getPauseButtonModel());
     }</diff>
      <filename>src/mytime/ui/swing/SwingUIMainWindow.java</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,7 @@
 package mytime.ui.swing;
 
+import java.util.Date;
+
 import javax.swing.SwingUtilities;
 
 import mytime.app.AppMainWindow;
@@ -51,6 +53,15 @@ public class SwingUIRoot implements IUIRoot {
     }
 
     /**
+     * Return the current time as a Date object.
+     * 
+     * @return the current time
+     */
+    public Date getTime() {
+	return new Date();
+    }
+
+    /**
      * Exit the JVM.
      * 
      * @see mytime.app.IUIRoot#exit()</diff>
      <filename>src/mytime/ui/swing/SwingUIRoot.java</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dd60869447cf049b5e660178702285c12c7c7486</id>
    </parent>
  </parents>
  <author>
    <name>Marnix Klooster</name>
    <email>marnix.klooster@gmail.com</email>
  </author>
  <url>http://github.com/marnix/mytime/commit/9df7ad94aa70b9b52dec295ed23110f31bbf908d</url>
  <id>9df7ad94aa70b9b52dec295ed23110f31bbf908d</id>
  <committed-date>2009-01-10T09:24:49-08:00</committed-date>
  <authored-date>2009-01-10T09:24:49-08:00</authored-date>
  <message>Added a 'start time' field to the UI.</message>
  <tree>d50c952fc938ada25b1bdef845c821cb20f3ed84</tree>
  <committer>
    <name>Marnix Klooster</name>
    <email>marnix.klooster@gmail.com</email>
  </committer>
</commit>
