FileDocCategorySizeDatePackage
ViewUpSpeedGraph.javaAPI DocAzureus 3.0.3.43441Sat Jun 02 14:13:54 BST 2007com.aelitis.azureus.ui.swt.views

ViewUpSpeedGraph

public class ViewUpSpeedGraph extends org.gudy.azureus2.ui.swt.views.AbstractIView
author
TuxPaper
created
Apr 7, 2007

Fields Summary
org.gudy.azureus2.core3.global.GlobalManager
manager
org.gudy.azureus2.core3.global.GlobalManagerStats
stats
org.gudy.azureus2.core3.stats.transfer.OverallStats
totalStats
org.eclipse.swt.widgets.Canvas
upSpeedCanvas
org.gudy.azureus2.ui.swt.components.graphics.SpeedGraphic
upSpeedGraphic
Constructors Summary
public ViewUpSpeedGraph()

		this.manager = AzureusCoreFactory.getSingleton().getGlobalManager();
		this.stats = manager.getStats();
		this.totalStats = StatsFactory.getStats();
		
		SimpleTimer.addPeriodicEvent("TopBarSpeedGraphicView", 1000, new TimerEventPerformer() {
			public void perform(TimerEvent event) {
				periodicUpdate();
			}
		});
	
Methods Summary
public voiddelete()

		Utils.disposeComposite(upSpeedCanvas);
		upSpeedGraphic.dispose();
	
public org.eclipse.swt.widgets.CompositegetComposite()

		return upSpeedCanvas;
	
public java.lang.StringgetData()

		return "SpeedView.title.full";
	
public java.lang.StringgetFullTitle()

		return "UL Speed";
	
public voidinitialize(org.eclipse.swt.widgets.Composite composite)

		GridData gridData;

		upSpeedCanvas = new Canvas(composite, SWT.NULL);
		gridData = new GridData(GridData.FILL_BOTH);
		upSpeedCanvas.setLayoutData(gridData);
		upSpeedGraphic = SpeedGraphic.getInstance();
		upSpeedGraphic.initialize(upSpeedCanvas);
		//upSpeedGraphic.setAutoAlpha(true);
	
public voidperiodicUpdate()


		int swarms_peer_speed = (int) stats.getTotalSwarmsPeerRate(true, false);

		upSpeedGraphic.addIntsValue(new int[] {
			stats.getDataSendRate() + stats.getProtocolSendRate(),
			COConfigurationManager.getIntParameter(TransferSpeedValidator.getActiveUploadParameter(manager)) * 1024,
			swarms_peer_speed
		});
	
public voidrefresh()

		upSpeedGraphic.refresh();