FileDocCategorySizeDatePackage
AbstractTrackerCell.javaAPI DocAzureus 3.0.3.43708Tue Dec 19 09:26:54 GMT 2006org.gudy.azureus2.ui.swt.views.tableitems.mytorrents

AbstractTrackerCell

public abstract class AbstractTrackerCell extends Object implements org.gudy.azureus2.plugins.ui.tables.TableCellRefreshListener, org.gudy.azureus2.core3.download.DownloadManagerTrackerListener, org.gudy.azureus2.plugins.ui.tables.TableCellToolTipListener, org.gudy.azureus2.plugins.ui.tables.TableCellDisposeListener
Base cell class for cells listening to the tracker listener

Fields Summary
org.gudy.azureus2.plugins.ui.tables.TableCell
cell
org.gudy.azureus2.core3.download.DownloadManager
dm
Constructors Summary
public AbstractTrackerCell(org.gudy.azureus2.plugins.ui.tables.TableCell cell)
Initialize

param
cell

		this.cell = cell;
		cell.addListeners(this);

		dm = (DownloadManager) cell.getDataSource();
		if (dm == null)
			return;
		dm.addTrackerListener(this);
	
Methods Summary
public voidannounceResult(org.gudy.azureus2.core3.tracker.client.TRTrackerAnnouncerResponse response)

		// Don't care about announce
	
public voidcellHover(org.gudy.azureus2.plugins.ui.tables.TableCell cell)

	
public voidcellHoverComplete(org.gudy.azureus2.plugins.ui.tables.TableCell cell)

		cell.setToolTip(null);
	
public booleancheckScrapeResult(org.gudy.azureus2.core3.tracker.client.TRTrackerScraperResponse response)

		if (response != null) {
			TableCell cell_ref = cell;
			
			if ( cell_ref == null ){
				return( false );
			}
			// Exit if this scrape result is not from the tracker currently being used.
			DownloadManager dm = (DownloadManager) cell.getDataSource();
			if (dm == null || dm != this.dm)
				return false;

			TOTorrent	torrent = dm.getTorrent();
			
			if ( torrent == null ){
				return( false );
			}
			URL announceURL = torrent.getAnnounceURL();
			URL responseURL = response.getURL();
			if (announceURL != responseURL && announceURL != null
					&& responseURL != null
					&& !announceURL.toString().equals(responseURL.toString()))
				return false;
			

			cell_ref.invalidate();
			
			return response.isValid();
		}

		return false;
	
public voiddispose(org.gudy.azureus2.plugins.ui.tables.TableCell cell)

		if (dm != null)
			dm.removeTrackerListener(this);
		DownloadManager dm = (DownloadManager) cell.getDataSource();
		if (dm != null && dm != this.dm)
			dm.removeTrackerListener(this);
		dm = null;
		cell = null;
	
public voidrefresh(org.gudy.azureus2.plugins.ui.tables.TableCell cell)

		DownloadManager oldDM = dm;
		dm = (DownloadManager) cell.getDataSource();

		// datasource changed, change listener
		if (dm != oldDM) {
			if (oldDM != null)
				oldDM.removeTrackerListener(this);

			if (dm != null)
				dm.addTrackerListener(this);
		}