Package org.onebusaway.transit_data.model

Examples of org.onebusaway.transit_data.model.RouteBean$Builder


      TripStatusBean tripStatus = vehicle.getTripStatus();
      if (tripStatus == null) {
        continue;
      }
      TripBean activeTrip = tripStatus.getActiveTrip();
      RouteBean route = activeTrip.getRoute();

      FeedEntity.Builder entity = feed.addEntityBuilder();
      entity.setId(Integer.toString(feed.getEntityCount()));
      TripUpdate.Builder tripUpdate = entity.getTripUpdateBuilder();

      TripDescriptor.Builder tripDesc = tripUpdate.getTripBuilder();
      tripDesc.setTripId(normalizeId(activeTrip.getId()));
      tripDesc.setRouteId(normalizeId(route.getId()));

      VehicleDescriptor.Builder vehicleDesc = tripUpdate.getVehicleBuilder();
      vehicleDesc.setId(normalizeId(vehicle.getVehicleId()));

      StopBean nextStop = tripStatus.getNextStop();
View Full Code Here


  }

  private List<RouteBean> getRoutesForRouteFilter(RouteFilterBean routeFilter) {
    List<RouteBean> routes = new ArrayList<RouteBean>();
    for (String routeId : routeFilter.getRouteIds()) {
      RouteBean route = _transitDataService.getRouteForId(routeId);
      if (route != null)
        routes.add(route);
    }
    Collections.sort(routes, new RouteNameComparator());
    return routes;
View Full Code Here

      return name;
    TripBean trip = bean.getTrip();
    name = trip.getRouteShortName();
    if (name != null)
      return name;
    RouteBean route = trip.getRoute();
    name = route.getShortName();
    if (name != null)
      return name;
    return route.getId();
  }
View Full Code Here

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

    long now = System.currentTimeMillis();

    for (ArrivalAndDepartureBean adb : arrivals) {

      TripBean trip = adb.getTrip();
      RouteBean route = trip.getRoute();

      addMessage(Messages.ROUTE);

      String routeNumber = RoutePresenter.getNameForRoute(route);
      addText(_routeNumberPronunciation.modify(routeNumber));
View Full Code Here

  private void addArrivalsAndDeparture(ArrivalAndDepartureBean bean) {

    int rowIndex = _arrivalsAndDeparturesTable.getRowCount();

    TripBean trip = bean.getTrip();
    RouteBean route = trip.getRoute();
    String routeName = RoutePresenter.getNameForRoute(route);
   
    _arrivalsAndDeparturesTable.setText(rowIndex, 0, routeName);

    DivPanel divPanel = new DivPanel();
View Full Code Here

  private void updateArrivalsAndDeparturePanel(ArrivalAndDepartureBean bean) {

    long now = System.currentTimeMillis();

    TripBean trip = bean.getTrip();
    RouteBean route = trip.getRoute();
    String routeName = RoutePresenter.getNameForRoute(route);
    _arrivalsAndDeparturesTable.setText(1, 0, routeName);

    if (RoutePresenter.isRouteNameLong(routeName))
      _arrivalsAndDeparturesTable.getCellFormatter().addStyleName(1, 0,
View Full Code Here

    @Override
    public void onSuccess(RoutesBean routesBean) {
      List<RouteBean> routes = routesBean.getRoutes();
      if (routes.size() == 1) {
        RouteBean route = routes.get(0);
        System.out.println("route found: " + route.getShortName() + " "
            + route.getLongName());
        _service.getStopsForRoute(route.getId(),
            new StopsForRouteHandler(route));
      } else {
        TabBarController rootController = MobileApplicationContext.getRootController();
        rootController.setSelectedIndex(0);
      }
View Full Code Here

    if( bean.getTripHeadsign() != null)
      return bean.getTripHeadsign();
    TripBean trip = bean.getTrip();
    if( trip.getTripHeadsign() != null)
      return trip.getTripHeadsign();
    RouteBean route = trip.getRoute();
    return RoutePresenter.getDescriptionForRoute(route);
  }
View Full Code Here

    Grid row = new Grid(1, 3);
    row.addStyleName(_css.ArrivalEntry());

    TripBean trip = bean.getTrip();
    RouteBean route = trip.getRoute();

    String routeName = RoutePresenter.getNameForRoute(route);
    row.setWidget(0, 0, new SpanWidget(routeName, _css.ArrivalEntryRouteName()));

    FlowPanel center = new FlowPanel();
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.RouteBean$Builder

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.