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);
}
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));
}
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));
}
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()));
}
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);
}
Aggregations