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

SwarmAverageCompletion

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

Fields Summary
Constructors Summary
public SwarmAverageCompletion(String sTableID)

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

    int average = -1;

    DownloadManager dm = (DownloadManager)cell.getDataSource();
    
    if( dm != null ) {
    	PEPeerManager pm = dm.getPeerManager();
    	
    	if( pm != null ) {
    		average = pm.getAverageCompletionInThousandNotation();
    	}
    }

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