use of com.biglybt.core.tag.TagFeatureRateLimit in project BiglyBT by BiglySoftware.
the class ColumnTagUpLimit method refresh.
@Override
public void refresh(TableCell cell) {
Tag tag = (Tag) cell.getDataSource();
if (tag instanceof TagFeatureRateLimit) {
TagFeatureRateLimit rl = (TagFeatureRateLimit) tag;
if (rl.supportsTagUploadLimit()) {
int sortVal = rl.getTagUploadLimit();
if (!cell.setSortValue(sortVal) && cell.isValid()) {
return;
}
if (!cell.isShown()) {
return;
}
cell.setText(sortVal == -1 ? MessageText.getString("label.disabled") : (sortVal == 0 ? Constants.INFINITY_STRING : DisplayFormatters.formatByteCountToKiBEtcPerSec(sortVal)));
}
}
}
use of com.biglybt.core.tag.TagFeatureRateLimit in project BiglyBT by BiglySoftware.
the class ColumnTagUpRate method refresh.
@Override
public void refresh(TableCell cell) {
Tag tag = (Tag) cell.getDataSource();
if (tag instanceof TagFeatureRateLimit) {
TagFeatureRateLimit rl = (TagFeatureRateLimit) tag;
if (rl.supportsTagRates()) {
int sortVal = rl.getTagCurrentUploadRate();
if (!cell.setSortValue(sortVal) && cell.isValid()) {
return;
}
if (!cell.isShown()) {
return;
}
cell.setText(sortVal < 0 ? "-" : DisplayFormatters.formatByteCountToKiBEtcPerSec(sortVal));
}
}
}
use of com.biglybt.core.tag.TagFeatureRateLimit in project BiglyBT by BiglySoftware.
the class ColumnTagUpSession method refresh.
@Override
public void refresh(TableCell cell) {
Tag tag = (Tag) cell.getDataSource();
if (tag instanceof TagFeatureRateLimit) {
TagFeatureRateLimit rl = (TagFeatureRateLimit) tag;
if (rl.supportsTagRates()) {
long[] up = rl.getTagSessionUploadTotal();
if (up != null) {
long tot = 0;
for (long l : up) {
tot += l;
}
if (!cell.setSortValue(tot) && cell.isValid()) {
return;
}
if (!cell.isShown()) {
return;
}
cell.setText(DisplayFormatters.formatByteCountToKiBEtc(tot));
}
}
}
}
use of com.biglybt.core.tag.TagFeatureRateLimit in project BiglyBT by BiglySoftware.
the class ColumnTagUploadPriority method setCheckBoxState.
@Override
protected void setCheckBoxState(Object datasource, boolean set) {
TagFeatureRateLimit tag = (TagFeatureRateLimit) datasource;
tag.setTagUploadPriority(set ? 1 : 0);
}
use of com.biglybt.core.tag.TagFeatureRateLimit in project BiglyBT by BiglySoftware.
the class ColumnTagDownRate method refresh.
@Override
public void refresh(TableCell cell) {
Tag tag = (Tag) cell.getDataSource();
if (tag instanceof TagFeatureRateLimit) {
TagFeatureRateLimit rl = (TagFeatureRateLimit) tag;
if (rl.supportsTagRates()) {
int sortVal = rl.getTagCurrentDownloadRate();
if (!cell.setSortValue(sortVal) && cell.isValid()) {
return;
}
if (!cell.isShown()) {
return;
}
cell.setText(sortVal < 0 ? "-" : DisplayFormatters.formatByteCountToKiBEtcPerSec(sortVal));
}
}
}
Aggregations