A Western New York judge agreed that it was improper to have spoken to media during an anti-violence demonstration as a related criminal case played out, as was his request for a moment of silence while presiding over another matter involving two police officers who were struck by gunfire, one of them killed.