//# 0 errors, 82 messages
//#
/*
    //#TitlePanel.java:1:1: class: com.dmdirc.addons.ui_swing.components.TitlePanel
    //#TitlePanel.java:1:1: method: com.dmdirc.addons.ui_swing.components.TitlePanel.com.dmdirc.addons.ui_swing.components.TitlePanel__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;

import java.awt.Color;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.Border;

import net.miginfocom.swing.MigLayout;

/**
 * Displays a title panel.
 */
public class TitlePanel extends JPanel {

    /**
     * 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 = -4026633984970698130L;
    /** Title label. */
    private JLabel title;
    /** Title border. */
    final Border border;

    /**
     * Instantiates a new title panel.
     *
     * @param border Border to use for the panel
     */
    public TitlePanel(final Border border) {
        this(border, "");
    //#TitlePanel.java:57: method: void com.dmdirc.addons.ui_swing.components.TitlePanel.com.dmdirc.addons.ui_swing.components.TitlePanel(Border)
    //#input(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): border
    //#input(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): java.awt.Color.WHITE
    //#input(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): this
    //#output(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): new JLabel(TitlePanel#2) num objects
    //#output(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): this.border
    //#output(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): this.title
    //#new obj(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): new JLabel(TitlePanel#2)
    //#post(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): this.border == border
    //#post(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): init'ed(this.border)
    //#post(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): this.title == &new JLabel(TitlePanel#2)
    //#post(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): new JLabel(TitlePanel#2) num objects == 1
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): Effects-of-calling:net.miginfocom.swing.MigLayout
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): Effects-of-calling:javax.swing.JPanel
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): Effects-of-calling:javax.swing.JLabel
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): Effects-of-calling:javax.swing.JLabel:getFont
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): Effects-of-calling:java.awt.Font:getSize
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): Effects-of-calling:java.awt.Font:deriveFont
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): Effects-of-calling:javax.swing.JLabel:setFont
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.TitlePanel:add
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.TitlePanel:setBorder
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.TitlePanel:setBackground
    }
    //#TitlePanel.java:58: end of method: void com.dmdirc.addons.ui_swing.components.TitlePanel.com.dmdirc.addons.ui_swing.components.TitlePanel(Border)

    /**
     * Instantiates a new title panel.
     *
     * @param text Initial text
     */
    public TitlePanel(final String text) {
        this(BorderFactory.createLineBorder(Color.BLACK), text);
    //#TitlePanel.java:66: method: void com.dmdirc.addons.ui_swing.components.TitlePanel.com.dmdirc.addons.ui_swing.components.TitlePanel(String)
    //#input(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): java.awt.Color.BLACK
    //#input(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): java.awt.Color.WHITE
    //#input(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): text
    //#input(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): this
    //#output(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): new JLabel(TitlePanel#2) num objects
    //#output(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): this.border
    //#output(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): this.title
    //#new obj(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): new JLabel(TitlePanel#2)
    //#presumption(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): init'ed(java.awt.Color.BLACK)
    //#post(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): init'ed(this.border)
    //#post(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): this.title == &new JLabel(TitlePanel#2)
    //#post(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): new JLabel(TitlePanel#2) num objects == 1
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): Effects-of-calling:net.miginfocom.swing.MigLayout
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): Effects-of-calling:javax.swing.JPanel
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): Effects-of-calling:javax.swing.JLabel
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): Effects-of-calling:javax.swing.JLabel:getFont
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): Effects-of-calling:java.awt.Font:getSize
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): Effects-of-calling:java.awt.Font:deriveFont
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): Effects-of-calling:javax.swing.JLabel:setFont
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.TitlePanel:add
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.TitlePanel:setBorder
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.TitlePanel(String)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.TitlePanel:setBackground
    }
    //#TitlePanel.java:67: end of method: void com.dmdirc.addons.ui_swing.components.TitlePanel.com.dmdirc.addons.ui_swing.components.TitlePanel(String)

    /**
     * Instantiates a new title panel.
     *
     * @param border Border to use for the panel
     * @param text Initial text
     */
    public TitlePanel(final Border border, final String text) {
        super(new MigLayout());
    //#TitlePanel.java:76: method: void com.dmdirc.addons.ui_swing.components.TitlePanel.com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)
    //#TitlePanel.java:76: Warning: method not available - call not analyzed
    //#    call on void net.miginfocom.swing.MigLayout()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.TitlePanel
    //#    method: void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)
    //#    unanalyzed callee: void net.miginfocom.swing.MigLayout()
    //#input(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): border
    //#input(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): java.awt.Color.WHITE
    //#input(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): text
    //#input(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): this
    //#output(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): new JLabel(TitlePanel#2) num objects
    //#output(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): this.border
    //#output(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): this.title
    //#new obj(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): new JLabel(TitlePanel#2)
    //#presumption(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): init'ed(java.awt.Color.WHITE)
    //#presumption(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): javax.swing.JLabel:getFont(...)@81 != null
    //#presumption(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): javax.swing.JLabel:getFont(...)@81 != null
    //#post(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): this.border == border
    //#post(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): init'ed(this.border)
    //#post(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): this.title == &new JLabel(TitlePanel#2)
    //#post(void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)): new JLabel(TitlePanel#2) num objects == 1

        this.border = border;

        title = new JLabel(text);
        title.setFont(title.getFont().deriveFont((float) (title.getFont().
                getSize() * 1.5)));

        add(title, "grow, push");
    //#TitlePanel.java:84: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.TitlePanel:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.TitlePanel
    //#    method: void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.TitlePanel:add(Component, Object)
        setBorder(border);
    //#TitlePanel.java:85: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.TitlePanel:setBorder(Border)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.TitlePanel
    //#    method: void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.TitlePanel:setBorder(Border)
        setBackground(Color.WHITE);
    //#TitlePanel.java:86: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.TitlePanel:setBackground(Color)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.TitlePanel
    //#    method: void com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.TitlePanel:setBackground(Color)
    }
    //#TitlePanel.java:87: end of method: void com.dmdirc.addons.ui_swing.components.TitlePanel.com.dmdirc.addons.ui_swing.components.TitlePanel(Border, String)

    /**
     * Sets the text of this title panel.
     *
     * @param text New title text.
     */
    public void setText(final String text) {
        title.setText(text);
    //#TitlePanel.java:95: method: void com.dmdirc.addons.ui_swing.components.TitlePanel.setText(String)
    //#input(void setText(String)): text
    //#input(void setText(String)): this
    //#input(void setText(String)): this.title
    //#pre[3] (void setText(String)): this.title != null
    }
    //#TitlePanel.java:96: end of method: void com.dmdirc.addons.ui_swing.components.TitlePanel.setText(String)
}
    //#output(com.dmdirc.addons.ui_swing.components.TitlePanel__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/TitlePanel]
    //#output(com.dmdirc.addons.ui_swing.components.TitlePanel__static_init): __Dispatch_Table.setText(Ljava/lang/String;)V
    //#post(com.dmdirc.addons.ui_swing.components.TitlePanel__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/TitlePanel] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.components.TitlePanel__static_init): __Dispatch_Table.setText(Ljava/lang/String;)V == &setText
    //#TitlePanel.java:: end of method: com.dmdirc.addons.ui_swing.components.TitlePanel.com.dmdirc.addons.ui_swing.components.TitlePanel__static_init
    //#TitlePanel.java:: end of class: com.dmdirc.addons.ui_swing.components.TitlePanel
