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

DownSpeedLimitItem

public class DownSpeedLimitItem extends org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn implements org.gudy.azureus2.plugins.ui.tables.TableCellRefreshListener
author
parg

Fields Summary
Constructors Summary
public DownSpeedLimitItem(String sTableID)
Default Constructor

	  super("maxdownspeed", ALIGN_TRAIL, POSITION_INVISIBLE, 35, sTableID);
	  setRefreshInterval(INTERVAL_LIVE);
    setMinWidthAuto(true);
	
Methods Summary
public voidrefresh(org.gudy.azureus2.plugins.ui.tables.TableCell cell)

	  DownloadManager dm = (DownloadManager)cell.getDataSource();
	  long value = (dm == null) ? 0 : dm.getStats().getDownloadRateLimitBytesPerSecond();
	  if (!cell.setSortValue(value) && cell.isValid())
	    return;
	  
	  if(value == -1) {
	    cell.setText(MessageText.getString("MyTorrents.items.DownSpeedLimit.disabled"));
	  } else if(value  == 0) {
	    cell.setText(Constants.INFINITY_STRING);
	  } else {
	    cell.setText(DisplayFormatters.formatByteCountToKiBEtcPerSec(value));
	  }