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);
}
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));
}
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);
}
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);
}
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));
}
Aggregations