Reconfigurable photonic crystal