Search in sources :

Example 61 with PEPeer

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

Example 62 with PEPeer

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

Example 63 with PEPeer

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

Example 64 with PEPeer

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

Example 65 with PEPeer

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) ? "*" : "");
}
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