Package org.onebusaway.transit_data.model

Examples of org.onebusaway.transit_data.model.StopsWithArrivalsAndDeparturesBean


    TimeZone timeZone = timeZones.getMax();
    if (timeZone == null)
      timeZone = TimeZone.getDefault();

    StopsWithArrivalsAndDeparturesBean result = new StopsWithArrivalsAndDeparturesBean();
    result.setStops(stops);
    result.setArrivalsAndDepartures(allArrivalsAndDepartures);
    result.setNearbyStops(nearbyStops);
    result.setSituations(new ArrayList<ServiceAlertBean>(situationsById.values()));
    result.setTimeZone(timeZone.getID());
    return result;
  }
View Full Code Here


      String[] routeNames = token.split(",");
      for (String routeName : routeNames)
        routes.add(routeName);
    }

    StopsWithArrivalsAndDeparturesBean result = _model.getResult();
    Iterator<ArrivalAndDepartureBean> it = result.getArrivalsAndDepartures().iterator();

    while (it.hasNext()) {
      ArrivalAndDepartureBean bean = it.next();
      TripBean trip = bean.getTrip();
      RouteBean route = trip.getRoute();
View Full Code Here

    Set<String> routeIds = getRouteIdsForMatchingRoutes();

    List<ArrivalAndDepartureBean> arrivals = new ArrayList<ArrivalAndDepartureBean>();

    StopsWithArrivalsAndDeparturesBean m = _model.getResult();
    for (ArrivalAndDepartureBean pab : m.getArrivalsAndDepartures()) {
      RouteBean route = pab.getTrip().getRoute();
      if (routeIds.contains(route.getId())
          || _route.equals(route.getShortName())) {
        arrivals.add(pab);
      }
    }

    m = new StopsWithArrivalsAndDeparturesBean(m.getStops(), arrivals,
        m.getNearbyStops(), m.getSituations());

    _model.setResult(m);

    logUserInteraction("routeIds", routeIds);
View Full Code Here

    return SUCCESS;
  }

  private Set<String> getRouteIdsForMatchingRoutes() {
    StopsWithArrivalsAndDeparturesBean result = _model.getResult();
    Set<String> ids = new HashSet<String>();
    for (StopBean stop : result.getStops()) {
      for (RouteBean route : stop.getRoutes()) {
        if (route.getShortName().equals(_route))
          ids.add(route.getId());
      }
    }
View Full Code Here

  @Override
  public void buildTemplate(ActionContext context) {

    ValueStack valueStack = context.getValueStack();
    PhoneArrivalsAndDeparturesModel model = (PhoneArrivalsAndDeparturesModel) valueStack.findValue("model");
    StopsWithArrivalsAndDeparturesBean result = model.getResult();

    buildPredictedArrivalsTemplate(result.getArrivalsAndDepartures());

    addMessage(Messages.ARRIVAL_INFO_ON_SPECIFIC_ROUTE);
    AgiActionName byRouteAction = addActionWithParameterFromMatch("1(\\d+)#",
        "/stop/arrivalsAndDeparturesForRoute", "route", 1);
    byRouteAction.putParam("model", model);

    addMessage(Messages.ARRIVAL_INFO_BOOKMARK_THIS_LOCATION);
    AgiActionName bookmarkAction = addAction("2", "/stop/bookmark");
    bookmarkAction.putParam("stops", result.getStops());

    addMessage(Messages.ARRIVAL_INFO_RETURN_TO_MAIN_MENU);
    addAction("3", "/index");

    addAction("(#|[04-9]|1.*\\*)", "/repeat");
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.StopsWithArrivalsAndDeparturesBean

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.