private static Shape createArrowShape ( int w , int y0 , int y1 ) { Path2D path = new Path2D . Double ( ) ; path . moveTo ( 0 , y0 ) ; if ( ( w & 1 ) == 0 ) { path . lineTo ( w >> 1 , y1 ) ; } else { int c = w >> 1 ; path . lineTo ( c , y1 ) ; path . lineTo ( c + 1 , y1 ) ; } path . lineTo ( w , y0 ) ; path . closePath ( ) ; return path ; }
Creates a triangle shape with the given coordinates