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