CustomTimedOverlayManager timedOverlayManager = new CustomTimedOverlayManager();
timedOverlayManager.setMapOverlayManager(mapOverlayManager);
timedOverlayManager.setQueryModel(queryModel);
timedOverlayManager.setColorGradientControl(colorGradient);
CustomTripPlanResultTablePresenter plansWidget = new CustomTripPlanResultTablePresenter();
plansWidget.setMapWidget(mapWidget);
ActiveResultPresenter activeResult = new ActiveResultPresenter();
activeResult.setMapOverlayManager(mapOverlayManager);
activeResult.setControl(control);
MainPage mainPage = new MainPage();
mainPage.setControl(control);
mainPage.setMapWidget(mapWidget);
mainPage.setSearchWidget(searchWidget);
mainPage.addResultsPanelWidget(welcome.getWidget());
mainPage.addResultsPanelWidget(addressLookup.getWidget());
mainPage.addResultsPanelWidget(resultsTable.getWidget());
mainPage.addResultsPanelWidget(activeResult.getWidget());
mainPage.addResultsPanelWidget(plansWidget.getWidget());
manager.addContextListener(mainPage);
SearchOriginMapPresenter searchOriginMapMarker = new SearchOriginMapPresenter();
searchOriginMapMarker.setMapOverlayManager(mapOverlayManager);
searchOriginMapMarker.setLocationQueryModel(queryModel);
/**
* Wire up all the listeners
*/
timedRegionModel.addModelListener(timedOverlayManager.getRegionModelListener());
timedPolygonModel.addModelListener(timedOverlayManager.getPolygonModelListener());
locationQueryModelEvents.addModelListener(control.getQueryModelHandler());
queryModelEvents.addModelListener(searchWidget.getQueryModelHandler());
resultsModelEvents.addModelListener(filteredResultsModel.getResultsModelHandler());
resultsModelEvents.addModelListener(filter.getResultsModelHandler());
filteredResultsModelEvents.addModelListener(pagedResultsModel.getModelListener());
tripModel.addModelListener(plansWidget);
stateEvents.addModelListener(welcome.getStateEventListener());
stateEvents.addModelListener(resultsTable);
stateEvents.addModelListener(activeResult);
stateEvents.addModelListener(searchOriginMapMarker);
stateEvents.addModelListener(plansWidget.getStateEventHandler());
stateEvents.addModelListener(timedOverlayManager.getStateEventHandler());
stateEvents.addModelListener(addressLookup.getStateEventListener());
StyleInjector.inject(OneBusAwayStandardResources.INSTANCE.getCss().getText());
StyleInjector.inject(TripPlannerResources.INSTANCE.getCss().getText());