use of org.onebusaway.transit_data.model.StopBean in project onebusaway-application-modules by camsys.
the class StopSelectionServiceImpl method getStopsForRouteAsStopSelectionTree.
/**
**
* Private Methods
***
*/
private StopSelectionTreeBean getStopsForRouteAsStopSelectionTree(StopsForRouteBean stopsForRoute) {
StopSelectionTreeBean tree = new StopSelectionTreeBean();
StopGroupingBean byDirection = getGroupingByType(stopsForRoute, TransitDataConstants.STOP_GROUPING_TYPE_DIRECTION);
Map<String, StopBean> stopsById = getStopsById(stopsForRoute);
if (byDirection != null) {
groupByDirection(tree, stopsForRoute, byDirection, stopsById);
} else {
groupByStop(tree, stopsForRoute.getStops());
}
return tree;
}
use of org.onebusaway.transit_data.model.StopBean in project onebusaway-application-modules by camsys.
the class ArrivalsAndDeparturesForRouteAction method getRouteIdsForMatchingRoutes.
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());
}
}
return ids;
}
use of org.onebusaway.transit_data.model.StopBean in project onebusaway-application-modules by camsys.
the class MultipleStopsFoundTemplate method buildTemplate.
@SuppressWarnings("unchecked")
@Override
public void buildTemplate(ActionContext context) {
ValueStack vs = context.getValueStack();
List<StopBean> stops = (List<StopBean>) vs.findValue("stops");
int index = 1;
addMessage(Messages.MULTIPLE_STOPS_WERE_FOUND);
for (StopBean stop : stops) {
addMessage(Messages.FOR);
addText(_destinationPronunciation.modify(stop.getName()));
addMessage(Messages.PLEASE_PRESS);
String key = Integer.toString(index++);
addText(key);
AgiActionName action = addAction(key, "/stop/arrivalsAndDeparturesForStopId");
action.putParam("stopIds", Arrays.asList(stop.getId()));
}
addMessage(Messages.HOW_TO_GO_BACK);
addAction("\\*", "/back");
addMessage(Messages.TO_REPEAT);
}
use of org.onebusaway.transit_data.model.StopBean in project onebusaway-application-modules by camsys.
the class StopFoundTemplate method buildTemplate.
@Override
public void buildTemplate(ActionContext context) {
ValueStack vs = context.getValueStack();
StopBean stop = (StopBean) vs.findValue("stop");
addMessage(Messages.THE_STOP_NUMBER_FOR);
addText(_destinationPronunciation.modify(stop.getName()));
String direction = _directionPronunciation.modify(stop.getDirection());
addMessage(Messages.DIRECTION_BOUND, direction);
addText(Messages.IS);
addText(stop.getCode());
addMessage(Messages.STOP_FOUND_ARRIVAL_INFO);
AgiActionName arrivalInfoAction = addAction("1", "/stop/arrivalsAndDeparturesForStopId");
arrivalInfoAction.putParam("stopIds", Arrays.asList(stop.getId()));
addMessage(Messages.STOP_FOUND_BOOKMARK_THIS_LOCATION);
AgiActionName bookmarkAction = addAction("2", "/stop/bookmark");
bookmarkAction.putParam("stop", stop);
addMessage(Messages.STOP_FOUND_RETURN_TO_MAIN_MENU);
addAction("3", "/index");
addAction("[04-9]", "/repeat");
addMessage(Messages.HOW_TO_GO_BACK);
addAction("\\*", "/back");
addMessage(Messages.TO_REPEAT);
}
use of org.onebusaway.transit_data.model.StopBean in project onebusaway-application-modules by camsys.
the class RouteBeanServiceImplTest method getStopBean.
private StopBean getStopBean(StopEntryImpl stopEntry) {
StopBean stop = new StopBean();
stop.setId(AgencyAndIdLibrary.convertToString(stopEntry.getId()));
return stop;
}
Aggregations