public void draw(Graphics2D g) {
      int w = getWidth();
      int h = getHeight();

      RoundRectangle2D box = new RoundRectangle2D.Float(
         0, 0, w, h, 20, 20);
      g.setColor(background);
      g.fill(box);

      GradientPaint paint;
      
      /*
      GradientPaint paint = new GradientPaint(
         0, 0, Color.DARK_GRAY, 0, h, Color.LIGHT_GRAY);
      g.setPaint(paint);
      */

      int bx = (int)getBallX();
      int by = (int)getBallY();
      int bw = (int)getBallWidth();
      int minX = (int)getBallX(this.min);
      int maxX = (int)getBallX(this.max);

      
      g.setColor(isEnabled() ? Color.GRAY : background);
      g.setStroke(new BasicStroke(1.5f));
      g.drawLine(minX, by, maxX, by);
      g.drawLine(maxX + (int)getMargin(), 0, maxX + (int)getMargin(), h);

      g.setColor(isEnabled() ? Color.LIGHT_GRAY : background);
      g.setStroke(new BasicStroke(1.5f));
      g.draw(box);
      
      // Draw ticks
      //g.drawLine(minX, by - bw/4, minX, by + bw/4);
      //g.drawLine(maxX, by - bw/4, maxX, by + bw/4);

      Ellipse2D ball = new Ellipse2D.Double(
         bx - bw/2, by - bw/2, bw, bw);

      g.setColor(isEnabled() ? Color.GRAY : background);
      g.fill(ball);
      int y1 = by - bw/2;
      int y2 = down? by + bw * 2 : by + bw/2;

      if (isEnabled()) {
         paint = new GradientPaint(
            0, y1, new Color(0xddffffff, true),
            0, y2, new Color(0x00ffffff, true));
         g.setPaint(paint);
         g.fill(ball);

         paint = new GradientPaint(
            0, by - bw/2, Color.LIGHT_GRAY,
            0, by + bw/2, Color.BLACK);
         g.setPaint(paint);
         g.draw(ball);
      }

      g.setColor(Color.LIGHT_GRAY);
      g.setFont(font);
      String s = decimalValue.format(value) + unit;
      g.drawString(s, w - getGutter() + 5, h - 17);

      g.setFont(new Font(null, 0, 14));
      g.drawString(getText(), minX, h - 4);
      
   }