use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class TypeItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
long value = (peer == null) ? 0 : (peer.isIncoming() ? 1 : 0);
if (!cell.setSortValue(value) && cell.isValid())
return;
cell.setText((value == 1) ? "R" : "L");
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class LANItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
boolean lan = (peer == null) ? false : peer.isLANLocal();
if (!cell.setSortValue(lan ? 1 : 0) && cell.isValid())
return;
cell.setText(lan ? "*" : "");
TableRow row = cell.getTableRow();
if (row != null) {
row.setForeground(Utils.colorToIntArray(lan ? Colors.blue : null));
}
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class MessagingItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
int value = (peer == null) ? -1 : peer.getMessagingMode();
if (!cell.setSortValue(value) && cell.isValid())
return;
String text;
switch(value) {
case PEPeer.MESSAGING_BT_ONLY:
text = "";
break;
case PEPeer.MESSAGING_LTEP:
text = "LT";
break;
case PEPeer.MESSAGING_AZMP:
text = "AZ";
break;
case PEPeer.MESSAGING_EXTERN:
text = "Plugin";
break;
default:
text = "";
break;
}
cell.setText(text);
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class PeerByteIDItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
if (peer == null) {
cell.setText("");
return;
}
byte[] peer_id = peer.getId();
if (peer_id == null) {
cell.setText("");
return;
}
cell.setText(ByteFormatter.nicePrint(peer_id));
}
use of com.biglybt.core.peer.PEPeer in project BiglyBT by BiglySoftware.
the class PeerSourceItem method refresh.
@Override
public void refresh(TableCell cell) {
PEPeer peer = (PEPeer) cell.getDataSource();
String value = (peer == null) ? "" : peer.getPeerSource();
if (!cell.setSortValue(value) && cell.isValid())
return;
cell.setText("" + value);
}
Aggregations