@SuppressWarnings("unchecked")
 private void initialize() {
   List<BcrPosition> positions = route.getPositions();
   positions.clear();
   positions.add(a);
   positions.add(b);
   positions.add(c);
   positions.add(d);
   positions.add(e);
   model.setRoute(route);
 }
Example #2
0
 public BaseNavigationPosition getDuplicateFirstPosition(
     BaseRoute<BaseNavigationPosition, BaseNavigationFormat> route) {
   List<BaseNavigationPosition> positions = route.getPositions();
   BaseNavigationPosition first = positions.get(0);
   return new NmnPosition(
       first.getLongitude() + DUPLICATE_OFFSET,
       first.getLatitude() + DUPLICATE_OFFSET,
       (Double) null,
       null,
       null,
       "Start:" + first.getComment());
 }
 @SuppressWarnings("unchecked")
 private void renameRoute(
     BaseRoute route,
     BaseRoute routeToWrite,
     int startIndex,
     int endIndex,
     int trackIndex,
     OutputStream... targets) {
   // gives splitted TomTomRoute and SimpleRoute routes a more useful name for the fragment
   if (route.getFormat() instanceof TomTomRouteFormat
       || route.getFormat() instanceof SimpleFormat
       || route.getFormat() instanceof GpxFormat
           && routeToWrite.getFormat() instanceof BcrFormat) {
     String name = createRouteName(routeToWrite.getPositions().subList(startIndex, endIndex));
     if (targets.length > 1) name = "Track" + (trackIndex + 1) + ": " + name;
     routeToWrite.setName(name);
   }
 }
 @SuppressWarnings("unchecked")
 private void commentRoute(BaseRoute route) {
   commentPositions(route.getPositions());
   commentRouteName(route);
 }