|
|
|
@ -12,6 +12,8 @@ package gui;
|
|
|
|
|
import clientP2P.*;
|
|
|
|
|
import tools.LogLevel;
|
|
|
|
|
import tools.Logger;
|
|
|
|
|
import serverP2P.ServerManagementUDP;
|
|
|
|
|
import serverP2P.ServerManagementTCP;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author Louis Royer
|
|
|
|
@ -30,6 +32,9 @@ public class DownloadSelectionGen extends javax.swing.JPanel {
|
|
|
|
|
private String[] listFilesToDownload;
|
|
|
|
|
private ClientManagement clientManagement;
|
|
|
|
|
private Logger logger;
|
|
|
|
|
private ServerManagementTCP smtcp;
|
|
|
|
|
private ServerManagementUDP smudp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param listFilesToDownload list of files to display
|
|
|
|
@ -37,10 +42,12 @@ public class DownloadSelectionGen extends javax.swing.JPanel {
|
|
|
|
|
* @param logger logger
|
|
|
|
|
* Creates new form ArgumentsGen
|
|
|
|
|
*/
|
|
|
|
|
public DownloadSelectionGen(String[] listFilesToDownload, ClientManagement clientManagement, Logger logger) {
|
|
|
|
|
public DownloadSelectionGen(String[] listFilesToDownload, ClientManagement clientManagement, Logger logger, ServerManagementTCP smtcp, ServerManagementUDP smudp) {
|
|
|
|
|
this.listFilesToDownload = listFilesToDownload;
|
|
|
|
|
this.clientManagement = clientManagement;
|
|
|
|
|
this.logger = logger;
|
|
|
|
|
this.smtcp = smtcp;
|
|
|
|
|
this.smudp = smudp;
|
|
|
|
|
initComponents();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -121,7 +128,7 @@ public class DownloadSelectionGen extends javax.swing.JPanel {
|
|
|
|
|
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
|
|
|
|
|
String fileSelected = jList1.getSelectedValue();
|
|
|
|
|
System.out.println("File to download: " + fileSelected);
|
|
|
|
|
DownloadFileGUI dl = new DownloadFileGUI(fileSelected, clientManagement, logger);
|
|
|
|
|
DownloadFileGUI dl = new DownloadFileGUI(fileSelected, clientManagement, logger, smtcp, smudp);
|
|
|
|
|
dl.download();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|