Package org.onebusaway.webapp.gwt.oba_application.model

Examples of org.onebusaway.webapp.gwt.oba_application.model.PagedResultsModel$ReverseComparator


    FilteredResultsModel filteredResultsModel = new FilteredResultsModel();
    filteredResultsModel.setResultsModel(resultsModel);
    filteredResultsModel.setEvents(filteredResultsModelEvents);

    PagedResultsModel pagedResultsModel = new PagedResultsModel();
    pagedResultsModel.setModel(filteredResultsModel);
    pagedResultsModel.setEvents(stateEvents);

    TripPlanModel tripModel = new TripPlanModel();

    /**
     * Control Layer
     */
    YelpLocalSearchProvider localSearchProvider = new YelpLocalSearchProvider("VJYMvEAOfkqDeyHh4C9gTg");
    localSearchProvider.setTimeout(10000);

    MapOverlayManager mapOverlayManager = new MapOverlayManager();

    MinTransitTimeResultHandler minTransitTimeHandler = new MinTransitTimeResultHandler();
    minTransitTimeHandler.setMapOverlayManager(mapOverlayManager);
    // minTransitTimeHandler.setTimedRegionModel(timedRegionModel);
    minTransitTimeHandler.setTimedPolygonModel(timedPolygonModel);

    OneBusAwayStandardControlImpl control = new OneBusAwayStandardControlImpl();
    control.setStateEvents(stateEvents);

    // Models
    control.setQueryModel(queryModel);
    control.setResultsModel(resultsModel);
    control.setFilteredResultsModel(filteredResultsModel);
    control.setPagedResultsModel(pagedResultsModel);
    control.setTripPlanModel(tripModel);
    // Controls
    control.setLocalSearchProvider(localSearchProvider);
    control.setMinTransitTimeResultHandler(minTransitTimeHandler);

    control.setContextManager(manager);

    minTransitTimeHandler.setControl(control);

    /**
     * View Layer
     */
    MapWidget mapWidget = new MapWidget(LatLng.newInstance(47.601533, -122.32933), 11);
    mapWidget.addControl(new LargeMapControl());
    mapWidget.addControl(new MapTypeControl());
    mapWidget.addControl(new ScaleControl());
   
    ColorGradientControl colorGradient = new ColorGradientControl();
    mapWidget.addControl(colorGradient);
   
    mapOverlayManager.setMapWidget(mapWidget);

    SearchWidget searchWidget = new SearchWidget();
    searchWidget.setControl(control);
    searchWidget.setMapWidget(mapWidget);

    WelcomePagePresenter welcome = new WelcomePagePresenter();

    AddressLookupPresenter addressLookup = new AddressLookupPresenter();
    addressLookup.setControl(control);

    ResultsFilterPresenter filter = new ResultsFilterPresenter();
    filter.setControl(control);

    ResultsTablePresenter resultsTable = new ResultsTablePresenter();
    resultsTable.setControl(control);
    resultsTable.setResultsModel(pagedResultsModel);
    resultsTable.setMapOverlayManager(mapOverlayManager);
    resultsTable.setResultsFilterWidget(filter.getWidget());

    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);
View Full Code Here


      //_progressBar.setProgress(sps.getPercentComplete());
    } else if (state instanceof SearchCompleteState) {
      _progressPanel.setVisible(false);
    } else if (state instanceof PlacesChangedState) {
      PlacesChangedState pcs = (PlacesChangedState) state;
      PagedResultsModel model = pcs.getModel();
      if (model.getSelectedResult() == null)
        _minimized = false;
      refresh();
    } else if (state instanceof SelectedPlaceChangedState) {
      SelectedPlaceChangedState pcs = (SelectedPlaceChangedState) state;
      if (pcs.getSelectedResult() == null) {
View Full Code Here

      if (state instanceof SearchStartedState) {
        clear();
      } else if (state instanceof PlacesChangedState) {
        PlacesChangedState pcs = (PlacesChangedState) state;
        PagedResultsModel model = pcs.getModel();
        if (model.getSelectedResult() == null)
          setVisible(true);
      } else if (state instanceof SelectedPlaceChangedState) {
        SelectedPlaceChangedState pcs = (SelectedPlaceChangedState) state;
        if (pcs.getSelectedResult() == null) {
          setVisible(true);
View Full Code Here

TOP

Related Classes of org.onebusaway.webapp.gwt.oba_application.model.PagedResultsModel$ReverseComparator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.