📄 configsectiontransferautospeedselect.java
字号:
limit_to_text = limittotexthelper;
sm = speedmanager;
super();
}
});
max_upload.addChangeListener(new ParameterChangeAdapter() {
final IntParameter val$max_upload;
final SpeedManager val$sm;
final ConfigSectionTransferAutoSpeedSelect this$0;
public void parameterChanged(Parameter p, boolean caused_internally)
{
if (max_upload.isDisposed())
return;
int value = max_upload.getValue() * 1024;
SpeedManagerLimitEstimate existing = sm.getEstimatedUploadCapacityBytesPerSec();
if (existing.getBytesPerSec() != value)
sm.setEstimatedUploadCapacityBytesPerSec(value, existing.getEstimateType());
}
{
this$0 = ConfigSectionTransferAutoSpeedSelect.this;
max_upload = intparameter;
sm = speedmanager;
super();
}
});
label = new Label(networkGroup, 0);
label = new Label(networkGroup, 0);
Messages.setLanguageText(label, "SpeedView.stats.estdowncap");
gridData = new GridData();
gridData.horizontalIndent = 20;
label.setLayoutData(gridData);
SpeedManagerLimitEstimate down_lim = sm.getEstimatedDownloadCapacityBytesPerSec();
String co_down = "AutoSpeed Network Download Speed (temp)";
String co_down_type = "AutoSpeed Network Download Speed Type (temp)";
COConfigurationManager.setParameter(co_down, down_lim.getBytesPerSec() / 1024);
COConfigurationManager.setParameter(co_down_type, limit_to_text.getSettableType(down_lim));
final IntParameter max_download = new IntParameter(networkGroup, co_down);
final Label download_bits = new Label(networkGroup, 0);
gridData = new GridData();
download_bits.setLayoutData(gridData);
download_bits.setText(getMBitLimit(limit_to_text, (down_lim.getBytesPerSec() / 1024) * 1024));
final StringListParameter max_download_type = new StringListParameter(networkGroup, co_down_type, limit_to_text.getSettableTypes(), limit_to_text.getSettableTypes());
max_download_type.addChangeListener(new ParameterChangeAdapter() {
final StringListParameter val$max_download_type;
final org.gudy.azureus2.ui.swt.views.stats.TransferStatsView.limitToTextHelper val$limit_to_text;
final SpeedManager val$sm;
final ConfigSectionTransferAutoSpeedSelect this$0;
public void parameterChanged(Parameter p, boolean caused_internally)
{
if (max_download_type.isDisposed())
return;
float type = limit_to_text.textToType(max_download_type.getValue());
SpeedManagerLimitEstimate existing = sm.getEstimatedDownloadCapacityBytesPerSec();
if (existing.getEstimateType() != type)
sm.setEstimatedDownloadCapacityBytesPerSec(existing.getBytesPerSec(), type);
}
{
this$0 = ConfigSectionTransferAutoSpeedSelect.this;
max_download_type = stringlistparameter;
limit_to_text = limittotexthelper;
sm = speedmanager;
super();
}
});
max_download.addChangeListener(new ParameterChangeAdapter() {
final IntParameter val$max_download;
final SpeedManager val$sm;
final ConfigSectionTransferAutoSpeedSelect this$0;
public void parameterChanged(Parameter p, boolean caused_internally)
{
if (max_download.isDisposed())
return;
int value = max_download.getValue() * 1024;
SpeedManagerLimitEstimate existing = sm.getEstimatedDownloadCapacityBytesPerSec();
if (existing.getBytesPerSec() != value)
sm.setEstimatedDownloadCapacityBytesPerSec(value, existing.getEstimateType());
}
{
this$0 = ConfigSectionTransferAutoSpeedSelect.this;
max_download = intparameter;
sm = speedmanager;
super();
}
});
label = new Label(networkGroup, 0);
Label reset_label = new Label(networkGroup, 0);
Messages.setLanguageText(reset_label, "ConfigView.section.transfer.autospeed.resetnetwork");
Button reset_button = new Button(networkGroup, 8);
Messages.setLanguageText(reset_button, "ConfigView.section.transfer.autospeed.reset.button");
reset_button.addListener(13, new Listener() {
final SpeedManager val$sm;
final ConfigSectionTransferAutoSpeedSelect this$0;
public void handleEvent(Event event)
{
sm.reset();
}
{
this$0 = ConfigSectionTransferAutoSpeedSelect.this;
sm = speedmanager;
super();
}
});
sm.addListener(new SpeedManagerListener() {
private final SpeedManagerListener listener = this;
final Label val$asn_label;
final SpeedManager val$sm;
final Label val$up_cap;
final org.gudy.azureus2.ui.swt.views.stats.TransferStatsView.limitToTextHelper val$limit_to_text;
final Label val$upload_bits;
final IntParameter val$max_upload;
final StringListParameter val$max_upload_type;
final Label val$down_cap;
final Label val$download_bits;
final IntParameter val$max_download;
final StringListParameter val$max_download_type;
final ConfigSectionTransferAutoSpeedSelect this$0;
public void propertyChanged(final int property)
{
Utils.execSWTThread(new Runnable() {
final int val$property;
final 6 this$1;
public void run()
{
if (asn_label.isDisposed())
sm.removeListener(listener);
else
if (property == 1)
asn_label.setText(sm.getASN());
else
if (property == 2)
{
SpeedManagerLimitEstimate limit = sm.getEstimatedUploadCapacityBytesPerSec();
up_cap.setText(limit_to_text.getLimitText(limit));
upload_bits.setText(getMBitLimit(limit_to_text, limit.getBytesPerSec()));
max_upload.setValue(limit.getBytesPerSec() / 1024);
max_upload_type.setValue(limit_to_text.getSettableType(limit));
} else
if (property == 3)
{
SpeedManagerLimitEstimate limit = sm.getEstimatedDownloadCapacityBytesPerSec();
down_cap.setText(limit_to_text.getLimitText(limit));
download_bits.setText(getMBitLimit(limit_to_text, limit.getBytesPerSec()));
max_download.setValue(limit.getBytesPerSec() / 1024);
max_download_type.setValue(limit_to_text.getSettableType(limit));
}
}
{
this$1 = 6.this;
property = i;
super();
}
});
}
{
this$0 = ConfigSectionTransferAutoSpeedSelect.this;
asn_label = label;
sm = speedmanager;
up_cap = label1;
limit_to_text = limittotexthelper;
upload_bits = label2;
max_upload = intparameter;
max_upload_type = stringlistparameter;
down_cap = label3;
download_bits = label4;
max_download = intparameter1;
max_download_type = stringlistparameter1;
super();
}
});
spacer = new Label(cSection, 0);
gridData = new GridData();
gridData.horizontalSpan = 3;
spacer.setLayoutData(gridData);
BooleanParameter debug_au = new BooleanParameter(cSection, "Auto Upload Speed Debug Enabled", "ConfigView.section.transfer.autospeed.enabledebug");
gridData = new GridData();
gridData.horizontalSpan = 3;
debug_au.setLayoutData(gridData);
spacer = new Label(cSection, 0);
gridData = new GridData();
gridData.horizontalSpan = 3;
spacer.setLayoutData(gridData);
Group azWiki = new Group(cSection, 64);
gridData = new GridData();
azWiki.setLayoutData(gridData);
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.marginHeight = 1;
layout.marginWidth = 20;
azWiki.setLayout(layout);
azWiki.setText(MessageText.getString("Utils.link.visit"));
Label linkLabel = new Label(azWiki, 0);
linkLabel.setText((new StringBuilder()).append(Constants.APP_NAME).append(" Wiki AutoSpeed (beta)").toString());
linkLabel.setData("http://www.azureuswiki.com/index.php/Auto_Speed");
linkLabel.setCursor(Cursors.handCursor);
linkLabel.setForeground(Colors.blue);
gridData = new GridData();
linkLabel.setLayoutData(gridData);
linkLabel.addMouseListener(new MouseAdapter() {
final ConfigSectionTransferAutoSpeedSelect this$0;
public void mouseDoubleClick(MouseEvent arg0)
{
Utils.launch((String)((Label)arg0.widget).getData());
}
public void mouseUp(MouseEvent arg0)
{
Utils.launch((String)((Label)arg0.widget).getData());
}
{
this$0 = ConfigSectionTransferAutoSpeedSelect.this;
super();
}
});
return cSection;
}
protected String getMBitLimit(org.gudy.azureus2.ui.swt.views.stats.TransferStatsView.limitToTextHelper helper, long value)
{
return (new StringBuilder()).append("(").append(value != 0L ? DisplayFormatters.formatByteCountToBitsPerSec(value) : helper.getUnlimited()).append(")").toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -