use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class DiscardedItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
long value = (peer == null) ? 0 : peer.getStats().getTotalBytesDiscarded();
if (!cell.setSortValue(value) && cell.isValid())
return;
cell.setText(DisplayFormatters.formatByteCountToKiBEtc(value));
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class EncryptionItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
String value = peer == null ? "" : peer.getEncryption();
if (!cell.setSortValue(value) && cell.isValid())
return;
cell.setText(value);
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class HostNameItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
String addr = peer == null ? "" : peer.getIPHostName();
if (cell.setText(addr) && !addr.equals(peer == null ? "" : peer.getIp())) {
String[] l = addr.split("\\.");
StringBuilder buf = new StringBuilder();
for (int i = l.length - 1; i >= 0; i--) {
buf.append(l[i]);
buf.append('.');
}
cell.setSortValue(buf.toString());
}
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class InterestedItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
long value = (peer == null) ? 0 : (peer.isInteresting() ? 1 : 0);
if (!cell.setSortValue(value) && cell.isValid())
return;
cell.setText((value == 1) ? "*" : "");
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class InterestingItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
long value = (peer == null) ? 0 : (peer.isInterested() ? 1 : 0);
if (!cell.setSortValue(value) && cell.isValid())
return;
cell.setText((value == 1) ? "*" : "");
}
Aggregations