@Override
    public void paint(Graphics g, JComponent c) {
      JLabel label = (JLabel)c;
      String text = label.getText();
      Icon icon = (label.isEnabled()) ? label.getIcon() : label.getDisabledIcon();

      if ((icon == null) && (text == null)) {
        return;
      }

      Rectangle paintIconR = new Rectangle();
      Rectangle paintTextR = new Rectangle();
      Rectangle paintViewR = new Rectangle();
      Insets paintViewInsets = new Insets(0, 0, 0, 0);

      FontMetrics fm = g.getFontMetrics();
      paintViewInsets = c.getInsets(paintViewInsets);

      paintViewR.x = paintViewInsets.left;
      paintViewR.y = paintViewInsets.top;

      // Use inverted height & width
      paintViewR.height = c.getWidth() - (paintViewInsets.left + paintViewInsets.right);
      paintViewR.width = c.getHeight() - (paintViewInsets.top + paintViewInsets.bottom);

      paintIconR.x = 0;
      paintIconR.y = 0;
      paintIconR.width = 0;
      paintIconR.height = 0;
      paintTextR.x = 0;
      paintTextR.y = 0;
      paintTextR.width = 0;
      paintTextR.height = 0;

      String clippedText = layoutCL(label, fm, text, icon, paintViewR, paintIconR, paintTextR);
      // Setup shadow in textLayout
      Graphics2D g2 = (Graphics2D) g;
      g.setFont(getFont());
//      Paint fillPaint = new GradientPaint(0, 0, new Color(1.0f, 1.0f, 1.0f)
//                                        , 0, getFont().getSize(), new Color(0.9f, 0.9f, 0.9f));
      FontRenderContext fontRenderContext = g2.getFontRenderContext();

      TextLayout textLayout = new TextLayout(clippedText, g2.getFont(), fontRenderContext);

      AffineTransform tr = g2.getTransform();
      if (!topdown) {
        if (clockwise) {
          g2.rotate(Math.PI / 2);
          g2.translate(0, -c.getWidth());
        } 
        else {
          g2.rotate(-Math.PI / 2);
          g2.translate(-c.getHeight(), 0);
        }
      }
      if (icon != null) {
        icon.paintIcon(c, g, paintIconR.x, paintIconR.y);
      }

      if (text != null) {
        int textX = paintTextR.x;
        int textY = paintTextR.y + fm.getAscent();
        
        if (topdown) {
          topDown(g, textX, textY, text);
        }
        else {
          if (label.isEnabled()) {
            // Draws shadow
            g2.setPaint(shadowColor);
            textLayout.draw(g2, textX - 3, textY + 3);
            // Paints text
            paintEnabledText(label, g, clippedText, textX, textY);
          } 
          else {
            // Draws shadow
            g2.setPaint(shadowColor);
            textLayout.draw(g2, textX - 3, textY + 3);
            // Paints text
            paintDisabledText(label, g, clippedText, textX, textY);
          }
        }
      }
      g2.setTransform(tr);
    }