Search in sources :

Example 16 with PEPeer

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");
}
Also used : PEPeer(com.biglybt.core.peer.PEPeer)

Example 17 with PEPeer

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));
    }
}
Also used : PEPeer(com.biglybt.core.peer.PEPeer)

Example 18 with PEPeer

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);
}
Also used : PEPeer(com.biglybt.core.peer.PEPeer)

Example 19 with PEPeer

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));
}
Also used : PEPeer(com.biglybt.core.peer.PEPeer)

Example 20 with PEPeer

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);
}
Also used : PEPeer(com.biglybt.core.peer.PEPeer)

Aggregations

PEPeer (com.biglybt.core.peer.PEPeer)84 PEPeerManager (com.biglybt.core.peer.PEPeerManager)18 DownloadManager (com.biglybt.core.download.DownloadManager)11 ArrayList (java.util.ArrayList)11 DiskManagerFileInfo (com.biglybt.core.disk.DiskManagerFileInfo)5 AERunnable (com.biglybt.core.util.AERunnable)5 PEPiece (com.biglybt.core.peer.PEPiece)4 List (java.util.List)4 Image (org.eclipse.swt.graphics.Image)4 DiskManager (com.biglybt.core.disk.DiskManager)3 GlobalManager (com.biglybt.core.global.GlobalManager)3 PEPeerStats (com.biglybt.core.peer.PEPeerStats)3 PEPeerTransport (com.biglybt.core.peer.impl.PEPeerTransport)3 TOTorrent (com.biglybt.core.torrent.TOTorrent)3 Point (org.eclipse.swt.graphics.Point)3 DiskManagerPiece (com.biglybt.core.disk.DiskManagerPiece)2 DownloadManagerPeerListener (com.biglybt.core.download.DownloadManagerPeerListener)2 PiecePicker (com.biglybt.core.peermanager.piecepicker.PiecePicker)2 BitFlags (com.biglybt.core.peermanager.piecepicker.util.BitFlags)2 Tag (com.biglybt.core.tag.Tag)2