use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class PiecesItem method cellAdded.
@Override
public void cellAdded(TableCell cell) {
synchronized (this) {
row_count++;
}
cell.setFillCell(true);
Object ds = cell.getDataSource();
if (ds instanceof PEPeer) {
PEPeer peer = (PEPeer) ds;
DiskManager diskmanager = peer.getManager().getDiskManager();
if (diskmanager.getRemaining() > 0) {
if (!diskmanager.hasListener(this)) {
diskmanager.addListener(this);
}
}
}
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class PortItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
int value = (peer == null) ? 0 : peer.getPort();
if (!cell.setSortValue(value) && cell.isValid())
return;
cell.setText("" + value);
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class SnubbedItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
boolean bSnubbed = (peer == null) ? false : peer.isSnubbed();
if (!cell.setSortValue(bSnubbed ? 1 : 0) && cell.isValid())
return;
cell.setText(bSnubbed ? "*" : "");
TableRow row = cell.getTableRow();
if (row != null) {
row.setForeground(Utils.colorToIntArray(bSnubbed ? Colors.grey : null));
}
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class StatUpItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
long value = (peer == null) ? 0 : peer.getStats().getEstimatedUploadRateOfPeer();
if (!cell.setSortValue(value) && cell.isValid())
return;
cell.setText(DisplayFormatters.formatByteCountToKiBEtcPerSec(value));
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class TimeToSendPieceItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
long value = (peer == null) ? 0 : peer.getUploadHint();
Comparable sortValue = cell.getSortValue();
long oldValue = 0;
if (sortValue instanceof Number) {
oldValue = ((Number) sortValue).longValue();
}
if (!cell.setSortValue(value) && cell.isValid())
return;
String text = TimeFormatter.format(value / 1000);
if (oldValue > 0) {
text += ", " + TimeFormatter.format(oldValue / 1000);
}
cell.setText(text);
}
Aggregations