FileDocCategorySizeDatePackage
TrackerNextAccessItem.javaAPI DocAzureus 3.0.3.42837Mon Feb 19 14:24:06 GMT 2007org.gudy.azureus2.ui.swt.views.tableitems.mytorrents

TrackerNextAccessItem

public class TrackerNextAccessItem extends org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn implements TableCellRefreshListener, TableCellToolTipListener, TableCellDisposeListener
author
Olivier

Fields Summary
HashMap
map
Constructors Summary
public TrackerNextAccessItem(String sTableID)

	
     
    super("trackernextaccess", ALIGN_TRAIL, POSITION_INVISIBLE, 70, sTableID);
    setRefreshInterval(INTERVAL_LIVE);
    setMinWidthAuto(true);
  
Methods Summary
public voidcellHover(TableCell cell)

		DownloadManager dm = (DownloadManager) cell.getDataSource();
		cell.setToolTip(TrackerCellUtils.getTooltipText(cell, dm));
	
public voidcellHoverComplete(TableCell cell)

		cell.setToolTip(null);
	
public voiddispose(TableCell cell)

		map.remove(cell.getDataSource());
	
public voidrefresh(TableCell cell)

    DownloadManager dm = (DownloadManager)cell.getDataSource();
    if (cell.isValid() && map.containsKey(dm)) {
    	long lNextUpdate = ((Long)map.get(dm)).longValue();
    	if (System.currentTimeMillis() < lNextUpdate)
    		return;
    }
    long value = (dm == null) ? 0 : dm.getTrackerTime();
    
    if (value < -1)
      value = -1;

    long lNextUpdate = System.currentTimeMillis()
				+ (((value > 60) ? (value % 60) : 1) * 1000);
		map.put(dm, new Long(lNextUpdate));

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

    String sText = TimeFormatter.formatColon(value);
    
    if (value > 60)
    	sText = "< " + sText;
    
  	TrackerCellUtils.updateColor(cell, dm);
    cell.setText(sText);