code: public Paint getTopShadowGradient(Shape s) {
          Rectangle2D bounds = s.getBounds2D();
          float       minY   = (float) bounds.getMinY();
          float       maxY   = (float) bounds.getMaxY();
          float       midX   = (float) bounds.getCenterX();
  
          return new LinearGradientPaint(midX, minY, midX, maxY, (new float[] { 0f, 1f }), new Color[] { innerShadow.top, transparentColor });
      }
docs: Create the gradient for the top of a rectangular shadow.
  
  @param  s the shape of the gradient. This is only used for its bounds.
  
  @return the gradient.