@Override
  public void paint(Graphics g) {
    if (myDelayedAnimation) {
      prepareForAnimation();
      myDelayedAnimation = false;
    }

    if (myCurrentImage == null) {
      super.paint(g);
      return;
    }

    g.drawImage(myCurrentImage, 0, 0, myCurrentImage.getWidth(), myCurrentImage.getHeight(), null);
    if (myListener != null) {
      myListener.onPaint();
    }
  }
@Override
  public void paint(Graphics g)