FileDocCategorySizeDatePackage
UpSpeedLimitItem.javaAPI DocAzureus 3.0.3.42293Sun Sep 23 04:55:06 BST 2007org.gudy.azureus2.ui.swt.views.tableitems.peers

UpSpeedLimitItem

public class UpSpeedLimitItem extends org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn implements org.gudy.azureus2.plugins.ui.tables.TableCellRefreshListener
author
Olivier Chalouhi

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

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

		PEPeer peer = (PEPeer)cell.getDataSource();
	  long value = (peer == null) ? 0 : peer.getUploadRateLimitBytesPerSecond();
	  if (!cell.setSortValue(value) && cell.isValid())
	    return;
	  
	  if(value == -1) {
	    cell.setText(MessageText.getString("MyTorrents.items.UpSpeedLimit.disabled"));
	  } else if(value  == 0) {
	    cell.setText(Constants.INFINITY_STRING);
	  } else {
	    cell.setText(DisplayFormatters.formatByteCountToKiBEtcPerSec(value));
	  }