@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().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) { sort_value = data_value; } else { sort_value = data_value + prot_value; } if (!cell.setSortValue(sort_value) && cell.isValid()) return; cell.setText(DisplayFormatters.formatDataProtByteCountToKiBEtc(data_value, prot_value)); }
@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().getTotalDataBytesSent(); prot_value = peer.getStats().getTotalProtocolBytesSent(); } long sort_value; if (separate_prot_data_stats) { sort_value = (data_value << 24) + prot_value; } else if (data_stats_only) { sort_value = data_value; } else { sort_value = data_value + prot_value; } if (!cell.setSortValue(sort_value) && cell.isValid()) return; cell.setText(DisplayFormatters.formatDataProtByteCountToKiBEtc(data_value, prot_value)); } }
agg_downloaded.setText( DisplayFormatters.formatByteCountToKiBEtc( total_downloaded )); agg_upload_speed.setText( DisplayFormatters.formatDataProtByteCountToKiBEtc( total_data_up_speed, total_prot_up_speed )); agg_download_speed.setText( DisplayFormatters.formatDataProtByteCountToKiBEtc( total_data_down_speed, total_prot_down_speed));