private static Path2D createTopTabShape(int x,int y,int w,int h,double rTop,boolean addBottom){
  Path2D path=new Path2D.Double();
  path.append(new Line2D.Double(x,y + h - 1,x,y + rTop),true);
  QuadCurve2D curve=new QuadCurve2D.Double(x,y + rTop,x,y,x + rTop,y);
  path.append(curve,true);
  path.append(new Line2D.Double(x + rTop,y,x + w - rTop,y),true);
  curve=new QuadCurve2D.Double(x + w - rTop,y,x + w,y,x + w,y + rTop);
  path.append(curve,true);
  path.append(new Line2D.Double(x + w,y + rTop,x + w,y + h),true);
  if (addBottom) {
    path.append(new Line2D.Double(x + w,y + h - 1,x,y + h - 1),true);
  }
  return path;
}

private static Path2D createTopTabShape ( int x , int y , int w , int h , double rTop , boolean addBottom ) { Path2D path = new Path2D . Double ( ) ; path . append ( new Line2D . Double ( x , y + h - 1 , x , y + rTop ) , true ) ; QuadCurve2D curve = new QuadCurve2D . Double ( x , y + rTop , x , y , x + rTop , y ) ; path . append ( curve , true ) ; path . append ( new Line2D . Double ( x + rTop , y , x + w - rTop , y ) , true ) ; curve = new QuadCurve2D . Double ( x + w - rTop , y , x + w , y , x + w , y + rTop ) ; path . append ( curve , true ) ; path . append ( new Line2D . Double ( x + w , y + rTop , x + w , y + h ) , true ) ; if ( addBottom ) { path . append ( new Line2D . Double ( x + w , y + h - 1 , x , y + h - 1 ) , true ) ; } return path ; }
creates the shape for a top tab .
