Judge: Islamic cell planned Barcelona attack