//# 0 errors, 107 messages
//#
/*
    //#CommunicationStep.java:1:1: class: com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep
    //#CommunicationStep.java:1:1: method: com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__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.wizard.firstrun;

import com.dmdirc.addons.ui_swing.components.text.TextLabel;
import com.dmdirc.addons.ui_swing.wizard.Step;

import javax.swing.JCheckBox;

import net.miginfocom.swing.MigLayout;

/**
 * Sets communication options.
 */
public final class CommunicationStep extends Step {

    /**
     * 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;
    /** Update info. */
    private TextLabel updatesInfo;
    /** Update checker. */
    private JCheckBox updates;
    /** Error reports info. */
    private TextLabel errorsInfo;
    /** Error reports. */
    private JCheckBox errors;

    /**
     * Creates a new instance of SetupStep.
     */
    public CommunicationStep() {
        super();
    //#CommunicationStep.java:56: method: void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()
    //#input(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): this
    //#output(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): new JCheckBox(initComponents#2) num objects
    //#output(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): new JCheckBox(initComponents#4) num objects
    //#output(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): new TextLabel(initComponents#1) num objects
    //#output(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): new TextLabel(initComponents#3) num objects
    //#output(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): this.errors
    //#output(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): this.errorsInfo
    //#output(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): this.updates
    //#output(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): this.updatesInfo
    //#new obj(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): new JCheckBox(initComponents#2)
    //#new obj(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): new JCheckBox(initComponents#4)
    //#new obj(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): new TextLabel(initComponents#1)
    //#new obj(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): new TextLabel(initComponents#3)
    //#post(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): this.errors == &new JCheckBox(initComponents#4)
    //#post(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): this.errorsInfo == &new TextLabel(initComponents#3)
    //#post(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): this.updates == &new JCheckBox(initComponents#2)
    //#post(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): this.updatesInfo == &new TextLabel(initComponents#1)
    //#post(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): new JCheckBox(initComponents#2) num objects == 1
    //#post(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): new JCheckBox(initComponents#4) num objects == 1
    //#post(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): new TextLabel(initComponents#1) num objects == 1
    //#post(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): new TextLabel(initComponents#3) num objects == 1
    //#unanalyzed(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.text.TextLabel
    //#unanalyzed(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): Effects-of-calling:javax.swing.JCheckBox
    //#unanalyzed(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): Effects-of-calling:net.miginfocom.swing.MigLayout
    //#unanalyzed(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): Effects-of-calling:com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep:setLayout
    //#unanalyzed(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): Effects-of-calling:com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep:add
    //#unanalyzed(void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()): Effects-of-calling:javax.swing.JPanel

        initComponents();
        layoutComponents();
    }
    //#CommunicationStep.java:60: end of method: void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep()

    /**
     * Initialises the components.
     */
    protected void initComponents() {
        updatesInfo =
    //#CommunicationStep.java:66: method: void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.initComponents()
    //#CommunicationStep.java:66: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.text.TextLabel(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep
    //#    method: void initComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.text.TextLabel(String)
    //#input(void initComponents()): this
    //#output(void initComponents()): new JCheckBox(initComponents#2) num objects
    //#output(void initComponents()): new JCheckBox(initComponents#4) num objects
    //#output(void initComponents()): new TextLabel(initComponents#1) num objects
    //#output(void initComponents()): new TextLabel(initComponents#3) num objects
    //#output(void initComponents()): this.errors
    //#output(void initComponents()): this.errorsInfo
    //#output(void initComponents()): this.updates
    //#output(void initComponents()): this.updatesInfo
    //#new obj(void initComponents()): new JCheckBox(initComponents#2)
    //#new obj(void initComponents()): new JCheckBox(initComponents#4)
    //#new obj(void initComponents()): new TextLabel(initComponents#1)
    //#new obj(void initComponents()): new TextLabel(initComponents#3)
    //#post(void initComponents()): this.errors == &new JCheckBox(initComponents#4)
    //#post(void initComponents()): this.errorsInfo == &new TextLabel(initComponents#3)
    //#post(void initComponents()): this.updates == &new JCheckBox(initComponents#2)
    //#post(void initComponents()): this.updatesInfo == &new TextLabel(initComponents#1)
    //#post(void initComponents()): new JCheckBox(initComponents#2) num objects == 1
    //#post(void initComponents()): new JCheckBox(initComponents#4) num objects == 1
    //#post(void initComponents()): new TextLabel(initComponents#1) num objects == 1
    //#post(void initComponents()): new TextLabel(initComponents#3) num objects == 1
                new TextLabel("DMDirc can automatically check for " +
                "updates for various parts of the client, you can globally " +
                "disable that behaviour here, you can also fine tune the " +
                "behaviour in the preferences dialog once the client is running.");
        updates = new JCheckBox("Enable update checks?", true);
        errorsInfo = new TextLabel("DMDirc will automatically report application " +
    //#CommunicationStep.java:72: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.text.TextLabel(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep
    //#    method: void initComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.text.TextLabel(String)
                "errors to the developers, whilst this is of great help to the developers " +
                "you may disable this behaviour here.");
        errors = new JCheckBox("Enable error reporting?", true);
    }
    //#CommunicationStep.java:76: end of method: void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.initComponents()

    /**
     * Lays out the components.
     */
    private void layoutComponents() {
        setLayout(new MigLayout("fillx, wrap 1"));
    //#CommunicationStep.java:82: method: void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.layoutComponents()
    //#CommunicationStep.java:82: Warning: method not available - call not analyzed
    //#    call on void net.miginfocom.swing.MigLayout(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep
    //#    method: void layoutComponents()
    //#    unanalyzed callee: void net.miginfocom.swing.MigLayout(String)
    //#CommunicationStep.java:82: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep:setLayout(LayoutManager)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep
    //#    method: void layoutComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep:setLayout(LayoutManager)
    //#input(void layoutComponents()): this
    //#input(void layoutComponents()): this.errors
    //#input(void layoutComponents()): this.errorsInfo
    //#input(void layoutComponents()): this.updates
    //#input(void layoutComponents()): this.updatesInfo
    //#pre[2] (void layoutComponents()): init'ed(this.errors)
    //#pre[3] (void layoutComponents()): init'ed(this.errorsInfo)
    //#pre[4] (void layoutComponents()): init'ed(this.updates)
    //#pre[5] (void layoutComponents()): init'ed(this.updatesInfo)

        add(updatesInfo, "growx, pushx");
    //#CommunicationStep.java:84: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep
    //#    method: void layoutComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep:add(Component, Object)
        add(updates, "");
    //#CommunicationStep.java:85: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep
    //#    method: void layoutComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep:add(Component, Object)
        add(errorsInfo, "growx, pushx");
    //#CommunicationStep.java:86: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep
    //#    method: void layoutComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep:add(Component, Object)
        add(errors, "");
    //#CommunicationStep.java:87: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep:add(Component, Object)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep
    //#    method: void layoutComponents()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep:add(Component, Object)
    }
    //#CommunicationStep.java:88: end of method: void com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.layoutComponents()

    /**
     * Checks if updates are enabled.
     * 
     * @return true iif updates are enabled
     */
    public boolean checkUpdates() {
        return updates.isSelected();
    //#CommunicationStep.java:96: method: bool com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.checkUpdates()
    //#input(bool checkUpdates()): this
    //#input(bool checkUpdates()): this.updates
    //#output(bool checkUpdates()): return_value
    //#pre[2] (bool checkUpdates()): this.updates != null
    //#post(bool checkUpdates()): init'ed(return_value)
    //#CommunicationStep.java:96: end of method: bool com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.checkUpdates()
    }

    /**
     * Checks if error reports are enabled.
     * 
     * @return true iif error reports  are enabled
     */
    public boolean checkErrors() {
        return updates.isSelected();
    //#CommunicationStep.java:105: method: bool com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.checkErrors()
    //#input(bool checkErrors()): this
    //#input(bool checkErrors()): this.updates
    //#output(bool checkErrors()): return_value
    //#pre[2] (bool checkErrors()): this.updates != null
    //#post(bool checkErrors()): init'ed(return_value)
    //#CommunicationStep.java:105: end of method: bool com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.checkErrors()
    }

    /** {@inheritDoc} */
    @Override
    public String getTitle() {
        return "Communication settings";
    //#CommunicationStep.java:111: method: String com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.getTitle()
    //#output(String getTitle()): return_value
    //#post(String getTitle()): return_value == &"Communication settings"
    //#CommunicationStep.java:111: end of method: String com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.getTitle()
    }
}
    //#output(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/wizard/firstrun/CommunicationStep]
    //#output(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): __Dispatch_Table.checkErrors()Z
    //#output(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): __Dispatch_Table.checkUpdates()Z
    //#output(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): __Dispatch_Table.getTitle()Ljava/lang/String;
    //#output(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): __Dispatch_Table.initComponents()V
    //#output(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): __Dispatch_Table.layoutComponents()V
    //#output(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): com/dmdirc/addons/ui_swing/wizard/Step.__Descendant_Table[com/dmdirc/addons/ui_swing/wizard/firstrun/CommunicationStep]
    //#post(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/wizard/firstrun/CommunicationStep] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): com/dmdirc/addons/ui_swing/wizard/Step.__Descendant_Table[com/dmdirc/addons/ui_swing/wizard/firstrun/CommunicationStep] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): __Dispatch_Table.checkErrors()Z == &checkErrors
    //#post(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): __Dispatch_Table.checkUpdates()Z == &checkUpdates
    //#post(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): __Dispatch_Table.getTitle()Ljava/lang/String; == &getTitle
    //#post(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): __Dispatch_Table.initComponents()V == &initComponents
    //#post(com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init): __Dispatch_Table.layoutComponents()V == &layoutComponents
    //#CommunicationStep.java:: end of method: com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep.com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep__static_init
    //#CommunicationStep.java:: end of class: com.dmdirc.addons.ui_swing.wizard.firstrun.CommunicationStep
