use of com.biglybt.ui.UIFunctions in project BiglyBT by BiglySoftware.
the class SBC_TagsOverview method focusChanged.
@Override
public void focusChanged(TableRowCore focus) {
updateSelectedContent();
UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
if (uiFunctions != null) {
uiFunctions.refreshIconBar();
}
}
use of com.biglybt.ui.UIFunctions in project BiglyBT by BiglySoftware.
the class SBC_TagsOverview method defaultSelected.
@Override
public void defaultSelected(TableRowCore[] rows, int stateMask) {
if (rows.length == 1) {
Object obj = rows[0].getDataSource();
if (obj instanceof Tag) {
Tag tag = (Tag) obj;
UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
if (uiFunctions != null) {
if (!COConfigurationManager.getBooleanParameter("Library.TagInSideBar")) {
COConfigurationManager.setParameter("Library.TagInSideBar", true);
}
if (!tag.isVisible()) {
tag.setVisible(true);
}
String id = "Tag." + tag.getTagType().getTagType() + "." + tag.getTagID();
uiFunctions.getMDI().showEntryByID(id, tag);
}
}
}
}
use of com.biglybt.ui.UIFunctions in project BiglyBT by BiglySoftware.
the class SB_Transfers method refreshTagSideBar.
// tag stuff
private void refreshTagSideBar(Tag tag) {
UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
MultipleDocumentInterface mdi = uiFunctions != null ? uiFunctions.getMDI() : null;
if (mdi == null) {
return;
}
MdiEntry entry = mdi.getEntry("Tag." + tag.getTagType().getTagType() + "." + tag.getTagID());
if (entry == null) {
if (tag.isVisible()) {
setupTag(tag);
}
return;
}
if (!tag.isVisible()) {
removeTag(tag);
return;
}
String old_title = entry.getTitle();
String tag_title = tag.getTagName(true);
if (!old_title.equals(tag_title)) {
entry.setTitle(tag_title);
}
Integer num = (Integer) entry.getUserData(TAG_INDICATOR_KEY);
int tag_count = tag.getTaggedCount();
if (num == null || num != tag_count) {
entry.setUserData(TAG_INDICATOR_KEY, tag_count);
requestRedraw(entry);
}
ViewTitleInfoManager.refreshTitleInfo(entry.getViewTitleInfo());
Object[] tag_data = (Object[]) entry.getUserData(TAG_DATA_KEY);
if (tag_data != null) {
boolean[] auto_tag = tag.isTagAuto();
boolean[] old_auto_tag = (boolean[]) tag_data[1];
if (!Arrays.equals(auto_tag, old_auto_tag)) {
tag_data[1] = auto_tag;
if (auto_tag[0] && auto_tag[1]) {
entry.removeListener((MdiEntryDropListener) tag_data[0]);
} else {
entry.addListener((MdiEntryDropListener) tag_data[0]);
}
}
}
}
Aggregations