Default Constructor super("%", ALIGN_TRAIL, POSITION_LAST, 60, TableManager.TABLE_TORRENT_FILES); setRefreshInterval(INTERVAL_LIVE); setMinWidthAuto(true);
super("%", ALIGN_TRAIL, POSITION_LAST, 60, TableManager.TABLE_TORRENT_FILES); setRefreshInterval(INTERVAL_LIVE); setMinWidthAuto(true);
DiskManagerFileInfo fileInfo = (DiskManagerFileInfo)cell.getDataSource(); long percent = 0; if (fileInfo != null ){ if ( fileInfo.getDownloaded() < 0 ){ percent = -1; // unknown skeleton value }else if ( fileInfo.getLength() != 0 ){ percent = (1000 * fileInfo.getDownloaded()) / fileInfo.getLength(); } }else{ percent = -1; // unknown skeleton value } if( !cell.setSortValue( percent ) && cell.isValid() ) { return; } cell.setText( percent < 0?"":DisplayFormatters.formatPercentFromThousands((int)percent));