Methods Summary |
---|
public void | delete()
Utils.disposeComposite(panel);
downSpeedGraphic.dispose();
upSpeedGraphic.dispose();
COConfigurationManager.removeParameterListener("Stats Graph Dividers", this);
|
public org.eclipse.swt.widgets.Composite | getComposite()
return panel;
|
public java.lang.String | getData()
return "SpeedView.title.full";
|
public java.lang.String | getFullTitle()
return MessageText.getString("SpeedView.title.full"); //$NON-NLS-1$
|
public void | initialize(org.eclipse.swt.widgets.Composite composite)
panel = new Composite(composite,SWT.NULL);
panel.setLayout(new GridLayout());
GridData gridData;
Group gDownSpeed = new Group(panel,SWT.NULL);
Messages.setLanguageText(gDownSpeed,"SpeedView.downloadSpeed.title");
gridData = new GridData(GridData.FILL_BOTH);
gDownSpeed.setLayoutData(gridData);
gDownSpeed.setLayout(new GridLayout());
downSpeedCanvas = new Canvas(gDownSpeed,SWT.NO_BACKGROUND);
gridData = new GridData(GridData.FILL_BOTH);
downSpeedCanvas.setLayoutData(gridData);
downSpeedGraphic = SpeedGraphic.getInstance();
downSpeedGraphic.initialize(downSpeedCanvas);
Color[] colors = downSpeedGraphic.colors;
Group gUpSpeed = new Group(panel,SWT.NULL);
Messages.setLanguageText(gUpSpeed,"SpeedView.uploadSpeed.title");
gridData = new GridData(GridData.FILL_BOTH);
gUpSpeed.setLayoutData(gridData);
gUpSpeed.setLayout(new GridLayout());
upSpeedCanvas = new Canvas(gUpSpeed,SWT.NO_BACKGROUND);
gridData = new GridData(GridData.FILL_BOTH);
upSpeedCanvas.setLayoutData(gridData);
upSpeedGraphic = SpeedGraphic.getInstance();
upSpeedGraphic.initialize(upSpeedCanvas);
COConfigurationManager.addAndFireParameterListener("Stats Graph Dividers", this);
upSpeedGraphic.setLineColors(colors);
String[] colorConfigs = new String[] {
"ActivityView.legend.peeraverage",
"ActivityView.legend.achieved",
"ActivityView.legend.limit",
"ActivityView.legend.swarmaverage",
"ActivityView.legend.trimmed"
};
Legend.createLegendComposite(panel, colors, colorConfigs);
|
public void | parameterChanged(java.lang.String param_name)
boolean update_dividers = COConfigurationManager.getBooleanParameter("Stats Graph Dividers");
int update_divider_width = update_dividers ? 60 : 0;
downSpeedGraphic.setUpdateDividerWidth(update_divider_width);
upSpeedGraphic.setUpdateDividerWidth(update_divider_width);
|
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 });
upSpeedGraphic.addIntsValue(
new int[]{ stats.getDataSendRate() + stats.getProtocolSendRate(),
COConfigurationManager.getIntParameter(TransferSpeedValidator.getActiveUploadParameter( manager )) * 1024,
swarms_peer_speed });
|
public void | refresh()
downSpeedGraphic.refresh();
upSpeedGraphic.refresh();
|