Package org.onebusaway.transit_data.model.trips

Examples of org.onebusaway.transit_data.model.trips.TripBean


  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();

    DivPanel destinationPanel = new DivPanel("arrivalsDestinationEntry");
    divPanel.add(destinationPanel);
    String href = "trip.action?id=" + trip.getId() + "&stop="
        + bean.getStop().getId();
    destinationPanel.add(new Anchor(trip.getTripHeadsign(), href));

    DivPanel timeAndStatusPanel = new DivPanel("arrivalsTimePanel");
    divPanel.add(timeAndStatusPanel);
    String time = _timeFormat.format(new Date(bean.computeBestDepartureTime()));
    timeAndStatusPanel.add(new SpanWidget(time, "arrivalsTimeEntry"));
View Full Code Here


  }

  private void refreshInterface(StopWithArrivalsAndDeparturesBean bean) {
    updateStopPanel(bean.getStop());
    for (ArrivalAndDepartureBean dep : bean.getArrivalsAndDepartures()) {
      TripBean trip = dep.getTrip();
      if (trip.getId().equals(_tripId)) {
        updateArrivalsAndDeparturePanel(dep);
        _departureBean = dep;
      }
    }
  }
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,
          _stopCss.arrivalsRouteLongNameEntry());

    DivPanel divPanel = new DivPanel();

    DivPanel destinationPanel = new DivPanel(
        _stopCss.arrivalsDestinationEntry());
    divPanel.add(destinationPanel);
    String href = "trip.action?id=" + trip.getId() + "&stop="
        + bean.getStop().getId();
    destinationPanel.add(new Anchor(trip.getTripHeadsign(), href));

    DivPanel timeAndStatusPanel = new DivPanel(_stopCss.arrivalsTimePanel());
    divPanel.add(timeAndStatusPanel);
    String time = _timeFormat.format(new Date(bean.computeBestDepartureTime()));
    timeAndStatusPanel.add(new SpanWidget(time, _stopCss.arrivalsTimeEntry()));
View Full Code Here

    long time = _model.getTime();
    long timeFrom = time - _minutesBefore * 60 * 1000;
    long timeTo = time + _minutesAfter * 60 * 1000;

    TripBean trip = _model.getTrip();

    if (_model.getVehicleId() != null
        || (_model.getTrip() != null && _model.getServiceDate() > 0)) {
      VehicleLocationRecordQueryBean query = new VehicleLocationRecordQueryBean();
      query.setServiceDate(_model.getServiceDate());
      if (trip != null)
        query.setBlockId(trip.getBlockId());
      query.setVehicleId(_model.getVehicleId());
      query.setFromTime(timeFrom);
      query.setToTime(timeTo);
      long t3 = System.currentTimeMillis();
      ListBean<VehicleLocationRecordBean> records = _transitDataService.getVehicleLocationRecords(query);
View Full Code Here

  }
 
  public String getTripHeadsign(ArrivalAndDepartureBean bean) {
    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

    String arrivalLabelStyle = _methods.getStatusLabelStyle(bean);

    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();
    row.setWidget(0, 1, center);

    center.add(new DivWidget(trip.getTripHeadsign(),
        _css.ArrivalEntryTripName()));

    FlowPanel arrivalTimePanel = new FlowPanel();
    arrivalTimePanel.addStyleName(_css.ArrivalEntryArrivalTimeDetail());
    center.add(arrivalTimePanel);
View Full Code Here

        marker.addMarkerClickHandler(new MarkerClickHandler() {
          @Override
          public void onClick(MarkerClickEvent event) {
            FlowPanel panel = new FlowPanel();

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

            panel.add(new DivWidget("Route: " + route.getShortName()));
            panel.add(new DivWidget("Trip: " + trip.getId()));
            panel.add(new DivWidget("Destination: "
                + bean.getTrip().getTripHeadsign()));

            InfoWindow window = _map.getInfoWindow();
            window.open(point, new InfoWindowContent(panel));
View Full Code Here

      String mode = leg.getMode();
      if( mode.equals("transit")) {

        TransitLegBean transitLeg = leg.getTransitLeg();
        TripBean tripBean = transitLeg.getTrip();
        RouteBean routeBean = tripBean.getRoute();

        DivPanel panel = new DivPanel();
        panel.addStyleName(_css.tripPanelVehiclePanel());

        DivPanel row1 = new DivPanel(_css.tripPanelVehiclePanelRow1());
        panel.add(row1);

        DataResource busIcon = resources.getBusTripTypeIcon();
        Image image = new Image(busIcon.getUrl());
        image.addStyleName(_css.tripPanelVehiclePanelModeImage());
        row1.add(image);

        int minutes = Math.round((leg.getEndTime() - leg.getStartTime())
            / (1000 * 60));
       
        String routeShortName = getBestName(transitLeg.getRouteShortName(),tripBean.getRouteShortName(), routeBean.getShortName(),"");
        String tripHeadsign = getBestName(transitLeg.getTripHeadsign(),tripBean.getTripHeadsign(),routeBean.getLongName(),"");
       
        row1.add(new DivWidget("Bus - " + routeShortName + " - "
            + tripHeadsign, _css.tripPanelVehiclePanelTitle()));

        String departureTime = _timeFormat.format(new Date(leg.getStartTime()));
View Full Code Here

    _feed.setEntries(entries);

    for (TripProblemReportBean report : reports) {

      StopBean stop = report.getStop();
      TripBean trip = report.getTrip();

      SyndEntry entry = new SyndEntryImpl();

      StringBuilder entryTitle = new StringBuilder();
      if (trip == null) {
        entryTitle.append("trip_id=");
        entryTitle.append(report.getTripId());
        entryTitle.append(" (?)");
      } else {
        entryTitle.append(RoutePresenter.getNameForRoute(trip));
        entryTitle.append(" - ");
        entryTitle.append(trip.getTripHeadsign());
      }
      if (stop == null) {
        entryTitle.append(" - stop_id=");
        entryTitle.append(report.getStopId());
        entryTitle.append(" (?)");
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data.model.trips.TripBean

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.