Java animations for sorting algorithms , (thread and canvas)