@Override public void onPaint(ViewTransform transform,Graphics2D g){
  int x=transform.getSwingX(mBounds.x);
  int y=transform.getSwingY(mBounds.y);
  int w=transform.getSwingDimension(mBounds.width);
  int h=transform.getSwingDimension(mBounds.height);
  double progress=getProgress();
  int alpha=getPulsatingAlpha(progress);
  Color highlight=new Color(mColor.getRed(),mColor.getGreen(),mColor.getBlue(),alpha);
  g.setColor(highlight);
  int extra=getExtra(progress);
  g.fillRect(x - extra,y - extra,w + 2 * extra + 1,h + 2 * extra + 1);
}

@ Override public void onPaint ( ViewTransform transform , Graphics2D g ) { int x = transform . getSwingX ( mBounds . x ) ; int y = transform . getSwingY ( mBounds . y ) ; int w = transform . getSwingDimension ( mBounds . width ) ; int h = transform . getSwingDimension ( mBounds . height ) ; double progress = getProgress ( ) ; int alpha = getPulsatingAlpha ( progress ) ; Color highlight = new Color ( mColor . getRed ( ) , mColor . getGreen ( ) , mColor . getBlue ( ) , alpha ) ; g . setColor ( highlight ) ; int extra = getExtra ( progress ) ; g . fillRect ( x - extra , y - extra , w + 2 * extra + 1 , h + 2 * extra + 1 ) ; }
paint method for the animation . we simply draw an opaque circle at ( x , y ) , applying a transparency as the animation progresses .
