Search in sources :

Example 6 with TorrentOpenFileOptions

use of com.biglybt.core.torrent.impl.TorrentOpenFileOptions in project BiglyBT by BiglySoftware.

the class TableColumnOTOF_Name method refresh.

@Override
public void refresh(TableCell cell) {
    Object ds = cell.getDataSource();
    if (!(ds instanceof TorrentOpenFileOptions)) {
        return;
    }
    TorrentOpenFileOptions tfi = (TorrentOpenFileOptions) ds;
    cell.setText(tfi.getDestFileName());
}
Also used : TorrentOpenFileOptions(com.biglybt.core.torrent.impl.TorrentOpenFileOptions)

Example 7 with TorrentOpenFileOptions

use of com.biglybt.core.torrent.impl.TorrentOpenFileOptions in project BiglyBT by BiglySoftware.

the class TableColumnOTOF_Priority method refresh.

@Override
public void refresh(TableCell cell) {
    Object ds = cell.getDataSource();
    if (!(ds instanceof TorrentOpenFileOptions)) {
        return;
    }
    TorrentOpenFileOptions tfi = (TorrentOpenFileOptions) ds;
    int priority;
    String text;
    if (tfi.isToDownload()) {
        priority = tfi.getPriority();
        if (priority > 0) {
            text = MessageText.getString("FileItem.high");
            if (priority > 1) {
                text += " (" + priority + ")";
            }
        } else if (priority < 0) {
            text = MessageText.getString("FileItem.low");
            if (priority < -1) {
                text += " (" + priority + ")";
            }
        } else {
            text = MessageText.getString("FileItem.normal");
        }
    } else {
        priority = Integer.MIN_VALUE;
        text = "";
    }
    if (cell.setSortValue(priority)) {
        cell.setText(text);
    }
}
Also used : TorrentOpenFileOptions(com.biglybt.core.torrent.impl.TorrentOpenFileOptions)

Example 8 with TorrentOpenFileOptions

use of com.biglybt.core.torrent.impl.TorrentOpenFileOptions in project BiglyBT by BiglySoftware.

the class TableColumnOTOF_Size method refresh.

@Override
public void refresh(TableCell cell) {
    Object ds = cell.getDataSource();
    if (!(ds instanceof TorrentOpenFileOptions)) {
        return;
    }
    TorrentOpenFileOptions tfi = (TorrentOpenFileOptions) ds;
    cell.setSortValue(tfi.lSize);
    cell.setText(DisplayFormatters.formatByteCountToKiBEtc(tfi.lSize));
}
Also used : TorrentOpenFileOptions(com.biglybt.core.torrent.impl.TorrentOpenFileOptions)

Aggregations

TorrentOpenFileOptions (com.biglybt.core.torrent.impl.TorrentOpenFileOptions)8 Core (com.biglybt.core.Core)1 CoreRunningListener (com.biglybt.core.CoreRunningListener)1 DiskManagerFileInfo (com.biglybt.core.disk.DiskManagerFileInfo)1 DiskManagerFileInfoSet (com.biglybt.core.disk.DiskManagerFileInfoSet)1 DownloadManager (com.biglybt.core.download.DownloadManager)1 DownloadManagerInitialisationAdapter (com.biglybt.core.download.DownloadManagerInitialisationAdapter)1 DownloadManagerState (com.biglybt.core.download.DownloadManagerState)1 GlobalManager (com.biglybt.core.global.GlobalManager)1 Tag (com.biglybt.core.tag.Tag)1 TOTorrent (com.biglybt.core.torrent.TOTorrent)1 TOTorrentException (com.biglybt.core.torrent.TOTorrentException)1 VuzeFile (com.biglybt.core.vuzefile.VuzeFile)1 UIFunctions (com.biglybt.ui.UIFunctions)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Rectangle (org.eclipse.swt.graphics.Rectangle)1