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

SwarmAverageSpeed

public class SwarmAverageSpeed extends org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn implements TableCellRefreshListener

Fields Summary
Constructors Summary
public SwarmAverageSpeed(String sTableID)

    super("swarm_average_speed", ALIGN_TRAIL, POSITION_INVISIBLE, 70, sTableID);
    setRefreshInterval(INTERVAL_LIVE);
    setMinWidthAuto(true);
  
Methods Summary
public voidrefresh(TableCell cell)

    long speed = -1;

    DownloadManager dm = (DownloadManager)cell.getDataSource();
    if( dm != null ) {
    	speed = dm.getStats().getTotalAveragePerPeer();
    }

    if( !cell.setSortValue( speed ) && cell.isValid() ) {
      return;
    }
    
    if( speed < 0 ) {
      cell.setText( "" );
    }
    else {
      cell.setText( DisplayFormatters.formatByteCountToKiBEtcPerSec( speed ) );
    }