FileDocCategorySizeDatePackage
DownSpeedItem.javaAPI DocAzureus 3.0.3.42161Sun Sep 23 04:55:00 BST 2007org.gudy.azureus2.ui.swt.views.tableitems.peers

DownSpeedItem

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

Fields Summary
Constructors Summary
public DownSpeedItem(String table_id)
Default Constructor

    super("downloadspeed", ALIGN_TRAIL, POSITION_LAST, 65, table_id);
    setRefreshInterval(INTERVAL_LIVE);
  
Methods Summary
public voidrefresh(TableCell cell)

    PEPeer peer = (PEPeer)cell.getDataSource();
    long data_value	= 0;
    long prot_value	= 0;
    
    if ( peer != null ){
    	data_value = peer.getStats().getDataReceiveRate();
       	prot_value = peer.getStats().getProtocolReceiveRate();
    }
    long	sort_value = ( data_value<<32 ) + prot_value;
    
    if (!cell.setSortValue(sort_value) && cell.isValid())
      return;

    cell.setText(DisplayFormatters.formatDataProtByteCountToKiBEtcPerSec(data_value,prot_value));