📄 remainingitem.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: RemainingItem.java
package org.gudy.azureus2.ui.swt.views.tableitems.mytorrents;
import org.gudy.azureus2.core3.download.DownloadManager;
import org.gudy.azureus2.core3.download.DownloadManagerStats;
import org.gudy.azureus2.core3.util.DisplayFormatters;
import org.gudy.azureus2.plugins.download.DownloadTypeIncomplete;
import org.gudy.azureus2.plugins.ui.tables.*;
import org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn;
public class RemainingItem extends CoreTableColumn
implements TableCellRefreshListener
{
public static final Class DATASOURCE_TYPE = org/gudy/azureus2/plugins/download/DownloadTypeIncomplete;
public static final String COLUMN_ID = "remaining";
private boolean bLastValueEstimate;
public RemainingItem(String sTableID)
{
super(DATASOURCE_TYPE, "remaining", 2, 70, sTableID);
bLastValueEstimate = false;
setRefreshInterval(-2);
setMinWidthAuto(true);
}
public void fillTableColumnInfo(TableColumnInfo info)
{
info.addCategories(new String[] {
"content", "progress"
});
}
public void refresh(TableCell cell)
{
long lRemaining = getRemaining(cell);
if (!cell.setSortValue(lRemaining) && cell.isValid())
return;
if (bLastValueEstimate)
cell.setText((new StringBuilder()).append("~ ").append(DisplayFormatters.formatByteCountToKiBEtc(lRemaining)).toString());
else
cell.setText(DisplayFormatters.formatByteCountToKiBEtc(lRemaining));
}
private long getRemaining(TableCell cell)
{
DownloadManager manager = (DownloadManager)cell.getDataSource();
if (manager == null)
return 0L;
else
return manager.getStats().getRemaining();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -