Search in sources :

Example 6 with PEPeer

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

Example 7 with PEPeer

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

Example 8 with PEPeer

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

Example 9 with PEPeer

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

Example 10 with PEPeer

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));
}
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