Search in sources :

Example 16 with DiskManagerFileInfo

use of com.biglybt.core.disk.DiskManagerFileInfo in project BiglyBT by BiglySoftware.

the class FileModifiedItem method refresh.

@Override
public void refresh(TableCell cell, long timestamp) {
    DiskManagerFileInfo file = (DiskManagerFileInfo) cell.getDataSource();
    if (file == null) {
        timestamp = 0;
    } else {
        timestamp = file.getLastModified();
    }
    super.refresh(cell, timestamp);
}
Also used : DiskManagerFileInfo(com.biglybt.core.disk.DiskManagerFileInfo)

Example 17 with DiskManagerFileInfo

use of com.biglybt.core.disk.DiskManagerFileInfo in project BiglyBT by BiglySoftware.

the class FileReadSpeedItem method refresh.

@Override
public void refresh(TableCell cell) {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) cell.getDataSource();
    int speed = 0;
    if (fileInfo != null) {
        speed = fileInfo.getReadBytesPerSecond();
    }
    if (!cell.setSortValue(speed) && cell.isValid()) {
        return;
    }
    cell.setText(speed <= 0 ? "" : DisplayFormatters.formatByteCountToKiBEtcPerSec(speed));
}
Also used : DiskManagerFileInfo(com.biglybt.core.disk.DiskManagerFileInfo)

Example 18 with DiskManagerFileInfo

use of com.biglybt.core.disk.DiskManagerFileInfo in project BiglyBT by BiglySoftware.

the class FileWriteSpeedItem method refresh.

@Override
public void refresh(TableCell cell) {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) cell.getDataSource();
    int speed = 0;
    if (fileInfo != null) {
        speed = fileInfo.getWriteBytesPerSecond();
    }
    if (!cell.setSortValue(speed) && cell.isValid()) {
        return;
    }
    cell.setText(speed <= 0 ? "" : DisplayFormatters.formatByteCountToKiBEtcPerSec(speed));
}
Also used : DiskManagerFileInfo(com.biglybt.core.disk.DiskManagerFileInfo)

Example 19 with DiskManagerFileInfo

use of com.biglybt.core.disk.DiskManagerFileInfo in project BiglyBT by BiglySoftware.

the class FirstPieceItem method refresh.

@Override
public void refresh(TableCell cell) {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) cell.getDataSource();
    long sort_value;
    if (fileInfo == null) {
        sort_value = 0;
    } else {
        sort_value = fileInfo.getFirstPieceNumber();
        if (sort_value >= 0) {
            int index = fileInfo.getIndex();
            if (index < 0) {
                index = 0;
            }
            sort_value = (sort_value << 32) + index;
        }
    }
    if (!cell.setSortValue(sort_value) && cell.isValid()) {
        return;
    }
    // < 0 -> unknown skeleton value
    cell.setText(sort_value < 0 || fileInfo == null ? "" : ("" + fileInfo.getFirstPieceNumber()));
}
Also used : DiskManagerFileInfo(com.biglybt.core.disk.DiskManagerFileInfo)

Example 20 with DiskManagerFileInfo

use of com.biglybt.core.disk.DiskManagerFileInfo in project BiglyBT by BiglySoftware.

the class ModeItem method refresh.

@Override
public void refresh(TableCell cell) {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) cell.getDataSource();
    long value = (fileInfo == null) ? 0 : fileInfo.getAccessMode();
    if (!cell.setSortValue(value) && cell.isValid()) {
        return;
    }
    String sText = value < 0 ? "" : MessageText.getString(value == DiskManagerFileInfo.WRITE ? "FileItem.write" : "FileItem.read");
    cell.setText(sText);
}
Also used : DiskManagerFileInfo(com.biglybt.core.disk.DiskManagerFileInfo)

Aggregations

DiskManagerFileInfo (com.biglybt.core.disk.DiskManagerFileInfo)107 DownloadManager (com.biglybt.core.download.DownloadManager)54 File (java.io.File)16 TOTorrent (com.biglybt.core.torrent.TOTorrent)15 PEPeerManager (com.biglybt.core.peer.PEPeerManager)9 DiskManagerFileInfoSet (com.biglybt.core.disk.DiskManagerFileInfoSet)8 TableRowCore (com.biglybt.ui.common.table.TableRowCore)8 DiskManager (com.biglybt.core.disk.DiskManager)7 IOException (java.io.IOException)7 Point (org.eclipse.swt.graphics.Point)7 DownloadManagerState (com.biglybt.core.download.DownloadManagerState)6 MessageBoxShell (com.biglybt.ui.swt.shells.MessageBoxShell)6 FilesView (com.biglybt.ui.swt.views.FilesView)6 List (java.util.List)6 Image (org.eclipse.swt.graphics.Image)6 DiskManagerPiece (com.biglybt.core.disk.DiskManagerPiece)5 PEPeer (com.biglybt.core.peer.PEPeer)5 TOTorrentException (com.biglybt.core.torrent.TOTorrentException)5 UIFunctions (com.biglybt.ui.UIFunctions)5 ISelectedContent (com.biglybt.ui.selectedcontent.ISelectedContent)5