public void refresh() {
if (isDisposed()) return ;
List<Peer> upload_peers = null;
UploadSession upload_session = null;
if (upload_manager.hasUpload(download_session.getFileHash())) {
try {
upload_session = upload_manager.getUpload(download_session.getFileHash());
upload_peers = upload_session.getPeers();
} catch (UploadManagerException e) {
e.printStackTrace();
return ;
}
}
List<Peer> download_peers = download_session.getPeers();
for(Peer peer : shown_peers) {
boolean remove = false;
if (!download_session.hasPeer(peer))
if (upload_session == null)
remove = true;
else
remove = !upload_session.hasPeer(peer);
if (remove)
peers_table.removeRow(peer);
}
for(Peer peer : download_peers) {