Search in sources :

Example 6 with TagFeatureRateLimit

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)));
        }
    }
}
Also used : TagFeatureRateLimit(com.biglybt.core.tag.TagFeatureRateLimit) Tag(com.biglybt.core.tag.Tag)

Example 7 with TagFeatureRateLimit

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));
        }
    }
}
Also used : TagFeatureRateLimit(com.biglybt.core.tag.TagFeatureRateLimit) Tag(com.biglybt.core.tag.Tag)

Example 8 with TagFeatureRateLimit

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));
            }
        }
    }
}
Also used : TagFeatureRateLimit(com.biglybt.core.tag.TagFeatureRateLimit) Tag(com.biglybt.core.tag.Tag)

Example 9 with TagFeatureRateLimit

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);
}
Also used : TagFeatureRateLimit(com.biglybt.core.tag.TagFeatureRateLimit)

Example 10 with TagFeatureRateLimit

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));
        }
    }
}
Also used : TagFeatureRateLimit(com.biglybt.core.tag.TagFeatureRateLimit) Tag(com.biglybt.core.tag.Tag)

Aggregations

TagFeatureRateLimit (com.biglybt.core.tag.TagFeatureRateLimit)13 Tag (com.biglybt.core.tag.Tag)12