Examples of StopSelectionTreeBean


Examples of org.onebusaway.presentation.model.StopSelectionTreeBean

  }

  public StopSelectionBean getSelectedStops(StopsForRouteBean stopsForRoute,
      List<Integer> selectionIndices) throws InvalidSelectionServiceException {
    StopSelectionBean selection = new StopSelectionBean();
    StopSelectionTreeBean tree = getStopsForRouteAsStopSelectionTree(stopsForRoute);
    visitTree(tree, selection, selectionIndices, 0);
    return selection;
  }
View Full Code Here

Examples of org.onebusaway.presentation.model.StopSelectionTreeBean

   ****/

  private StopSelectionTreeBean getStopsForRouteAsStopSelectionTree(
      StopsForRouteBean stopsForRoute) {

    StopSelectionTreeBean tree = new StopSelectionTreeBean();

    StopGroupingBean byDirection = getGroupingByType(stopsForRoute,
        TransitDataConstants.STOP_GROUPING_TYPE_DIRECTION);

    Map<String, StopBean> stopsById = getStopsById(stopsForRoute);
View Full Code Here

Examples of org.onebusaway.presentation.model.StopSelectionTreeBean

      return;
    }

    for (StopGroupBean group : groups) {

      StopSelectionTreeBean subTree = tree.getSubTree(group.getName());
      List<StopBean> stops = new ArrayList<StopBean>();
      for (String stopId : group.getStopIds())
        stops.add(stopsById.get(stopId));
      groupByStop(subTree, stops);
    }
View Full Code Here

Examples of org.onebusaway.presentation.model.StopSelectionTreeBean

  private void groupByStop(StopSelectionTreeBean tree, Iterable<StopBean> stops) {

    for (StopBean stop : stops) {

      StopSelectionTreeBean subTree = tree;

      if (_splitStopNames) {
        List<NameBean> names = _locationNameSplitStrategy.splitLocationNameIntoParts(stop.getName());
        for (NameBean name : names)
          subTree = subTree.getSubTree(name);
      } else {
        NameBean name = new NameBean(SelectionNameTypes.STOP_NAME,
            stop.getName());
        subTree = subTree.getSubTree(name);
      }

      // As a last resort, we extend the tree by the stop number (guaranteed to
      // be unique)
      String code = stop.getCode() != null ? stop.getCode() : stop.getId();

      NameBean name = new NameBean(SelectionNameTypes.STOP_DESCRIPTION,
          "Stop # " + code);
      subTree = subTree.getSubTree(name);
      subTree.setStop(stop);
    }
  }
View Full Code Here

Examples of org.onebusaway.presentation.model.StopSelectionTreeBean

    if (names.size() == 1) {

      NameBean next = names.iterator().next();
      selection.addSelected(next);

      StopSelectionTreeBean subtree = tree.getSubTree(next);
      visitTree(subtree, selection, selectionIndices, index);

      return;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.