//# 0 errors, 70 messages
//#
/*
    //#SummaryPanel.java:1:1: class: com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel
    //#SummaryPanel.java:1:1: method: com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel.com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel__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.dialogs.sslcertificate;

import com.dmdirc.ui.IconManager;
import com.dmdirc.ui.core.dialogs.sslcertificate.CertificateSummaryEntry;

import java.util.ArrayList;
import java.util.List;

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

import net.miginfocom.swing.MigLayout;

/**
 * Displays a summary about the certificate chain.
 */
public class SummaryPanel 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 = 1;
    /** List of certificate summary entries. */
    private List<CertificateSummaryEntry> summary;

    public SummaryPanel() {
    //#SummaryPanel.java:51: method: void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel.com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()
    //#input(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): this
    //#output(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): new ArrayList(SummaryPanel#1) num objects
    //#output(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): this.summary
    //#new obj(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): new ArrayList(SummaryPanel#1)
    //#post(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): this.summary == &new ArrayList(SummaryPanel#1)
    //#post(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): new ArrayList(SummaryPanel#1) num objects == 1
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:javax.swing.BorderFactory:createTitledBorder
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel:setBorder
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:net.miginfocom.swing.MigLayout
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel:setLayout
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:com.dmdirc.ui.core.dialogs.sslcertificate.CertificateSummaryEntry:getText
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:com.dmdirc.ui.core.dialogs.sslcertificate.CertificateSummaryEntry:isGood
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:com.dmdirc.ui.IconManager:getIconManager
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:com.dmdirc.ui.IconManager:getIcon
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:javax.swing.JLabel
    //#unanalyzed(void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()): Effects-of-calling:com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel:add
        summary = new ArrayList<CertificateSummaryEntry>();
        layoutComponents();
    }
    //#SummaryPanel.java:54: end of method: void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel.com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel()

    private void layoutComponents() {
        setBorder(BorderFactory.createTitledBorder("Summary"));
    //#SummaryPanel.java:57: method: void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel.layoutComponents()
    //#SummaryPanel.java:57: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel:setBorder(Border)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel
    //#    method: void layoutComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel:setBorder(Border)
    //#input(void layoutComponents()): this
    //#input(void layoutComponents()): this.summary
    //#pre[2] (void layoutComponents()): this.summary != null
    //#presumption(void layoutComponents()): com.dmdirc.ui.IconManager:getIconManager(...)@61 != null
    //#presumption(void layoutComponents()): com.dmdirc.ui.IconManager:getIconManager(...)@61 != null
    //#presumption(void layoutComponents()): java.util.Iterator:next(...)@60 != null
    //#test_vector(void layoutComponents()): com.dmdirc.ui.core.dialogs.sslcertificate.CertificateSummaryEntry:isGood(...)@61: {0}, {1}
    //#test_vector(void layoutComponents()): java.util.Iterator:hasNext(...)@60: {0}, {1}
        setLayout(new MigLayout("fill, wrap 1"));
    //#SummaryPanel.java:58: Warning: method not available - call not analyzed
    //#    call on void net.miginfocom.swing.MigLayout(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel
    //#    method: void layoutComponents()
    //#    unanalyzed callee: void net.miginfocom.swing.MigLayout(String)
    //#SummaryPanel.java:58: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel:setLayout(LayoutManager)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel
    //#    method: void layoutComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel:setLayout(LayoutManager)

        for (CertificateSummaryEntry entry : summary) {
            add(new JLabel(entry.getText(),
    //#SummaryPanel.java:61: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.ui.core.dialogs.sslcertificate.CertificateSummaryEntry:getText()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel
    //#    method: void layoutComponents()
    //#    unanalyzed callee: String com.dmdirc.ui.core.dialogs.sslcertificate.CertificateSummaryEntry:getText()
    //#SummaryPanel.java:61: Warning: method not available - call not analyzed
    //#    call on bool com.dmdirc.ui.core.dialogs.sslcertificate.CertificateSummaryEntry:isGood()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel
    //#    method: void layoutComponents()
    //#    unanalyzed callee: bool com.dmdirc.ui.core.dialogs.sslcertificate.CertificateSummaryEntry:isGood()
    //#SummaryPanel.java:61: Warning: method not available - call not analyzed
    //#    call on IconManager com.dmdirc.ui.IconManager:getIconManager()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel
    //#    method: void layoutComponents()
    //#    unanalyzed callee: IconManager com.dmdirc.ui.IconManager:getIconManager()
    //#SummaryPanel.java:61: Warning: method not available - call not analyzed
    //#    call on Icon com.dmdirc.ui.IconManager:getIcon(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel
    //#    method: void layoutComponents()
    //#    unanalyzed callee: Icon com.dmdirc.ui.IconManager:getIcon(String)
    //#SummaryPanel.java:61: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel
    //#    method: void layoutComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel:add(Component, Object)
                    entry.isGood() ? IconManager.getIconManager().getIcon("tick")
                    : IconManager.getIconManager().getIcon("cross"), JLabel.LEFT),
                    "growx");
        }
    }
    //#SummaryPanel.java:66: end of method: void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel.layoutComponents()

    void setSummary(final List<CertificateSummaryEntry> summary) {
        this.summary = summary;
    //#SummaryPanel.java:69: method: void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel.setSummary(List)
    //#input(void setSummary(List)): summary
    //#input(void setSummary(List)): this
    //#output(void setSummary(List)): this.summary
    //#pre[1] (void setSummary(List)): summary != null
    //#post(void setSummary(List)): this.summary == summary
    //#post(void setSummary(List)): this.summary != null
    //#unanalyzed(void setSummary(List)): Effects-of-calling:javax.swing.BorderFactory:createTitledBorder
    //#unanalyzed(void setSummary(List)): Effects-of-calling:com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel:setBorder
    //#unanalyzed(void setSummary(List)): Effects-of-calling:net.miginfocom.swing.MigLayout
    //#unanalyzed(void setSummary(List)): Effects-of-calling:com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel:setLayout
    //#unanalyzed(void setSummary(List)): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(void setSummary(List)): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(void setSummary(List)): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(void setSummary(List)): Effects-of-calling:com.dmdirc.ui.core.dialogs.sslcertificate.CertificateSummaryEntry:getText
    //#unanalyzed(void setSummary(List)): Effects-of-calling:com.dmdirc.ui.core.dialogs.sslcertificate.CertificateSummaryEntry:isGood
    //#unanalyzed(void setSummary(List)): Effects-of-calling:com.dmdirc.ui.IconManager:getIconManager
    //#unanalyzed(void setSummary(List)): Effects-of-calling:com.dmdirc.ui.IconManager:getIcon
    //#unanalyzed(void setSummary(List)): Effects-of-calling:javax.swing.JLabel
    //#unanalyzed(void setSummary(List)): Effects-of-calling:com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel:add
        layoutComponents();
    }
    //#SummaryPanel.java:71: end of method: void com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel.setSummary(List)
}
    //#output(com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/dialogs/sslcertificate/SummaryPanel]
    //#output(com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel__static_init): __Dispatch_Table.layoutComponents()V
    //#output(com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel__static_init): __Dispatch_Table.setSummary(Ljava/util/List;)V
    //#post(com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/dialogs/sslcertificate/SummaryPanel] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel__static_init): __Dispatch_Table.layoutComponents()V == &layoutComponents
    //#post(com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel__static_init): __Dispatch_Table.setSummary(Ljava/util/List;)V == &setSummary
    //#SummaryPanel.java:: end of method: com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel.com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel__static_init
    //#SummaryPanel.java:: end of class: com.dmdirc.addons.ui_swing.dialogs.sslcertificate.SummaryPanel
