//# 0 errors, 512 messages
//#
/*
    //#ButtonBar.java:1:1: class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#ButtonBar.java:1:1: method: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init
 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package com.dmdirc.addons.ui_swing.framemanager.buttonbar;

import com.dmdirc.FrameContainer;
import com.dmdirc.FrameContainerComparator;
import com.dmdirc.config.IdentityManager;
import com.dmdirc.interfaces.IconChangeListener;
import com.dmdirc.interfaces.NotificationListener;
import com.dmdirc.interfaces.SelectionListener;
import com.dmdirc.ui.interfaces.FrameManager;
import com.dmdirc.ui.interfaces.FramemanagerPosition;
import com.dmdirc.ui.interfaces.Window;
import com.dmdirc.addons.ui_swing.UIUtilities;
import com.dmdirc.util.MapList;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JToggleButton;
import javax.swing.SwingConstants;

import net.miginfocom.swing.MigLayout;

/**
 * The button bar manager is a grid of buttons that presents a manager similar
 * to that used by mIRC.
 *
 * @author chris
 */
public final class ButtonBar implements FrameManager, ActionListener,
        ComponentListener, Serializable, NotificationListener,
        SelectionListener, IconChangeListener {

    /**
     * A version number for this class. It should be changed whenever the class
     * structure is changed (or anything else that would prevent serialized
     * objects being unserialized with the new class).
     */
    private static final long serialVersionUID = 3;
    /** A map of parent containers to their respective windows. */
    private final MapList<FrameContainer, FrameContainer> windows;
    /** A map of containers to the buttons we're using for them. */
    private final Map<FrameContainer, JToggleButton> buttons;
    /** The position of this frame manager. */
    private final FramemanagerPosition position;
    /** The parent for the manager. */
    private JComponent parent;
    /** The panel used for our buttons. */
    private final JPanel panel;
    /** The currently selected window. */
    private transient FrameContainer selected;
    /** Selected window. */
    private Window activeWindow;
    /** The number of buttons per row or column. */
    private int cells = 1;
    /** The number of buttons to render per {cell,row}. */
    private int maxButtons = Integer.MAX_VALUE;
    /** The width of buttons. */
    private int buttonWidth;

    /** Creates a new instance of DummyFrameManager. */
    public ButtonBar() {
    //#ButtonBar.java:95: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): ""._tainted
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): "."._tainted
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): "<Unknown>"._tainted
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): "@"._tainted
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): "Config option not found: "._tainted
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): "framemanagerPosition"._tainted
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): "ui"._tainted
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com.dmdirc.config.ConfigManager$1__static_init.new int[](ConfigManager$1__static_init#1).length
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com.dmdirc.config.ConfigManager$1__static_init.new int[](ConfigManager$1__static_init#1)[0..4_294_967_295]
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/ConfigManager$1.$SwitchMap$com$dmdirc$config$ConfigTarget$TYPE
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/ConfigManager.__Descendant_Table[com/dmdirc/config/ConfigManager]
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/ConfigManager.__Descendant_Table[others]
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/ConfigManager.__Dispatch_Table.getOption(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/ConfigManager.__Dispatch_Table.identityApplies(Lcom/dmdirc/config/Identity;)Z
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/ConfigManager.stats
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/ConfigTarget.__Descendant_Table[com/dmdirc/config/ConfigTarget]
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/ConfigTarget.__Descendant_Table[others]
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/ConfigTarget.__Dispatch_Table.getData()Ljava/lang/String;
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/ConfigTarget.__Dispatch_Table.getType()Lcom/dmdirc/config/ConfigTarget$TYPE;
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/Identity.__Descendant_Table[com/dmdirc/config/Identity]
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/Identity.__Descendant_Table[others]
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/Identity.__Dispatch_Table.addListener(Lcom/dmdirc/interfaces/ConfigChangeListener;)V
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/Identity.__Dispatch_Table.getOption(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/Identity.__Dispatch_Table.getTarget()Lcom/dmdirc/config/ConfigTarget;
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/Identity.__Dispatch_Table.hasOption(Ljava/lang/String;Ljava/lang/String;)Z
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/IdentityManager.__Class_Obj.__Lock
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/IdentityManager.globalconfig
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/IdentityManager.globalconfig.__Tag
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/IdentityManager.globalconfig.sources
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/IdentityManager.globalconfig.sources.__Lock
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/IdentityManager.identities
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/IdentityManager.managers
    //#input(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/IdentityManager.globalconfig
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): java.lang.StringBuilder:toString(...)._tainted
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ArrayList(getSources#1) num objects
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ArrayList(getSources#1).__Lock
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1) num objects
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).__Tag
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).channel
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).ircd
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).listeners
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).network
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).server
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).sources
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new HashMap(ButtonBar#2) num objects
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new JPanel(ButtonBar#3) num objects
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new JPanel(ButtonBar#5) num objects
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new MapList(ButtonBar#1) num objects
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new MapList(ConfigManager#1) num objects
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this.buttons
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this.cells
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this.maxButtons
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this.panel
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this.position
    //#output(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this.windows
    //#new obj(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): java.lang.StringBuilder:toString(...)
    //#new obj(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ArrayList(getSources#1)
    //#new obj(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1)
    //#new obj(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new HashMap(ButtonBar#2)
    //#new obj(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new JPanel(ButtonBar#3)
    //#new obj(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new JPanel(ButtonBar#5)
    //#new obj(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new MapList(ButtonBar#1)
    //#new obj(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new MapList(ConfigManager#1)
    //#pre[4] (void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): init'ed(com/dmdirc/config/IdentityManager.globalconfig)
    //#pre[1] (void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): (soft) init'ed(com.dmdirc.config.ConfigManager$1__static_init.new int[](ConfigManager$1__static_init#1)[0..4_294_967_295])
    //#presumption(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com.dmdirc.ui.interfaces.FramemanagerPosition:getPosition(...)@98 != null
    //#presumption(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): getGlobalConfig(...).__Tag == com/dmdirc/config/ConfigManager
    //#presumption(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): getGlobalConfig(...).sources != null
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/IdentityManager.globalconfig == One-of{old com/dmdirc/config/IdentityManager.globalconfig, &new ConfigManager(getGlobalConfig#1)}
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com/dmdirc/config/IdentityManager.globalconfig != null
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): java.lang.StringBuilder:toString(...)._tainted == 0
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this.buttons == &new HashMap(ButtonBar#2)
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this.cells == 1
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new HashMap(ButtonBar#2) num objects == 1
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new MapList(ButtonBar#1) num objects == 1
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this.maxButtons == 2_147_483_647
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this.panel in Addr_Set{&new JPanel(ButtonBar#5),&new JPanel(ButtonBar#3)}
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this.position != null
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): this.windows == &new MapList(ButtonBar#1)
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ArrayList(getSources#1) num objects <= 1
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1) num objects == new ArrayList(getSources#1) num objects
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new MapList(ConfigManager#1) num objects == new ArrayList(getSources#1) num objects
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): init'ed(new ArrayList(getSources#1).__Lock)
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).__Tag == com/dmdirc/config/ConfigManager
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).channel == &java.lang.StringBuilder:toString(...)
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).ircd == &""
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).network == &""
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).server == &""
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).listeners == &new MapList(ConfigManager#1)
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new ConfigManager(getGlobalConfig#1).sources == &new ArrayList(getSources#1)
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new JPanel(ButtonBar#3) num objects <= 1
    //#post(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): new JPanel(ButtonBar#5) num objects <= 1
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:com.dmdirc.logger.Logger:assertTrue
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.util.List:add
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:getTarget
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:com.dmdirc.config.ConfigTarget$TYPE:ordinal
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.lang.String:equalsIgnoreCase
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:addListener
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:getSources
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:com.dmdirc.config.ConfigSource
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:com.dmdirc.util.MapList
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:addConfigManager
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.util.Collections:sort
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.util.Map:containsKey
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.util.Map:get
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.lang.Integer:intValue
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.lang.Integer:valueOf
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.util.Map:put
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:hasOption
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:getOption
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:java.lang.IllegalArgumentException
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:com.dmdirc.util.ConfigFile:getKeyDomain
    //#unanalyzed(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): Effects-of-calling:com.dmdirc.util.ConfigFile:isKeyDomain
    //#test_vector(void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()): com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal(...)@101: {0}, {1}
        windows = new MapList<FrameContainer, FrameContainer>();
    //#ButtonBar.java:96: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.util.MapList()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()
    //#    unanalyzed callee: void com.dmdirc.util.MapList()
        buttons = new HashMap<FrameContainer, JToggleButton>();
        position = FramemanagerPosition.getPosition(
    //#ButtonBar.java:98: Warning: method not available - call not analyzed
    //#    call on FramemanagerPosition com.dmdirc.ui.interfaces.FramemanagerPosition:getPosition(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()
    //#    unanalyzed callee: FramemanagerPosition com.dmdirc.ui.interfaces.FramemanagerPosition:getPosition(String)
                IdentityManager.getGlobalConfig().getOption("ui", "framemanagerPosition"));

        if (position.isHorizontal()) {
    //#ButtonBar.java:101: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()
    //#    unanalyzed callee: bool com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal()
            panel = new JPanel(new MigLayout("ins 0, fill, flowx"));
    //#ButtonBar.java:102: Warning: method not available - call not analyzed
    //#    call on void net.miginfocom.swing.MigLayout(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()
    //#    unanalyzed callee: void net.miginfocom.swing.MigLayout(String)
        } else {
            panel = new JPanel(new MigLayout("ins 0, fill, flowy"));
    //#ButtonBar.java:104: Warning: method not available - call not analyzed
    //#    call on void net.miginfocom.swing.MigLayout(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()
    //#    unanalyzed callee: void net.miginfocom.swing.MigLayout(String)
        }
    }
    //#ButtonBar.java:106: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar()

    /** {@inheritDoc} */
    @Override
    public void setParent(final JComponent parent) {
        this.parent = parent;
    //#ButtonBar.java:111: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.setParent(JComponent)
    //#input(void setParent(JComponent)): parent
    //#input(void setParent(JComponent)): this
    //#input(void setParent(JComponent)): this.cells
    //#input(void setParent(JComponent)): this.panel
    //#input(void setParent(JComponent)): this.position
    //#output(void setParent(JComponent)): this.buttonWidth
    //#output(void setParent(JComponent)): this.maxButtons
    //#output(void setParent(JComponent)): this.parent
    //#pre[2] (void setParent(JComponent)): parent != null
    //#pre[6] (void setParent(JComponent)): this.position != null
    //#pre[4] (void setParent(JComponent)): (soft) this.cells != 0
    //#presumption(void setParent(JComponent)): (javax.swing.JComponent:getWidth(...)@116 - 15)/this.cells in {-2_147_483_648..-11, -9..4_294_967_280}
    //#presumption(void setParent(JComponent)): javax.swing.JComponent:getWidth(...)@119/(150 + 10) in {-2_147_483_648..4_294_967_295}
    //#post(void setParent(JComponent)): this.buttonWidth in {-2_147_483_648..-11, -9..4_294_967_280}
    //#post(void setParent(JComponent)): possibly_updated(this.maxButtons)
    //#post(void setParent(JComponent)): this.parent == parent
    //#post(void setParent(JComponent)): this.parent != null
    //#test_vector(void setParent(JComponent)): com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal(...)@118: {0}, {1}

        parent.setLayout(new MigLayout());
    //#ButtonBar.java:113: Warning: method not available - call not analyzed
    //#    call on void net.miginfocom.swing.MigLayout()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void setParent(JComponent)
    //#    unanalyzed callee: void net.miginfocom.swing.MigLayout()
        parent.add(panel);

        buttonWidth = position.isHorizontal() ? 150 : (parent.getWidth() - UIUtilities.SMALL_BORDER * 3) / cells;
    //#ButtonBar.java:116: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void setParent(JComponent)
    //#    unanalyzed callee: bool com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal()

        if (position.isHorizontal()) {
    //#ButtonBar.java:118: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void setParent(JComponent)
    //#    unanalyzed callee: bool com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal()
            maxButtons = parent.getWidth() / (buttonWidth + UIUtilities.SMALL_BORDER * 2);
        }

        parent.addComponentListener(this);
    }
    //#ButtonBar.java:123: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.setParent(JComponent)

    /**
     * Removes all buttons from the bar and readds them.
     */
    private void relayout() {
        panel.removeAll();
    //#ButtonBar.java:129: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.relayout()
    //#input(void relayout()): this
    //#input(void relayout()): this.buttonWidth
    //#input(void relayout()): this.buttons
    //#input(void relayout()): this.panel
    //#input(void relayout()): this.windows
    //#pre[4] (void relayout()): this.panel != null
    //#pre[5] (void relayout()): this.windows != null
    //#pre[2] (void relayout()): (soft) init'ed(this.buttonWidth)
    //#pre[3] (void relayout()): (soft) this.buttons != null
    //#presumption(void relayout()): com.dmdirc.util.MapList:entrySet(...)@131 != null
    //#presumption(void relayout()): java.util.Iterator:next(...)@131 != null
    //#presumption(void relayout()): java.util.Map:get(...)@132 != null
    //#presumption(void relayout()): java.util.Map:get(...)@133 != null
    //#presumption(void relayout()): java.util.Map:get(...)@139 != null
    //#presumption(void relayout()): java.util.Map:get(...)@140 != null
    //#presumption(void relayout()): java.util.Map_Entry:getValue(...)@138 != null
    //#test_vector(void relayout()): java.util.Iterator:hasNext(...)@131: {0}, {1}
    //#test_vector(void relayout()): java.util.Iterator:hasNext(...)@138: {0}, {1}

        for (Map.Entry<FrameContainer, List<FrameContainer>> entry : windows.entrySet()) {
    //#ButtonBar.java:131: Warning: method not available - call not analyzed
    //#    call on Set com.dmdirc.util.MapList:entrySet()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void relayout()
    //#    unanalyzed callee: Set com.dmdirc.util.MapList:entrySet()
            buttons.get(entry.getKey()).setPreferredSize(new Dimension(buttonWidth, 25));
            buttons.get(entry.getKey()).setMinimumSize(new Dimension(buttonWidth, 25));
            panel.add(buttons.get(entry.getKey()));

            Collections.sort(entry.getValue(), new FrameContainerComparator());
    //#ButtonBar.java:136: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainerComparator()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void relayout()
    //#    unanalyzed callee: void com.dmdirc.FrameContainerComparator()

            for (FrameContainer child : entry.getValue()) {
                buttons.get(child).setPreferredSize(new Dimension(buttonWidth, 25));
                buttons.get(child).setMinimumSize(new Dimension(buttonWidth, 25));
                panel.add(buttons.get(child));
            }
        }
        panel.validate();
    }
    //#ButtonBar.java:145: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.relayout()

    /**
     * Adds a button to the button array with the details from the specified
     * container.
     *
     * @param source The Container to get title/icon info from
     */
    private void addButton(final FrameContainer source) {
        final JToggleButton button = new JToggleButton(source.toString(), source.getIcon());
    //#ButtonBar.java:154: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.addButton(FrameContainer)
    //#ButtonBar.java:154: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.FrameContainer:toString()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void addButton(FrameContainer)
    //#    unanalyzed callee: String com.dmdirc.FrameContainer:toString()
    //#ButtonBar.java:154: Warning: method not available - call not analyzed
    //#    call on Icon com.dmdirc.FrameContainer:getIcon()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void addButton(FrameContainer)
    //#    unanalyzed callee: Icon com.dmdirc.FrameContainer:getIcon()
    //#input(void addButton(FrameContainer)): source
    //#input(void addButton(FrameContainer)): source._tainted
    //#input(void addButton(FrameContainer)): this
    //#input(void addButton(FrameContainer)): this.buttons
    //#pre[1] (void addButton(FrameContainer)): source != null
    //#pre[4] (void addButton(FrameContainer)): this.buttons != null

        button.addActionListener(this);
        button.setHorizontalAlignment(SwingConstants.LEFT);
        button.setMargin(new Insets(0, 0, 0, 0));

        buttons.put(source, button);
    }
    //#ButtonBar.java:161: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.addButton(FrameContainer)

    /** {@inheritDoc} */
    @Override
    public boolean canPositionVertically() {
        return true;
    //#ButtonBar.java:166: method: bool com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.canPositionVertically()
    //#output(bool canPositionVertically()): return_value
    //#post(bool canPositionVertically()): return_value == 1
    //#ButtonBar.java:166: end of method: bool com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.canPositionVertically()
    }

    /** {@inheritDoc} */
    @Override
    public boolean canPositionHorizontally() {
        return true;
    //#ButtonBar.java:172: method: bool com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.canPositionHorizontally()
    //#output(bool canPositionHorizontally()): return_value
    //#post(bool canPositionHorizontally()): return_value == 1
    //#ButtonBar.java:172: end of method: bool com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.canPositionHorizontally()
    }

    /** {@inheritDoc} */
    @Override
    public void addWindow(final FrameContainer window) {
        windows.add(window);
    //#ButtonBar.java:178: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.addWindow(FrameContainer)
    //#ButtonBar.java:178: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.util.MapList:add(Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void addWindow(FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.util.MapList:add(Object)
    //#input(void addWindow(FrameContainer)): this
    //#input(void addWindow(FrameContainer)): this.buttonWidth
    //#input(void addWindow(FrameContainer)): this.buttons
    //#input(void addWindow(FrameContainer)): this.panel
    //#input(void addWindow(FrameContainer)): this.windows
    //#input(void addWindow(FrameContainer)): window
    //#input(void addWindow(FrameContainer)): window._tainted
    //#pre[3] (void addWindow(FrameContainer)): this.buttons != null
    //#pre[4] (void addWindow(FrameContainer)): this.panel != null
    //#pre[5] (void addWindow(FrameContainer)): this.windows != null
    //#pre[6] (void addWindow(FrameContainer)): window != null
    //#pre[2] (void addWindow(FrameContainer)): (soft) init'ed(this.buttonWidth)
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:com.dmdirc.FrameContainer:toString
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:com.dmdirc.FrameContainer:getIcon
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:javax.swing.JToggleButton
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:addActionListener
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:setHorizontalAlignment
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:java.awt.Insets
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:setMargin
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:java.util.Map:put
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:javax.swing.JPanel:removeAll
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:com.dmdirc.util.MapList:entrySet
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:java.util.Set:iterator
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:java.util.Map$Entry:getKey
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:java.util.Map:get
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:java.awt.Dimension
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:setPreferredSize
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:setMinimumSize
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:javax.swing.JPanel:add
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:java.util.Map$Entry:getValue
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:com.dmdirc.FrameContainerComparator
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:java.util.Collections:sort
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void addWindow(FrameContainer)): Effects-of-calling:javax.swing.JPanel:validate
        addButton(window);

        relayout();
        window.addNotificationListener(this);
    //#ButtonBar.java:182: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:addNotificationListener(NotificationListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void addWindow(FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:addNotificationListener(NotificationListener)
        window.addSelectionListener(this);
    //#ButtonBar.java:183: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:addSelectionListener(SelectionListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void addWindow(FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:addSelectionListener(SelectionListener)
        window.addIconChangeListener(this);
    //#ButtonBar.java:184: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:addIconChangeListener(IconChangeListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void addWindow(FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:addIconChangeListener(IconChangeListener)
    }
    //#ButtonBar.java:185: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.addWindow(FrameContainer)

    /** {@inheritDoc} */
    @Override
    public void delWindow(final FrameContainer window) {
        windows.remove(window);
    //#ButtonBar.java:190: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.delWindow(FrameContainer)
    //#ButtonBar.java:190: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.util.MapList:remove(Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void delWindow(FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.util.MapList:remove(Object)
    //#input(void delWindow(FrameContainer)): this
    //#input(void delWindow(FrameContainer)): this.buttonWidth
    //#input(void delWindow(FrameContainer)): this.buttons
    //#input(void delWindow(FrameContainer)): this.panel
    //#input(void delWindow(FrameContainer)): this.windows
    //#input(void delWindow(FrameContainer)): window
    //#pre[4] (void delWindow(FrameContainer)): this.panel != null
    //#pre[5] (void delWindow(FrameContainer)): this.windows != null
    //#pre[6] (void delWindow(FrameContainer)): window != null
    //#pre[2] (void delWindow(FrameContainer)): (soft) init'ed(this.buttonWidth)
    //#pre[3] (void delWindow(FrameContainer)): (soft) this.buttons != null
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:javax.swing.JPanel:removeAll
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:com.dmdirc.util.MapList:entrySet
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:java.util.Set:iterator
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:java.util.Map$Entry:getKey
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:java.util.Map:get
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:java.awt.Dimension
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:setPreferredSize
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:setMinimumSize
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:javax.swing.JPanel:add
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:java.util.Map$Entry:getValue
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:com.dmdirc.FrameContainerComparator
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:java.util.Collections:sort
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void delWindow(FrameContainer)): Effects-of-calling:javax.swing.JPanel:validate

        relayout();
        window.removeNotificationListener(this);
    //#ButtonBar.java:193: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:removeNotificationListener(NotificationListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void delWindow(FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:removeNotificationListener(NotificationListener)
        window.removeIconChangeListener(this);
    //#ButtonBar.java:194: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:removeIconChangeListener(IconChangeListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void delWindow(FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:removeIconChangeListener(IconChangeListener)
        window.removeSelectionListener(this);
    //#ButtonBar.java:195: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:removeSelectionListener(SelectionListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void delWindow(FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:removeSelectionListener(SelectionListener)
    }
    //#ButtonBar.java:196: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.delWindow(FrameContainer)

    /** {@inheritDoc} */
    @Override
    public void addWindow(final FrameContainer parent, final FrameContainer window) {
        windows.add(parent, window);
    //#ButtonBar.java:201: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.addWindow(FrameContainer, FrameContainer)
    //#ButtonBar.java:201: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.util.MapList:add(Object, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void addWindow(FrameContainer, FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.util.MapList:add(Object, Object)
    //#input(void addWindow(FrameContainer, FrameContainer)): parent
    //#input(void addWindow(FrameContainer, FrameContainer)): this
    //#input(void addWindow(FrameContainer, FrameContainer)): this.buttonWidth
    //#input(void addWindow(FrameContainer, FrameContainer)): this.buttons
    //#input(void addWindow(FrameContainer, FrameContainer)): this.panel
    //#input(void addWindow(FrameContainer, FrameContainer)): this.windows
    //#input(void addWindow(FrameContainer, FrameContainer)): window
    //#input(void addWindow(FrameContainer, FrameContainer)): window._tainted
    //#pre[4] (void addWindow(FrameContainer, FrameContainer)): this.buttons != null
    //#pre[5] (void addWindow(FrameContainer, FrameContainer)): this.panel != null
    //#pre[6] (void addWindow(FrameContainer, FrameContainer)): this.windows != null
    //#pre[7] (void addWindow(FrameContainer, FrameContainer)): window != null
    //#pre[3] (void addWindow(FrameContainer, FrameContainer)): (soft) init'ed(this.buttonWidth)
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:com.dmdirc.FrameContainer:toString
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:com.dmdirc.FrameContainer:getIcon
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JToggleButton
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:addActionListener
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:setHorizontalAlignment
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.awt.Insets
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:setMargin
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Map:put
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JPanel:removeAll
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:com.dmdirc.util.MapList:entrySet
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Set:iterator
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Map$Entry:getKey
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Map:get
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.awt.Dimension
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:setPreferredSize
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:setMinimumSize
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JPanel:add
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Map$Entry:getValue
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:com.dmdirc.FrameContainerComparator
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Collections:sort
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void addWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JPanel:validate
        addButton(window);

        relayout();
        window.addNotificationListener(this);
    //#ButtonBar.java:205: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:addNotificationListener(NotificationListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void addWindow(FrameContainer, FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:addNotificationListener(NotificationListener)
        window.addSelectionListener(this);
    //#ButtonBar.java:206: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:addSelectionListener(SelectionListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void addWindow(FrameContainer, FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:addSelectionListener(SelectionListener)
        window.addIconChangeListener(this);
    //#ButtonBar.java:207: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:addIconChangeListener(IconChangeListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void addWindow(FrameContainer, FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:addIconChangeListener(IconChangeListener)
    }
    //#ButtonBar.java:208: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.addWindow(FrameContainer, FrameContainer)

    /** {@inheritDoc} */
    @Override
    public void delWindow(final FrameContainer parent, final FrameContainer window) {
        windows.remove(parent, window);
    //#ButtonBar.java:213: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.delWindow(FrameContainer, FrameContainer)
    //#ButtonBar.java:213: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.util.MapList:remove(Object, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void delWindow(FrameContainer, FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.util.MapList:remove(Object, Object)
    //#input(void delWindow(FrameContainer, FrameContainer)): parent
    //#input(void delWindow(FrameContainer, FrameContainer)): this
    //#input(void delWindow(FrameContainer, FrameContainer)): this.buttonWidth
    //#input(void delWindow(FrameContainer, FrameContainer)): this.buttons
    //#input(void delWindow(FrameContainer, FrameContainer)): this.panel
    //#input(void delWindow(FrameContainer, FrameContainer)): this.windows
    //#input(void delWindow(FrameContainer, FrameContainer)): window
    //#pre[5] (void delWindow(FrameContainer, FrameContainer)): this.panel != null
    //#pre[6] (void delWindow(FrameContainer, FrameContainer)): this.windows != null
    //#pre[7] (void delWindow(FrameContainer, FrameContainer)): window != null
    //#pre[3] (void delWindow(FrameContainer, FrameContainer)): (soft) init'ed(this.buttonWidth)
    //#pre[4] (void delWindow(FrameContainer, FrameContainer)): (soft) this.buttons != null
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JPanel:removeAll
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:com.dmdirc.util.MapList:entrySet
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Set:iterator
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Map$Entry:getKey
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Map:get
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.awt.Dimension
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:setPreferredSize
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JToggleButton:setMinimumSize
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JPanel:add
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Map$Entry:getValue
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:com.dmdirc.FrameContainerComparator
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.Collections:sort
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void delWindow(FrameContainer, FrameContainer)): Effects-of-calling:javax.swing.JPanel:validate

        relayout();
        window.removeNotificationListener(this);
    //#ButtonBar.java:216: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:removeNotificationListener(NotificationListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void delWindow(FrameContainer, FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:removeNotificationListener(NotificationListener)
        window.removeIconChangeListener(this);
    //#ButtonBar.java:217: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:removeIconChangeListener(IconChangeListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void delWindow(FrameContainer, FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:removeIconChangeListener(IconChangeListener)
        window.removeSelectionListener(this);
    //#ButtonBar.java:218: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:removeSelectionListener(SelectionListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void delWindow(FrameContainer, FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:removeSelectionListener(SelectionListener)
    }
    //#ButtonBar.java:219: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.delWindow(FrameContainer, FrameContainer)

    /**
     * Called when the user clicks on one of the buttons.
     *
     * @param e The action event associated with this action
     */
    @Override
    public void actionPerformed(final ActionEvent e) {
        for (Map.Entry<FrameContainer, JToggleButton> entry : buttons.entrySet()) {
    //#ButtonBar.java:228: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.actionPerformed(ActionEvent)
    //#input(void actionPerformed(ActionEvent)): e
    //#input(void actionPerformed(ActionEvent)): this
    //#input(void actionPerformed(ActionEvent)): this.activeWindow
    //#input(void actionPerformed(ActionEvent)): this.buttons
    //#pre[4] (void actionPerformed(ActionEvent)): this.buttons != null
    //#pre[1] (void actionPerformed(ActionEvent)): (soft) e != null
    //#pre[3] (void actionPerformed(ActionEvent)): (soft) init'ed(this.activeWindow)
    //#presumption(void actionPerformed(ActionEvent)): com.dmdirc.FrameContainer:getFrame(...)@230 != null
    //#presumption(void actionPerformed(ActionEvent)): java.util.Iterator:next(...)@228 != null
    //#presumption(void actionPerformed(ActionEvent)): java.util.Map:entrySet(...)@228 != null
    //#presumption(void actionPerformed(ActionEvent)): java.util.Map_Entry:getKey(...)@230 != null
    //#presumption(void actionPerformed(ActionEvent)): java.util.Map_Entry:getKey(...)@234 != null
    //#presumption(void actionPerformed(ActionEvent)): java.util.Map_Entry:getValue(...)@229 != null
    //#presumption(void actionPerformed(ActionEvent)): java.util.Map_Entry:getValue(...)@231 != null
    //#test_vector(void actionPerformed(ActionEvent)): java.lang.Object:equals(...)@229: {0}, {1}
    //#test_vector(void actionPerformed(ActionEvent)): java.lang.Object:equals(...)@230: {0}, {1}
    //#test_vector(void actionPerformed(ActionEvent)): java.util.Iterator:hasNext(...)@228: {0}, {1}
            if (entry.getValue().equals(e.getSource())) {
                if (entry.getKey().getFrame().equals(activeWindow)) {
    //#ButtonBar.java:230: Warning: method not available - call not analyzed
    //#    call on Window com.dmdirc.FrameContainer:getFrame()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void actionPerformed(ActionEvent)
    //#    unanalyzed callee: Window com.dmdirc.FrameContainer:getFrame()
                    entry.getValue().setSelected(true);
                }

                entry.getKey().activateFrame();
    //#ButtonBar.java:234: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:activateFrame()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void actionPerformed(ActionEvent)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:activateFrame()
            }
        }
    }
    //#ButtonBar.java:237: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.actionPerformed(ActionEvent)

    /**
     * Called when the parent component is resized.
     *
     * @param e A ComponentEvent corresponding to this event.
     */
    @Override
    public void componentResized(final ComponentEvent e) {
        buttonWidth = position.isHorizontal() ? 150 : (parent.getWidth() - UIUtilities.SMALL_BORDER * 3) / cells;
    //#ButtonBar.java:246: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.componentResized(ComponentEvent)
    //#ButtonBar.java:246: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void componentResized(ComponentEvent)
    //#    unanalyzed callee: bool com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal()
    //#input(void componentResized(ComponentEvent)): this
    //#input(void componentResized(ComponentEvent)): this.buttons
    //#input(void componentResized(ComponentEvent)): this.cells
    //#input(void componentResized(ComponentEvent)): this.panel
    //#input(void componentResized(ComponentEvent)): this.parent
    //#input(void componentResized(ComponentEvent)): this.position
    //#input(void componentResized(ComponentEvent)): this.windows
    //#output(void componentResized(ComponentEvent)): this.buttonWidth
    //#output(void componentResized(ComponentEvent)): this.maxButtons
    //#pre[5] (void componentResized(ComponentEvent)): this.panel != null
    //#pre[7] (void componentResized(ComponentEvent)): this.position != null
    //#pre[8] (void componentResized(ComponentEvent)): this.windows != null
    //#pre[3] (void componentResized(ComponentEvent)): (soft) this.buttons != null
    //#pre[4] (void componentResized(ComponentEvent)): (soft) this.cells != 0
    //#pre[6] (void componentResized(ComponentEvent)): (soft) this.parent != null
    //#presumption(void componentResized(ComponentEvent)): (javax.swing.JComponent:getWidth(...)@246 - 15)/this.cells in {-2_147_483_648..-11, -9..4_294_967_280}
    //#presumption(void componentResized(ComponentEvent)): javax.swing.JComponent:getWidth(...)@249/(150 + 10) in {-2_147_483_648..4_294_967_295}
    //#post(void componentResized(ComponentEvent)): this.buttonWidth in {-2_147_483_648..-11, -9..4_294_967_280}
    //#post(void componentResized(ComponentEvent)): possibly_updated(this.maxButtons)
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:javax.swing.JPanel:removeAll
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:com.dmdirc.util.MapList:entrySet
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:java.util.Set:iterator
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:java.util.Map$Entry:getKey
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:java.util.Map:get
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:java.awt.Dimension
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:javax.swing.JToggleButton:setPreferredSize
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:javax.swing.JToggleButton:setMinimumSize
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:javax.swing.JPanel:add
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:java.util.Map$Entry:getValue
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:com.dmdirc.FrameContainerComparator
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:java.util.Collections:sort
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void componentResized(ComponentEvent)): Effects-of-calling:javax.swing.JPanel:validate
    //#test_vector(void componentResized(ComponentEvent)): com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal(...)@248: {0}, {1}

        if (position.isHorizontal()) {
    //#ButtonBar.java:248: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void componentResized(ComponentEvent)
    //#    unanalyzed callee: bool com.dmdirc.ui.interfaces.FramemanagerPosition:isHorizontal()
            maxButtons = parent.getWidth() / (buttonWidth + UIUtilities.SMALL_BORDER * 2);
        }

        relayout();
    }
    //#ButtonBar.java:253: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.componentResized(ComponentEvent)

    /**
     * Called when the parent component is moved.
     *
     * @param e A ComponentEvent corresponding to this event.
     */
    @Override
    public void componentMoved(final ComponentEvent e) {
        // Do nothing
    }
    //#ButtonBar.java:263: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.componentMoved(ComponentEvent)
    //#ButtonBar.java:263: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.componentMoved(ComponentEvent)

    /**
     * Called when the parent component is made visible.
     *
     * @param e A ComponentEvent corresponding to this event.
     */
    @Override
    public void componentShown(final ComponentEvent e) {
        // Do nothing
    }
    //#ButtonBar.java:273: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.componentShown(ComponentEvent)
    //#ButtonBar.java:273: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.componentShown(ComponentEvent)

    /**
     * Called when the parent component is made invisible.
     *
     * @param e A ComponentEvent corresponding to this event.
     */
    @Override
    public void componentHidden(final ComponentEvent e) {
        // Do nothing
    }
    //#ButtonBar.java:283: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.componentHidden(ComponentEvent)
    //#ButtonBar.java:283: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.componentHidden(ComponentEvent)

    /** {@inheritDoc} */
    @Override
    public void notificationSet(final Window window, final Color colour) {
        if (buttons.containsKey(window.getContainer())) {
    //#ButtonBar.java:288: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.notificationSet(Window, Color)
    //#ButtonBar.java:288: Warning: method not available - call not analyzed
    //#    call on FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void notificationSet(Window, Color)
    //#    unanalyzed callee: FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
    //#input(void notificationSet(Window, Color)): colour
    //#input(void notificationSet(Window, Color)): this
    //#input(void notificationSet(Window, Color)): this.buttons
    //#input(void notificationSet(Window, Color)): window
    //#pre[3] (void notificationSet(Window, Color)): this.buttons != null
    //#pre[4] (void notificationSet(Window, Color)): window != null
    //#presumption(void notificationSet(Window, Color)): java.util.Map:get(...)@289 != null
    //#test_vector(void notificationSet(Window, Color)): java.util.Map:containsKey(...)@288: {0}, {1}
            buttons.get(window.getContainer()).setForeground(colour);
    //#ButtonBar.java:289: Warning: method not available - call not analyzed
    //#    call on FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void notificationSet(Window, Color)
    //#    unanalyzed callee: FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
        }
    }
    //#ButtonBar.java:291: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.notificationSet(Window, Color)

    /** {@inheritDoc} */
    @Override
    public void notificationCleared(final Window window) {
        notificationSet(window, window.getContainer().getNotification());
    //#ButtonBar.java:296: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.notificationCleared(Window)
    //#ButtonBar.java:296: Warning: method not available - call not analyzed
    //#    call on FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void notificationCleared(Window)
    //#    unanalyzed callee: FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
    //#ButtonBar.java:296: Warning: method not available - call not analyzed
    //#    call on Color com.dmdirc.FrameContainer:getNotification()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void notificationCleared(Window)
    //#    unanalyzed callee: Color com.dmdirc.FrameContainer:getNotification()
    //#input(void notificationCleared(Window)): this
    //#input(void notificationCleared(Window)): this.buttons
    //#input(void notificationCleared(Window)): window
    //#pre[2] (void notificationCleared(Window)): this.buttons != null
    //#pre[3] (void notificationCleared(Window)): window != null
    //#presumption(void notificationCleared(Window)): com.dmdirc.ui.interfaces.Window:getContainer(...)@296 != null
    //#unanalyzed(void notificationCleared(Window)): Effects-of-calling:java.util.Map:get
    //#unanalyzed(void notificationCleared(Window)): Effects-of-calling:java.util.Map:containsKey
    //#unanalyzed(void notificationCleared(Window)): Effects-of-calling:com.dmdirc.ui.interfaces.Window:getContainer
    //#unanalyzed(void notificationCleared(Window)): Effects-of-calling:javax.swing.JToggleButton:setForeground
    }
    //#ButtonBar.java:297: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.notificationCleared(Window)

    /** {@inheritDoc} */
    @Override
    public void selectionChanged(final Window window) {
        activeWindow = window;   
    //#ButtonBar.java:302: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.selectionChanged(Window)
    //#input(void selectionChanged(Window)): this
    //#input(void selectionChanged(Window)): this.buttons
    //#input(void selectionChanged(Window)): this.selected
    //#input(void selectionChanged(Window)): window
    //#output(void selectionChanged(Window)): this.activeWindow
    //#output(void selectionChanged(Window)): this.selected
    //#pre[1] (void selectionChanged(Window)): init'ed(this.selected)
    //#pre[3] (void selectionChanged(Window)): this.buttons != null
    //#pre[4] (void selectionChanged(Window)): window != null
    //#presumption(void selectionChanged(Window)): java.util.Map:get(...)@304 != null
    //#presumption(void selectionChanged(Window)): java.util.Map:get(...)@310 != null
    //#post(void selectionChanged(Window)): this.activeWindow == window
    //#post(void selectionChanged(Window)): this.activeWindow != null
    //#post(void selectionChanged(Window)): init'ed(this.selected)
    //#test_vector(void selectionChanged(Window)): this.selected: Addr_Set{null}, Inverse{null}
    //#test_vector(void selectionChanged(Window)): java.util.Map:containsKey(...)@303: {0}, {1}
    //#test_vector(void selectionChanged(Window)): java.util.Map:containsKey(...)@309: {0}, {1}
        if (selected != null && buttons.containsKey(selected)) {
            buttons.get(selected).setSelected(false);
        }

        selected = window.getContainer();
    //#ButtonBar.java:307: Warning: method not available - call not analyzed
    //#    call on FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void selectionChanged(Window)
    //#    unanalyzed callee: FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()

        if (buttons.containsKey(window.getContainer())) {
    //#ButtonBar.java:309: Warning: method not available - call not analyzed
    //#    call on FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void selectionChanged(Window)
    //#    unanalyzed callee: FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
            buttons.get(window.getContainer()).setSelected(true);
    //#ButtonBar.java:310: Warning: method not available - call not analyzed
    //#    call on FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void selectionChanged(Window)
    //#    unanalyzed callee: FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
        }
    }
    //#ButtonBar.java:312: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.selectionChanged(Window)

    /** {@inheritDoc} */
    @Override
    public void iconChanged(final Window window, final Icon icon) {
        buttons.get(window.getContainer()).setIcon(icon);
    //#ButtonBar.java:317: method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.iconChanged(Window, Icon)
    //#ButtonBar.java:317: Warning: method not available - call not analyzed
    //#    call on FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
    //#    method: void iconChanged(Window, Icon)
    //#    unanalyzed callee: FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
    //#input(void iconChanged(Window, Icon)): icon
    //#input(void iconChanged(Window, Icon)): this
    //#input(void iconChanged(Window, Icon)): this.buttons
    //#input(void iconChanged(Window, Icon)): window
    //#pre[3] (void iconChanged(Window, Icon)): this.buttons != null
    //#pre[4] (void iconChanged(Window, Icon)): window != null
    //#presumption(void iconChanged(Window, Icon)): java.util.Map:get(...)@317 != null
    }
    //#ButtonBar.java:318: end of method: void com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.iconChanged(Window, Icon)
}
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/framemanager/buttonbar/ButtonBar]
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.actionPerformed(Ljava/awt/event/ActionEvent;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.addButton(Lcom/dmdirc/FrameContainer;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.addWindow(Lcom/dmdirc/FrameContainer;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.addWindow(Lcom/dmdirc/FrameContainer;Lcom/dmdirc/FrameContainer;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.canPositionHorizontally()Z
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.canPositionVertically()Z
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.componentHidden(Ljava/awt/event/ComponentEvent;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.componentMoved(Ljava/awt/event/ComponentEvent;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.componentResized(Ljava/awt/event/ComponentEvent;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.componentShown(Ljava/awt/event/ComponentEvent;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.delWindow(Lcom/dmdirc/FrameContainer;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.delWindow(Lcom/dmdirc/FrameContainer;Lcom/dmdirc/FrameContainer;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.iconChanged(Lcom/dmdirc/ui/interfaces/Window;Ljavax/swing/Icon;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.notificationCleared(Lcom/dmdirc/ui/interfaces/Window;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.notificationSet(Lcom/dmdirc/ui/interfaces/Window;Ljava/awt/Color;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.relayout()V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.selectionChanged(Lcom/dmdirc/ui/interfaces/Window;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.setParent(Ljavax/swing/JComponent;)V
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/framemanager/buttonbar/ButtonBar] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.actionPerformed(Ljava/awt/event/ActionEvent;)V == &actionPerformed
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.addButton(Lcom/dmdirc/FrameContainer;)V == &addButton
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.addWindow(Lcom/dmdirc/FrameContainer;)V == &addWindow
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.addWindow(Lcom/dmdirc/FrameContainer;Lcom/dmdirc/FrameContainer;)V == &addWindow
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.canPositionHorizontally()Z == &canPositionHorizontally
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.canPositionVertically()Z == &canPositionVertically
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.componentHidden(Ljava/awt/event/ComponentEvent;)V == &componentHidden
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.componentMoved(Ljava/awt/event/ComponentEvent;)V == &componentMoved
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.componentResized(Ljava/awt/event/ComponentEvent;)V == &componentResized
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.componentShown(Ljava/awt/event/ComponentEvent;)V == &componentShown
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.delWindow(Lcom/dmdirc/FrameContainer;)V == &delWindow
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.delWindow(Lcom/dmdirc/FrameContainer;Lcom/dmdirc/FrameContainer;)V == &delWindow
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.iconChanged(Lcom/dmdirc/ui/interfaces/Window;Ljavax/swing/Icon;)V == &iconChanged
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.notificationCleared(Lcom/dmdirc/ui/interfaces/Window;)V == &notificationCleared
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.notificationSet(Lcom/dmdirc/ui/interfaces/Window;Ljava/awt/Color;)V == &notificationSet
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.relayout()V == &relayout
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.selectionChanged(Lcom/dmdirc/ui/interfaces/Window;)V == &selectionChanged
    //#post(com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init): __Dispatch_Table.setParent(Ljavax/swing/JComponent;)V == &setParent
    //#ButtonBar.java:: end of method: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar.com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar__static_init
    //#ButtonBar.java:: end of class: com.dmdirc.addons.ui_swing.framemanager.buttonbar.ButtonBar
