use of com.biglybt.ui.common.updater.UIUpdatableAlways in project BiglyBT by BiglySoftware.
the class UIUpdaterSWT method update.
private void update(CopyOnWriteList<UIUpdatable> updateables, boolean is_visible) {
long start = 0;
Map<UIUpdatable, Long> mapTimeMap = DEBUG_TIMER ? new HashMap<UIUpdatable, Long>() : null;
Display display = Utils.getDisplay();
if (display == null || display.isDisposed()) {
return;
}
for (UIUpdatable updateable : updateables) {
try {
if (DEBUG_TIMER) {
start = SystemTime.getCurrentTime();
}
if (updateable instanceof UIUpdatableAlways) {
((UIUpdatableAlways) updateable).updateUI(is_visible);
} else {
updateable.updateUI();
}
if (DEBUG_TIMER) {
long diff = SystemTime.getCurrentTime() - start;
if (diff > 0) {
mapTimeMap.put(updateable, new Long(diff));
}
}
} catch (Throwable t) {
Logger.log(new LogEvent(LOGID, "Error while trying to update UI Element " + updateable.getUpdateUIName(), t));
}
}
if (DEBUG_TIMER) {
makeDebugToolTip(mapTimeMap);
}
}
Aggregations