public List displayPathOnRoad(Point start,Point end,Route route,List segments){
  List newPoints;
  try {
    if (route == null) {
      OMPoint point=new RedPoint(start.x,start.y,5);
      toDraw.add(point);
      point=new RedPoint(end.x,end.y,5);
      toDraw.add(point);
      return null;
    }
    if (drawResults) {
      OMPoint point=new YellowPoint(start.x,start.y,10);
      toDraw.add(point);
      point=new YellowPoint(end.x,end.y,10);
      toDraw.add(point);
    }
    newPoints=new ArrayList();
    populatePointsAndSegments(route,newPoints,segments);
    if (drawResults) {
      Point last=null;
      Point first=null;
      for (Iterator iter=newPoints.iterator(); iter.hasNext(); ) {
        Point pt=(Point)iter.next();
        if (last != null) {
          OMLine line=new BlueLine(last.x,last.y,pt.x,pt.y);
          toDraw.add(line);
        }
        if (first == null)         first=pt;
        last=pt;
      }
      if (first != null && last != null) {
        OMLine line=new YellowLine(start.x,start.y,first.x,first.y,10);
        toDraw.add(line);
        line=new YellowLine(last.x,last.y,end.x,end.y,10);
        toDraw.add(line);
      }
    }
  }
 catch (  Exception e) {
    logger.warning("Got exception " + e);
    e.printStackTrace();
    return null;
  }
  return newPoints;
}

public List displayPathOnRoad ( Point start , Point end , Route route , List segments ) { List newPoints ; try { if ( route == null ) { OMPoint point = new RedPoint ( start . x , start . y , 5 ) ; toDraw . add ( point ) ; point = new RedPoint ( end . x , end . y , 5 ) ; toDraw . add ( point ) ; return null ; } if ( drawResults ) { OMPoint point = new YellowPoint ( start . x , start . y , 10 ) ; toDraw . add ( point ) ; point = new YellowPoint ( end . x , end . y , 10 ) ; toDraw . add ( point ) ; } newPoints = new ArrayList ( ) ; populatePointsAndSegments ( route , newPoints , segments ) ; if ( drawResults ) { Point last = null ; Point first = null ; for ( Iterator iter = newPoints . iterator ( ) ; iter . hasNext ( ) ; ) { Point pt = ( Point ) iter . next ( ) ; if ( last != null ) { OMLine line = new BlueLine ( last . x , last . y , pt . x , pt . y ) ; toDraw . add ( line ) ; } if ( first == null ) first = pt ; last = pt ; } if ( first != null && last != null ) { OMLine line = new YellowLine ( start . x , start . y , first . x , first . y , 10 ) ; toDraw . add ( line ) ; line = new YellowLine ( last . x , last . y , end . x , end . y , 10 ) ; toDraw . add ( line ) ; } } } catch ( Exception e ) { logger . warning ( "Got exception " + e ) ; e . printStackTrace ( ) ; return null ; } return newPoints ; }
displays a route between two points on the map . < p >
