FileDocCategorySizeDatePackage
GainItem.javaAPI DocAzureus 3.0.3.41882Sun Sep 23 04:55:16 BST 2007org.gudy.azureus2.ui.swt.views.tableitems.peers

GainItem

public class GainItem extends org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn implements TableCellRefreshListener
author
The8472
created
Jun 28, 2007

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

    super("gain", ALIGN_TRAIL, POSITION_INVISIBLE, 70, table_id);
    setRefreshInterval(INTERVAL_LIVE);
  
Methods Summary
public voidrefresh(TableCell cell)

    PEPeer peer = (PEPeer)cell.getDataSource();
    long value = (peer == null) ? 0 : peer.getStats().getTotalDataBytesReceived()-peer.getStats().getTotalDataBytesSent();

    if (!cell.setSortValue(value) && cell.isValid())
      return;

    cell.setText((value >= 0 ? "" : "-") + DisplayFormatters.formatByteCountToKiBEtc(Math.abs(value)));