//# 0 errors, 49 messages
//#
/*
    //#InvitePopup.java:1:1: class: com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup
    //#InvitePopup.java:1:1: method: com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup.com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup__static_init
 * Copyright (c) 2006-2008 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.components.statusbar;

import com.dmdirc.Invite;
import com.dmdirc.Server;
import com.dmdirc.ui.messages.Formatter;
import java.awt.Window;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * Shows information about received invites.
 *
 * @since 0.6.3m1
 * @author chris
 */
public class InvitePopup extends StatusbarPopupWindow {

    /**
     * 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;

    /** The server to show invites for. */
    private final Server server;

    /**
     * Creates a new InvitePopup for the specified panel and server.
     * 
     * @param parent The parent of this popup
     * @param server The server to show invites for
     * @param parentWindow Parent window
     */
    public InvitePopup(final JPanel parent, final Server server, final Window parentWindow) {
        super(parent, parentWindow);
    //#InvitePopup.java:58: method: void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup.com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)
    //#input(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): com/dmdirc/addons/ui_swing/components/statusbar/StatusbarPopupWindow.java.awt.Dialog$ModalityType.MODELESS
    //#input(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): parent
    //#input(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): parentWindow
    //#input(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): server
    //#input(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): this
    //#output(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): this.parent
    //#output(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): this.parentWindow
    //#output(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): this.server
    //#post(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): this.parent == parent
    //#post(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): init'ed(this.parent)
    //#post(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): this.parentWindow == parentWindow
    //#post(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): init'ed(this.parentWindow)
    //#post(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): this.server == server
    //#post(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): init'ed(this.server)
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.StandardDialog
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.statusbar.StatusbarPopupWindow:setDefaultCloseOperation
        this.server = server;
    }
    //#InvitePopup.java:60: end of method: void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup.com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup(JPanel, Server, Window)

    /** {@inheritDoc} */
    @Override
    protected void initContent(final JPanel panel) {
        for (Invite invite : server.getInvites()) {
    //#InvitePopup.java:65: method: void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup.initContent(JPanel)
    //#InvitePopup.java:65: Warning: method not available - call not analyzed
    //#    call on List com.dmdirc.Server:getInvites()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup
    //#    method: void initContent(JPanel)
    //#    unanalyzed callee: List com.dmdirc.Server:getInvites()
    //#input(void initContent(JPanel)): " ago"._tainted
    //#input(void initContent(JPanel)): panel
    //#input(void initContent(JPanel)): this
    //#input(void initContent(JPanel)): this.server
    //#pre[3] (void initContent(JPanel)): this.server != null
    //#pre[1] (void initContent(JPanel)): (soft) panel != null
    //#presumption(void initContent(JPanel)): com.dmdirc.Invite:getSource(...).length@67 >= 1
    //#presumption(void initContent(JPanel)): com.dmdirc.Invite:getSource(...)@67 != null
    //#presumption(void initContent(JPanel)): com.dmdirc.Invite:getTimestamp(...)@68 - java.lang.System:currentTimeMillis(...)@68 in {-4_294_967_295_999..2_147_483_648_999}
    //#presumption(void initContent(JPanel)): com.dmdirc.Server:getInvites(...)@65 != null
    //#presumption(void initContent(JPanel)): java.util.Iterator:next(...)@65 != null
    //#test_vector(void initContent(JPanel)): java.util.Iterator:hasNext(...)@65: {0}, {1}
            panel.add(new JLabel(invite.getChannel()), "growx, pushx");
    //#InvitePopup.java:66: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.Invite:getChannel()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup
    //#    method: void initContent(JPanel)
    //#    unanalyzed callee: String com.dmdirc.Invite:getChannel()
            panel.add(new JLabel(invite.getSource()[0], JLabel.CENTER), "growx, pushx, al center");
    //#InvitePopup.java:67: Warning: method not available - call not analyzed
    //#    call on String[] com.dmdirc.Invite:getSource()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup
    //#    method: void initContent(JPanel)
    //#    unanalyzed callee: String[] com.dmdirc.Invite:getSource()
            panel.add(new JLabel(Formatter.formatDuration((int)
    //#InvitePopup.java:68: Warning: method not available - call not analyzed
    //#    call on long com.dmdirc.Invite:getTimestamp()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup
    //#    method: void initContent(JPanel)
    //#    unanalyzed callee: long com.dmdirc.Invite:getTimestamp()
    //#InvitePopup.java:68: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.ui.messages.Formatter:formatDuration(int)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup
    //#    method: void initContent(JPanel)
    //#    unanalyzed callee: String com.dmdirc.ui.messages.Formatter:formatDuration(int)
                    (System.currentTimeMillis() - invite.getTimestamp()) / 1000) + " ago",
                    JLabel.RIGHT), "growx, pushx, al right, wrap");
        }
    }
    //#InvitePopup.java:72: end of method: void com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup.initContent(JPanel)

}
    //#output(com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/statusbar/InvitePopup]
    //#output(com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup__static_init): __Dispatch_Table.initContent(Ljavax/swing/JPanel;)V
    //#output(com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup__static_init): __Dispatch_Table.setVisible(Z)V
    //#output(com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup__static_init): com/dmdirc/addons/ui_swing/components/statusbar/StatusbarPopupWindow.__Descendant_Table[com/dmdirc/addons/ui_swing/components/statusbar/InvitePopup]
    //#post(com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/statusbar/InvitePopup] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup__static_init): com/dmdirc/addons/ui_swing/components/statusbar/StatusbarPopupWindow.__Descendant_Table[com/dmdirc/addons/ui_swing/components/statusbar/InvitePopup] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup__static_init): __Dispatch_Table.initContent(Ljavax/swing/JPanel;)V == &initContent
    //#post(com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup__static_init): __Dispatch_Table.setVisible(Z)V == &com/dmdirc/addons/ui_swing/components/statusbar/StatusbarPopupWindow.setVisible
    //#InvitePopup.java:: end of method: com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup.com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup__static_init
    //#InvitePopup.java:: end of class: com.dmdirc.addons.ui_swing.components.statusbar.InvitePopup
