Search in sources :

Example 1 with TrackerPeerSource

use of com.biglybt.core.tracker.TrackerPeerSource in project BiglyBT by BiglySoftware.

the class LastUpdateItem method refresh.

@Override
public void refresh(TableCell cell, long timestamp) {
    TrackerPeerSource ps = (TrackerPeerSource) cell.getDataSource();
    timestamp = (ps == null) ? 0 : ps.getLastUpdate();
    super.refresh(cell, timestamp * 1000);
}
Also used : TrackerPeerSource(com.biglybt.core.tracker.TrackerPeerSource)

Example 2 with TrackerPeerSource

use of com.biglybt.core.tracker.TrackerPeerSource in project BiglyBT by BiglySoftware.

the class LeechersItem method refresh.

@Override
public void refresh(TableCell cell) {
    TrackerPeerSource ps = (TrackerPeerSource) cell.getDataSource();
    int value = (ps == null) ? -1 : ps.getLeecherCount();
    if (!cell.setSortValue(value) && cell.isValid()) {
        return;
    }
    cell.setText(value < 0 ? "" : String.valueOf(value));
}
Also used : TrackerPeerSource(com.biglybt.core.tracker.TrackerPeerSource)

Example 3 with TrackerPeerSource

use of com.biglybt.core.tracker.TrackerPeerSource in project BiglyBT by BiglySoftware.

the class NameItem method refresh.

@Override
public void refresh(TableCell cell) {
    TrackerPeerSource ps = (TrackerPeerSource) cell.getDataSource();
    String name = (ps == null) ? "" : ps.getName();
    if (!cell.setSortValue(name) && cell.isValid()) {
        return;
    }
    cell.setText(name);
}
Also used : TrackerPeerSource(com.biglybt.core.tracker.TrackerPeerSource)

Example 4 with TrackerPeerSource

use of com.biglybt.core.tracker.TrackerPeerSource in project BiglyBT by BiglySoftware.

the class StatusItem method refresh.

@Override
public void refresh(TableCell cell) {
    TrackerPeerSource ps = (TrackerPeerSource) cell.getDataSource();
    int status;
    if (ps == null) {
        status = TrackerPeerSource.ST_UNKNOWN;
    } else {
        if (ps.isUpdating()) {
            status = TrackerPeerSource.ST_UPDATING;
        } else {
            status = ps.getStatus();
        }
    }
    String str = js_resources[status];
    String extra = ps == null ? "" : ps.getStatusString();
    if (status == TrackerPeerSource.ST_ONLINE) {
        if (extra != null) {
            int pos = extra.indexOf(" (");
            if (pos != -1) {
                str += extra.substring(pos);
            }
        }
    } else if (status == TrackerPeerSource.ST_ERROR || status == TrackerPeerSource.ST_STOPPED || status == TrackerPeerSource.ST_QUEUED) {
        if (extra != null) {
            str += ": " + extra;
        }
    }
    if (!cell.setSortValue(str) && cell.isValid()) {
        return;
    }
    cell.setText(str);
}
Also used : TrackerPeerSource(com.biglybt.core.tracker.TrackerPeerSource)

Example 5 with TrackerPeerSource

use of com.biglybt.core.tracker.TrackerPeerSource in project BiglyBT by BiglySoftware.

the class UpdateInItem method refresh.

@Override
public void refresh(TableCell cell) {
    TrackerPeerSource ps = (TrackerPeerSource) cell.getDataSource();
    int secs;
    if (ps == null) {
        secs = -1;
    } else {
        int state = ps.getStatus();
        if ((state == TrackerPeerSource.ST_ONLINE || state == TrackerPeerSource.ST_ERROR) && !ps.isUpdating()) {
            secs = ps.getSecondsToUpdate();
        } else {
            secs = -1;
        }
    }
    if (!cell.setSortValue(secs) && cell.isValid()) {
        return;
    }
    cell.setText(TimeFormatter.formatColon(secs));
}
Also used : TrackerPeerSource(com.biglybt.core.tracker.TrackerPeerSource)

Aggregations

TrackerPeerSource (com.biglybt.core.tracker.TrackerPeerSource)16 TrackerPeerSourceAdapter (com.biglybt.core.tracker.TrackerPeerSourceAdapter)2 URL (java.net.URL)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 PEPeerManager (com.biglybt.core.peer.PEPeerManager)1 TOTorrent (com.biglybt.core.torrent.TOTorrent)1 TRTrackerAnnouncer (com.biglybt.core.tracker.client.TRTrackerAnnouncer)1 TRTrackerScraperResponse (com.biglybt.core.tracker.client.TRTrackerScraperResponse)1 AERunnable (com.biglybt.core.util.AERunnable)1 PluginInterface (com.biglybt.pif.PluginInterface)1 Download (com.biglybt.pif.download.Download)1 DHTPluginContact (com.biglybt.plugin.dht.DHTPluginContact)1 DHTPluginOperationListener (com.biglybt.plugin.dht.DHTPluginOperationListener)1 DHTPluginValue (com.biglybt.plugin.dht.DHTPluginValue)1 ExternalSeedPlugin (com.biglybt.plugin.extseed.ExternalSeedPlugin)1 UserPrompterResultListener (com.biglybt.ui.UserPrompterResultListener)1 UIFunctionsSWT (com.biglybt.ui.swt.UIFunctionsSWT)1 MultiTrackerEditor (com.biglybt.ui.swt.maketorrent.MultiTrackerEditor)1 TrackerEditorListener (com.biglybt.ui.swt.maketorrent.TrackerEditorListener)1