📄 upratioitem.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: UpRatioItem.java
package org.gudy.azureus2.ui.swt.views.tableitems.peers;
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 UpRatioItem extends CoreTableColumn
implements TableCellRefreshListener
{
public UpRatioItem(String table_id)
{
super("UpRatio", 2, -1, 70, table_id);
setRefreshInterval(-2);
}
public void fillTableColumnInfo(TableColumnInfo info)
{
info.addCategories(new String[] {
"sharing"
});
}
public void refresh(TableCell cell)
{
PEPeer peer = (PEPeer)cell.getDataSource();
float value = 0.0F;
long lDivisor = 0L;
long lDivident = 0L;
if (peer != null)
{
lDivisor = peer.getStats().getTotalBytesDownloadedByPeer() - peer.getStats().getTotalDataBytesSent();
lDivident = peer.getStats().getTotalDataBytesSent();
if (lDivisor > 1024L)
{
value = (float)lDivident / (float)lDivisor;
if (value == 0.0F)
value = -1F;
} else
if (lDivident > 0L)
value = 3.1536E+007F;
}
if (!cell.setSortValue((long)(value * 1000F)) && cell.isValid())
return;
String s;
if (lDivisor <= 0L)
s = "";
else
if (value == 3.1536E+007F)
s = "∞:1";
else
if (value == -1F)
s = "1:∞";
else
s = (new StringBuilder()).append(DisplayFormatters.formatDecimal(value, 2)).append(":1").toString();
cell.setText(s);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -