ViewDownSpeedGraphpublic class ViewDownSpeedGraph extends org.gudy.azureus2.ui.swt.views.AbstractIView
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 | downSpeedCanvas | org.gudy.azureus2.ui.swt.components.graphics.SpeedGraphic | downSpeedGraphic |
Constructors Summary |
---|
public ViewDownSpeedGraph()
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 void | delete()
Utils.disposeComposite(downSpeedCanvas);
downSpeedGraphic.dispose();
| public org.eclipse.swt.widgets.Composite | getComposite()
return downSpeedCanvas;
| public java.lang.String | getData()
return "SpeedView.title.full";
| public java.lang.String | getFullTitle()
return "DL Speed";
| public void | initialize(org.eclipse.swt.widgets.Composite composite)
GridData gridData;
downSpeedCanvas = new Canvas(composite, SWT.NONE);
gridData = new GridData(GridData.FILL_BOTH);
downSpeedCanvas.setLayoutData(gridData);
downSpeedGraphic = SpeedGraphic.getInstance();
downSpeedGraphic.initialize(downSpeedCanvas);
//downSpeedGraphic.setAutoAlpha(true);
SWTSkinProperties skinProperties = SWTSkinFactory.getInstance().getSkinProperties();
Color cBG1 = skinProperties.getColor("color.topbar.speed.bg1");
Color cBG2 = skinProperties.getColor("color.topbar.speed.bg2");
Color cBG3 = skinProperties.getColor("color.topbar.speed.bg3");
downSpeedGraphic.setColors(cBG1, cBG2, cBG3);
downSpeedGraphic.setLineColors(skinProperties.getColor("color.topbar.speed.average"),
skinProperties.getColor("color.topbar.speed.value0"),
skinProperties.getColor("color.topbar.speed.value1"),
skinProperties.getColor("color.topbar.speed.value2plus"),
skinProperties.getColor("color.topbar.speed.trimmed"));
| public void | periodicUpdate()
int swarms_peer_speed = (int) stats.getTotalSwarmsPeerRate(true, false);
downSpeedGraphic.addIntsValue(new int[] {
stats.getDataReceiveRate() + stats.getProtocolReceiveRate(),
COConfigurationManager.getIntParameter("Max Download Speed KBs") * 1024,
swarms_peer_speed
});
| public void | refresh()
downSpeedGraphic.refresh();
|
|