protected void drawPath(Canvas canvas,List<Float> points,Paint paint,boolean circular){
  GeneralPath path=new GeneralPath();
  int height=canvas.getHeight();
  int width=canvas.getWidth();
  float[] tempDrawPoints;
  if (points.size() < 4) {
    return;
  }
  tempDrawPoints=calculateDrawPoints(points.get(0),points.get(1),points.get(2),points.get(3),height,width);
  path.moveTo(tempDrawPoints[0],tempDrawPoints[1]);
  path.lineTo(tempDrawPoints[2],tempDrawPoints[3]);
  int length=points.size();
  for (int i=4; i < length; i+=2) {
    if ((points.get(i - 1) < 0 && points.get(i + 1) < 0) || (points.get(i - 1) > height && points.get(i + 1) > height)) {
      continue;
    }
    tempDrawPoints=calculateDrawPoints(points.get(i - 2),points.get(i - 1),points.get(i),points.get(i + 1),height,width);
    if (!circular) {
      path.moveTo(tempDrawPoints[0],tempDrawPoints[1]);
    }
    path.lineTo(tempDrawPoints[2],tempDrawPoints[3]);
  }
  if (circular) {
    path.lineTo(points.get(0),points.get(1));
  }
  canvas.drawPath(path,paint);
}

protected void drawPath ( Canvas canvas , List < Float > points , Paint paint , boolean circular ) { GeneralPath path = new GeneralPath ( ) ; int height = canvas . getHeight ( ) ; int width = canvas . getWidth ( ) ; float [ ] tempDrawPoints ; if ( points . size ( ) < 4 ) { return ; } tempDrawPoints = calculateDrawPoints ( points . get ( 0 ) , points . get ( 1 ) , points . get ( 2 ) , points . get ( 3 ) , height , width ) ; path . moveTo ( tempDrawPoints [ 0 ] , tempDrawPoints [ 1 ] ) ; path . lineTo ( tempDrawPoints [ 2 ] , tempDrawPoints [ 3 ] ) ; int length = points . size ( ) ; for ( int i = 4 ; i < length ; i += 2 ) { if ( ( points . get ( i - 1 ) < 0 && points . get ( i + 1 ) < 0 ) || ( points . get ( i - 1 ) > height && points . get ( i + 1 ) > height ) ) { continue ; } tempDrawPoints = calculateDrawPoints ( points . get ( i - 2 ) , points . get ( i - 1 ) , points . get ( i ) , points . get ( i + 1 ) , height , width ) ; if ( ! circular ) { path . moveTo ( tempDrawPoints [ 0 ] , tempDrawPoints [ 1 ] ) ; } path . lineTo ( tempDrawPoints [ 2 ] , tempDrawPoints [ 3 ] ) ; } if ( circular ) { path . lineTo ( points . get ( 0 ) , points . get ( 1 ) ) ; } canvas . drawPath ( path , paint ) ; }
the graphical representation of a path .
