private static float getY2(JComponent c, GradientDirection d) {
    return d == GradientDirection.BOTTOM_LEFT_TOP_RIGHT ||
           d == GradientDirection.LEFT_RIGHT ? 0 : c.getHeight();
  }
private static float getY2(JComponent c, GradientDirection d)