//# 0 errors, 107 messages
//#
/*
    //#FrameContainerMenuItem.java:1:1: class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1
    //#FrameContainerMenuItem.java:1:1: method: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1.com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1__static_init
    //#FrameContainerMenuItem.java:1:1: class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem
    //#FrameContainerMenuItem.java:1:1: method: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem__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.windowmenu;

import com.dmdirc.FrameContainer;
import com.dmdirc.interfaces.IconChangeListener;
import com.dmdirc.ui.interfaces.Window;

import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Icon;
import javax.swing.JMenuItem;
import javax.swing.SwingUtilities;

/**
 * Action representing a frame.
 */
public class FrameContainerMenuItem extends JMenuItem implements IconChangeListener,
    //#FrameContainerMenuItem.java:39: method: FrameContainer com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.access$000(FrameContainerMenuItem)
    //#input(FrameContainer access$000(FrameContainerMenuItem)): x0
    //#input(FrameContainer access$000(FrameContainerMenuItem)): x0.frame
    //#output(FrameContainer access$000(FrameContainerMenuItem)): return_value
    //#pre[1] (FrameContainer access$000(FrameContainerMenuItem)): x0 != null
    //#pre[2] (FrameContainer access$000(FrameContainerMenuItem)): init'ed(x0.frame)
    //#post(FrameContainer access$000(FrameContainerMenuItem)): return_value == x0.frame
    //#post(FrameContainer access$000(FrameContainerMenuItem)): init'ed(return_value)
    //#FrameContainerMenuItem.java:39: end of method: FrameContainer com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.access$000(FrameContainerMenuItem)
        ActionListener {

    /**
     * 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 = 1;
    /** Wrapped frame. */
    private FrameContainer frame;

    /**
     * Instantiates a new FrameContainer menu item wrapping the specified frame.
     * 
     * @param frame Wrapped frame
     */
    public FrameContainerMenuItem(final FrameContainer frame) {
        super(frame.toString(), frame.getIcon());
    //#FrameContainerMenuItem.java:57: method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)
    //#FrameContainerMenuItem.java:57: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.FrameContainer:toString()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem
    //#    method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)
    //#    unanalyzed callee: String com.dmdirc.FrameContainer:toString()
    //#FrameContainerMenuItem.java:57: Warning: method not available - call not analyzed
    //#    call on Icon com.dmdirc.FrameContainer:getIcon()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem
    //#    method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)
    //#    unanalyzed callee: Icon com.dmdirc.FrameContainer:getIcon()
    //#input(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)): frame
    //#input(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)): frame._tainted
    //#input(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)): this
    //#output(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)): this.frame
    //#pre[1] (void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)): frame != null
    //#post(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)): this.frame == frame
    //#post(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)): this.frame != null

        this.frame = frame;

        addActionListener(this);
    //#FrameContainerMenuItem.java:61: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:addActionListener(ActionListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem
    //#    method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:addActionListener(ActionListener)
        frame.addIconChangeListener(this);
    //#FrameContainerMenuItem.java:62: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:addIconChangeListener(IconChangeListener)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem
    //#    method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:addIconChangeListener(IconChangeListener)
    }
    //#FrameContainerMenuItem.java:63: end of method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem(FrameContainer)

    /** {@inheritDoc} */
    @Override
    public void iconChanged(final Window window, final Icon icon) {
        SwingUtilities.invokeLater(new Runnable() {
    //#FrameContainerMenuItem.java:68: method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1.com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)
    //#input(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): Param_1
    //#input(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): Param_2
    //#input(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): Param_3
    //#input(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): this
    //#output(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): this.this$0
    //#output(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): this.val$icon
    //#output(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): this.val$window
    //#post(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): this.this$0 == Param_1
    //#post(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): init'ed(this.this$0)
    //#post(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): this.val$icon == Param_3
    //#post(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): init'ed(this.val$icon)
    //#post(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): this.val$window == Param_2
    //#post(void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)): init'ed(this.val$window)
    //#FrameContainerMenuItem.java:68: end of method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1.com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1(FrameContainerMenuItem, Window, Icon)
    //#FrameContainerMenuItem.java:68: method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.iconChanged(Window, Icon)
    //#input(void iconChanged(Window, Icon)): icon
    //#input(void iconChanged(Window, Icon)): this
    //#input(void iconChanged(Window, Icon)): window

            /** {@inheritDoc} */
            @Override
            public void run() {
                if ((frame != null && window != null) &&
    //#FrameContainerMenuItem.java:73: method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1.run()
    //#FrameContainerMenuItem.java:73: 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.windowmenu.FrameContainerMenuItem$1
    //#    method: void run()
    //#    unanalyzed callee: FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
    //#input(void run()): this
    //#input(void run()): this.this$0
    //#input(void run()): this.this$0.frame
    //#input(void run()): this.val$icon
    //#input(void run()): this.val$window
    //#pre[6] (void run()): init'ed(this.frame)
    //#pre[5] (void run()): (soft) this.this$0 != null
    //#test_vector(void run()): this.frame: Addr_Set{null}, Inverse{null}
    //#test_vector(void run()): this.val$window: Addr_Set{null}, Inverse{null}
    //#test_vector(void run()): java.lang.Object:equals(...)@73: {0}, {1}
                        frame.equals(window.getContainer())) {
                    setIcon(icon);
    //#FrameContainerMenuItem.java:75: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:setIcon(Icon)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1
    //#    method: void run()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:setIcon(Icon)
                }
            }
    //#FrameContainerMenuItem.java:77: end of method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1.run()
        });
    }
    //#FrameContainerMenuItem.java:79: end of method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.iconChanged(Window, Icon)

    /** 
     * {@inheritDoc}
     * 
     * @param e Action event
     */
    @Override
    public void actionPerformed(final ActionEvent e) {
        frame.activateFrame();
    //#FrameContainerMenuItem.java:88: method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.actionPerformed(ActionEvent)
    //#FrameContainerMenuItem.java:88: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.FrameContainer:activateFrame()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem
    //#    method: void actionPerformed(ActionEvent)
    //#    unanalyzed callee: void com.dmdirc.FrameContainer:activateFrame()
    //#input(void actionPerformed(ActionEvent)): this
    //#input(void actionPerformed(ActionEvent)): this.frame
    //#pre[2] (void actionPerformed(ActionEvent)): this.frame != null
    }
    //#FrameContainerMenuItem.java:89: end of method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.actionPerformed(ActionEvent)

    /**
     * Called when a new window is selected.
     *
     * @param window The window that's now selected
     */
    public void selectionChanged(final Window window) {
        if (frame.equals(window.getContainer())) {
    //#FrameContainerMenuItem.java:97: method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.selectionChanged(Window)
    //#FrameContainerMenuItem.java:97: 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.windowmenu.FrameContainerMenuItem
    //#    method: void selectionChanged(Window)
    //#    unanalyzed callee: FrameContainer com.dmdirc.ui.interfaces.Window:getContainer()
    //#input(void selectionChanged(Window)): this
    //#input(void selectionChanged(Window)): this.frame
    //#input(void selectionChanged(Window)): window
    //#pre[2] (void selectionChanged(Window)): this.frame != null
    //#pre[3] (void selectionChanged(Window)): window != null
    //#presumption(void selectionChanged(Window)): com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:getFont(...)@100 != null
    //#presumption(void selectionChanged(Window)): com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:getFont(...)@98 != null
    //#test_vector(void selectionChanged(Window)): java.lang.Object:equals(...)@97: {0}, {1}
            setFont(getFont().deriveFont(Font.BOLD));
    //#FrameContainerMenuItem.java:98: Warning: method not available - call not analyzed
    //#    call on Font com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:getFont()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem
    //#    method: void selectionChanged(Window)
    //#    unanalyzed callee: Font com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:getFont()
    //#FrameContainerMenuItem.java:98: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:setFont(Font)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem
    //#    method: void selectionChanged(Window)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:setFont(Font)
        } else {
            setFont(getFont().deriveFont(Font.PLAIN));
    //#FrameContainerMenuItem.java:100: Warning: method not available - call not analyzed
    //#    call on Font com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:getFont()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem
    //#    method: void selectionChanged(Window)
    //#    unanalyzed callee: Font com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:getFont()
    //#FrameContainerMenuItem.java:100: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:setFont(Font)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem
    //#    method: void selectionChanged(Window)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem:setFont(Font)
        }
    }
    //#FrameContainerMenuItem.java:102: end of method: void com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.selectionChanged(Window)

    /**
     * Returns the wrapped frame container.
     * 
     * @return Wrapped frame container
     */
    public FrameContainer getFrame() {
        return frame;
    //#FrameContainerMenuItem.java:110: method: FrameContainer com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.getFrame()
    //#input(FrameContainer getFrame()): this
    //#input(FrameContainer getFrame()): this.frame
    //#output(FrameContainer getFrame()): return_value
    //#pre[2] (FrameContainer getFrame()): init'ed(this.frame)
    //#post(FrameContainer getFrame()): return_value == this.frame
    //#post(FrameContainer getFrame()): init'ed(return_value)
    //#FrameContainerMenuItem.java:110: end of method: FrameContainer com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.getFrame()
    }
}
    //#output(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/framemanager/windowmenu/FrameContainerMenuItem$1]
    //#output(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1__static_init): __Dispatch_Table.run()V
    //#post(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/framemanager/windowmenu/FrameContainerMenuItem$1] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1__static_init): __Dispatch_Table.run()V == &run
    //#FrameContainerMenuItem.java:: end of method: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1.com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1__static_init
    //#FrameContainerMenuItem.java:: end of class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem$1
    //#output(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/framemanager/windowmenu/FrameContainerMenuItem]
    //#output(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem__static_init): __Dispatch_Table.actionPerformed(Ljava/awt/event/ActionEvent;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem__static_init): __Dispatch_Table.getFrame()Lcom/dmdirc/FrameContainer;
    //#output(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem__static_init): __Dispatch_Table.iconChanged(Lcom/dmdirc/ui/interfaces/Window;Ljavax/swing/Icon;)V
    //#output(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem__static_init): __Dispatch_Table.selectionChanged(Lcom/dmdirc/ui/interfaces/Window;)V
    //#post(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/framemanager/windowmenu/FrameContainerMenuItem] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem__static_init): __Dispatch_Table.actionPerformed(Ljava/awt/event/ActionEvent;)V == &actionPerformed
    //#post(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem__static_init): __Dispatch_Table.getFrame()Lcom/dmdirc/FrameContainer; == &getFrame
    //#post(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem__static_init): __Dispatch_Table.iconChanged(Lcom/dmdirc/ui/interfaces/Window;Ljavax/swing/Icon;)V == &iconChanged
    //#post(com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem__static_init): __Dispatch_Table.selectionChanged(Lcom/dmdirc/ui/interfaces/Window;)V == &selectionChanged
    //#FrameContainerMenuItem.java:: end of method: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem.com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem__static_init
    //#FrameContainerMenuItem.java:: end of class: com.dmdirc.addons.ui_swing.framemanager.windowmenu.FrameContainerMenuItem
