[Tynstep-svn] r56 - in trunk/step-web-app/src/main/java/com/tyndalehouse/step/web: . client client/event client/eventhandler client/presenter client/toolkit client/toolkit/timeline client/toolkit/timeline/components client/toolkit/timeline/exceptions client/toolkit/timeline/helpers client/view server/db server/guice server/handler shared shared/command shared/result
ChrisBurrell at crosswire.org
ChrisBurrell at crosswire.org
Fri Dec 18 01:44:53 MST 2009
Author: ChrisBurrell
Date: 2009-12-18 01:44:53 -0700 (Fri, 18 Dec 2009)
New Revision: 56
Added:
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/Orientation.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/TimebandRequestWindow.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/TimelineConstants.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/Unit.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/CannotDeleteEventException.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/IncapableOfCalculatingRequestWindowException.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/TimeBandNotFoundException.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/helpers/
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/helpers/TimeConversionUtil.java
Removed:
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/StepWebApp.gwt.xml
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/handler/
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/timeline/
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/CannotDeleteEventException.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/IncapableOfCalculatingRequestWindowException.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Orientation.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/RequestWindow.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeBandNotFoundException.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeConversionUtil.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimebandRequestWindow.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimelineConstants.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Unit.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/widgets/
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetModuleRefDataHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/command/GetModuleRefDataCommand.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/event/
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/eventhandler/
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetModuleRefDataResult.java
Modified:
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/BookSelectedEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ModuleChangeEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/MultipleWordsSelectedEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/NewArticleSelectedEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ScriptureChangeEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/TimelineScrollEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/VersionChangeEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/WordSelectedEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/BookSelectedEventHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/ModuleChangeEventHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/MultipleWordsSelectedEventHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/NewArticleSelectedEventHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/ScriptureChangeEventHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/TimelineScrollEventHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/VersionChangeEventHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/WordSelectedEventHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ModuleSelectorPresenter.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ScripturePresenter.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ScriptureSelectorPresenter.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/TimelinePresenter.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/SimpleListBox.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TapeTrack.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeBand.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeEvent.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeScale.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Timeline.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureView.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/TimelineView.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/DbProvider.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/guice/ServerModule.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetAvailableBibleVersionsHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetBibleBooksHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetCurrentBibleTextHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineOriginForScriptureHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineUISetupHandler.java
trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetTimelineOriginForScriptureResult.java
Log:
update for integration server
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/StepWebApp.gwt.xml
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/StepWebApp.gwt.xml 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/StepWebApp.gwt.xml 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
-<module rename-to='step'>
- <!-- Inherit the core Web Toolkit stuff. -->
- <inherits name="com.google.gwt.user.User" />
- <inherits name="com.google.gwt.inject.Inject" />
- <inherits name='net.customware.gwt.dispatch.Dispatch' />
- <inherits name='net.customware.gwt.presenter.Presenter' />
-
-
- <!-- Inherit the default GWT style sheet. You can change -->
- <!-- the theme of your GWT application by uncommenting -->
- <!-- any one of the following lines. -->
- <inherits name='com.google.gwt.user.theme.standard.Standard' />
- <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
- <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
-
- <!-- Specify the app entry point class. -->
- <entry-point class='com.tyndalehouse.step.web.client.StepEntryPoint' />
-
- <!-- Add gwt-log support, default level `OFF` - check for
- extended property 'log_level' to see if this is overridden -->
- <inherits name="com.allen_sauer.gwt.log.gwt-log-OFF" />
-
-<!-- including GWT-EXT for timeline module -->
-
-<inherits name='com.extjs.gxt.ui.GXT'/>
-
- <!-- Also compile Logger at `INFO` level -->
- <extend-property name="log_level" values="DEBUG" />
- <set-property name="log_level" value="DEBUG" />
-
- <!-- Turn off the floating logger - output will be shown in the
- hosted mode console -->
- <set-property name="log_DivLogger" value="DISABLED" />
-
- <source path="shared" />
- <source path="client" />
-
-<!-- <stylesheet src="js/api/ext/resources/css/ext-all.css" /> -->
-<stylesheet src="gwtext/css/gxt-all.css" />
-
-
-<!-- DEV MODE SETTINGS -->
-
-
-</module>
Property changes on: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event
___________________________________________________________________
Added: svn:mergeinfo
+
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/BookSelectedEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/event/BookSelectedEvent.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/BookSelectedEvent.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.event;
+package com.tyndalehouse.step.web.client.event;
import com.google.gwt.event.shared.GwtEvent;
-import com.tyndalehouse.step.web.shared.eventhandler.BookSelectedEventHandler;
+import com.tyndalehouse.step.web.client.eventhandler.BookSelectedEventHandler;
public class BookSelectedEvent extends GwtEvent<BookSelectedEventHandler>{
public static Type<BookSelectedEventHandler> TYPE = new Type<BookSelectedEventHandler>();
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ModuleChangeEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/event/ModuleChangeEvent.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ModuleChangeEvent.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.event;
+package com.tyndalehouse.step.web.client.event;
import com.google.gwt.event.shared.GwtEvent;
-import com.tyndalehouse.step.web.shared.eventhandler.ModuleChangeEventHandler;
+import com.tyndalehouse.step.web.client.eventhandler.ModuleChangeEventHandler;
public class ModuleChangeEvent extends GwtEvent<ModuleChangeEventHandler> {
public static Type<ModuleChangeEventHandler> TYPE = new Type<ModuleChangeEventHandler>();
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/MultipleWordsSelectedEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/event/MultipleWordsSelectedEvent.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/MultipleWordsSelectedEvent.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.event;
+package com.tyndalehouse.step.web.client.event;
import com.google.gwt.event.shared.GwtEvent;
-import com.tyndalehouse.step.web.shared.eventhandler.MultipleWordsSelectedEventHandler;
+import com.tyndalehouse.step.web.client.eventhandler.MultipleWordsSelectedEventHandler;
public class MultipleWordsSelectedEvent extends GwtEvent<MultipleWordsSelectedEventHandler>{
public static Type<MultipleWordsSelectedEventHandler> TYPE = new Type<MultipleWordsSelectedEventHandler>();
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/NewArticleSelectedEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/event/NewArticleSelectedEvent.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/NewArticleSelectedEvent.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.event;
+package com.tyndalehouse.step.web.client.event;
import com.google.gwt.event.shared.GwtEvent;
-import com.tyndalehouse.step.web.shared.eventhandler.NewArticleSelectedEventHandler;
+import com.tyndalehouse.step.web.client.eventhandler.NewArticleSelectedEventHandler;
public class NewArticleSelectedEvent extends GwtEvent<NewArticleSelectedEventHandler>{
public static Type<NewArticleSelectedEventHandler> TYPE = new Type<NewArticleSelectedEventHandler>();
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ScriptureChangeEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/event/ScriptureChangeEvent.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/ScriptureChangeEvent.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.event;
+package com.tyndalehouse.step.web.client.event;
import com.google.gwt.event.shared.GwtEvent;
-import com.tyndalehouse.step.web.shared.eventhandler.ScriptureChangeEventHandler;
+import com.tyndalehouse.step.web.client.eventhandler.ScriptureChangeEventHandler;
public class ScriptureChangeEvent extends GwtEvent<ScriptureChangeEventHandler>{
public static Type<ScriptureChangeEventHandler> TYPE = new Type<ScriptureChangeEventHandler>();
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/TimelineScrollEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/event/TimelineScrollEvent.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/TimelineScrollEvent.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,11 +1,11 @@
-package com.tyndalehouse.step.web.shared.event;
+package com.tyndalehouse.step.web.client.event;
import java.util.ArrayList;
import java.util.List;
import com.google.gwt.event.shared.GwtEvent;
+import com.tyndalehouse.step.web.client.eventhandler.TimelineScrollEventHandler;
import com.tyndalehouse.step.web.shared.beans.TimeBandVisibleDate;
-import com.tyndalehouse.step.web.shared.eventhandler.TimelineScrollEventHandler;
public class TimelineScrollEvent extends GwtEvent<TimelineScrollEventHandler>{
public static Type<TimelineScrollEventHandler> TYPE = new Type<TimelineScrollEventHandler>();
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/VersionChangeEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/event/VersionChangeEvent.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/VersionChangeEvent.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.event;
+package com.tyndalehouse.step.web.client.event;
import com.google.gwt.event.shared.GwtEvent;
-import com.tyndalehouse.step.web.shared.eventhandler.VersionChangeEventHandler;
+import com.tyndalehouse.step.web.client.eventhandler.VersionChangeEventHandler;
public class VersionChangeEvent extends GwtEvent<VersionChangeEventHandler>{
public static Type<VersionChangeEventHandler> TYPE = new Type<VersionChangeEventHandler>();
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/WordSelectedEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/event/WordSelectedEvent.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/event/WordSelectedEvent.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.event;
+package com.tyndalehouse.step.web.client.event;
import com.google.gwt.event.shared.GwtEvent;
-import com.tyndalehouse.step.web.shared.eventhandler.WordSelectedEventHandler;
+import com.tyndalehouse.step.web.client.eventhandler.WordSelectedEventHandler;
public class WordSelectedEvent extends GwtEvent<WordSelectedEventHandler>{
public static Type<WordSelectedEventHandler> TYPE = new Type<WordSelectedEventHandler>();
Property changes on: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler
___________________________________________________________________
Added: svn:mergeinfo
+
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/BookSelectedEventHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/eventhandler/BookSelectedEventHandler.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/BookSelectedEventHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.eventhandler;
+package com.tyndalehouse.step.web.client.eventhandler;
import com.google.gwt.event.shared.EventHandler;
-import com.tyndalehouse.step.web.shared.event.BookSelectedEvent;
+import com.tyndalehouse.step.web.client.event.BookSelectedEvent;
public interface BookSelectedEventHandler extends EventHandler {
void onBookSelected(BookSelectedEvent event);
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/ModuleChangeEventHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/eventhandler/ModuleChangeEventHandler.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/ModuleChangeEventHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.eventhandler;
+package com.tyndalehouse.step.web.client.eventhandler;
import com.google.gwt.event.shared.EventHandler;
-import com.tyndalehouse.step.web.shared.event.ModuleChangeEvent;
+import com.tyndalehouse.step.web.client.event.ModuleChangeEvent;
public interface ModuleChangeEventHandler extends EventHandler {
void onModuleChange(ModuleChangeEvent event);
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/MultipleWordsSelectedEventHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/eventhandler/MultipleWordsSelectedEventHandler.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/MultipleWordsSelectedEventHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.eventhandler;
+package com.tyndalehouse.step.web.client.eventhandler;
import com.google.gwt.event.shared.EventHandler;
-import com.tyndalehouse.step.web.shared.event.MultipleWordsSelectedEvent;
+import com.tyndalehouse.step.web.client.event.MultipleWordsSelectedEvent;
public interface MultipleWordsSelectedEventHandler extends EventHandler {
void onMultipleWordsSelected(MultipleWordsSelectedEvent event);
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/NewArticleSelectedEventHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/eventhandler/NewArticleSelectedEventHandler.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/NewArticleSelectedEventHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.eventhandler;
+package com.tyndalehouse.step.web.client.eventhandler;
import com.google.gwt.event.shared.EventHandler;
-import com.tyndalehouse.step.web.shared.event.NewArticleSelectedEvent;
+import com.tyndalehouse.step.web.client.event.NewArticleSelectedEvent;
public interface NewArticleSelectedEventHandler extends EventHandler {
void onNewArticleSelected(NewArticleSelectedEvent event);
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/ScriptureChangeEventHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/eventhandler/ScriptureChangeEventHandler.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/ScriptureChangeEventHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.eventhandler;
+package com.tyndalehouse.step.web.client.eventhandler;
import com.google.gwt.event.shared.EventHandler;
-import com.tyndalehouse.step.web.shared.event.ScriptureChangeEvent;
+import com.tyndalehouse.step.web.client.event.ScriptureChangeEvent;
public interface ScriptureChangeEventHandler extends EventHandler {
void onScriptureChange(ScriptureChangeEvent event);
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/TimelineScrollEventHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/eventhandler/TimelineScrollEventHandler.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/TimelineScrollEventHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.eventhandler;
+package com.tyndalehouse.step.web.client.eventhandler;
import com.google.gwt.event.shared.EventHandler;
-import com.tyndalehouse.step.web.shared.event.TimelineScrollEvent;
+import com.tyndalehouse.step.web.client.event.TimelineScrollEvent;
public interface TimelineScrollEventHandler extends EventHandler {
public void onScroll(TimelineScrollEvent event);
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/VersionChangeEventHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/eventhandler/VersionChangeEventHandler.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/VersionChangeEventHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.eventhandler;
+package com.tyndalehouse.step.web.client.eventhandler;
import com.google.gwt.event.shared.EventHandler;
-import com.tyndalehouse.step.web.shared.event.VersionChangeEvent;
+import com.tyndalehouse.step.web.client.event.VersionChangeEvent;
public interface VersionChangeEventHandler extends EventHandler {
void onVersionChange(VersionChangeEvent event);
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/WordSelectedEventHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/eventhandler/WordSelectedEventHandler.java 2009-12-14 18:53:45 UTC (rev 50)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/eventhandler/WordSelectedEventHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,7 @@
-package com.tyndalehouse.step.web.shared.eventhandler;
+package com.tyndalehouse.step.web.client.eventhandler;
import com.google.gwt.event.shared.EventHandler;
-import com.tyndalehouse.step.web.shared.event.WordSelectedEvent;
+import com.tyndalehouse.step.web.client.event.WordSelectedEvent;
public interface WordSelectedEventHandler extends EventHandler {
void onWordSelectedEvent(WordSelectedEvent event);
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ModuleSelectorPresenter.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ModuleSelectorPresenter.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ModuleSelectorPresenter.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -13,19 +13,15 @@
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.HasChangeHandlers;
import com.google.inject.Inject;
+import com.tyndalehouse.step.web.client.event.ModuleChangeEvent;
import com.tyndalehouse.step.web.client.service.refdata.ModuleRefData;
import com.tyndalehouse.step.web.client.toolkit.HasSource;
-import com.tyndalehouse.step.web.shared.event.ModuleChangeEvent;
public class ModuleSelectorPresenter extends WidgetPresenter<ModuleSelectorPresenter.Display> implements ChangeHandler {
- private final DispatchAsync dispatcher;
-
@Inject
public ModuleSelectorPresenter(Display display, EventBus eventBus, DispatchAsync dispatcher) {
super(display, eventBus);
- this.dispatcher = dispatcher;
-
bind();
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ScripturePresenter.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ScripturePresenter.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ScripturePresenter.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -15,12 +15,12 @@
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.HasChangeHandlers;
import com.google.inject.Inject;
+import com.tyndalehouse.step.web.client.event.ScriptureChangeEvent;
+import com.tyndalehouse.step.web.client.event.VersionChangeEvent;
+import com.tyndalehouse.step.web.client.eventhandler.ScriptureChangeEventHandler;
import com.tyndalehouse.step.web.client.toolkit.HasSource;
import com.tyndalehouse.step.web.shared.command.GetAvailableBibleVersionsCommand;
import com.tyndalehouse.step.web.shared.command.GetCurrentBibleTextCommand;
-import com.tyndalehouse.step.web.shared.event.ScriptureChangeEvent;
-import com.tyndalehouse.step.web.shared.event.VersionChangeEvent;
-import com.tyndalehouse.step.web.shared.eventhandler.ScriptureChangeEventHandler;
import com.tyndalehouse.step.web.shared.result.GetAvailableBibleVersionsResult;
import com.tyndalehouse.step.web.shared.result.GetCurrentBibleTextResult;
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ScriptureSelectorPresenter.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ScriptureSelectorPresenter.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/ScriptureSelectorPresenter.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -2,9 +2,6 @@
import java.util.Collection;
-import org.apache.commons.lang.StringUtils;
-
-
import net.customware.gwt.dispatch.client.DispatchAsync;
import net.customware.gwt.presenter.client.DisplayCallback;
import net.customware.gwt.presenter.client.EventBus;
@@ -19,8 +16,8 @@
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.HasValue;
import com.google.inject.Inject;
+import com.tyndalehouse.step.web.client.event.ScriptureChangeEvent;
import com.tyndalehouse.step.web.shared.command.GetBibleBooksCommand;
-import com.tyndalehouse.step.web.shared.event.ScriptureChangeEvent;
import com.tyndalehouse.step.web.shared.result.GetBibleBooksCommandResult;
public class ScriptureSelectorPresenter extends WidgetPresenter<ScriptureSelectorPresenter.Display> {
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/TimelinePresenter.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/TimelinePresenter.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/TimelinePresenter.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -15,21 +15,21 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.inject.Inject;
+import com.tyndalehouse.step.web.client.event.ScriptureChangeEvent;
+import com.tyndalehouse.step.web.client.event.TimelineScrollEvent;
+import com.tyndalehouse.step.web.client.eventhandler.ScriptureChangeEventHandler;
+import com.tyndalehouse.step.web.client.eventhandler.TimelineScrollEventHandler;
import com.tyndalehouse.step.web.client.toolkit.timeline.TimeBand;
-import com.tyndalehouse.step.web.client.toolkit.timeline.TimeBandNotFoundException;
import com.tyndalehouse.step.web.client.toolkit.timeline.TimeEvent;
import com.tyndalehouse.step.web.client.toolkit.timeline.Timeline;
-import com.tyndalehouse.step.web.client.toolkit.timeline.Unit;
+import com.tyndalehouse.step.web.client.toolkit.timeline.components.Unit;
+import com.tyndalehouse.step.web.client.toolkit.timeline.exceptions.TimeBandNotFoundException;
import com.tyndalehouse.step.web.shared.beans.TimeBandVisibleDate;
import com.tyndalehouse.step.web.shared.beans.TimelineBean;
import com.tyndalehouse.step.web.shared.beans.TimelineEventBean;
import com.tyndalehouse.step.web.shared.command.GetEventsForDateRangeCommand;
import com.tyndalehouse.step.web.shared.command.GetTimelineOriginForScriptureCommand;
import com.tyndalehouse.step.web.shared.command.GetTimelineUISetupCommand;
-import com.tyndalehouse.step.web.shared.event.ScriptureChangeEvent;
-import com.tyndalehouse.step.web.shared.event.TimelineScrollEvent;
-import com.tyndalehouse.step.web.shared.eventhandler.ScriptureChangeEventHandler;
-import com.tyndalehouse.step.web.shared.eventhandler.TimelineScrollEventHandler;
import com.tyndalehouse.step.web.shared.result.GetEventsForDateRangeResult;
import com.tyndalehouse.step.web.shared.result.GetTimelineOriginForScriptureResult;
import com.tyndalehouse.step.web.shared.result.GetTimelineUISetupResult;
@@ -115,14 +115,15 @@
Log.debug("Could not find timeband");
}
}
-
+
// now that we've added something, we can notify
- // the timebands that their minimum
- // received windows are slightly more
+ // the timebands that their minimum received windows are slightly more
+ // and also resize the bands too
for (TimeBandVisibleDate tbvd : event.getTimebandVisibleDates()) {
try {
TimeBand tb = tl.getBand(tbvd.getTimebandId());
tb.adjustRequestedView(tbvd.getMinDate(), tbvd.getMaxDate());
+ tb.resizeBand();
} catch (TimeBandNotFoundException e) {
//if for some reason the timeband has gone, we can but ignore
//the error
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/SimpleListBox.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/SimpleListBox.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/SimpleListBox.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,6 @@
package com.tyndalehouse.step.web.client.toolkit;
import java.util.List;
-import java.util.SortedMap;
import com.google.gwt.user.client.ui.ListBox;
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/CannotDeleteEventException.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/CannotDeleteEventException.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/CannotDeleteEventException.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,15 +0,0 @@
-package com.tyndalehouse.step.web.client.toolkit.timeline;
-
-public class CannotDeleteEventException extends Exception {
-
- public CannotDeleteEventException(final String message) {
- super(message);
- }
-
- /**
- *
- */
- private static final long serialVersionUID = -9221252482310063155L;
-
-
-}
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/IncapableOfCalculatingRequestWindowException.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/IncapableOfCalculatingRequestWindowException.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/IncapableOfCalculatingRequestWindowException.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,13 +0,0 @@
-package com.tyndalehouse.step.web.client.toolkit.timeline;
-
-public class IncapableOfCalculatingRequestWindowException extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = 1866493907904681758L;
-
- public IncapableOfCalculatingRequestWindowException(final String message) {
- super(message);
- }
-}
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Orientation.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Orientation.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Orientation.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +0,0 @@
-package com.tyndalehouse.step.web.client.toolkit.timeline;
-
-public enum Orientation {
- HORIZONTAL,
- VERTICAL,
-
-}
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/RequestWindow.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/RequestWindow.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/RequestWindow.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,5 +0,0 @@
-package com.tyndalehouse.step.web.client.toolkit.timeline;
-
-public class RequestWindow {
-
-}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TapeTrack.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TapeTrack.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TapeTrack.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,6 +1,5 @@
package com.tyndalehouse.step.web.client.toolkit.timeline;
-import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Widget;
@@ -13,6 +12,9 @@
*
*/
public class TapeTrack extends Widget {
+ /**
+ * Element on the DOM that is the track
+ */
private Element track;
/**
@@ -28,10 +30,20 @@
*/
private int latestPaintOpportunity;
- private boolean appended;
+ /**
+ * Determines whether the Tape Track is part of the DOM yet
+ */
+ private boolean isRendered;
+ /**
+ * The default constructor initialises in memory a tape track.
+ * This includes setting up the div outside of the DOM,
+ * and setting the default earliest and latest opportunities
+ * for painting as Max and Min Integers hence allowing
+ * everything to be painted
+ */
public TapeTrack() {
- appended = false;
+ isRendered = false;
track = DOM.createDiv();
track.setClassName("step-tape-track");
earliestPaintOpportunity = Integer.MAX_VALUE;
@@ -76,9 +88,9 @@
* @param band
*/
public void paint(final TimeBand band) {
- if(!appended) {
+ if(!isRendered) {
band.getBandDiv().appendChild(track);
- appended = true;
+ isRendered = true;
}
}
@@ -88,5 +100,4 @@
public Element getTrack() {
return track;
}
-
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeBand.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeBand.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeBand.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -4,8 +4,6 @@
import java.util.List;
import java.util.TreeMap;
-import mx4j.util.TimeTask;
-
import com.allen_sauer.gwt.log.client.Log;
import com.extjs.gxt.ui.client.core.El;
import com.google.gwt.event.dom.client.MouseDownEvent;
@@ -13,22 +11,36 @@
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Widget;
+import com.tyndalehouse.step.web.client.toolkit.timeline.components.TimebandRequestWindow;
+import com.tyndalehouse.step.web.client.toolkit.timeline.components.TimelineConstants;
+import com.tyndalehouse.step.web.client.toolkit.timeline.components.Unit;
+import com.tyndalehouse.step.web.client.toolkit.timeline.exceptions.CannotDeleteEventException;
+import com.tyndalehouse.step.web.client.toolkit.timeline.exceptions.IncapableOfCalculatingRequestWindowException;
+import com.tyndalehouse.step.web.client.toolkit.timeline.helpers.TimeConversionUtil;
import com.tyndalehouse.step.web.shared.beans.TimeBandVisibleDate;
/**
* The TimeBand object represents a section of the timeline that contains the
- * events.
+ * events. There are many timebands on the timeline. Timebands contain
+ * TimeScales representing units as well as TapeTracks which contain the events
+ * The events are logically held on the Timeband, but painted on the time track.
*
* @author CJBurrell
- *
*/
-//TODO: add another container around the scale band to ensure that the writing doesn't overlap
-//or change the location of the scale band to be at the bottom rather than at the top of each band
public class TimeBand extends Widget {
+ /**
+ * Id of the timeband
+ */
+ private int id;
- /* business rules */
- private int id;
+ /**
+ * Min date that the timeband is expected to paint
+ */
private long minDate;
+
+ /**
+ * Max date that the timeband is expected to paint
+ */
private long maxDate;
/**
@@ -36,201 +48,140 @@
*/
private TreeMap<Integer, TimeEvent> events;
- /* graphical properties */
+ /**
+ * Determines the unit of the timeband and how to convert from/to
+ * time/pixels
+ */
private Unit unit;
+ /**
+ * The DOM element containing all timeband elements
+ */
private Element bandDiv;
- /** height of the time band, defaults at 50px */
- //private int height = 100;
-
- private int pixelsPerUnit;
-
/**
- * this is the parent widget.
+ * The timeband container which contains the bandDiv
*/
- private final Timeline parent;
-
- // TODO: adjust this
- private long currentDate;
- private long currentDateX = 0;
-
- private boolean showScale = true;
- private int mouseDownScrollLeft;
private Element timebandContainer;
/**
- * This indicates whether the band has been painted and is showing
+ * Number of pixels to be shown per unit
*/
- private boolean isRendered = false;
-
+ private int pixelsPerUnit;
+
/**
- * This is the timescale visible on the timeband drawing lines across the timebands
- * for each unit
+ * this is the parent widget Timeline object
*/
- private TimeScale timescale;
-
- /**
- * this is the autohide option, which should hide the timeband if no events are displayed
- */
- private boolean autoHide = true;
-
- /**
- * when this is set to true, then we can use the request window object
- * to determine whether or not we are showing all the events we are able to
- * If events can be deleted or moved to other timebands, it becomes difficult to work out
- * what the request window should be.
- */
- private boolean deletionsDisabled= true;
- private TimebandRequestWindow requestWindow = null;
-
- //TODO:Derive this from a properties file? somehow? or database?
- /**
- * this describes how much of a unit needs to be visible before calling back to the server
- */
- private double outstandingUnitFactor = 0.5;
-
- /**
- * This determines how much of a zoom is applied. For example
- * a factor of 0.25 changes the scale of 50 pixels per decade to
- * (1 + 0.25) * 50 = 75 pixels
- */
- private double zoomFactor = 0.25;
- private String description;
-
- private List<TapeTrack> tapeTracks;
-
-
- public TimeBand(final Timeline parent, final int id, String description) {
- this.parent = parent;
- this.id = id;
- this.description = description;
+ private final Timeline parent;
- events = new TreeMap<Integer, TimeEvent>();
- bandDiv = DOM.createDiv();
- timebandContainer = DOM.createDiv();
-
- bandDiv.setClassName("step-timeband");
- setElement(timebandContainer);
-
- tapeTracks = new ArrayList<TapeTrack>();
- }
-
/**
- * @return the showScale
+ * The current date that is shown
*/
- public boolean isShowScale() {
- return showScale;
- }
+ private long currentDate;
/**
- * @param showScale
- * the showScale to set
+ * The current pixel on the timeband representing the current date (above)
*/
- public void setShowScale(boolean showScale) {
- this.showScale = showScale;
- }
+ private long currentDateX = 0;
/**
- * @return the bandDiv
+ * Whether or not to show the scale band
*/
- public Element getBandDiv() {
- return bandDiv;
- }
+ private boolean showScale = true;
/**
- * @param bandDiv
- * the bandDiv to set
+ * The last recorded mouse position on the mouse down event
*/
- public void setBandDiv(Element bandDiv) {
- this.bandDiv = bandDiv;
- }
+ private int mouseDownScrollLeft;
/**
- * @return the pixelsPerUnit
+ * This indicates whether the band has been painted and is showing
*/
- public int getPixelsPerUnit() {
- return pixelsPerUnit;
- }
+ private boolean isRendered = false;
/**
- * @param pixelsPerUnit
- * the pixelsPerUnit to set
+ * This is the timescale visible on the timeband drawing lines across the
+ * timebands for each unit
*/
- public void setPixelsPerUnit(int pixelsPerUnit) {
- this.pixelsPerUnit = pixelsPerUnit;
- }
+ private TimeScale timescale;
/**
- * @return the id
+ * this is the autohide option, which should hide the timeband if no events
+ * are displayed
*/
- public int getId() {
- return id;
- }
+ private boolean autoHide = true;
/**
- * @param id
- * the id to set
+ * when this is set to true, then we can use the request window object to
+ * determine whether or not we are showing all the events we are able to If
+ * events can be deleted or moved to other timebands, it becomes difficult
+ * to work out what the request window should be.
*/
- public void setId(int id) {
- this.id = id;
- }
+ private boolean deletionsDisabled = true;
/**
- * @return the minDate
+ * Each timeband is given a request window. This object is responsible of
+ * working out how much to request from the server, so as not to flood it
+ * with requests of stuff it already has
*/
- public long getMinDate() {
- return minDate;
- }
+ private TimebandRequestWindow requestWindow = null;
+ // TODO:Derive this from a properties file? somehow? or database?
/**
- * @param minDate
- * the minDate to set
+ * this describes how much of a unit needs to be visible before calling back
+ * to the server
*/
- public void setMinDate(long minDate) {
- this.minDate = minDate;
- }
+ private double outstandingUnitFactor = 0.5;
/**
- * @return the maxDate
+ * This determines how much of a zoom is applied. For example a factor of
+ * 0.25 changes the scale of 50 pixels per decade to (1 + 0.25) * 50 = 75
+ * pixels
*/
- public long getMaxDate() {
- return maxDate;
- }
+ private double zoomFactor = 0.25;
/**
- * @return the unit
+ * The timeband description
*/
- public Unit getUnit() {
- return unit;
- }
+ private String description;
/**
- * @param unit
- * the unit to set
+ * The list of tape tracks on this timeband.
*/
- public void setUnit(Unit unit) {
- this.unit = unit;
- }
+ private List<TapeTrack> tapeTracks;
+ private boolean needsResizing = false;
+
/**
- * @param maxDate
- * the maxDate to set
+ * To create a new timeband on the timeline
+ *
+ * @param parent
+ * the timeline on which it is to be created
+ * @param id
+ * the id of the timeband
+ * @param description
+ * its description
*/
- public void setMaxDate(long maxDate) {
- this.maxDate = maxDate;
- }
+ public TimeBand(final Timeline parent, final int id, String description) {
+ this.parent = parent;
+ this.id = id;
+ this.description = description;
- /**
- * @return the events
- */
- public TreeMap<Integer, TimeEvent> getEvents() {
- return events;
+ // set up collections
+ events = new TreeMap<Integer, TimeEvent>();
+ tapeTracks = new ArrayList<TapeTrack>();
+
+ // set up page properties
+ bandDiv = DOM.createDiv();
+ timebandContainer = DOM.createDiv();
+ bandDiv.setClassName("step-timeband");
+ setElement(timebandContainer);
}
/**
- * Adds an event to the timeband, and therefore on to a random timetack.
- * The first available spot to minimize the space required.
+ * Adds an event to the timeband, and therefore on to a random timetack. The
+ * first available spot to minimize the space required.
+ *
* @param event
*/
public void addEvent(TimeEvent event) {
@@ -239,7 +190,7 @@
events.put(event.getId(), event);
if (isVisible()) {
- //Log.debug("Request to paint event triggered");
+ // Log.debug("Request to paint event triggered");
addEventToTapeTrack(event);
} else if (autoHide) {
// well the band is not visible, so if the event is in the
@@ -256,48 +207,57 @@
}
public void addEventToTapeTrack(TimeEvent event) {
- int startIndex = showScale ? 1 : 0; //leaving room for the scale band
-
- while(startIndex < tapeTracks.size()) {
- //Log.debug("Trying to add " + event.getDescription() + " to track " + startIndex);
- //try and add event to track
- if(tapeTracks.get(startIndex).addEvent(event)) {
+ int startIndex = showScale ? 1 : 0; // leaving room for the scale band
+
+ // if event is added already, then exit
+ if (event.isRendered()) {
+ return;
+ }
+
+ while (startIndex < tapeTracks.size()) {
+ // Log.debug("Trying to add " + event.getDescription() +
+ // " to track " + startIndex);
+ // try and add event to track
+ if (tapeTracks.get(startIndex).addEvent(event)) {
return;
}
startIndex++;
}
-
- //Log.debug("Going to create a new tape track");
-
- //check that the event was added, otherwise log error or add timetrack
- if(startIndex >= tapeTracks.size()) {
- //did not manage to add it to tracks. therefore, let's add another one:
+
+ // Log.debug("Going to create a new tape track");
+
+ // check that the event was added, otherwise add timetrack
+ if (startIndex >= tapeTracks.size()) {
+ // did not manage to add it to tracks. therefore, let's add another
+ // one:
TapeTrack t = addNewTapeTrack();
t.addEvent(event);
}
- resizeBand();
}
-
private TapeTrack addNewTapeTrack() {
TapeTrack t = new TapeTrack();
tapeTracks.add(t);
t.paint(this);
+
+ needsResizing = true;
+
return t;
}
/**
* Removes an event from the band
*
- * @param id the id of the event to be removed.
- * @throws CannotDeleteEventException An event cannot be removed from a timeband.
+ * @param id
+ * the id of the event to be removed.
+ * @throws CannotDeleteEventException
+ * An event cannot be removed from a timeband.
*/
public void removeEvent(final int id) throws CannotDeleteEventException {
- if(deletionsDisabled) {
- throw new CannotDeleteEventException("The event you are trying to delete (" + id + ") is on band set on" +
- "deletionsDisabled = true");
+ if (deletionsDisabled) {
+ throw new CannotDeleteEventException("The event you are trying to delete (" + id + ") is on band set on" + "deletionsDisabled = true");
}
-
+
events.remove(id);
// TODO: refresh the timeline dom
}
@@ -307,90 +267,97 @@
}
public long getMinVisibleDate() {
- return TimeConversionUtil.pixelToTime(
- timebandContainer.getScrollLeft(), this);
+ return TimeConversionUtil.pixelToTime(timebandContainer.getScrollLeft(), this);
}
public long getMaxVisibleDate() {
int realClientWidth = timebandContainer.getClientWidth();
- //if this is not rendered properly yet, then we have no width:
- if(realClientWidth == 0) {
- //use the timeline width, perhaps we can take the parent width instead...
- //this is important as it it could that the timline doesn't take the full width
+ // if this is not rendered properly yet, then we have no width:
+ if (realClientWidth == 0) {
+ // use the timeline width, perhaps we can take the parent width
+ // instead...
+ // this is important as it it could that the timline doesn't take
+ // the full width
realClientWidth = Window.getClientWidth();
}
-
- return TimeConversionUtil.pixelToTime(
- timebandContainer.getScrollLeft() + realClientWidth, this);
+
+ return TimeConversionUtil.pixelToTime(timebandContainer.getScrollLeft() + realClientWidth, this);
}
+ /**
+ * Repaints the timeband
+ *
+ * @param top
+ */
protected void paint() {
- paint(0);
- }
-
- protected void paint(int top) {
- Log.debug("Request to paint band id:" + getId() + " Current date: " + getCurrentDate() + " Desc:" + getDescription());
+ // Log.debug("Request to paint band id:" + getId() + " Current date: " +
+ // getCurrentDate() + " Desc:" + getDescription());
if (!isRendered) {
- addBandToUI(top);
+ addBandToUI();
isRendered = true;
}
// show scale band?
- //TODO: only paint if we're rendering this band
if (showScale) {
- //check if default time track has been added and add if not
- if(tapeTracks.size() == 0) {
+ // check if default time track has been added and add if not
+ if (tapeTracks.size() == 0) {
addNewTapeTrack();
}
-
- if(timescale == null) {
+
+ if (timescale == null) {
timescale = new TimeScale(this);
- }
+ }
timescale.paint();
}
-
- // get the events to paint themselves (they will decide whether or not to
- //paint if they are already showing...
+ drawEvents();
+
+ }
+
+ /**
+ * Draws event onto the band
+ */
+ private void drawEvents() {
+ // get the events to paint themselves (they will decide whether or not
+ // to
+ // paint if they are already showing...
for (TimeEvent te : events.values()) {
addEventToTapeTrack(te);
}
+
+ //after adding events, call the resizing function.
+ //It decides whether or not the band needs resizing, so no overhead
+ resizeBand();
}
-
- private void resizeBand() {
- //resize the timeband to take account of the number of timetracks
- new El(timebandContainer).setHeight(tapeTracks.size() * TimelineConstants.TAPE_TRACK_HEIGHT);
+ /**
+ * Resizes bands dependant on how many bands are present.
+ */
+ public void resizeBand() {
+ if(needsResizing) {
+ // resize the timeband to take account of the number of timetracks
+ new El(timebandContainer).setHeight(tapeTracks.size() * TimelineConstants.TAPE_TRACK_HEIGHT);
+ needsResizing = false;
+ }
}
-// //Remove this bit later, and have it dynamically add tracks
-// private void initTapeTracks() {
-// int countTapeTracks = height / TimelineConstants.TAPE_TRACK_HEIGHT;
-// tapeTracks = new ArrayList<TapeTrack>(countTapeTracks);
-// for(int ii = 0; ii < countTapeTracks; ii++) {
-// addNewTapeTrack();
-// }
-// }
-
- protected void addBandToUI(int top) {
+ /**
+ * adds the band to the DOM
+ */
+ protected void addBandToUI() {
El el = new El(timebandContainer);
El gxtBandDiv = new El(bandDiv);
- //set display options, ie. auto hide
- if(autoHide && !hasVisibleEvents()) {
+ // set display options, ie. auto hide
+ if (autoHide && !hasVisibleEvents()) {
el.setDisplayed(false);
}
-
+
parent.getTimelineContainer().appendChild(timebandContainer);
-
timebandContainer.appendChild(bandDiv);
-
- addLabelToBand();
+ addLabelToBand();
el.setStyleName("step-timeband-container");
-// el.setHeight(getHeight());
- // el.setTop(top);
-
gxtBandDiv.setHeight("100%");
gxtBandDiv.setTop(0);
}
@@ -399,105 +366,66 @@
Element timebandLabel = DOM.createDiv();
El gxtTimebandLabel = new El(timebandLabel);
gxtTimebandLabel.setStyleName("step-timeband-label", true);
- timebandLabel.setInnerText(description + "(" + id +")");
+ timebandLabel.setInnerText(description + "(" + id + ")");
timebandContainer.appendChild(timebandLabel);
}
/**
- * Tells the caller whether the event is in the visible section of the div on the browser.
- * @param event the event to be tested
+ * Tells the caller whether the event is in the visible section of the div
+ * on the browser.
+ *
+ * @param event
+ * the event to be tested
* @return true if the event is in the visible section
*/
private boolean isEventInVisibleSection(TimeEvent event) {
Long eventMinDate = event.getMinDate();
- Long eventMaxDate = event.getMaxDate(); //eventMaxDate can be null
+ Long eventMaxDate = event.getMaxDate(); // eventMaxDate can be null
long minVisibleDate = getMinVisibleDate();
long maxVisibleDate = getMaxVisibleDate();
- //output compare option:
-// DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy G");
-
-// Log.debug("Comparing ev(" +
-// dtf.format(new Date(eventMinDate)) + "," +
-// dtf.format(new Date(eventMaxDate)) + ") " +
-// "to band(" +
-// dtf.format(new Date(minVisibleDate)) + "," +
-// dtf.format(new Date(maxVisibleDate)) + ")");
-
- if((eventMinDate >= minVisibleDate && eventMinDate <= maxVisibleDate) ||
- (eventMaxDate != null && eventMaxDate >= minVisibleDate && eventMaxDate <= maxVisibleDate) ||
- (eventMaxDate != null && eventMinDate <= minVisibleDate && eventMaxDate >= maxVisibleDate)) {
+ // output compare option:
+ // DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy G");
+
+ // Log.debug("Comparing ev(" +
+ // dtf.format(new Date(eventMinDate)) + "," +
+ // dtf.format(new Date(eventMaxDate)) + ") " +
+ // "to band(" +
+ // dtf.format(new Date(minVisibleDate)) + "," +
+ // dtf.format(new Date(maxVisibleDate)) + ")");
+
+ if ((eventMinDate >= minVisibleDate && eventMinDate <= maxVisibleDate)
+ || (eventMaxDate != null && eventMaxDate >= minVisibleDate && eventMaxDate <= maxVisibleDate)
+ || (eventMaxDate != null && eventMinDate <= minVisibleDate && eventMaxDate >= maxVisibleDate)) {
return true;
}
return false;
}
-
+
/**
- * Checks whether any of the already attached events are in the visible section
+ * Checks whether any of the already attached events are in the visible
+ * section
+ *
* @return
*/
private boolean hasVisibleEvents() {
- //first check count of events, this is because perhaps we are initialising
- //and we don't have anything else to go on...
- if(events.size() == 0) {
+ // first check count of events, this is because perhaps we are
+ // initialising
+ // and we don't have anything else to go on...
+ if (events.size() == 0) {
return false;
}
-
- //check each event to see if they are in the visible section
- for(TimeEvent event : events.values()) {
- if(isEventInVisibleSection(event)) {
+
+ // check each event to see if they are in the visible section
+ for (TimeEvent event : events.values()) {
+ if (isEventInVisibleSection(event)) {
return true;
}
}
return false;
}
- public void setCurrentDate(long currentDate) {
- this.currentDate = currentDate;
-
- //if we're changing the date, then everything on the band is going to be wrong, so
- //get rid of it...
-
- }
-
- /**
- * @return the currentDateX
- */
- public long getCurrentDateX() {
- return currentDateX;
- }
-
- /**
- * @param currentDateX
- * the currentDateX to set
- */
- public void setCurrentDateX(long currentDateX) {
- this.currentDateX = currentDateX;
- }
-
- /**
- * @return the currentDate
- */
- public long getCurrentDate() {
- return currentDate;
- }
-
-// /**
-// * @return the height
-// */
-// public int getHeight() {
-// return height;
-// }
-
-// /**
-// * @param height
-// * the height to set
-// */
-// public void setHeight(int height) {
-// this.height = height;
-// }
-
public void captureScrollLeft(MouseDownEvent e) {
this.mouseDownScrollLeft = timebandContainer.getScrollLeft();
}
@@ -518,166 +446,365 @@
}
/**
- * @return the deletionsDisabled
+ * This method is used to tell the Timeband that it now has all events
+ * within the section: (x1,x2). We can then use this to ensure subsequent
+ * requests don't request the same thing from the server, hence reducing
+ * load between the server and the client and also reducing the load on the
+ * server
+ *
+ * @param minDateRequested
+ * the minimum date that was requested and retrieved from the
+ * back-end
+ * @param maxDate2
+ * the maximum date that was requested and retrieved from the
+ * back-end
*/
- public boolean isDeletionsDisabled() {
- return deletionsDisabled;
- }
-
- /**
- * @param deletionsDisabled the deletionsDisabled to set
- */
- public void setDeletionsDisabled(boolean deletionsDisabled) {
- this.deletionsDisabled = deletionsDisabled;
- }
-
- /**
- * This method is used to tell the Timeband that it now has all events within the section:
- * (x1,x2). We can then use this to ensure subsequent requests don't request the same thing
- * from the server, hence reducing load between the server and the client
- * and also reducing the load on the server
- * @param minDateRequested the minimum date that was requested and retrieved from the back-end
- * @param maxDate2 the maximum date that was requested and retrieved from the back-end
- */
public void adjustRequestedView(long minDateRequested, long maxDateRequested) {
- if(requestWindow == null) {
+ if (requestWindow == null) {
requestWindow = new TimebandRequestWindow(minDateRequested, maxDateRequested);
} else {
requestWindow.adjustRange(minDateRequested, maxDateRequested);
}
}
+ /**
+ * Works out how much of the timeband is to be requested Ideally we should
+ * TODO: this somewhere else.
+ *
+ * @return the visible section of the timeband
+ * @throws IncapableOfCalculatingRequestWindowException
+ * thrown if we are not in a position to calculate what the
+ * remaining section is.
+ */
public TimeBandVisibleDate getOustandingTimebandPeriod() throws IncapableOfCalculatingRequestWindowException {
long minVisibleDate = getMinVisibleDate();
long maxVisibleDate = getMaxVisibleDate();
long minimumDifference = (long) (unit.getMilliseconds() * outstandingUnitFactor);
-
- //the new requested bit depends on our request window
- if(requestWindow == null) {
+
+ // the new requested bit depends on our request window
+ if (requestWindow == null) {
return new TimeBandVisibleDate(id, minVisibleDate, maxVisibleDate);
} else {
- //return only the portion that has changed (probably only one pixel worth)! TODO later: ensure
- //we send requests when they are actually worth sending
+ // return only the portion that has changed (probably only one pixel
+ // worth)! TODO later: ensure
+ // we send requests when they are actually worth sending
// -------|--------$------|-----$--------------------
- // mvd mrd Mvd Mrd
+ // mvd mrd Mvd Mrd
long minReceivedDate = requestWindow.getMinDate();
long maxReceivedDate = requestWindow.getMaxDate();
boolean shiftedLeft = minVisibleDate < minReceivedDate;
boolean shiftedRight = maxVisibleDate > maxReceivedDate;
-
- if(!shiftedLeft && !shiftedRight) {
+
+ if (!shiftedLeft && !shiftedRight) {
return TimeBandVisibleDate.getNoRequest();
- } else if(shiftedLeft && shiftedRight) {
- //in this case, it was probably a zoom, and so we need to request both parts
+ } else if (shiftedLeft && shiftedRight) {
+ // in this case, it was probably a zoom, and so we need to
+ // request both parts
return new TimeBandVisibleDate(id, minVisibleDate, maxVisibleDate);
- } else if(shiftedLeft) {
- //window could potentially have jumped, so there may be a gap between maxVisibleDate and min, so take
- //check for gap first, and then decide
- //TODO: check here
- if(maxVisibleDate < minReceivedDate) {
- //we have issues here, as we're either going to have to remember about all the already painted stuff
- //or we're going to have to clear down the band first.
- //TODO: at the moment we reset, but ideally, remember what's been painted or clear down band.
+ } else if (shiftedLeft) {
+ // window could potentially have jumped, so there may be a gap
+ // between maxVisibleDate and min, so take
+ // check for gap first, and then decide
+ // TODO: check here
+ if (maxVisibleDate < minReceivedDate) {
+ // we have issues here, as we're either going to have to
+ // remember about all the already painted stuff
+ // or we're going to have to clear down the band first.
+ // TODO: at the moment we reset, but ideally, remember
+ // what's been painted or clear down band.
requestWindow = null;
return new TimeBandVisibleDate(id, minVisibleDate, maxVisibleDate);
} else {
- //the max is greater than the minimum so we return
- if(minReceivedDate - minVisibleDate > minimumDifference) {
+ // the max is greater than the minimum so we return
+ if (minReceivedDate - minVisibleDate > minimumDifference) {
return new TimeBandVisibleDate(id, minVisibleDate, minReceivedDate);
} else {
return TimeBandVisibleDate.getNoRequest();
}
}
- } else if(shiftedRight) {
- //same problem as above if
- if(minVisibleDate > maxReceivedDate) {
+ } else if (shiftedRight) {
+ // same problem as above if
+ if (minVisibleDate > maxReceivedDate) {
requestWindow = null;
return new TimeBandVisibleDate(id, minVisibleDate, maxVisibleDate);
} else {
- //in particular check that the gap between maxReceivedDate and maxVisibleDate is enough
- if(maxVisibleDate - maxReceivedDate > minimumDifference) {
+ // in particular check that the gap between maxReceivedDate
+ // and maxVisibleDate is enough
+ if (maxVisibleDate - maxReceivedDate > minimumDifference) {
return new TimeBandVisibleDate(id, maxReceivedDate, maxVisibleDate);
} else {
return TimeBandVisibleDate.getNoRequest();
}
}
} else {
- //TODO: add the proper debug information to the exception
+ // TODO: add the proper debug information to the exception
throw new IncapableOfCalculatingRequestWindowException("Unable to calculate request window. It was shifted neither left, nor right");
- }
- }
+ }
+ }
}
/**
- * @param outstandingUnitFactor the outstandingUnitFactor to set
+ * The way zooming works is that we recalculate the positions of all events
+ * on the timeline
*/
- public void setOutstandingUnitFactor(double outstandingUnitFactor) {
- this.outstandingUnitFactor = outstandingUnitFactor;
+ public void zoomOut() {
+ // first change the zoom factor, then repaint events, and the timescale
+ // lets just assume a default zoom factor for now
+ // TODO: zoom in factor to be parameterised
+ zoom(1 - zoomFactor);
+
}
/**
- * @return the outstandingUnitFactor
+ * Zooms in
*/
- public double getOutstandingUnitFactor() {
- return outstandingUnitFactor;
+ public void zoomIn() {
+ zoom(1 + zoomFactor);
}
- public boolean isRendered() {
- return isRendered;
+ /**
+ * Zooms out given a ratio
+ *
+ * @param zoomRatio
+ * the given ratio to zoom in and out
+ */
+ private void zoom(double zoomRatio) {
+ // TODO: somehow start with those events in the window (although for
+ // zoomout, won't make a different
+ // first change the scale
+ pixelsPerUnit *= zoomRatio;
+ adjustUnit();
+ redrawBand();
}
/**
- * The way zooming works is that we recalculate the positions of all events on the timeline
+ * Gets the band to scroll to the current date
*/
- public void zoomOut() {
- //first change the zoom factor, then repaint events, and the timescale
- //lets just assume a default zoom factor for now
- //TODO: zoom in factor to be parameterised
- zoom(1 - zoomFactor);
-
+ public void scrollToCurrentDate() {
+ new El(timebandContainer).setScrollLeft((int) currentDateX);
+ // Log.debug("Scroll left is " + timebandContainer.getScrollLeft());
+ // Log.debug("Scroll left is " + new
+ // El(timebandContainer).getScrollLeft());
}
/**
- *
+ * Resets the timeband and redraws it
*/
- public void zoomIn() {
- zoom(1 + zoomFactor);
+ public void redrawEmptyBand() {
+ events.clear();
+ redrawBand();
}
-
- private void zoom(double zoomRatio) {
- //TODO: somehow start with those events in the window (although for zoomout, won't make a different
- //first change the scale
-
- //TODO: something clever with the unit? for eg. take the ratio with current unit, and see if ratio would
- //be similar with another unit?
- //for now however, let's do it simply
- pixelsPerUnit *= zoomRatio;
-
- //do a sensible check...
- adjustUnit();
-
- repaint();
- }
+ /**
+ * Does not delete the events but redraws everything else.
+ */
+ public void redrawBand() {
+ tapeTracks.clear();
-
-
- private void repaint() {
- //TODO: the timescale should technically be in charge of the unit
- //logically speaking, let's start with the timescale
+ // use El to remove all children
+ new El(bandDiv).removeChildren();
+ resetAllEvents();
+
timescale.repaint();
-
- for(TimeEvent te : events.values()) {
- te.repaint();
- }
+
+ requestWindow = null;
+
+ drawEvents();
}
/**
- * TODO: The idea is to adjust depending on how many pixels constitutes a unit
- * so that we can easily zoom in and out and have the units repainted properly
+ * Resets the rendered status on all events
*/
+ private void resetAllEvents() {
+ for (TimeEvent te : events.values()) {
+ te.reset();
+ }
+ }
+
+ /**
+ * @return the showScale
+ */
+ public boolean isShowScale() {
+ return showScale;
+ }
+
+ /**
+ * @param showScale
+ * the showScale to set
+ */
+ public void setShowScale(boolean showScale) {
+ this.showScale = showScale;
+ }
+
+ /**
+ * @return the bandDiv
+ */
+ public Element getBandDiv() {
+ return bandDiv;
+ }
+
+ /**
+ * @param bandDiv
+ * the bandDiv to set
+ */
+ public void setBandDiv(Element bandDiv) {
+ this.bandDiv = bandDiv;
+ }
+
+ /**
+ * @return the pixelsPerUnit
+ */
+ public int getPixelsPerUnit() {
+ return pixelsPerUnit;
+ }
+
+ /**
+ * @param pixelsPerUnit
+ * the pixelsPerUnit to set
+ */
+ public void setPixelsPerUnit(int pixelsPerUnit) {
+ this.pixelsPerUnit = pixelsPerUnit;
+ }
+
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+
+ /**
+ * @param id
+ * the id to set
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the minDate
+ */
+ public long getMinDate() {
+ return minDate;
+ }
+
+ /**
+ * @param minDate
+ * the minDate to set
+ */
+ public void setMinDate(long minDate) {
+ this.minDate = minDate;
+ }
+
+ /**
+ * @return the maxDate
+ */
+ public long getMaxDate() {
+ return maxDate;
+ }
+
+ /**
+ * @return the unit
+ */
+ public Unit getUnit() {
+ return unit;
+ }
+
+ /**
+ * @param unit
+ * the unit to set
+ */
+ public void setUnit(Unit unit) {
+ this.unit = unit;
+ }
+
+ /**
+ * @param maxDate
+ * the maxDate to set
+ */
+ public void setMaxDate(long maxDate) {
+ this.maxDate = maxDate;
+ }
+
+ /**
+ * @return the events
+ */
+ public TreeMap<Integer, TimeEvent> getEvents() {
+ return events;
+ }
+
+ public void setCurrentDate(long currentDate) {
+ this.currentDate = currentDate;
+
+ // if we're changing the date, then everything on the band is going to
+ // be wrong, so
+ // get rid of it...
+
+ }
+
+ /**
+ * @return the currentDateX
+ */
+ public long getCurrentDateX() {
+ return currentDateX;
+ }
+
+ /**
+ * @param currentDateX
+ * the currentDateX to set
+ */
+ public void setCurrentDateX(long currentDateX) {
+ this.currentDateX = currentDateX;
+ }
+
+ /**
+ * @return the currentDate
+ */
+ public long getCurrentDate() {
+ return currentDate;
+ }
+
+ /**
+ * @return the deletionsDisabled
+ */
+ public boolean isDeletionsDisabled() {
+ return deletionsDisabled;
+ }
+
+ /**
+ * @param deletionsDisabled
+ * the deletionsDisabled to set
+ */
+ public void setDeletionsDisabled(boolean deletionsDisabled) {
+ this.deletionsDisabled = deletionsDisabled;
+ }
+
+ /**
+ * @param outstandingUnitFactor
+ * the outstandingUnitFactor to set
+ */
+ public void setOutstandingUnitFactor(double outstandingUnitFactor) {
+ this.outstandingUnitFactor = outstandingUnitFactor;
+ }
+
+ /**
+ * @return the outstandingUnitFactor
+ */
+ public double getOutstandingUnitFactor() {
+ return outstandingUnitFactor;
+ }
+
+ public boolean isRendered() {
+ return isRendered;
+ }
+
+ /**
+ * TODO: The idea is to adjust depending on how many pixels constitutes a
+ * unit so that we can easily zoom in and out and have the units repainted
+ * properly
+ */
private void adjustUnit() {
-
+
}
/**
@@ -695,41 +822,21 @@
}
/**
- * @param description the description to set
+ * @param description
+ * the description to set
*/
public void setDescription(String description) {
this.description = description;
}
/**
- * @param zoomFactor the zoomFactor to set
+ * @param zoomFactor
+ * the zoomFactor to set
*/
public void setZoomFactor(double zoomFactor) {
this.zoomFactor = zoomFactor;
}
- //not sure if this should be part of setCurrentDate
- public void scrollToCurrentDate() {
- //TODO: fix this here...
- new El(timebandContainer).setScrollLeft((int) currentDateX);
- Log.debug("Scroll left is " + timebandContainer.getScrollLeft());
- Log.debug("Scroll left is " + new El(timebandContainer).getScrollLeft());
-
- }
-
- public void redrawEmptyBand() {
- events.clear();
- tapeTracks.clear();
-
- //use El to remove all children
- new El(bandDiv).removeChildren();
-
- //bandDiv = DOM.createDiv();
- requestWindow = null;
-
- timescale.paint();
- }
-
public int getSizeTapeTracks() {
return tapeTracks.size();
}
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeBandNotFoundException.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeBandNotFoundException.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeBandNotFoundException.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,14 +0,0 @@
-package com.tyndalehouse.step.web.client.toolkit.timeline;
-
-public class TimeBandNotFoundException extends Exception {
-
- public TimeBandNotFoundException(final String message) {
- super(message);
- }
-
- /**
- *
- */
- private static final long serialVersionUID = 6234571991235670035L;
-
-}
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeConversionUtil.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeConversionUtil.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeConversionUtil.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,71 +0,0 @@
-package com.tyndalehouse.step.web.client.toolkit.timeline;
-
-import java.util.Date;
-
-import com.google.gwt.i18n.client.DateTimeFormat;
-
-public class TimeConversionUtil {
- //TODO: make these parameterizable?
- private final static DateTimeFormat year = DateTimeFormat.getFormat("yyyy G");
- private final static DateTimeFormat month = DateTimeFormat.getFormat("MMM yyyy G");
- private final static DateTimeFormat day = DateTimeFormat.getFormat("dd/MM/yyyy G");
-
- /**
- * This takes a pixel position and returns the equivalent time
- * @param pixelPosition the pixel position that we are trying to convert
- * @param currentDateX the pixel position of the origin
- * @param currentDate the time that the origin is set to
- * @param unit the size of a unit
- * @param pixelsPerUnit the number of pixels per unit
- * @return the time of pixelPosition
- */
- public static long pixelToTime(long pixelPosition, TimeBand timeband) {
- long currentDateX = timeband.getCurrentDateX();
- long currentDate = timeband.getCurrentDate();
- Unit unit = timeband.getUnit();
- long pixelsPerUnit = timeband.getPixelsPerUnit();
-
-
- long differenceWithOrigin = pixelPosition - currentDateX;
- long date = currentDate + (differenceWithOrigin * unit.getMilliseconds() / pixelsPerUnit);
- return date;
- }
-
- /**
- * A date is always calculated within a time band.
- * @param eventDate the date to be converted
- * @param timeband
- * @return
- */
- public static int timeToPixel(final long eventDate, TimeBand currentTimeband) {
- // here's what we start from
- long millisecondPerUnit = currentTimeband.getUnit().getMilliseconds();
- long pixelsPerUnit = currentTimeband.getPixelsPerUnit();
- long currentOriginDate = currentTimeband.getCurrentDate();
- long currentOriginXPixel = currentTimeband.getCurrentDateX();
-
- // what's one pixel in milliseconds?
- double onePixelInMs = (double) millisecondPerUnit / pixelsPerUnit;
-
- // calculate difference with current position on timeband
- long differenceWithEvent = eventDate - currentOriginDate;
- long pixelValueOnBand = currentOriginXPixel + (long) (differenceWithEvent / onePixelInMs);
- return (int) pixelValueOnBand;
- }
-
- public static String formatPixelToTime(final long pixelPosition, TimeBand timeband) {
- return formatTime(pixelToTime(pixelPosition, timeband));
- }
-
- /**
- * formats the given time for the moment as yyyy G
- * @param eventDate date to be formatted
- * @return the string representation of the date
- */
- public static String formatTime(final long eventDate) {
- //TODO: change for multiple formats when need be
- //use the year one for now
- Date date = new Date(eventDate);
- return year.format(date);
- }
-}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeEvent.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeEvent.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeEvent.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,10 +1,11 @@
package com.tyndalehouse.step.web.client.toolkit.timeline;
-import com.allen_sauer.gwt.log.client.Log;
import com.extjs.gxt.ui.client.core.El;
import com.extjs.gxt.ui.client.util.TextMetrics;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
+import com.tyndalehouse.step.web.client.toolkit.timeline.components.TimelineConstants;
+import com.tyndalehouse.step.web.client.toolkit.timeline.helpers.TimeConversionUtil;
public class TimeEvent {
@@ -55,17 +56,28 @@
private boolean isRendered = false;
+ /**
+ * @return the isRendered
+ */
+ public boolean isRendered() {
+ return isRendered;
+ }
+
public TimeEvent(final int id, final String description, final Long minDate, final Long maxDate, final TimeBand tb) {
this.id = id;
this.description = description;
this.minDate = minDate;
this.maxDate = maxDate;
this.currentTimeband = tb;
- this.leftPixelPosition = (int) TimeConversionUtil.timeToPixel(minDate.longValue(), currentTimeband);
- eventDiv = DOM.createDiv();
- icon = DOM.createDiv();
- label = DOM.createDiv();
+
+ setupEventSpecificOptions();
+ }
+ /**
+ * Sets up properties and fields that depend on the type of event
+ */
+ private void setupEventSpecificOptions() {
+ this.leftPixelPosition = (int) TimeConversionUtil.timeToPixel(minDate.longValue(), currentTimeband);
if (maxDate == null) {
// then it's a point in time
eventType = TimelineConstants.POINT_IN_TIME_EVENT;
@@ -75,11 +87,15 @@
durationWidth = Math.max(TimelineConstants.EVENT_MIN_WIDTH,
TimeConversionUtil.timeToPixel(maxDate.longValue(), currentTimeband) - leftPixelPosition);
}
-
- setupDivProperties();
}
-
+
+ /**
+ * Creates all the elements/styles/etc.
+ */
private void setupDivProperties() {
+ eventDiv = DOM.createDiv();
+ icon = DOM.createDiv();
+ label = DOM.createDiv();
El gxtEvent = new El(eventDiv);
El gxtLabel = new El(label);
@@ -136,21 +152,6 @@
}
/**
- * This method removes an event from the current timeband
- * and moves in onto a different timeband. This will be useful
- * when time bands become invisible, or we are not interested
- * in most of the timeband, and we want to use the "importance"
- * field
- * @param newTimeBand the timeband to be moved to
- * @throws CannotDeleteEventException An event can't be moved from one timeband to another if deletions are disallowed
- */
- public synchronized void moveTimeBand(TimeBand newTimeBand) throws CannotDeleteEventException {
- currentTimeband.removeEvent(this.getId());
- currentTimeband = newTimeBand;
- currentTimeband.addEvent(this);
- }
-
- /**
* @return the minDate
*/
public long getMinDate() {
@@ -246,6 +247,7 @@
public synchronized void paint(TapeTrack track) {
//all we do is attach it to the parent if need be.
if (!isRendered) {
+ setupDivProperties();
track.getTrack().appendChild(eventDiv);
isRendered = true;
}
@@ -283,19 +285,6 @@
}
/**
- * Again we could do something clever here, but for now,
- * let's just remove the event and paint it on again.
- * @param zoomRatio
- */
- public void repaint() {
- eventDiv.getParentNode().removeChild(eventDiv);
-
- //may want to paint on a different tape track
- //this is a bit of a strange way of doing this!
- currentTimeband.addEventToTapeTrack(this);
- }
-
- /**
* @return the leftPixelPosition
*/
public int getLeftPixelPosition() {
@@ -315,4 +304,11 @@
public int getTotalWidth() {
return totalWidth;
}
+
+ public void reset() {
+ isRendered = false;
+
+ //also recalculate the times and dates of the events (perhaps this is not always necessary)
+ setupEventSpecificOptions(); // a few extra bits in there, but nothing that takes time
+ }
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeScale.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeScale.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeScale.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -2,10 +2,11 @@
import java.util.HashMap;
-import com.allen_sauer.gwt.log.client.Log;
import com.extjs.gxt.ui.client.core.El;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
+import com.tyndalehouse.step.web.client.toolkit.timeline.components.Unit;
+import com.tyndalehouse.step.web.client.toolkit.timeline.helpers.TimeConversionUtil;
public class TimeScale {
private boolean isRendered = false;
@@ -70,7 +71,7 @@
El gxtScaleBand = new El(scaleBand);
int pixelsPerUnit = band.getPixelsPerUnit();
int relativeLeft = (int) firstVisibleSegmentPixel;
- Log.debug("Drawing segments");
+ //Log.debug("Drawing segments");
for (long ii = 0; ii < numberOfVisibleSegments+1; ii++) {
//check segment not already drawn...
Integer key = new Integer(relativeLeft);
@@ -105,39 +106,19 @@
}
}
+
+
+ public void reset() {
+ isRendered = false;
+ }
+
/**
* The easy way is to get rid of everything and repaint
* The slightly more clever way is to actually repaint the existing dom elements. It uses more memory though, however, we can try both eventually if need be.
*/
public void repaint() {
//remove oneself first
- band.getBandDiv().removeChild(scaleBand);
- isRendered = false;
+ reset();
paint();
-
- //temporary store for all the new keys. we can't remove
- //while iterating, nor do we want to replace existing keys
-// HashMap<Integer, Integer> oldToNewKeyMap = new HashMap<Integer, Integer>();
-//
-// for(Element tsu : paintedTimescaleBands.values()) {
-// El element = new El(tsu);
-// int previousLeft = element.getLeft();
-// int newLeft = (int) (previousLeft * zoomRatio);
-// element.setLeft(newLeft);
-// element.setWidth(band.getPixelsPerUnit());
-//
-// //add to the old to new key map
-// oldToNewKeyMap.put(new Integer(previousLeft), new Integer(newLeft));
-// }
-//
-// //make a copy of the old HashMap
-// HashMap<Integer, Element> copyOfPaintedTimescaleBands = new HashMap<Integer, Element>();
-// copyOfPaintedTimescaleBands.putAll(copyOfPaintedTimescaleBands);
-//
-// //clear and repopulate with new keys
-// paintedTimescaleBands.clear();
-// for(Integer k : oldToNewKeyMap.keySet()) {
-// paintedTimescaleBands.put(oldToNewKeyMap.get(k), copyOfPaintedTimescaleBands.get(k));
-// }
}
}
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimebandRequestWindow.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimebandRequestWindow.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimebandRequestWindow.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,69 +0,0 @@
-package com.tyndalehouse.step.web.client.toolkit.timeline;
-
-import com.allen_sauer.gwt.log.client.Log;
-
-/**
- * This window identifies what is already displayed on the timeline
- * Perhaps later we send this back to the server, and let the server work out
- * which bits and pieces each timebands are interested in.
- * So still send the full view coordinates, but send that as well.
- * @author CJBurrell
- *
- */
-public class TimebandRequestWindow {
- private long minDate;
- private long maxDate;
-
- public TimebandRequestWindow(final long initialMin, final long initialMax) {
- minDate = initialMin;
- maxDate = initialMax;
- }
-
- /**
- * Enlarges the minimum window on the left hand-side
- * @param minDateRequested the new minDate that the band has received
- */
- public void adjustRange(long minDateRequested, long maxDateRequested) {
- //Log.debug("Adjusting minimum of received/requested window");
-
- //adjust minimum: as long as the minimum is before, but the max within range, we're fine to adjust
- // --------------------<-------$-----<-------$------------------
- // mdr md Mdr MD
- if(minDateRequested < minDate && maxDateRequested >= minDate) {
- minDate = minDateRequested;
- }
-
- //do the same for the maximum:
- if(maxDateRequested > maxDate && minDateRequested <= maxDate) {
- maxDate = maxDateRequested;
- }
- }
-
- /**
- * @return the minDate
- */
- public long getMinDate() {
- return minDate;
- }
-
- /**
- * @param minDate the minDate to set
- */
- public void setMinDate(long minDate) {
- this.minDate = minDate;
- }
-
- /**
- * @return the maxDate
- */
- public long getMaxDate() {
- return maxDate;
- }
-
- /**
- * @param maxDate the maxDate to set
- */
- public void setMaxDate(long maxDate) {
- this.maxDate = maxDate;
- }
-}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Timeline.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Timeline.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Timeline.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -14,9 +14,13 @@
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Widget;
+import com.tyndalehouse.step.web.client.event.TimelineScrollEvent;
+import com.tyndalehouse.step.web.client.toolkit.timeline.components.TimelineConstants;
+import com.tyndalehouse.step.web.client.toolkit.timeline.components.Unit;
import com.tyndalehouse.step.web.client.toolkit.timeline.events.TimelineMouseHandler;
+import com.tyndalehouse.step.web.client.toolkit.timeline.exceptions.IncapableOfCalculatingRequestWindowException;
+import com.tyndalehouse.step.web.client.toolkit.timeline.exceptions.TimeBandNotFoundException;
import com.tyndalehouse.step.web.shared.beans.TimeBandVisibleDate;
-import com.tyndalehouse.step.web.shared.event.TimelineScrollEvent;
/**
* div .step-timeline (step-grab step-letgo) | | - div .step-timeline-container
@@ -93,12 +97,6 @@
for (TimeBand tb : timebands) {
tb.setScrollLeft(clientX, e.getClientX(), defaultUnit, defaultPixelsPerUnit);
//Log.debug("About to scroll: " + (clientX - e.getClientX()));
-
- // TODO: decide whether we want to filter out some events here
- // already
- // to avoid having events flying all over the place...
- // build the event here scrolling...
- // TODO: use units here instead?
}
// fire the event and let presenter decide how much of the event
@@ -179,9 +177,7 @@
int relativeTop = 0;
for (TimeBand tb : timebands) {
- tb.paint(relativeTop);
-
- //TODO: see if we really need to specify this, but for now get from number of timetracks
+ tb.paint();
relativeTop += tb.getSizeTapeTracks() * TimelineConstants.TAPE_TRACK_HEIGHT;
}
@@ -189,8 +185,6 @@
// timeline
new El(timelineDiv).setHeight(relativeTop);
isRendered = true;
-
- //finally scroll to the correct location
}
}
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimelineConstants.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimelineConstants.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimelineConstants.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,21 +0,0 @@
-package com.tyndalehouse.step.web.client.toolkit.timeline;
-
-public class TimelineConstants {
-
- /**
- * there refer to CSS styles.
- */
- public static final String EVENT = "step-time-event";
- public static final String POINT_IN_TIME_EVENT = "step-timeline-pointInTime";
- public static final String DURATION = "step-timeline-duration";
- public static final String DURATION_LABEL = "step-time-duration-label";
- public static final String POINT_IN_TIME_LABEL = "step-time-point-in-time-label";
-
- /**
- * space between the icon and the text
- */
- public static final int POINT_IN_TIME_WIDTH_SPACE = 15;
- public static final int TAPE_TRACK_HEIGHT = 20 + 2;
- public static final int EVENT_MIN_WIDTH = 2;
-
-}
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Unit.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Unit.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Unit.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,27 +0,0 @@
-package com.tyndalehouse.step.web.client.toolkit.timeline;
-
-public enum Unit {
- SECOND(1000L),
- MINUTE(60L * 1000L),
- HOUR(3600L * 1000L),
- DAY(24L * 3600L * 1000L),
- MONTH((365L * 24 * 3600 * 1000L)/12),
- YEAR(365L * 24 * 3600 * 1000L),
- DECADE(10L * 365L * 24 * 3600 * 1000L),
- CENTURY(10L * 10L * 365L * 24 * 3600 * 1000L),
- MILENIUM(10L * 10L * 10L * 365L * 24 * 3600 * 1000L);
-
- private final long milliseconds;
-
- Unit(long milliseconds) {
- this.milliseconds = milliseconds;
- }
-
- /**
- * @return the valueInMilliseconds
- */
- public long getMilliseconds() {
- return milliseconds;
- }
-
-}
Copied: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/Orientation.java (from rev 50, trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Orientation.java)
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/Orientation.java (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/Orientation.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -0,0 +1,21 @@
+package com.tyndalehouse.step.web.client.toolkit.timeline.components;
+
+/**
+ * This determines whether to render the timeband horizontally
+ * or vertically.
+ * At the moment only HORIZONTAL is supported.
+ * @author CJBurrell
+ *
+ */
+public enum Orientation {
+ /**
+ * Render the timeband horizontally
+ */
+ HORIZONTAL,
+
+ /**
+ * Render the timeband vertically
+ */
+ VERTICAL,
+
+}
Property changes on: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/Orientation.java
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/TimebandRequestWindow.java (from rev 50, trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimebandRequestWindow.java)
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/TimebandRequestWindow.java (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/TimebandRequestWindow.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -0,0 +1,68 @@
+package com.tyndalehouse.step.web.client.toolkit.timeline.components;
+
+
+/**
+ * This window identifies what is already displayed on the timeline
+ * Perhaps later we send this back to the server, and let the server work out
+ * which bits and pieces each timebands are interested in.
+ * So still send the full view coordinates, but send that as well.
+ * @author CJBurrell
+ *
+ */
+public class TimebandRequestWindow {
+ private long minDate;
+ private long maxDate;
+
+ public TimebandRequestWindow(final long initialMin, final long initialMax) {
+ minDate = initialMin;
+ maxDate = initialMax;
+ }
+
+ /**
+ * Enlarges the minimum window on the left hand-side
+ * @param minDateRequested the new minDate that the band has received
+ */
+ public void adjustRange(long minDateRequested, long maxDateRequested) {
+ //Log.debug("Adjusting minimum of received/requested window");
+
+ //adjust minimum: as long as the minimum is before, but the max within range, we're fine to adjust
+ // --------------------<-------$-----<-------$------------------
+ // mdr md Mdr MD
+ if(minDateRequested < minDate && maxDateRequested >= minDate) {
+ minDate = minDateRequested;
+ }
+
+ //do the same for the maximum:
+ if(maxDateRequested > maxDate && minDateRequested <= maxDate) {
+ maxDate = maxDateRequested;
+ }
+ }
+
+ /**
+ * @return the minDate
+ */
+ public long getMinDate() {
+ return minDate;
+ }
+
+ /**
+ * @param minDate the minDate to set
+ */
+ public void setMinDate(long minDate) {
+ this.minDate = minDate;
+ }
+
+ /**
+ * @return the maxDate
+ */
+ public long getMaxDate() {
+ return maxDate;
+ }
+
+ /**
+ * @param maxDate the maxDate to set
+ */
+ public void setMaxDate(long maxDate) {
+ this.maxDate = maxDate;
+ }
+}
Property changes on: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/TimebandRequestWindow.java
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/TimelineConstants.java (from rev 50, trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimelineConstants.java)
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/TimelineConstants.java (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/TimelineConstants.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -0,0 +1,21 @@
+package com.tyndalehouse.step.web.client.toolkit.timeline.components;
+
+public class TimelineConstants {
+
+ /**
+ * there refer to CSS styles.
+ */
+ public static final String EVENT = "step-time-event";
+ public static final String POINT_IN_TIME_EVENT = "step-timeline-pointInTime";
+ public static final String DURATION = "step-timeline-duration";
+ public static final String DURATION_LABEL = "step-time-duration-label";
+ public static final String POINT_IN_TIME_LABEL = "step-time-point-in-time-label";
+
+ /**
+ * space between the icon and the text
+ */
+ public static final int POINT_IN_TIME_WIDTH_SPACE = 15;
+ public static final int TAPE_TRACK_HEIGHT = 20 + 1;
+ public static final int EVENT_MIN_WIDTH = 2;
+
+}
Property changes on: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/TimelineConstants.java
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/Unit.java (from rev 50, trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/Unit.java)
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/Unit.java (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/Unit.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -0,0 +1,42 @@
+package com.tyndalehouse.step.web.client.toolkit.timeline.components;
+
+import com.google.gwt.i18n.client.DateTimeFormat;
+
+public enum Unit {
+ SECOND(1000L),
+ MINUTE(60L * 1000L),
+ HOUR(3600L * 1000L),
+ DAY(24L * 3600L * 1000L, "dd MMM yyyy G"),
+ MONTH((365L * 24 * 3600 * 1000L)/12, "MMM yyyy G"),
+ YEAR(365L * 24 * 3600 * 1000L, "yyyy G"),
+ DECADE(10L * 365L * 24 * 3600 * 1000L, "yyyy G"),
+ CENTURY(10L * 10L * 365L * 24 * 3600 * 1000L, "yyyy G"),
+ MILENIUM(10L * 10L * 10L * 365L * 24 * 3600 * 1000L, "yyyy G");
+
+ private final long milliseconds;
+ private final DateTimeFormat format;
+
+ /**
+ * @return the format
+ */
+ public DateTimeFormat getFormat() {
+ return format;
+ }
+
+ Unit(long milliseconds) {
+ this(milliseconds, "dd MMM YYYY G");
+ }
+
+ Unit(long milliseconds, String format) {
+ this.format = DateTimeFormat.getFormat(format);
+ this.milliseconds = milliseconds;
+ }
+
+ /**
+ * @return the valueInMilliseconds
+ */
+ public long getMilliseconds() {
+ return milliseconds;
+ }
+
+}
Property changes on: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/components/Unit.java
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/CannotDeleteEventException.java (from rev 50, trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/CannotDeleteEventException.java)
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/CannotDeleteEventException.java (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/CannotDeleteEventException.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -0,0 +1,25 @@
+package com.tyndalehouse.step.web.client.toolkit.timeline.exceptions;
+
+/**
+ * The request to delete an event has failed. The message should explain
+ * why this has happened.
+ * @author CJBurrell
+ *
+ */
+public class CannotDeleteEventException extends Exception {
+
+ /**
+ * The default constructor with the explanatory message
+ * @param message The message for the exception
+ */
+ public CannotDeleteEventException(final String message) {
+ super(message);
+ }
+
+ /**
+ * Serialisation id
+ */
+ private static final long serialVersionUID = -9221252482310063155L;
+
+
+}
Property changes on: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/CannotDeleteEventException.java
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/IncapableOfCalculatingRequestWindowException.java (from rev 50, trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/IncapableOfCalculatingRequestWindowException.java)
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/IncapableOfCalculatingRequestWindowException.java (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/IncapableOfCalculatingRequestWindowException.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -0,0 +1,25 @@
+package com.tyndalehouse.step.web.client.toolkit.timeline.exceptions;
+
+/**
+ * The request window is the window of pixels (start/end) that gets send to the
+ * server indicating the client wants to get events that are in that time section
+ * There are certain situations where it is impossible to calculate
+ * how the user has moved, for example when the browser moves so quickly
+ * that the whole screen shifts 1 screen-wide of pixels
+ * @author CJBurrell
+ */
+public class IncapableOfCalculatingRequestWindowException extends Exception {
+
+ /**
+ * serial id
+ */
+ private static final long serialVersionUID = 1866493907904681758L;
+
+ /**
+ * Default message constructor
+ * @param message message to explain why this is not possible
+ */
+ public IncapableOfCalculatingRequestWindowException(final String message) {
+ super(message);
+ }
+}
Property changes on: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/IncapableOfCalculatingRequestWindowException.java
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/TimeBandNotFoundException.java (from rev 50, trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeBandNotFoundException.java)
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/TimeBandNotFoundException.java (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/TimeBandNotFoundException.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -0,0 +1,23 @@
+package com.tyndalehouse.step.web.client.toolkit.timeline.exceptions;
+
+/**
+ * While trying to lookup the timeband, it was not found
+ * @author CJBurrell
+ *
+ */
+public class TimeBandNotFoundException extends Exception {
+
+ /**
+ * Constructor specifying the error message
+ * @param message
+ */
+ public TimeBandNotFoundException(final String message) {
+ super(message);
+ }
+
+ /**
+ * serial id
+ */
+ private static final long serialVersionUID = 6234571991235670035L;
+
+}
Property changes on: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/exceptions/TimeBandNotFoundException.java
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/helpers/TimeConversionUtil.java (from rev 50, trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/TimeConversionUtil.java)
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/helpers/TimeConversionUtil.java (rev 0)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/helpers/TimeConversionUtil.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -0,0 +1,71 @@
+package com.tyndalehouse.step.web.client.toolkit.timeline.helpers;
+
+import java.util.Date;
+
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.tyndalehouse.step.web.client.toolkit.timeline.TimeBand;
+import com.tyndalehouse.step.web.client.toolkit.timeline.components.Unit;
+
+public class TimeConversionUtil {
+ //TODO: make these parameterizable?
+ private final static DateTimeFormat year = DateTimeFormat.getFormat("yyyy G");
+
+ /**
+ * This takes a pixel position and returns the equivalent time
+ * @param pixelPosition the pixel position that we are trying to convert
+ * @param currentDateX the pixel position of the origin
+ * @param currentDate the time that the origin is set to
+ * @param unit the size of a unit
+ * @param pixelsPerUnit the number of pixels per unit
+ * @return the time of pixelPosition
+ */
+ public static long pixelToTime(long pixelPosition, TimeBand timeband) {
+ long currentDateX = timeband.getCurrentDateX();
+ long currentDate = timeband.getCurrentDate();
+ Unit unit = timeband.getUnit();
+ long pixelsPerUnit = timeband.getPixelsPerUnit();
+
+
+ long differenceWithOrigin = pixelPosition - currentDateX;
+ long date = currentDate + (differenceWithOrigin * unit.getMilliseconds() / pixelsPerUnit);
+ return date;
+ }
+
+ /**
+ * A date is always calculated within a time band.
+ * @param eventDate the date to be converted
+ * @param timeband
+ * @return
+ */
+ public static int timeToPixel(final long eventDate, TimeBand currentTimeband) {
+ // here's what we start from
+ long millisecondPerUnit = currentTimeband.getUnit().getMilliseconds();
+ long pixelsPerUnit = currentTimeband.getPixelsPerUnit();
+ long currentOriginDate = currentTimeband.getCurrentDate();
+ long currentOriginXPixel = currentTimeband.getCurrentDateX();
+
+ // what's one pixel in milliseconds?
+ double onePixelInMs = (double) millisecondPerUnit / pixelsPerUnit;
+
+ // calculate difference with current position on timeband
+ long differenceWithEvent = eventDate - currentOriginDate;
+ long pixelValueOnBand = currentOriginXPixel + (long) (differenceWithEvent / onePixelInMs);
+ return (int) pixelValueOnBand;
+ }
+
+ public static String formatPixelToTime(final long pixelPosition, TimeBand timeband) {
+ return formatTime(pixelToTime(pixelPosition, timeband));
+ }
+
+ /**
+ * formats the given time for the moment as yyyy G
+ * @param eventDate date to be formatted
+ * @return the string representation of the date
+ */
+ public static String formatTime(final long eventDate) {
+ //TODO: change for multiple formats when need be
+ //use the year one for now
+ Date date = new Date(eventDate);
+ return year.format(date);
+ }
+}
Property changes on: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/toolkit/timeline/helpers/TimeConversionUtil.java
___________________________________________________________________
Added: svn:mergeinfo
+
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureView.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureView.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureView.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -23,10 +23,6 @@
bibleVersions = new SourceListBox();
bibleVersions.setStylePrimaryName("bibleVersionsDropDown");
- //max limit on length of the bible versions:
- //TODO: de-hardcode this and make it a auto-complete dropdown probably
-
-
//adding the dropdown with the bible versions
vp.add(bibleVersions);
@@ -57,8 +53,7 @@
@Override
public void stopProcessing() {
- // TODO Auto-generated method stub
-
+ ;
}
@Override
@@ -71,8 +66,6 @@
return bibleVersions.getValue(bibleVersions.getSelectedIndex());
}
-
-
@Override
public void setPassage(String text) {
scriptureHTML.setHTML(text);
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/TimelineView.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/TimelineView.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/TimelineView.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -6,6 +6,7 @@
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.tyndalehouse.step.web.client.presenter.TimelinePresenter;
@@ -23,13 +24,20 @@
//TODO: change to a provider, lookup Gin/Guice manual to do this...
timeline = new Timeline(eventBus);
+ VerticalPanel vp = new VerticalPanel();
FlowPanel fp = new FlowPanel();
+ vp.add(fp);
+ vp.setWidth("100%");
+
zoomIn = new Button("+");
zoomOut = new Button("-");
- fp.add(timeline);
+ zoomIn.setStyleName("step-timeline-control");
+ zoomOut.setStyleName("step-timeline-control");
+
fp.add(zoomIn);
fp.add(zoomOut);
- initWidget(fp);
+ vp.add(timeline);
+ initWidget(vp);
}
@Override
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/DbProvider.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/DbProvider.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/db/DbProvider.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -4,48 +4,35 @@
import java.sql.DriverManager;
import java.sql.SQLException;
+import com.tyndalehouse.step.web.server.common.ConfigNotLoadedException;
+import com.tyndalehouse.step.web.server.common.ConfigProvider;
+
+//TODO: all this is in java 6, so we should somehow be able to add it to classpath
+//without shipping jar file
//TODO: ensure that we put shared libraries somewhere else...
//TODO: do something about styles, checkstyle, etc.
//TODO: make a connection pool so that we can reuse
//db connections and gain performance
public class DbProvider {
- //TODO: shove this in a properties file
- private static String dbConnectionString = "jdbc:derby:";
- private static String defaultLocation = "StepDB";
-
- //TODO: ensure that we can set in properties file dev or non dev environment
- // and use appropriate connection pool as a result...
- //private static String clientConnection = "jdbc:derby://localhost:1527//../StepDB";
-
- public DbProvider() {
- //TODO: somehow make this property based
- //if dev then //
-
- // else
-//
-// //TODO: move this somewhere else, or make it span across the app's life
-// try {
-// Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
-// } catch (ClassNotFoundException e) {
-// e.printStackTrace();
-// }
+ private DbProvider() {
}
public static Connection getConnection() throws SQLException {
try {
- Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+ String driver = ConfigProvider.get("db.driver");
+ String connectionUrl = ConfigProvider.get("connection.string");
+ Class.forName(driver);
+ return DriverManager.getConnection(connectionUrl);
} catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
+ //TODO: lookup GUICE and see about providers to log with our loggers
e.printStackTrace();
- }
-
- //TODO: not catching exceptions when database is opened by someone else
- String sysDbLocation = System.getProperty("step.db.location");
- if(sysDbLocation != null) {
- return DriverManager.getConnection(dbConnectionString + sysDbLocation);
- } else {
- return DriverManager.getConnection(dbConnectionString + defaultLocation);
+ } catch (ConfigNotLoadedException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ } catch(Throwable t) {
+ t.printStackTrace();
}
+ return null;
}
public static void finaliseConnection(Connection connection) throws SQLException {
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/guice/ServerModule.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/guice/ServerModule.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/guice/ServerModule.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -10,7 +10,6 @@
import com.tyndalehouse.step.web.server.handler.GetBibleBooksHandler;
import com.tyndalehouse.step.web.server.handler.GetCurrentBibleTextHandler;
import com.tyndalehouse.step.web.server.handler.GetEventsForDateRangeHandler;
-import com.tyndalehouse.step.web.server.handler.GetModuleRefDataHandler;
import com.tyndalehouse.step.web.server.handler.GetTimelineOriginForScriptureHandler;
import com.tyndalehouse.step.web.server.handler.GetTimelineUISetupHandler;
@@ -25,7 +24,6 @@
bindHandler(GetAvailableBibleVersionsHandler.class);
bindHandler(GetBibleBooksHandler.class);
bindHandler(GetCurrentBibleTextHandler.class);
- bindHandler(GetModuleRefDataHandler.class);
bindHandler(GetEventsForDateRangeHandler.class);
bindHandler(GetTimelineUISetupHandler.class);
bindHandler(GetTimelineOriginForScriptureHandler.class);
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetAvailableBibleVersionsHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetAvailableBibleVersionsHandler.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetAvailableBibleVersionsHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -26,18 +26,15 @@
this.logger = logger;
}
+ @SuppressWarnings("unchecked")
@Override
public GetAvailableBibleVersionsResult execute(
GetAvailableBibleVersionsCommand arg0, ExecutionContext arg1)
throws ActionException {
- Book b = null;
- List books = Books.installed().getBooks();
+ List<Book> books = Books.installed().getBooks();
SortedMap<String, String> map = new TreeMap<String, String>();
-
- for(int ii = 0; ii < books.size(); ii++) {
- b = ((Book) books.get(ii));
-
+ for(Book b : books) {
if(b.getBookCategory() == BookCategory.BIBLE) {
map.put(b.getInitials(), b.getName());
}
@@ -52,13 +49,12 @@
public void rollback(GetAvailableBibleVersionsCommand arg0,
GetAvailableBibleVersionsResult arg1, ExecutionContext arg2)
throws ActionException {
- // TODO Auto-generated method stub
+ logger.error("Rolling back GetAvailableBibleVersions");
}
@Override
public Class<GetAvailableBibleVersionsCommand> getActionType() {
- // TODO Auto-generated method stub
return GetAvailableBibleVersionsCommand.class;
}
}
\ No newline at end of file
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetBibleBooksHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetBibleBooksHandler.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetBibleBooksHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,6 @@
package com.tyndalehouse.step.web.server.handler;
import java.util.ArrayList;
-import java.util.List;
import java.util.Locale;
import net.customware.gwt.dispatch.server.ActionHandler;
@@ -9,13 +8,8 @@
import net.customware.gwt.dispatch.shared.ActionException;
import org.apache.commons.logging.Log;
-import org.crosswire.jsword.book.Book;
-import org.crosswire.jsword.book.BookData;
-import org.crosswire.jsword.book.BookException;
import org.crosswire.jsword.book.Books;
-import org.crosswire.jsword.book.OSISUtil;
import org.crosswire.jsword.book.install.sword.HttpSwordInstaller;
-import org.crosswire.jsword.passage.NoSuchKeyException;
import org.crosswire.jsword.passage.NoSuchVerseException;
import org.crosswire.jsword.versification.BibleInfo;
import org.crosswire.jsword.versification.BibleNames;
@@ -39,20 +33,13 @@
private void checkJSwordInstalled() throws Throwable {
try {
logger.info("checkJSwordInstalled called");
- logger
- .info("Eventually we want to do all of this at startup/installation/configuration time to save time");
+ logger.info("Eventually we want to do all of this at startup/installation/configuration time to save time");
// An installer knows how to install books
HttpSwordInstaller installer = getNewCustomInstaller();
logger.info("got new custom installer");
// installer.reloadBookList();
- // get some available books. In this case, just one book.
- //List availableBooks = installer.getBooks(new StepBookFilter("ESV")); //$NON-NLS-1$
- List availableBooks = installer.getBooks(); //$NON-NLS-1$
- logger
- .info("Got a list of available books matching our filter (ESV)");
-
// check esv installed?
if (Books.installed().getBook("ESV") != null) {
logger.info("The ESV is already installed");
@@ -61,6 +48,7 @@
installer.install(installer.getBook("ESV"));
}
+ //TODO: this needs to be changed
// check random other book installed installed?
if (Books.installed().getBook("UMGreek") != null) {
logger.info("The UMGreek is already installed");
@@ -135,28 +123,11 @@
logger.error("Failed to generate list of bible books", e);
}
- logger.info("Checking ESV book has been installed");
- Book b = Books.installed().getBook("ESV");
- BookData bd;
- try {
- logger.info("Creating book data");
- bd = new BookData (b,b.getKey("John 1:1"));
- logger.info("Adding new verse to dropdown!");
- suggestions.add(OSISUtil.getPlainText(bd.getOsisFragment()));
- } catch (BookException e) {
- // TODO Auto-generated catch block
- logger.error("Error retrieving verse", e);
- } catch (NoSuchKeyException e) {
- // TODO Auto-generated catch block
- logger.error("Error retrieving key", e);
- }
-
return new GetBibleBooksCommandResult(suggestions);
}
@Override
public Class<GetBibleBooksCommand> getActionType() {
- // TODO Auto-generated method stub
return GetBibleBooksCommand.class;
}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetCurrentBibleTextHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetCurrentBibleTextHandler.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetCurrentBibleTextHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,7 +1,5 @@
package com.tyndalehouse.step.web.server.handler;
-import java.net.URI;
-
import javax.xml.transform.TransformerException;
import net.customware.gwt.dispatch.server.ActionHandler;
@@ -82,7 +80,6 @@
SAXEventProvider osissep = data.getSAXEventProvider();
TransformingSAXEventProvider htmlsep = (TransformingSAXEventProvider) new ConfigurableHTMLConverter().convert(osissep);
- URI loc = bmd.getLocation();
String text = XMLUtil.writeToString(htmlsep);
return text;
} catch (SAXException e) {
@@ -99,7 +96,7 @@
public void rollback(GetCurrentBibleTextCommand arg0,
GetCurrentBibleTextResult arg1, ExecutionContext arg2)
throws ActionException {
- // TODO Auto-generated method stub
+ logger.error("Get Current Bible Text rolling back");
}
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetModuleRefDataHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetModuleRefDataHandler.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetModuleRefDataHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,83 +0,0 @@
-package com.tyndalehouse.step.web.server.handler;
-
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import net.customware.gwt.dispatch.server.ActionHandler;
-import net.customware.gwt.dispatch.server.ExecutionContext;
-import net.customware.gwt.dispatch.shared.ActionException;
-
-import org.apache.commons.logging.Log;
-
-import com.google.inject.Inject;
-import com.tyndalehouse.step.web.shared.command.GetModuleRefDataCommand;
-import com.tyndalehouse.step.web.shared.result.GetModuleRefDataResult;
-
-//TODO: Define custom ActionHandler with logging as part of it...
-//That way we can ensure that we log every entry and exit to handlers properly?
-//ensure that execute is wrapped around by logging...
-//or could possibly add this to the servlet
-//TODO: this should live in the UI, it will never change, and we can save on some
-//lookups to the server...
-public class GetModuleRefDataHandler implements
- ActionHandler<GetModuleRefDataCommand, GetModuleRefDataResult> {
- private final Log logger;
-
- @Inject
- public GetModuleRefDataHandler(Log logger) {
- this.logger = logger;
-
- }
-
- @Override
- public GetModuleRefDataResult execute(GetModuleRefDataCommand command,
- ExecutionContext arg1) throws ActionException {
-
- SortedMap<String, String> refData = new TreeMap<String, String>();
-
- //RefDataDbCommand dbCommand = injector.getInstance(RefDataDbCommand.class);
- //dbCommand.select("1");
-
- if(command.getModuleName() == null) {
- //TODO: For now hardcode the whole thing
- refData.put("History", "History");
- refData.put("Geography", "Geography");
- refData.put("Language", "Language");
- refData.put("Parallels", "Parallels");
- refData.put("Translations", "Translations");
- refData.put("Commentaries", "Commentaries");
- refData.put("Publications", "Publications");
- refData.put("Presentations", "Presentations");
-
- } else if(command.getSubModuleName() == null) {
- //get list of submodules
- //TODO: store all this in the database:
- //TODO: refactor the whole hasSource, to instead of using a map, use a set of enums
- refData.put("People", "People");
- refData.put("Events", "Events");
- refData.put("Eras", "Eras");
-
- } else {
- //get list of depths
- refData.put("Quick_Look", "Quick Look");
- refData.put("Deeper_Study", "Deep Study");
- refData.put("Scholarly_Details", "Scholarly Details");
- }
-
- return new GetModuleRefDataResult(refData);
- }
-
- @Override
- public void rollback(GetModuleRefDataCommand arg0,
- GetModuleRefDataResult arg1, ExecutionContext arg2)
- throws ActionException {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public Class<GetModuleRefDataCommand> getActionType() {
- // TODO Auto-generated method stub
- return GetModuleRefDataCommand.class;
- }
-}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineOriginForScriptureHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineOriginForScriptureHandler.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineOriginForScriptureHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -4,7 +4,6 @@
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
-import java.text.SimpleDateFormat;
import net.customware.gwt.dispatch.server.ActionHandler;
import net.customware.gwt.dispatch.server.ExecutionContext;
@@ -19,12 +18,9 @@
import org.crosswire.jsword.passage.RocketPassage;
import org.crosswire.jsword.passage.VerseRange;
-import com.extjs.gxt.ui.client.util.DateWrapper.Unit;
import com.google.inject.Inject;
import com.tyndalehouse.step.web.server.db.DbProvider;
-import com.tyndalehouse.step.web.shared.beans.TimeBandVisibleDate;
import com.tyndalehouse.step.web.shared.command.GetTimelineOriginForScriptureCommand;
-import com.tyndalehouse.step.web.shared.result.GetEventsForDateRangeResult;
import com.tyndalehouse.step.web.shared.result.GetTimelineOriginForScriptureResult;
public class GetTimelineOriginForScriptureHandler implements
@@ -45,7 +41,7 @@
throws ActionException {
Connection conn = null;
- SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy G");
+// SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy G");
//TODO: do some cleaning up for DB code...
try {
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineUISetupHandler.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineUISetupHandler.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/server/handler/GetTimelineUISetupHandler.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -90,6 +90,6 @@
@Override
public void rollback(GetTimelineUISetupCommand arg0, GetTimelineUISetupResult arg1, ExecutionContext arg2) throws ActionException {
- // TODO Auto-generated method stub
+ logger.error("Get Timeline UI Setup Handler rolling back");
}}
\ No newline at end of file
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/command/GetModuleRefDataCommand.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/command/GetModuleRefDataCommand.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/command/GetModuleRefDataCommand.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,38 +0,0 @@
-package com.tyndalehouse.step.web.shared.command;
-
-import net.customware.gwt.dispatch.shared.Action;
-
-import com.tyndalehouse.step.web.shared.result.GetModuleRefDataResult;
-
-public class GetModuleRefDataCommand implements Action<GetModuleRefDataResult> {
-
- private static final long serialVersionUID = 8410807905433715833L;
- public String getModuleName() {
- return moduleName;
- }
-
- public String getSubModuleName() {
- return subModuleName;
- }
-
- private String moduleName;
- private String subModuleName;
-
- //This will get a list of STEP modules
- public GetModuleRefDataCommand() {
- moduleName = null;
- subModuleName = null;
- }
-
- //This will get a list of submodules
- public GetModuleRefDataCommand(final String moduleName) {
- this.moduleName = moduleName;
- subModuleName = null;
- }
-
- //this will get a list of depths at which the submodules can be studied
- public GetModuleRefDataCommand(final String moduleName, final String subModuleName) {
- this.moduleName = moduleName;
- this.subModuleName = subModuleName;
- }
-}
Deleted: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetModuleRefDataResult.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetModuleRefDataResult.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetModuleRefDataResult.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,28 +0,0 @@
-package com.tyndalehouse.step.web.shared.result;
-
-import java.util.Collections;
-import java.util.SortedMap;
-
-import net.customware.gwt.dispatch.shared.Result;
-
-public class GetModuleRefDataResult implements Result {
- /**
- *
- */
- private static final long serialVersionUID = -6638520233396826761L;
- private SortedMap<String, String> refData;
-
- public SortedMap<String, String> getRefData() {
- return Collections.unmodifiableSortedMap(refData);
- }
-
- //this constructor is used for reflection and must be present
- @SuppressWarnings("unused")
- private GetModuleRefDataResult() {
-
- }
-
- public GetModuleRefDataResult(SortedMap<String, String> map) {
- this.refData = map;
- }
-}
Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetTimelineOriginForScriptureResult.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetTimelineOriginForScriptureResult.java 2009-12-18 08:40:50 UTC (rev 55)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/shared/result/GetTimelineOriginForScriptureResult.java 2009-12-18 08:44:53 UTC (rev 56)
@@ -1,12 +1,7 @@
package com.tyndalehouse.step.web.shared.result;
-import java.util.ArrayList;
-import java.util.List;
-
import net.customware.gwt.dispatch.shared.Result;
-import com.tyndalehouse.step.web.shared.beans.TimelineEventBean;
-
public class GetTimelineOriginForScriptureResult implements Result {
More information about the Tynstep-svn
mailing list