private void drawEdgeShadow(Graphics g, int startX, int endX, int y, boolean cornerStart, boolean vertical,
                              Color backgroundColor) {
    if (startX + (cornerStart ? 0 : shadowSize + shadowBlendSize) >= endX)
      return;

    g.setColor(getShadowColor(backgroundColor));

    for (int i = 0; i < shadowSize - shadowBlendSize; i++) {
      drawLine(g,
               startX + (cornerStart ? i + (vertical ? 1 : 0) : shadowSize + shadowBlendSize),
               y + i,
               endX - 1,
               y + i,
               vertical);
    }

    for (int i = 0; i < shadowBlendSize; i++) {
      g.setColor(getShadowBlendColor(i, backgroundColor));
      int d = shadowSize - shadowBlendSize + i;
      drawLine(g,
               startX + (cornerStart ? d + (vertical ? 1 : 0) : shadowSize + shadowBlendSize),
               y + d,
               endX - 1,
               y + d,
               vertical);
    }
  }