use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class DownSpeedItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
long data_value = 0;
long prot_value = 0;
if (peer != null) {
data_value = peer.getStats().getDataReceiveRate();
prot_value = peer.getStats().getProtocolReceiveRate();
}
long sort_value = (data_value << 32) + prot_value;
if (!cell.setSortValue(sort_value) && cell.isValid())
return;
cell.setText(DisplayFormatters.formatDataProtByteCountToKiBEtcPerSec(data_value, prot_value));
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class DownSpeedLimitItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
long value = (peer == null) ? 0 : peer.getStats().getDownloadRateLimitBytesPerSecond();
if (!cell.setSortValue(value) && cell.isValid())
return;
if (value == -1) {
cell.setText(MessageText.getString("MyTorrents.items.DownSpeedLimit.disabled"));
} else if (value == 0) {
cell.setText(Constants.INFINITY_STRING);
} else {
cell.setText(DisplayFormatters.formatByteCountToKiBEtcPerSec(value));
}
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class DownloadNameItem method refresh.
/* (non-Javadoc)
* @see com.biglybt.pif.ui.tables.TableCellRefreshListener#refresh(com.biglybt.pif.ui.tables.TableCell)
*/
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
if (peer == null) {
cell.setText("");
return;
}
PEPeerManager manager = peer.getManager();
if (manager == null) {
cell.setText("");
return;
}
cell.setText(manager.getDisplayName());
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class GainItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
long value = (peer == null) ? 0 : peer.getStats().getTotalDataBytesReceived() - peer.getStats().getTotalDataBytesSent();
if (!cell.setSortValue(value) && cell.isValid())
return;
cell.setText((value >= 0 ? "" : "-") + DisplayFormatters.formatByteCountToKiBEtc(Math.abs(value)));
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class HandshakeReservedBytesItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
byte[] handshake_reserved = null;
if (peer != null) {
handshake_reserved = peer.getHandshakeReservedBytes();
}
if (handshake_reserved == null) {
cell.setText("");
return;
}
cell.setText(ByteFormatter.nicePrint(handshake_reserved, false));
}
Aggregations