//# 0 errors, 242 messages
//#
/*
    //#OsdPlugin.java:1:1: class: com.dmdirc.addons.osd.OsdPlugin
    //#OsdPlugin.java:1:1: method: com.dmdirc.addons.osd.OsdPlugin.com.dmdirc.addons.osd.OsdPlugin__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.osd;

import com.dmdirc.commandparser.CommandManager;
import com.dmdirc.config.IdentityManager;
import com.dmdirc.config.prefs.CategoryChangeListener;
import com.dmdirc.config.prefs.PreferencesCategory;
import com.dmdirc.config.prefs.PreferencesInterface;
import com.dmdirc.config.prefs.PreferencesManager;
import com.dmdirc.config.prefs.PreferencesSetting;
import com.dmdirc.config.prefs.PreferencesType;
import com.dmdirc.config.prefs.SettingChangeListener;
import com.dmdirc.plugins.Plugin;
import java.util.HashMap;
import java.util.Map;

/**
 * Allows the user to display on-screen-display messages.
 * @author chris
 */
public final class OsdPlugin extends Plugin implements CategoryChangeListener,
        PreferencesInterface, SettingChangeListener {
    
    /** Config OSD Window. */
    private OsdWindow osdWindow;
    
    /** OSD Command. */
    private OsdCommand command;
    
    /** X-axis position of OSD. */
    private int x;
    
    /** Y-axis potion of OSD. */
    private int y;
    
    /** Setting objects with registered change listeners. */
    private PreferencesSetting fontSizeSetting, backgroundSetting, foregroundSetting;
    
    /**
     * Creates a new instance of OsdPlugin.
     */
    public OsdPlugin() {
        super();
    //#OsdPlugin.java:64: method: void com.dmdirc.addons.osd.OsdPlugin.com.dmdirc.addons.osd.OsdPlugin()
    //#OsdPlugin.java:64: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.plugins.Plugin()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void com.dmdirc.addons.osd.OsdPlugin()
    //#    unanalyzed callee: void com.dmdirc.plugins.Plugin()
    //#input(void com.dmdirc.addons.osd.OsdPlugin()): this
    }
    //#OsdPlugin.java:65: end of method: void com.dmdirc.addons.osd.OsdPlugin.com.dmdirc.addons.osd.OsdPlugin()
    
    /** {@inheritDoc} */
    @Override
    public void onLoad() {
        command = new OsdCommand(this);
    //#OsdPlugin.java:70: method: void com.dmdirc.addons.osd.OsdPlugin.onLoad()
    //#input(void onLoad()): this
    //#output(void onLoad()): new OsdCommand(onLoad#1) num objects
    //#output(void onLoad()): this.command.__Tag
    //#output(void onLoad()): this.command.plugin
    //#output(void onLoad()): this.command
    //#new obj(void onLoad()): new OsdCommand(onLoad#1)
    //#post(void onLoad()): this.command == &new OsdCommand(onLoad#1)
    //#post(void onLoad()): new OsdCommand(onLoad#1) num objects == 1
    //#post(void onLoad()): this.command.__Tag == com/dmdirc/addons/osd/OsdCommand
    //#post(void onLoad()): this.command.plugin == this
    //#post(void onLoad()): this.command.plugin != null
    //#unanalyzed(void onLoad()): Effects-of-calling:com.dmdirc.commandparser.commands.GlobalCommand
    //#unanalyzed(void onLoad()): Effects-of-calling:com.dmdirc.commandparser.CommandManager:registerCommand
    }
    //#OsdPlugin.java:71: end of method: void com.dmdirc.addons.osd.OsdPlugin.onLoad()
    
    /** {@inheritDoc} */
    @Override
    public void onUnload() {
        CommandManager.unregisterCommand(command);
    //#OsdPlugin.java:76: method: void com.dmdirc.addons.osd.OsdPlugin.onUnload()
    //#OsdPlugin.java:76: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.commandparser.CommandManager:unregisterCommand(CommandInfo)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void onUnload()
    //#    unanalyzed callee: void com.dmdirc.commandparser.CommandManager:unregisterCommand(CommandInfo)
    //#input(void onUnload()): this
    //#input(void onUnload()): this.command
    //#pre[2] (void onUnload()): init'ed(this.command)
    }
    //#OsdPlugin.java:77: end of method: void com.dmdirc.addons.osd.OsdPlugin.onUnload()

    /** {@inheritDoc} */
    @Override
    public void showConfig(final PreferencesManager manager) {
        x = IdentityManager.getGlobalConfig().getOptionInt(getDomain(), "locationX");
    //#OsdPlugin.java:82: method: void com.dmdirc.addons.osd.OsdPlugin.showConfig(PreferencesManager)
    //#OsdPlugin.java:82: Warning: method not available - call not analyzed
    //#    call on ConfigManager com.dmdirc.config.IdentityManager:getGlobalConfig()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: ConfigManager com.dmdirc.config.IdentityManager:getGlobalConfig()
    //#OsdPlugin.java:82: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#OsdPlugin.java:82: Warning: method not available - call not analyzed
    //#    call on int com.dmdirc.config.ConfigManager:getOptionInt(String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: int com.dmdirc.config.ConfigManager:getOptionInt(String, String)
    //#input(void showConfig(PreferencesManager)): com.dmdirc.config.prefs.PreferencesType.COLOUR
    //#input(void showConfig(PreferencesManager)): com.dmdirc.config.prefs.PreferencesType.INTEGER
    //#input(void showConfig(PreferencesManager)): manager
    //#input(void showConfig(PreferencesManager)): this
    //#output(void showConfig(PreferencesManager)): this.backgroundSetting
    //#output(void showConfig(PreferencesManager)): this.fontSizeSetting
    //#output(void showConfig(PreferencesManager)): this.foregroundSetting
    //#output(void showConfig(PreferencesManager)): this.x
    //#output(void showConfig(PreferencesManager)): this.y
    //#pre[1] (void showConfig(PreferencesManager)): manager != null
    //#presumption(void showConfig(PreferencesManager)): com.dmdirc.config.IdentityManager:getGlobalConfig(...)@82 != null
    //#presumption(void showConfig(PreferencesManager)): com.dmdirc.config.IdentityManager:getGlobalConfig(...)@83 != null
    //#presumption(void showConfig(PreferencesManager)): com.dmdirc.config.prefs.PreferencesManager:getCategory(...)@116 != null
    //#presumption(void showConfig(PreferencesManager)): init'ed(com.dmdirc.config.prefs.PreferencesType.COLOUR)
    //#presumption(void showConfig(PreferencesManager)): init'ed(com.dmdirc.config.prefs.PreferencesType.INTEGER)
    //#post(void showConfig(PreferencesManager)): init'ed(this.backgroundSetting)
    //#post(void showConfig(PreferencesManager)): init'ed(this.fontSizeSetting)
    //#post(void showConfig(PreferencesManager)): init'ed(this.foregroundSetting)
    //#post(void showConfig(PreferencesManager)): init'ed(this.x)
    //#post(void showConfig(PreferencesManager)): init'ed(this.y)
        y = IdentityManager.getGlobalConfig().getOptionInt(getDomain(), "locationY");
    //#OsdPlugin.java:83: Warning: method not available - call not analyzed
    //#    call on ConfigManager com.dmdirc.config.IdentityManager:getGlobalConfig()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: ConfigManager com.dmdirc.config.IdentityManager:getGlobalConfig()
    //#OsdPlugin.java:83: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#OsdPlugin.java:83: Warning: method not available - call not analyzed
    //#    call on int com.dmdirc.config.ConfigManager:getOptionInt(String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: int com.dmdirc.config.ConfigManager:getOptionInt(String, String)
        
        final PreferencesCategory category = new PreferencesCategory("OSD",
    //#OsdPlugin.java:85: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesCategory(String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesCategory(String, String)
                "General configuration for OSD plugin.");
        
        fontSizeSetting = new PreferencesSetting(PreferencesType.INTEGER,
    //#OsdPlugin.java:88: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#OsdPlugin.java:88: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesSetting(PreferencesType, String, String, String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesSetting(PreferencesType, String, String, String, String)
    //#OsdPlugin.java:88: Warning: method not available - call not analyzed
    //#    call on PreferencesSetting com.dmdirc.config.prefs.PreferencesSetting:registerChangeListener(SettingChangeListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: PreferencesSetting com.dmdirc.config.prefs.PreferencesSetting:registerChangeListener(SettingChangeListener)
                getDomain(), "fontSize", "Font size", "Changes the font " +
                "size of the OSD").registerChangeListener(this);
        backgroundSetting = new PreferencesSetting(PreferencesType.COLOUR,
    //#OsdPlugin.java:91: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#OsdPlugin.java:91: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesSetting(PreferencesType, String, String, String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesSetting(PreferencesType, String, String, String, String)
    //#OsdPlugin.java:91: Warning: method not available - call not analyzed
    //#    call on PreferencesSetting com.dmdirc.config.prefs.PreferencesSetting:registerChangeListener(SettingChangeListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: PreferencesSetting com.dmdirc.config.prefs.PreferencesSetting:registerChangeListener(SettingChangeListener)
                getDomain(), "bgcolour", "Background colour",
                "Background colour for the OSD").registerChangeListener(this);
        foregroundSetting = new PreferencesSetting(PreferencesType.COLOUR,
    //#OsdPlugin.java:94: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#OsdPlugin.java:94: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesSetting(PreferencesType, String, String, String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesSetting(PreferencesType, String, String, String, String)
    //#OsdPlugin.java:94: Warning: method not available - call not analyzed
    //#    call on PreferencesSetting com.dmdirc.config.prefs.PreferencesSetting:registerChangeListener(SettingChangeListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: PreferencesSetting com.dmdirc.config.prefs.PreferencesSetting:registerChangeListener(SettingChangeListener)
                getDomain(), "fgcolour", "Foreground colour",
                "Foreground colour for the OSD").registerChangeListener(this);
                
        category.addSetting(fontSizeSetting);
    //#OsdPlugin.java:98: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesCategory:addSetting(PreferencesSetting)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesCategory:addSetting(PreferencesSetting)
        category.addSetting(backgroundSetting);
    //#OsdPlugin.java:99: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesCategory:addSetting(PreferencesSetting)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesCategory:addSetting(PreferencesSetting)
        category.addSetting(foregroundSetting);
    //#OsdPlugin.java:100: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesCategory:addSetting(PreferencesSetting)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesCategory:addSetting(PreferencesSetting)
        category.addSetting(new PreferencesSetting(PreferencesType.INTEGER,
    //#OsdPlugin.java:101: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#OsdPlugin.java:101: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesSetting(PreferencesType, String, String, String, String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesSetting(PreferencesType, String, String, String, String)
    //#OsdPlugin.java:101: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesCategory:addSetting(PreferencesSetting)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesCategory:addSetting(PreferencesSetting)
                getDomain(), "timeout", "Timeout", "Length of time in " +
                "seconds before the OSD window closes"));
        
        final Map<String, String> posOptions = new HashMap<String, String>();
        posOptions.put("down", "Place new windows below old ones");
        posOptions.put("up", "Place new windows above old ones");
        posOptions.put("close", "Close existing windows");
        posOptions.put("ontop", "Place new windows on top of existing window");
        
        category.addSetting(new PreferencesSetting(getDomain(), "newbehaviour",
    //#OsdPlugin.java:111: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#OsdPlugin.java:111: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesSetting(String, String, String, String, Map)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesSetting(String, String, String, String, Map)
    //#OsdPlugin.java:111: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesCategory:addSetting(PreferencesSetting)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesCategory:addSetting(PreferencesSetting)
                "New window policy", "What to do when an OSD Window "
                + "is opened when there are other, existing windows open", posOptions));

        category.addChangeListener(this);
    //#OsdPlugin.java:115: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesCategory:addChangeListener(CategoryChangeListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesCategory:addChangeListener(CategoryChangeListener)
        manager.getCategory("Plugins").addSubCategory(category);
    //#OsdPlugin.java:116: Warning: method not available - call not analyzed
    //#    call on PreferencesCategory com.dmdirc.config.prefs.PreferencesManager:getCategory(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: PreferencesCategory com.dmdirc.config.prefs.PreferencesManager:getCategory(String)
    //#OsdPlugin.java:116: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesCategory:addSubCategory(PreferencesCategory)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesCategory:addSubCategory(PreferencesCategory)
        manager.registerSaveListener(this);
    //#OsdPlugin.java:117: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.prefs.PreferencesManager:registerSaveListener(PreferencesInterface)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void showConfig(PreferencesManager)
    //#    unanalyzed callee: void com.dmdirc.config.prefs.PreferencesManager:registerSaveListener(PreferencesInterface)
    }
    //#OsdPlugin.java:118: end of method: void com.dmdirc.addons.osd.OsdPlugin.showConfig(PreferencesManager)

    /** {@inheritDoc} */
    @Override
    public void categorySelected(final PreferencesCategory category) {
        osdWindow = new OsdWindow("Please drag this OSD to position", true, x, y, this);
    //#OsdPlugin.java:123: method: void com.dmdirc.addons.osd.OsdPlugin.categorySelected(PreferencesCategory)
    //#input(void categorySelected(PreferencesCategory)): com/dmdirc/addons/osd/OsdWindow.java.awt.Color.BLACK
    //#input(void categorySelected(PreferencesCategory)): com/dmdirc/addons/osd/OsdWindow.windows
    //#input(void categorySelected(PreferencesCategory)): com/dmdirc/addons/ui_swing/MainFrame.__Descendant_Table[com/dmdirc/addons/ui_swing/MainFrame]
    //#input(void categorySelected(PreferencesCategory)): com/dmdirc/addons/ui_swing/MainFrame.__Descendant_Table[others]
    //#input(void categorySelected(PreferencesCategory)): this
    //#input(void categorySelected(PreferencesCategory)): this.backgroundSetting
    //#input(void categorySelected(PreferencesCategory)): this.fontSizeSetting
    //#input(void categorySelected(PreferencesCategory)): this.foregroundSetting
    //#input(void categorySelected(PreferencesCategory)): this.osdWindow.label
    //#input(void categorySelected(PreferencesCategory)): this.osdWindow.panel
    //#input(void categorySelected(PreferencesCategory)): this.x
    //#input(void categorySelected(PreferencesCategory)): this.y
    //#output(void categorySelected(PreferencesCategory)): new JLabel(OsdWindow#5) num objects
    //#output(void categorySelected(PreferencesCategory)): new JPanel(OsdWindow#1) num objects
    //#output(void categorySelected(PreferencesCategory)): new OsdWindow(categorySelected#1) num objects
    //#output(void categorySelected(PreferencesCategory)): this.osdWindow.__Tag
    //#output(void categorySelected(PreferencesCategory)): this.osdWindow.config
    //#output(void categorySelected(PreferencesCategory)): this.osdWindow.label
    //#output(void categorySelected(PreferencesCategory)): this.osdWindow.panel
    //#output(void categorySelected(PreferencesCategory)): this.osdWindow.plugin
    //#output(void categorySelected(PreferencesCategory)): this.osdWindow
    //#new obj(void categorySelected(PreferencesCategory)): new JLabel(OsdWindow#5)
    //#new obj(void categorySelected(PreferencesCategory)): new JPanel(OsdWindow#1)
    //#new obj(void categorySelected(PreferencesCategory)): new OsdWindow(categorySelected#1)
    //#pre[3] (void categorySelected(PreferencesCategory)): this.backgroundSetting != null
    //#pre[4] (void categorySelected(PreferencesCategory)): this.fontSizeSetting != null
    //#pre[5] (void categorySelected(PreferencesCategory)): this.foregroundSetting != null
    //#pre[8] (void categorySelected(PreferencesCategory)): init'ed(this.x)
    //#pre[9] (void categorySelected(PreferencesCategory)): init'ed(this.y)
    //#pre[1] (void categorySelected(PreferencesCategory)): (soft) com/dmdirc/addons/osd/OsdWindow.windows != null
    //#post(void categorySelected(PreferencesCategory)): this.osdWindow == &new OsdWindow(categorySelected#1)
    //#post(void categorySelected(PreferencesCategory)): new JLabel(OsdWindow#5) num objects == 1
    //#post(void categorySelected(PreferencesCategory)): new JPanel(OsdWindow#1) num objects == 1
    //#post(void categorySelected(PreferencesCategory)): new OsdWindow(categorySelected#1) num objects == 1
    //#post(void categorySelected(PreferencesCategory)): this.osdWindow.config == 1
    //#post(void categorySelected(PreferencesCategory)): this.osdWindow.__Tag == com/dmdirc/addons/osd/OsdWindow
    //#post(void categorySelected(PreferencesCategory)): this.osdWindow.label == &new JLabel(OsdWindow#5)
    //#post(void categorySelected(PreferencesCategory)): this.osdWindow.panel == &new JPanel(OsdWindow#1)
    //#post(void categorySelected(PreferencesCategory)): this.osdWindow.plugin == this
    //#post(void categorySelected(PreferencesCategory)): this.osdWindow.plugin != null
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:javax.swing.JDialog:setVisible
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:java.util.List:add
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:transferFocusBackward
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.config.IdentityManager:getGlobalConfig
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdPlugin:getDomain
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.config.ConfigManager:getOptionInt
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.Main:getUI
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.ui.interfaces.UIController:getMainWindow
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:javax.swing.JDialog
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:setFocusableWindowState
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:setAlwaysOnTop
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:setResizable
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:setUndecorated
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:setDefaultCloseOperation
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:setLocation
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:javax.swing.JPanel
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:javax.swing.border.LineBorder
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:javax.swing.JPanel:setBorder
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.config.ConfigManager:getOptionColour
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:javax.swing.JPanel:setBackground
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:setContentPane
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:net.miginfocom.swing.MigLayout
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:setLayout
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:javax.swing.JLabel
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:javax.swing.JLabel:setForeground
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:javax.swing.JLabel:getFont
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:java.awt.Font:deriveFont
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:javax.swing.JLabel:setFont
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:javax.swing.JLabel:setHorizontalAlignment
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:add
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:pack
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:addMouseMotionListener
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.addons.osd.OsdWindow:addMouseListener
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:java.util.Timer
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:java.util.TimerTask
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:java.util.Timer:schedule
    //#unanalyzed(void categorySelected(PreferencesCategory)): Effects-of-calling:com.dmdirc.ui.messages.ColourManager:parseColour
        osdWindow.setBackgroundColour(backgroundSetting.getValue());
    //#OsdPlugin.java:124: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.config.prefs.PreferencesSetting:getValue()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void categorySelected(PreferencesCategory)
    //#    unanalyzed callee: String com.dmdirc.config.prefs.PreferencesSetting:getValue()
        osdWindow.setForegroundColour(foregroundSetting.getValue());
    //#OsdPlugin.java:125: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.config.prefs.PreferencesSetting:getValue()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void categorySelected(PreferencesCategory)
    //#    unanalyzed callee: String com.dmdirc.config.prefs.PreferencesSetting:getValue()
        osdWindow.setFontSize(Integer.parseInt(fontSizeSetting.getValue()));
    //#OsdPlugin.java:126: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.config.prefs.PreferencesSetting:getValue()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void categorySelected(PreferencesCategory)
    //#    unanalyzed callee: String com.dmdirc.config.prefs.PreferencesSetting:getValue()
    }
    //#OsdPlugin.java:127: end of method: void com.dmdirc.addons.osd.OsdPlugin.categorySelected(PreferencesCategory)

    /** {@inheritDoc} */
    @Override
    public void categoryDeselected(final PreferencesCategory category) {
        x = osdWindow.getLocationOnScreen().x;
    //#OsdPlugin.java:132: method: void com.dmdirc.addons.osd.OsdPlugin.categoryDeselected(PreferencesCategory)
    //#OsdPlugin.java:132: Warning: method not available - call not analyzed
    //#    call on Point com.dmdirc.addons.osd.OsdWindow:getLocationOnScreen()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void categoryDeselected(PreferencesCategory)
    //#    unanalyzed callee: Point com.dmdirc.addons.osd.OsdWindow:getLocationOnScreen()
    //#input(void categoryDeselected(PreferencesCategory)): com/dmdirc/addons/osd/OsdWindow.windows
    //#input(void categoryDeselected(PreferencesCategory)): this
    //#input(void categoryDeselected(PreferencesCategory)): this.osdWindow
    //#output(void categoryDeselected(PreferencesCategory)): this.osdWindow
    //#output(void categoryDeselected(PreferencesCategory)): this.x
    //#output(void categoryDeselected(PreferencesCategory)): this.y
    //#pre[1] (void categoryDeselected(PreferencesCategory)): com/dmdirc/addons/osd/OsdWindow.windows != null
    //#pre[2] (void categoryDeselected(PreferencesCategory)): this.osdWindow != null
    //#presumption(void categoryDeselected(PreferencesCategory)): com.dmdirc.addons.osd.OsdWindow:getLocationOnScreen(...)@132 != null
    //#presumption(void categoryDeselected(PreferencesCategory)): com.dmdirc.addons.osd.OsdWindow:getLocationOnScreen(...)@133 != null
    //#post(void categoryDeselected(PreferencesCategory)): this.osdWindow == null
    //#post(void categoryDeselected(PreferencesCategory)): init'ed(this.x)
    //#post(void categoryDeselected(PreferencesCategory)): init'ed(this.y)
    //#unanalyzed(void categoryDeselected(PreferencesCategory)): Effects-of-calling:javax.swing.JDialog:dispose
    //#unanalyzed(void categoryDeselected(PreferencesCategory)): Effects-of-calling:java.util.List:remove
        y = osdWindow.getLocationOnScreen().y;
    //#OsdPlugin.java:133: Warning: method not available - call not analyzed
    //#    call on Point com.dmdirc.addons.osd.OsdWindow:getLocationOnScreen()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void categoryDeselected(PreferencesCategory)
    //#    unanalyzed callee: Point com.dmdirc.addons.osd.OsdWindow:getLocationOnScreen()
        
        osdWindow.dispose();
        osdWindow = null;
    }
    //#OsdPlugin.java:137: end of method: void com.dmdirc.addons.osd.OsdPlugin.categoryDeselected(PreferencesCategory)

    /** {@inheritDoc} */
    @Override
    public void save() {
        IdentityManager.getConfigIdentity().setOption(getDomain(), "locationX", x);
    //#OsdPlugin.java:142: method: void com.dmdirc.addons.osd.OsdPlugin.save()
    //#OsdPlugin.java:142: Warning: method not available - call not analyzed
    //#    call on Identity com.dmdirc.config.IdentityManager:getConfigIdentity()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void save()
    //#    unanalyzed callee: Identity com.dmdirc.config.IdentityManager:getConfigIdentity()
    //#OsdPlugin.java:142: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void save()
    //#    unanalyzed callee: String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#OsdPlugin.java:142: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.Identity:setOption(String, String, int)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void save()
    //#    unanalyzed callee: void com.dmdirc.config.Identity:setOption(String, String, int)
    //#input(void save()): this
    //#input(void save()): this.x
    //#input(void save()): this.y
    //#pre[2] (void save()): init'ed(this.x)
    //#pre[3] (void save()): init'ed(this.y)
    //#presumption(void save()): com.dmdirc.config.IdentityManager:getConfigIdentity(...)@142 != null
    //#presumption(void save()): com.dmdirc.config.IdentityManager:getConfigIdentity(...)@143 != null
        IdentityManager.getConfigIdentity().setOption(getDomain(), "locationY", y);
    //#OsdPlugin.java:143: Warning: method not available - call not analyzed
    //#    call on Identity com.dmdirc.config.IdentityManager:getConfigIdentity()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void save()
    //#    unanalyzed callee: Identity com.dmdirc.config.IdentityManager:getConfigIdentity()
    //#OsdPlugin.java:143: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void save()
    //#    unanalyzed callee: String com.dmdirc.addons.osd.OsdPlugin:getDomain()
    //#OsdPlugin.java:143: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.config.Identity:setOption(String, String, int)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void save()
    //#    unanalyzed callee: void com.dmdirc.config.Identity:setOption(String, String, int)
    }
    //#OsdPlugin.java:144: end of method: void com.dmdirc.addons.osd.OsdPlugin.save()

    /** {@inheritDoc} */
    @Override
    public void settingChanged(final PreferencesSetting setting) {
        if (osdWindow == null) {
    //#OsdPlugin.java:149: method: void com.dmdirc.addons.osd.OsdPlugin.settingChanged(PreferencesSetting)
    //#input(void settingChanged(PreferencesSetting)): setting
    //#input(void settingChanged(PreferencesSetting)): this
    //#input(void settingChanged(PreferencesSetting)): this.backgroundSetting
    //#input(void settingChanged(PreferencesSetting)): this.fontSizeSetting
    //#input(void settingChanged(PreferencesSetting)): this.foregroundSetting
    //#input(void settingChanged(PreferencesSetting)): this.osdWindow
    //#input(void settingChanged(PreferencesSetting)): this.osdWindow.label
    //#input(void settingChanged(PreferencesSetting)): this.osdWindow.panel
    //#pre[6] (void settingChanged(PreferencesSetting)): init'ed(this.osdWindow)
    //#pre[1] (void settingChanged(PreferencesSetting)): (soft) setting != null
    //#pre[3] (void settingChanged(PreferencesSetting)): (soft) init'ed(this.backgroundSetting)
    //#pre[4] (void settingChanged(PreferencesSetting)): (soft) init'ed(this.fontSizeSetting)
    //#pre[5] (void settingChanged(PreferencesSetting)): (soft) init'ed(this.foregroundSetting)
    //#pre[7] (void settingChanged(PreferencesSetting)): (soft) this.osdWindow.label != null
    //#pre[8] (void settingChanged(PreferencesSetting)): (soft) this.osdWindow.panel != null
    //#unanalyzed(void settingChanged(PreferencesSetting)): Effects-of-calling:javax.swing.JPanel:setBackground
    //#unanalyzed(void settingChanged(PreferencesSetting)): Effects-of-calling:javax.swing.JLabel:setForeground
    //#unanalyzed(void settingChanged(PreferencesSetting)): Effects-of-calling:javax.swing.JLabel:getFont
    //#unanalyzed(void settingChanged(PreferencesSetting)): Effects-of-calling:java.awt.Font:deriveFont
    //#unanalyzed(void settingChanged(PreferencesSetting)): Effects-of-calling:javax.swing.JLabel:setFont
    //#unanalyzed(void settingChanged(PreferencesSetting)): Effects-of-calling:com.dmdirc.ui.messages.ColourManager:parseColour
    //#test_vector(void settingChanged(PreferencesSetting)): this.osdWindow: Inverse{null}, Addr_Set{null}
    //#test_vector(void settingChanged(PreferencesSetting)): java.lang.Object:equals(...)@155: {0}, {1}
    //#test_vector(void settingChanged(PreferencesSetting)): java.lang.Object:equals(...)@157: {0}, {1}
    //#test_vector(void settingChanged(PreferencesSetting)): java.lang.Object:equals(...)@159: {0}, {1}
            // They've changed categories but are somehow poking settings.
            // Ignore the request.
            return;
        }
        
        if (setting.equals(fontSizeSetting)) {
            osdWindow.setFontSize(Integer.parseInt(setting.getValue()));
    //#OsdPlugin.java:156: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.config.prefs.PreferencesSetting:getValue()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void settingChanged(PreferencesSetting)
    //#    unanalyzed callee: String com.dmdirc.config.prefs.PreferencesSetting:getValue()
        } else if (setting.equals(backgroundSetting)) {
            osdWindow.setBackgroundColour(setting.getValue());
    //#OsdPlugin.java:158: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.config.prefs.PreferencesSetting:getValue()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void settingChanged(PreferencesSetting)
    //#    unanalyzed callee: String com.dmdirc.config.prefs.PreferencesSetting:getValue()
        } else if (setting.equals(foregroundSetting)) {
            osdWindow.setForegroundColour(setting.getValue());
    //#OsdPlugin.java:160: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.config.prefs.PreferencesSetting:getValue()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.osd.OsdPlugin
    //#    method: void settingChanged(PreferencesSetting)
    //#    unanalyzed callee: String com.dmdirc.config.prefs.PreferencesSetting:getValue()
        }
    }
    //#OsdPlugin.java:162: end of method: void com.dmdirc.addons.osd.OsdPlugin.settingChanged(PreferencesSetting)

}
    //#output(com.dmdirc.addons.osd.OsdPlugin__static_init): __Descendant_Table[com/dmdirc/addons/osd/OsdPlugin]
    //#output(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.categoryDeselected(Lcom/dmdirc/config/prefs/PreferencesCategory;)V
    //#output(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.categorySelected(Lcom/dmdirc/config/prefs/PreferencesCategory;)V
    //#output(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.onLoad()V
    //#output(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.onUnload()V
    //#output(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.save()V
    //#output(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.settingChanged(Lcom/dmdirc/config/prefs/PreferencesSetting;)V
    //#output(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.showConfig(Lcom/dmdirc/config/prefs/PreferencesManager;)V
    //#post(com.dmdirc.addons.osd.OsdPlugin__static_init): __Descendant_Table[com/dmdirc/addons/osd/OsdPlugin] == &__Dispatch_Table
    //#post(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.categoryDeselected(Lcom/dmdirc/config/prefs/PreferencesCategory;)V == &categoryDeselected
    //#post(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.categorySelected(Lcom/dmdirc/config/prefs/PreferencesCategory;)V == &categorySelected
    //#post(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.onLoad()V == &onLoad
    //#post(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.onUnload()V == &onUnload
    //#post(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.save()V == &save
    //#post(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.settingChanged(Lcom/dmdirc/config/prefs/PreferencesSetting;)V == &settingChanged
    //#post(com.dmdirc.addons.osd.OsdPlugin__static_init): __Dispatch_Table.showConfig(Lcom/dmdirc/config/prefs/PreferencesManager;)V == &showConfig
    //#OsdPlugin.java:: end of method: com.dmdirc.addons.osd.OsdPlugin.com.dmdirc.addons.osd.OsdPlugin__static_init
    //#OsdPlugin.java:: end of class: com.dmdirc.addons.osd.OsdPlugin
