Default Constructor super("AvgAvail", ALIGN_TRAIL, POSITION_INVISIBLE, 50, sTableID); setRefreshInterval(INTERVAL_LIVE); setMinWidthAuto(true); iTimesBy = 1; for (int i = 1; i < numZeros; i++) iTimesBy *= 10;
super("AvgAvail", ALIGN_TRAIL, POSITION_INVISIBLE, 50, sTableID); setRefreshInterval(INTERVAL_LIVE); setMinWidthAuto(true); iTimesBy = 1; for (int i = 1; i < numZeros; i++) iTimesBy *= 10;
String sText = ""; DownloadManager dm = (DownloadManager)cell.getDataSource(); if (dm == null) return; PEPeerManager pm = dm.getPeerManager(); if (pm != null) { float f =pm.getAvgAvail(); if (!cell.setSortValue((long)(f * 1000)) && cell.isValid()) return; sText = String.valueOf((int)(f * iTimesBy)); if (numZeros - sText.length() > 0) sText = zeros.substring(0, numZeros - sText.length()) + sText; sText = sText.substring(0, sText.length() - numZeros + 1) + "." + sText.substring(sText.length() - numZeros + 1); } else { cell.setSortValue(0); } cell.setText(sText);