protected Paint createVerticalGradient(Shape s,FourColors colors){
  Rectangle2D bounds=s.getBounds2D();
  float xCenter=(float)bounds.getCenterX();
  float yMin=(float)bounds.getMinY();
  float yMax=(float)bounds.getMaxY();
  return createGradient(xCenter,yMin,xCenter,yMax,new float[]{0f,0.45f,0.62f,1f},new Color[]{colors.top,colors.upperMid,colors.lowerMid,colors.bottom});
}

protected Paint createVerticalGradient ( Shape s , FourColors colors ) { Rectangle2D bounds = s . getBounds2D ( ) ; float xCenter = ( float ) bounds . getCenterX ( ) ; float yMin = ( float ) bounds . getMinY ( ) ; float yMax = ( float ) bounds . getMaxY ( ) ; return createGradient ( xCenter , yMin , xCenter , yMax , new float [ ] { 0f , 0.45f , 0.62f , 1f } , new Color [ ] { colors . top , colors . upperMid , colors . lowerMid , colors . bottom } ) ; }
creates a simple vertical gradient using the shape for bounds and the colors for top , two middle , and bottom colors .
