In a previous paper, we have found that the resonance structure of the present Jupiter Trojan swarms could be split up into four different families of resonances. Here, in a first step, we generalize these families in order to describe the resonances occurring in Trojan swarms embedded in a generic planetary system. The location of these families changes under a modification of the fundamental frequencies of the planets and we show how the resonant structure would evolve during a planetary migration. We present a general method, based on the knowledge of the fundamental frequencies of the planets and on those that can be reached by the Trojans, which makes it possible to predict and localize the main events arising in the swarms during migration. In particular, we show how the size and stability of the Trojan swarms are affected by the modification of the frequencies of the planets. Finally, we use this method to study the global dynamics of the Jovian Trojan swarms when Saturn migrates outwards. Besides the two resonances found by Morbidelli et al. which could have led to the capture of the current population just after the crossing of the 2:1 orbital resonance, we also point out several sequences of chaotic events that can influence the Trojan population.