Package org.gudy.azureus2.core3.peer

Examples of org.gudy.azureus2.core3.peer.PEPeer


      CAT_PEER_IDENTIFICATION,
    });
  }

  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;}
    try {
      String text = new String(peer_id, 0, peer_id.length, Constants.BYTE_ENCODING);
      text = text.replace((char)12, (char)32); // Replace newlines.
      text = text.replace((char)10, (char)32);
View Full Code Here


    super(COLUMN_ID, ALIGN_TRAIL, POSITION_INVISIBLE, 70, table_id);
    setRefreshInterval(INTERVAL_LIVE);
  }

  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)));
View Full Code Here

 
  /* (non-Javadoc)
   * @see org.gudy.azureus2.plugins.ui.tables.TableCellRefreshListener#refresh(org.gudy.azureus2.plugins.ui.tables.TableCell)
   */
  public void refresh(TableCell cell) {
      PEPeer peer = (PEPeer)cell.getDataSource();
      if (peer == null) {cell.setText(""); return;}
      String peer_id_name = peer.getClientNameFromPeerID();
      String peer_handshake_name = peer.getClientNameFromExtensionHandshake();
     
      if (peer_id_name == null) {peer_id_name = "";}
      if (peer_handshake_name == null) {peer_handshake_name = "";}
     
      if (peer_id_name.equals("") && peer_handshake_name.equals("")) {
View Full Code Here

    super(COLUMN_ID, ALIGN_TRAIL, POSITION_INVISIBLE, 70, table_id);
    setRefreshInterval(INTERVAL_LIVE);
  }

  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().getTotalDataBytesReceived();
      prot_value = peer.getStats().getTotalProtocolBytesReceived();
    }
    long sort_value;
    if (separate_prot_data_stats) {
      sort_value = (data_value << 24) + prot_value;
    } else if (data_stats_only) {
View Full Code Here

    super(COLUMN_ID, ALIGN_CENTER, POSITION_INVISIBLE, 20, table_id);
    setRefreshInterval(INTERVAL_LIVE);
  }

  public void refresh(TableCell cell) {
    PEPeer peer = (PEPeer)cell.getDataSource();
    long value = (peer == null) ? 0 : (peer.isOptimisticUnchoke() ? 1 : 0);

    if (!cell.setSortValue(value) && cell.isValid())
      return;

    cell.setText((value == 1) ? "*" : "");
View Full Code Here

      CAT_PEER_IDENTIFICATION,
    });
  }

  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);
View Full Code Here

      CAT_CONNECTION,
    });
  }

  public void refresh(TableCell cell) {
    PEPeer peer = (PEPeer)cell.getDataSource();
    int value = (peer == null) ? 0 : peer.getPort();

    if (!cell.setSortValue(value) && cell.isValid())
      return;

    cell.setText(""+value);
View Full Code Here

    super(COLUMN_ID, POSITION_LAST, 100, table_id);
    setObfustication(true);
   }

  public void refresh(TableCell cell) {
    PEPeer peer = (PEPeer)cell.getDataSource();
    String sText = (peer == null) ? "" : peer.getIp();

    if (cell.setText(sText) || !cell.isValid()) {
      String[] sBlocks = sText.split("\\.");
      if (sBlocks.length == 4) {
        try {
View Full Code Here

 
  //Comparator Class
  //Note: this comparator imposes orderings that are inconsistent with equals.
  class PeerComparator implements Comparator {
    public int compare(Object arg0, Object arg1) {
      PEPeer peer0 = (PEPeer) arg0;
      PEPeer peer1 = (PEPeer) arg1;

      //Then we sort on %, but depending on interested ...
      int percent0 = peer0.getPercentDoneInThousandNotation();
      int percent1 = peer1.getPercentDoneInThousandNotation();
     
      return percent0 - percent1;
    }
View Full Code Here

    super(COLUMN_ID, ALIGN_CENTER, POSITION_INVISIBLE, 20, table_id);
    setRefreshInterval(INTERVAL_LIVE);
  }

  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) ? "*" : "");
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.peer.PEPeer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.