FileDocCategorySizeDatePackage
RemainingItem.javaAPI DocAzureus 3.0.3.42333Mon Feb 19 14:24:06 GMT 2007org.gudy.azureus2.ui.swt.views.tableitems.mytorrents

RemainingItem

public class RemainingItem extends org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn implements TableCellRefreshListener
author
Olivier
author
TuxPaper (2004/Apr/17: modified to TableCellAdapter)

Fields Summary
private boolean
bLastValueEstimate
Constructors Summary
public RemainingItem()
Default Constructor

    super("remaining", ALIGN_TRAIL, POSITION_INVISIBLE, 70, TableManager.TABLE_MYTORRENTS_INCOMPLETE);
    setRefreshInterval(INTERVAL_LIVE);
    setMinWidthAuto(true);
  
Methods Summary
private longgetRemaining(TableCell cell)

    DownloadManager manager = (DownloadManager)cell.getDataSource();
    if (manager == null)
      return 0;

   return( manager.getStats().getRemaining());
  
public voidrefresh(TableCell cell)

  
      
    long lRemaining = getRemaining(cell);

    if( !cell.setSortValue( lRemaining ) && cell.isValid() ) {
      return;
    }
    
    if (bLastValueEstimate) {
      cell.setText("~ " + DisplayFormatters.formatByteCountToKiBEtc(lRemaining));
    } else {
      cell.setText(DisplayFormatters.formatByteCountToKiBEtc(lRemaining));
    }