📄 badavailtimeitem.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: BadAvailTimeItem.java
package org.gudy.azureus2.ui.swt.views.tableitems.mytorrents;
import java.util.Locale;
import org.gudy.azureus2.core3.download.*;
import org.gudy.azureus2.core3.internat.MessageText;
import org.gudy.azureus2.core3.peer.PEPeerManager;
import org.gudy.azureus2.core3.util.DisplayFormatters;
import org.gudy.azureus2.plugins.download.Download;
import org.gudy.azureus2.plugins.ui.tables.*;
import org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn;
public class BadAvailTimeItem extends CoreTableColumn
implements TableCellRefreshListener
{
public static final Class DATASOURCE_TYPE = org/gudy/azureus2/plugins/download/Download;
public static final String COLUMN_ID = "bad_avail_time";
private static String now_string;
public BadAvailTimeItem(String sTableID)
{
super(DATASOURCE_TYPE, "bad_avail_time", 3, 120, sTableID);
setRefreshInterval(-2);
}
public void fillTableColumnInfo(TableColumnInfo info)
{
info.addCategories(new String[] {
"swarm", "time"
});
info.setProficiency((byte)2);
}
public void refresh(TableCell cell)
{
DownloadManager dm = (DownloadManager)cell.getDataSource();
long value = dm != null ? dm.getStats().getAvailWentBadTime() : -1L;
if (value == 0L)
{
PEPeerManager pm = dm.getPeerManager();
if (pm == null || (double)pm.getMinAvailability() < 1.0D)
{
long stopped = dm.getDownloadState().getLongAttribute("timestopped");
if (stopped > 0L)
value = stopped;
else
value = -1L;
} else
{
value = -2L;
}
}
String text;
if (value == -1L)
text = "";
else
if (value == -2L)
text = now_string;
else
text = DisplayFormatters.formatDate(value);
if (!cell.setSortValue(value) && cell.isValid())
{
return;
} else
{
cell.setText(text);
return;
}
}
static
{
MessageText.addAndFireListener(new org.gudy.azureus2.core3.internat.MessageText.MessageTextListener() {
public void localeChanged(Locale old_locale, Locale new_locale)
{
BadAvailTimeItem.now_string = MessageText.getString("SpeedView.stats.now");
}
});
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -