public void update() { if (visible.get() == false) { return; } final T total; final T filtered; final T selected; final boolean smart = CFG_GUI.OVERVIEW_PANEL_SMART_INFO_VISIBLE.isEnabled(); final boolean visibleOnly = CFG_GUI.OVERVIEW_PANEL_VISIBLE_ONLY_INFO_VISIBLE.isEnabled(); final boolean selectedOnly = CFG_GUI.OVERVIEW_PANEL_SELECTED_INFO_VISIBLE.isEnabled(); final boolean totalVisible = CFG_GUI.OVERVIEW_PANEL_TOTAL_INFO_VISIBLE.isEnabled(); final boolean containsSelection = hasSelection.get(); if (smart || (!visibleOnly && !totalVisible && !selectedOnly)) { if (containsSelection) { filtered = null; total = null; selected = createSelected(); } else { filtered = createFiltered(); total = null; selected = null; } } else { if (totalVisible) { total = createTotal(); } else { total = null; } if (visibleOnly) { filtered = createFiltered(); } else { filtered = null; } if (selectedOnly) { selected = createSelected(); } else { selected = null; } } new EDTRunner() { @Override protected void runInEDT() { if (!isDisplayable() || visible.get() == false) { return; } for (DataEntry<T> entry : dataEntries) { entry.updateVisibility(containsSelection); set(entry); } } private void set(DataEntry<T> dataEntry) { if (dataEntry != null) { dataEntry.setData(total, filtered, selected); } } }.waitForEDT(); }