Package org.onebusaway.transit_data.model

Examples of org.onebusaway.transit_data.model.StopBean


    List<SyndEntry> entries = new ArrayList<SyndEntry>();
    _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(" (?)");
      } else {
        entryTitle.append(" - ");
        entryTitle.append(getText("StopNum", new String[] {stop.getCode()}));
        entryTitle.append(" - ");
        entryTitle.append(stop.getName());
        if (stop.getDirection() != null) {
          entryTitle.append(" - ");
          entryTitle.append(getText("bound", new String[] {stop.getDirection()}));
        }
      }

      StringBuilder entryUrl = new StringBuilder();
      entryUrl.append(baseUrl);
View Full Code Here


      final CoordinateBounds bounds = computeBounds();

      for (Iterator<Map.Entry<String, StopAndOverlays>> it = _visibleStopsById.entrySet().iterator(); it.hasNext();) {
        Entry<String, StopAndOverlays> entry = it.next();
        StopAndOverlays stopAndOverlays = entry.getValue();
        StopBean stop = stopAndOverlays.getStop();
        if (!bounds.contains(stop.getLat(), stop.getLon())) {
          it.remove();
          for (Overlay overlay : stopAndOverlays.getOverlays())
            _manager.removeOverlay(overlay);
        }
      }

      // Update the map
      DeferredCommand.addCommand(new Command() {
        @Override
        public void execute() {
          _stopsForRegionService.getStopsForRegion(bounds, _stopsHandler);
        }
      });

    } else {

      for (StopAndOverlays stopAndOverlays : _visibleStopsById.values()) {
        StopBean stop = stopAndOverlays.getStop();
        if (_stopIdsToAlwaysShow.contains(stop.getId()))
          continue;
        for (Overlay overlay : stopAndOverlays.getOverlays())
          _manager.removeOverlay(overlay);
      }
      _visibleStopsById.keySet().retainAll(_stopIdsToAlwaysShow);
View Full Code Here

    List<SyndEntry> entries = new ArrayList<SyndEntry>();
    _feed.setEntries(entries);

    for (StopProblemReportBean report : reports) {

      StopBean stop = report.getStop();
      SyndEntry entry = new SyndEntryImpl();

      StringBuilder entryTitle = new StringBuilder();
      if (stop == null) {
        entryTitle.append("stopId=");
        entryTitle.append(report.getStopId());
        entryTitle.append(" (?)");
      } else {
        entryTitle.append(getText("StopNum", Arrays.asList(stop.getCode())));
        entryTitle.append(" - ");
        entryTitle.append(stop.getName());
        if (stop.getDirection() != null)
          entryTitle.append(" - ").append(getText("bound", Arrays.asList(stop.getDirection())));
      }

      StringBuilder entryUrl = new StringBuilder();
      entryUrl.append(baseUrl);
      entryUrl.append("/admin/problems/stop-problem-reports!edit.action?stopId=");
View Full Code Here

  private class StopClickedHandlerImpl implements StopClickedHandler {

    @Override
    public void handleStopClicked(StopClickedEvent event) {

      final StopBean stop = event.getStop();
      FlowPanel panel = new FlowPanel();

      panel.add(new DivWidget(stop.getName()));

      StringBuilder b = new StringBuilder();
      if (stop.getDirection() != null)
        b.append(stop.getDirection()).append(" - ");

      b.append("Routes: ");
      boolean first = true;
      for (RouteBean route : stop.getRoutes()) {
        if (!first)
          b.append(",");
        b.append(" ").append(route.getShortName());
      }

      panel.add(new DivWidget(b.toString()));

      Anchor anchor = new Anchor("Show Real-Time Arrivals");
      anchor.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent arg0) {
          Actions.showArrivalsAndDeparturesForStop(getNavigationController(),
              stop.getId());
        }
      });

      DivPanel anchorRow = new DivPanel();
      panel.add(anchorRow);
      anchorRow.add(anchor);

      InfoWindow window = _map.getInfoWindow();
      LatLng point = LatLng.newInstance(stop.getLat(), stop.getLon());
      window.open(point, new InfoWindowContent(panel));
    }
View Full Code Here

TOP

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

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.