📄 upitem.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: UpItem.java
package org.gudy.azureus2.ui.swt.views.tableitems.peers;
import org.gudy.azureus2.core3.config.COConfigurationManager;
import org.gudy.azureus2.core3.config.ParameterListener;
import org.gudy.azureus2.core3.peer.PEPeer;
import org.gudy.azureus2.core3.peer.PEPeerStats;
import org.gudy.azureus2.core3.util.DisplayFormatters;
import org.gudy.azureus2.plugins.ui.tables.*;
import org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn;
public class UpItem extends CoreTableColumn
implements TableCellRefreshListener
{
protected static boolean separate_prot_data_stats;
protected static boolean data_stats_only;
public UpItem(String table_id)
{
super("upload", 2, -1, 70, table_id);
setRefreshInterval(-2);
}
public void fillTableColumnInfo(TableColumnInfo info)
{
info.addCategories(new String[] {
"bytes"
});
}
public void refresh(TableCell cell)
{
PEPeer peer = (PEPeer)cell.getDataSource();
long data_value = 0L;
long prot_value = 0L;
if (peer != null)
{
data_value = peer.getStats().getTotalDataBytesSent();
prot_value = peer.getStats().getTotalProtocolBytesSent();
}
long sort_value;
if (separate_prot_data_stats)
sort_value = (data_value << 24) + prot_value;
else
if (data_stats_only)
sort_value = data_value;
else
sort_value = data_value + prot_value;
if (!cell.setSortValue(sort_value) && cell.isValid())
{
return;
} else
{
cell.setText(DisplayFormatters.formatDataProtByteCountToKiBEtc(data_value, prot_value));
return;
}
}
static
{
COConfigurationManager.addAndFireParameterListeners(new String[] {
"config.style.dataStatsOnly", "config.style.separateProtDataStats"
}, new ParameterListener() {
public void parameterChanged(String x)
{
UpItem.separate_prot_data_stats = COConfigurationManager.getBooleanParameter("config.style.separateProtDataStats");
UpItem.data_stats_only = COConfigurationManager.getBooleanParameter("config.style.dataStatsOnly");
}
});
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -