Icon (boolean expanded, boolean selected, boolean focused) { boolean white = selected && focused || StartupUiUtil.isUnderDarcula(); Icon expandedDefault = getTreeExpandedIcon(); Icon collapsedDefault = getTreeCollapsedIcon(); Icon expandedSelected = getTreeSelectedExpandedIcon(); Icon collapsedSelected = getTreeSelectedCollapsedIcon(); int width = Math.max( Math.max(expandedDefault.getIconWidth(), collapsedDefault.getIconWidth()), Math.max(expandedSelected.getIconWidth(), collapsedSelected.getIconWidth())); int height = Math.max( Math.max(expandedDefault.getIconHeight(), collapsedDefault.getIconHeight()), Math.max(expandedSelected.getIconHeight(), collapsedSelected.getIconHeight())); return new CenteredIcon(!white ? expanded ? expandedDefault : collapsedDefault : expanded ? expandedSelected : collapsedSelected, width, height, false); }