}
DownloadManager download_manager = file==null?null:file.getDownloadManager();
DiskManager disk_manager = download_manager==null?null:download_manager.getDiskManager();
PEPeerManager peer_manager = download_manager==null?null:download_manager.getPeerManager();
if ( file == null || disk_manager == null || peer_manager == null ) {
GC gc = new GC(fileInfoCanvas);
gc.fillRectangle(bounds);
gc.dispose();
return;
}
int first_piece = file.getFirstPieceNumber();
int num_pieces = file.getNbPieces();
int iNumCols = bounds.width / BLOCK_SIZE;
int iNeededHeight = (((num_pieces - 1) / iNumCols) + 1)
* BLOCK_SIZE;
if (sc.getMinHeight() != iNeededHeight) {
sc.setMinHeight(iNeededHeight);
sc.layout(true, true);
bounds = fileInfoCanvas.getClientArea();
}
img = new Image(fileInfoCanvas.getDisplay(), bounds.width, iNeededHeight);
GC gcImg = new GC(img);
try {
gcImg.setBackground(fileInfoCanvas.getBackground());
gcImg.fillRectangle(0, 0, bounds.width, bounds.height);
DiskManagerPiece[] dm_pieces = disk_manager.getPieces();
PEPiece[] pe_pieces = peer_manager.getPieces();
int iRow = 0;
int iCol = 0;
for (int i = first_piece; i < first_piece+num_pieces; i++) {