//# 0 errors, 143 messages
//#
/*
    //#TitlePanel.java:1:1: class: com.dmdirc.installer.ui.TitlePanel
    //#TitlePanel.java:1:1: method: com.dmdirc.installer.ui.TitlePanel.com.dmdirc.installer.ui.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.installer.ui;

import com.dmdirc.installer.Step;
import com.dmdirc.installer.ui.EtchedLineBorder.BorderSide;

import java.awt.BorderLayout;
import java.awt.Color;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EtchedBorder;

/**
 * Simple title panel for a wizard.
 */
public class TitlePanel extends JPanel {

    private static final long serialVersionUID = 7173184984913948951L;
    private final JLabel title;
    private final JLabel image;

    /**
     * Instantiates a new title panel.
     * 
     * @param step Initial title text
     */
    public TitlePanel(final Step step) {
        super(new BorderLayout());
    //#TitlePanel.java:52: method: void com.dmdirc.installer.ui.TitlePanel.com.dmdirc.installer.ui.TitlePanel(Step)
    //#TitlePanel.java:52: Warning: suspicious precondition
    //#    The precondition for step.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.installer.ui.TitlePanel
    //#    method: void com.dmdirc.installer.ui.TitlePanel(Step)
    //#    suspicious precondition index: [3]
    //#    Attribs:  Soft
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): ""._tainted
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): "&#10;"._tainted
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): "Confirm"._tainted
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): "Error"._tainted
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): "Install"._tainted
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): "Settings"._tainted
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): "Welcome"._tainted
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): __Descendant_Table[com/dmdirc/installer/ui/TitlePanel]
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): __Descendant_Table[others]
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): __Dispatch_Table.setStep(Lcom/dmdirc/installer/Step;)V
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/Step]
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/ui/StepConfirm]
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/ui/StepError]
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/ui/StepInstall]
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/ui/StepSettings]
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/ui/StepWelcome]
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/ui/SwingStep]
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/Step.__Descendant_Table[others]
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/Step.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/Step.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/Step.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/EtchedLineBorder$BorderSide.BOTTOM
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepConfirm.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepConfirm.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepConfirm.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepError.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepError.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepError.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepInstall.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepInstall.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepInstall.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepSettings.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepSettings.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepSettings.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepWelcome.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepWelcome.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/StepWelcome.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/SwingStep.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/SwingStep.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): com/dmdirc/installer/ui/SwingStep.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): java.awt.Color.WHITE
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): step
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): step.__Tag
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): this
    //#input(void com.dmdirc.installer.ui.TitlePanel(Step)): this.__Tag
    //#output(void com.dmdirc.installer.ui.TitlePanel(Step)): new JLabel(TitlePanel#2) num objects
    //#output(void com.dmdirc.installer.ui.TitlePanel(Step)): new JLabel(TitlePanel#3) num objects
    //#output(void com.dmdirc.installer.ui.TitlePanel(Step)): this.__Tag
    //#output(void com.dmdirc.installer.ui.TitlePanel(Step)): this.image
    //#output(void com.dmdirc.installer.ui.TitlePanel(Step)): this.title
    //#new obj(void com.dmdirc.installer.ui.TitlePanel(Step)): new JLabel(TitlePanel#2)
    //#new obj(void com.dmdirc.installer.ui.TitlePanel(Step)): new JLabel(TitlePanel#3)
    //#pre[1] (void com.dmdirc.installer.ui.TitlePanel(Step)): this.__Tag == com/dmdirc/installer/ui/TitlePanel
    //#pre[3] (void com.dmdirc.installer.ui.TitlePanel(Step)): (soft) step.__Tag in {com/dmdirc/installer/Step, com/dmdirc/installer/ui/StepConfirm, com/dmdirc/installer/ui/StepError, com/dmdirc/installer/ui/StepInstall, com/dmdirc/installer/ui/StepSettings, com/dmdirc/installer/ui/StepWelcome, com/dmdirc/installer/ui/SwingStep}
    //#presumption(void com.dmdirc.installer.ui.TitlePanel(Step)): init'ed(java.awt.Color.WHITE)
    //#presumption(void com.dmdirc.installer.ui.TitlePanel(Step)): javax.swing.JLabel:getFont(...)@59 != null
    //#presumption(void com.dmdirc.installer.ui.TitlePanel(Step)): javax.swing.JLabel:getFont(...)@59 != null
    //#post(void com.dmdirc.installer.ui.TitlePanel(Step)): this.__Tag == com/dmdirc/installer/ui/TitlePanel
    //#post(void com.dmdirc.installer.ui.TitlePanel(Step)): this.image == &new JLabel(TitlePanel#3)
    //#post(void com.dmdirc.installer.ui.TitlePanel(Step)): this.title == &new JLabel(TitlePanel#2)
    //#post(void com.dmdirc.installer.ui.TitlePanel(Step)): new JLabel(TitlePanel#2) num objects == 1
    //#post(void com.dmdirc.installer.ui.TitlePanel(Step)): new JLabel(TitlePanel#3) num objects == 1
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:javax.swing.JLabel:setText
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:javax.swing.JLabel:setIcon
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:getStepDescription
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:getStepName
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:getIcon
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:javax.swing.ImageIcon
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:javax.swing.border.EtchedBorder
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:java.awt.Toolkit:getDefaultToolkit
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:java.lang.ClassLoader:getSystemResource
    //#unanalyzed(void com.dmdirc.installer.ui.TitlePanel(Step)): Effects-of-calling:java.awt.Toolkit:createImage
        
        title = new JLabel();
        image = new JLabel();
        
        setStep(step);

        title.setFont(title.getFont().deriveFont((float) (title.getFont().
                getSize() * 1.5)));
        add(title, BorderLayout.CENTER);
    //#TitlePanel.java:61: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.installer.ui.TitlePanel:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.installer.ui.TitlePanel
    //#    method: void com.dmdirc.installer.ui.TitlePanel(Step)
    //#    unanalyzed callee: void com.dmdirc.installer.ui.TitlePanel:add(Component, Object)
        add(image, BorderLayout.EAST);
    //#TitlePanel.java:62: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.installer.ui.TitlePanel:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.installer.ui.TitlePanel
    //#    method: void com.dmdirc.installer.ui.TitlePanel(Step)
    //#    unanalyzed callee: void com.dmdirc.installer.ui.TitlePanel:add(Component, Object)
        setBackground(Color.WHITE);
    //#TitlePanel.java:63: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.installer.ui.TitlePanel:setBackground(Color)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.installer.ui.TitlePanel
    //#    method: void com.dmdirc.installer.ui.TitlePanel(Step)
    //#    unanalyzed callee: void com.dmdirc.installer.ui.TitlePanel:setBackground(Color)
        setBorder(new EtchedLineBorder(EtchedBorder.RAISED, BorderSide.BOTTOM));
    //#TitlePanel.java:64: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.installer.ui.TitlePanel:setBorder(Border)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.installer.ui.TitlePanel
    //#    method: void com.dmdirc.installer.ui.TitlePanel(Step)
    //#    unanalyzed callee: void com.dmdirc.installer.ui.TitlePanel:setBorder(Border)
    }
    //#TitlePanel.java:65: end of method: void com.dmdirc.installer.ui.TitlePanel.com.dmdirc.installer.ui.TitlePanel(Step)

    /**
     * Sets the title text.
     *
     * @param step new title text
     */
    public void setStep(final Step step) {
        if (step == null) {
    //#TitlePanel.java:73: method: void com.dmdirc.installer.ui.TitlePanel.setStep(Step)
    //#TitlePanel.java:73: Warning: suspicious precondition
    //#    The precondition for step.__Tag is not a contiguous range of values
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.installer.ui.TitlePanel
    //#    method: void setStep(Step)
    //#    suspicious precondition index: [2]
    //#    Attribs:  Soft
    //#input(void setStep(Step)): ""._tainted
    //#input(void setStep(Step)): "&#10;"._tainted
    //#input(void setStep(Step)): "Confirm"._tainted
    //#input(void setStep(Step)): "Error"._tainted
    //#input(void setStep(Step)): "Install"._tainted
    //#input(void setStep(Step)): "Settings"._tainted
    //#input(void setStep(Step)): "Welcome"._tainted
    //#input(void setStep(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/Step]
    //#input(void setStep(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/ui/StepConfirm]
    //#input(void setStep(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/ui/StepError]
    //#input(void setStep(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/ui/StepInstall]
    //#input(void setStep(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/ui/StepSettings]
    //#input(void setStep(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/ui/StepWelcome]
    //#input(void setStep(Step)): com/dmdirc/installer/Step.__Descendant_Table[com/dmdirc/installer/ui/SwingStep]
    //#input(void setStep(Step)): com/dmdirc/installer/Step.__Descendant_Table[others]
    //#input(void setStep(Step)): com/dmdirc/installer/Step.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void setStep(Step)): com/dmdirc/installer/Step.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/Step.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepConfirm.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepConfirm.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepConfirm.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepError.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepError.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepError.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepInstall.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepInstall.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepInstall.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepSettings.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepSettings.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepSettings.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepWelcome.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepWelcome.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/StepWelcome.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/SwingStep.__Dispatch_Table.getIcon()Ljava/awt/Image;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/SwingStep.__Dispatch_Table.getStepDescription()Ljava/lang/String;
    //#input(void setStep(Step)): com/dmdirc/installer/ui/SwingStep.__Dispatch_Table.getStepName()Ljava/lang/String;
    //#input(void setStep(Step)): step
    //#input(void setStep(Step)): step.__Tag
    //#input(void setStep(Step)): this
    //#input(void setStep(Step)): this.image
    //#input(void setStep(Step)): this.title
    //#pre[4] (void setStep(Step)): this.image != null
    //#pre[5] (void setStep(Step)): this.title != null
    //#pre[2] (void setStep(Step)): (soft) step.__Tag in {com/dmdirc/installer/Step, com/dmdirc/installer/ui/StepConfirm, com/dmdirc/installer/ui/StepError, com/dmdirc/installer/ui/StepInstall, com/dmdirc/installer/ui/StepSettings, com/dmdirc/installer/ui/StepWelcome, com/dmdirc/installer/ui/SwingStep}
    //#unanalyzed(void setStep(Step)): Effects-of-calling:java.awt.Toolkit:getDefaultToolkit
    //#unanalyzed(void setStep(Step)): Effects-of-calling:java.lang.ClassLoader:getSystemResource
    //#unanalyzed(void setStep(Step)): Effects-of-calling:java.awt.Toolkit:createImage
    //#test_vector(void setStep(Step)): step: Inverse{null}, Addr_Set{null}
    //#test_vector(void setStep(Step)): java.lang.String:equals(...)@79: {0}, {1}
            title.setText("");
            image.setIcon(null);
            return;
        }
        
        if ("".equals(step.getStepDescription())) {
            title.setText(step.getStepName());
        } else {
            title.setText(step.getStepName() + "\n" + step.getStepDescription());
        }
        if (step.getIcon() == null) {
            image.setIcon(null);
        } else {
            image.setIcon(new ImageIcon(step.getIcon()));
        }
    }
    //#TitlePanel.java:89: end of method: void com.dmdirc.installer.ui.TitlePanel.setStep(Step)
}
    //#output(com.dmdirc.installer.ui.TitlePanel__static_init): __Descendant_Table[com/dmdirc/installer/ui/TitlePanel]
    //#output(com.dmdirc.installer.ui.TitlePanel__static_init): __Dispatch_Table.setStep(Lcom/dmdirc/installer/Step;)V
    //#post(com.dmdirc.installer.ui.TitlePanel__static_init): __Descendant_Table[com/dmdirc/installer/ui/TitlePanel] == &__Dispatch_Table
    //#post(com.dmdirc.installer.ui.TitlePanel__static_init): __Dispatch_Table.setStep(Lcom/dmdirc/installer/Step;)V == &setStep
    //#TitlePanel.java:: end of method: com.dmdirc.installer.ui.TitlePanel.com.dmdirc.installer.ui.TitlePanel__static_init
    //#TitlePanel.java:: end of class: com.dmdirc.installer.ui.TitlePanel
