[Tynstep-svn] r10 - in trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client: gin presenter view

ChrisBurrell at crosswire.org ChrisBurrell at crosswire.org
Tue Nov 3 15:31:06 MST 2009


Author: ChrisBurrell
Date: 2009-11-03 15:31:05 -0700 (Tue, 03 Nov 2009)
New Revision: 10

Modified:
   trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/gin/StepClientModule.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/view/ScriptureView.java
   trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/StepView.java
   trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/TimelineView.java
Log:


Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/gin/StepClientModule.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/gin/StepClientModule.java	2009-11-03 22:29:51 UTC (rev 9)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/gin/StepClientModule.java	2009-11-03 22:31:05 UTC (rev 10)
@@ -49,10 +49,10 @@
 		bind(ScripturePresenter.Display.class).to(ScriptureView.class); //.in(Singleton.class);
 		
 		
-//		bind(TimelinePresenter.class);
-//		bind(TimelinePresenter.Display.class).to(TimelineView.class); //.in(Singleton.class);
+		bind(TimelinePresenter.class);
+		bind(TimelinePresenter.Display.class).to(TimelineView.class); //.in(Singleton.class);
+//		bind(ITimeLineRender.class).to(TimelineRenderer.class);
 		
-		
 		bind(HistoryModulePresenter.class);
 		bind(HistoryModulePresenter.Display.class).to(HistoryModuleView.class);
 

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-11-03 22:29:51 UTC (rev 9)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/presenter/TimelinePresenter.java	2009-11-03 22:31:05 UTC (rev 10)
@@ -6,9 +6,11 @@
 import net.customware.gwt.presenter.client.widget.WidgetDisplay;
 import net.customware.gwt.presenter.client.widget.WidgetPresenter;
 
+import com.google.gwt.core.client.JavaScriptObject;
 import com.google.inject.Inject;
+import com.tyndalehouse.step.web.client.widgets.timeline.TimeLineWidget;
 
-public class TimelinePresenter extends WidgetPresenter<TimelinePresenter.Display> { //implements TimelineXMLHandler {
+public class TimelinePresenter extends WidgetPresenter<TimelinePresenter.Display>{
 
 	@Inject
 	public TimelinePresenter(Display display, EventBus eventBus) {
@@ -18,7 +20,7 @@
 
 	public interface Display extends WidgetDisplay {
 
-//		TimeLineWidget getTimelineWidget();
+		TimeLineWidget getTimelineWidget();
 	}
 
 	@Override
@@ -30,7 +32,7 @@
 	@Override
 	protected void onBind() {
 		
-		//display.getTimelineWidget().load("stonehenge.xml", this);    
+//		display.getTimelineWidget().load("stonehenge.xml", this);    
 
 		
 //		eventBus.addHandler(NewArticleSelectedEvent.TYPE, new NewArticleSelectedEventHandler() {

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-11-03 22:29:51 UTC (rev 9)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/ScriptureView.java	2009-11-03 22:31:05 UTC (rev 10)
@@ -21,7 +21,12 @@
 		initWidget(vp);		
 		
 		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);
 		

Modified: trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/StepView.java
===================================================================
--- trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/StepView.java	2009-11-03 22:29:51 UTC (rev 9)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/StepView.java	2009-11-03 22:31:05 UTC (rev 10)
@@ -1,9 +1,15 @@
 package com.tyndalehouse.step.web.client.view;
 
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.DockPanel;
+import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.DockPanel.DockLayoutConstant;
 import com.google.inject.Inject;
 import com.tyndalehouse.step.web.client.presenter.ModuleSelectorPresenter;
 import com.tyndalehouse.step.web.client.presenter.ScripturePresenter;
@@ -25,11 +31,34 @@
 	public StepView(
 			ScriptureSelectorPresenter.Display scriptureSelector,
 			ScripturePresenter scripture, ScripturePresenter scripture2,
-			ModuleSelectorPresenter moduleSelector, StepModulePresenter<? extends StepModulePresenter.Display> module ) {
+			ModuleSelectorPresenter moduleSelector, StepModulePresenter<? extends StepModulePresenter.Display> module,
+			TimelinePresenter timelinePresenter) {
 
+		
+		FlowPanel flow = new FlowPanel();
+		
 		dp = new DockPanel();
-		initWidget(dp);
+		flow.add(dp);
+		initWidget(flow);
 
+		/**
+		//get the main element and add the three different div layouts.
+//		Element main = this.asWidget().getElement(); 
+//		Element top = DOM.createDiv();
+//		top.setId("top");
+//		
+//		Element middle = DOM.createDiv();
+//		middle.setId("middle");
+//
+//		Element bottom= DOM.createDiv();
+//		bottom.setId("bottom");
+//		main.appendChild(top);
+//		main.appendChild(middle);
+//		main.appendChild(bottom);
+//		
+//		top.appendChild(scriptureSelector.asWidget().getElement());
+		*/
+		
 		HorizontalPanel northPanel = new HorizontalPanel();
 		
 		dp.add(northPanel, DockPanel.NORTH);
@@ -41,8 +70,14 @@
 		addScriptureDisplay(scripture);
 		addScriptureDisplay(scripture2);
 		
+		//starts here hardcoded, each of the scripture panel takes 25%, but eventually, they
+		//should try and work this out for themselves
+		//TODO: see above
+		scripture.getDisplay().asWidget();
+		scripture2.getDisplay().asWidget();
+		
 		dp.add(module.getDisplay().asWidget(), DockPanel.CENTER);
-		//dp.add(timeline.getDisplay().asWidget(), DockPanel.SOUTH);
+		flow.add(timelinePresenter.getDisplay().asWidget());
 	}
 
 	

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-11-03 22:29:51 UTC (rev 9)
+++ trunk/step-web-app/src/main/java/com/tyndalehouse/step/web/client/view/TimelineView.java	2009-11-03 22:31:05 UTC (rev 10)
@@ -1,30 +1,72 @@
 package com.tyndalehouse.step.web.client.view;
 
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.ScrollPanel;
 import com.google.gwt.user.client.ui.Widget;
 import com.tyndalehouse.step.web.client.presenter.TimelinePresenter;
+import com.tyndalehouse.step.web.client.timeline.data.DatasetHandler;
+import com.tyndalehouse.step.web.client.timeline.data.StonehengeRender;
+import com.tyndalehouse.step.web.client.widgets.timeline.ITimeLineRender;
+import com.tyndalehouse.step.web.client.widgets.timeline.TimeLineWidget;
 
 public class TimelineView extends Composite implements TimelinePresenter.Display {
 
-//	TimeLineWidget timeline;
+	// GUI elements
+    private ScrollPanel panel = null;
+    private TimeLineWidget simileWidget = null;
 	
-	public TimelineView() {
-		SimplePanel mainPanel = new SimplePanel();
-        initWidget(mainPanel);
+	//this represents the number of pixels to colour in for one year.
+	//if an event is going to be 10 years, then it should be
+	//width/height pixelToYearScale*10
+	private int pixelToYearScale;
+	private HTML timeline;
+	private boolean isDisplayHorizontal = true;
+	
+	
+	//colours to be made variable later
+	private String[] bandColours = new String[] {"blue", "green", "orange", "yellow", "pink" };
+	
+	//@Inject
+	public TimelineView(/* ITimeLineRender renderer*/ ) {
+        ScrollPanel panel = new ScrollPanel();
+        initWidget(panel);	
+        //timeline = new HTML();
+        //panel.add(timeline);
+
+//        addTimeBand(new TimeBandImpl("Egypt"));
+//        addTimeBand(new TimeBandImpl("Israel"));
+//        addTimeBand(new TimeBandImpl("Judah"));
+//        
+//        
+        //render();
+        
+        
+        ITimeLineRender render = new StonehengeRender();
+        simileWidget = new TimeLineWidget("100", "100", render);
+        panel.add(simileWidget);
+        panel.setAlwaysShowScrollBars(false);
+        DatasetHandler.getInstance().initialise(simileWidget,  "step/stonehenge.xml");      
+        simileWidget.setStyleName("timeline-default");
+
+        //simileWidget.getTimeLine().
+        
+//        		
+//		SimplePanel mainPanel = new SimplePanel();
+//        initWidget(mainPanel);
 //		
-//		timeline = new TimeLineWidget("100%", "100%", new StonehengeRender());
+//		timeline = new TimeLineWidget("10%", "10%", renderer);
 //        mainPanel.add(timeline);
 //        
-        
-        //new Viewport(mainPanel);
+//        
+//        //new Viewport(mainPanel);		
 	}
 
-//	@Override
-//	public TimeLineWidget getTimelineWidget() {
-//		return timeline;
-//	}
 
+	
+
 	@Override
 	public Widget asWidget() {
 		return this;
@@ -43,4 +85,8 @@
 	}
 
 
+	@Override
+	public TimeLineWidget getTimelineWidget() {
+		return simileWidget;
+	}
 }




More information about the Tynstep-svn mailing list