// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) deadcode 
// Source File Name:   Introduction.java

package com.ptc.windchill.upgrade.tool;

import com.ptc.windchill.upgrade.util.WrappingMultiLineTextMessage;
import com.ptc.windchill.upgrade.util.fsm.StateDefinition;
import com.ptc.windchill.upgrade.util.fsm.StateMachine;
import java.awt.*;
import java.io.PrintStream;
import javax.swing.*;
import javax.swing.text.*;

// Referenced classes of package com.ptc.windchill.upgrade.tool:
//            AbstractState

public class Introduction extends AbstractState
{

    public Introduction(StateMachine statemachine, StateDefinition statedefinition)
    {
        super(statemachine, statedefinition, "Welcome");
    }

    public JComponent getViewComponent()
    {
        JPanel jpanel = new JPanel();
        java.awt.Color color = UIManager.getColor("Label.background");
        SimpleAttributeSet simpleattributeset = new SimpleAttributeSet();
        simpleattributeset.addAttribute(javax.swing.text.StyleConstants.CharacterConstants.Bold, Boolean.TRUE);
        JTextPane jtextpane = new JTextPane();
        jtextpane.setPreferredSize(new Dimension(30, 270));
        javax.swing.text.StyledDocument styleddocument = jtextpane.getStyledDocument();
        jtextpane.setBackground(color);
        jtextpane.setEditable(false);
        jtextpane.setFont(new Font(null, 0, 14));
        try
        {
            styleddocument.insertString(styleddocument.getLength(), "You can stop the Upgrade Manager after any step; ", null);
            styleddocument.insertString(styleddocument.getLength(), " however, we strongly recommend that you proceed directly from the ", null);
            styleddocument.insertString(styleddocument.getLength(), "Compare Schema ", simpleattributeset);
            styleddocument.insertString(styleddocument.getLength(), "step through ", null);
            styleddocument.insertString(styleddocument.getLength(), "Execute Server Migrators ", simpleattributeset);
            styleddocument.insertString(styleddocument.getLength(), "step without interupption.  If you stop the Upgrade Manager before these steps are completed, the utility may start at the ", null);
            styleddocument.insertString(styleddocument.getLength(), "Compare Schema", simpleattributeset);
            styleddocument.insertString(styleddocument.getLength(), " step when you restart the Upgrade Manager.", null);
            styleddocument.insertString(styleddocument.getLength(), LINE_SEPARATOR, null);
            styleddocument.insertString(styleddocument.getLength(), LINE_SEPARATOR, null);
            styleddocument.insertString(styleddocument.getLength(), "Note:", simpleattributeset);
            styleddocument.insertString(styleddocument.getLength(), " You will need to know the Administrator's username and password to execute steps; ", null);
            styleddocument.insertString(styleddocument.getLength(), "Execute Server Migrators ", simpleattributeset);
            styleddocument.insertString(styleddocument.getLength(), "through ", null);
            styleddocument.insertString(styleddocument.getLength(), "Queue Upgrade of Evolvable Objects", simpleattributeset);
        }
        catch(BadLocationException badlocationexception)
        {
            System.err.println("Unable to enter the string into the document");
        }
        WrappingMultiLineTextMessage wrappingmultilinetextmessage = new WrappingMultiLineTextMessage("Welcome to the Upgrade Manager.");
        WrappingMultiLineTextMessage wrappingmultilinetextmessage1 = new WrappingMultiLineTextMessage("On the left are the steps the Upgrade Manager performs to upgrade the database. Progress of the upgrade is refelected visually in this list.");
        wrappingmultilinetextmessage.setDefaultFont();
        wrappingmultilinetextmessage1.setDefaultFont();
        jpanel.setLayout(new GridBagLayout());
        GridBagConstraints gridbagconstraints = new GridBagConstraints();
        gridbagconstraints.gridx = 0;
        gridbagconstraints.gridy = 0;
        gridbagconstraints.insets = new Insets(2, 10, 5, 5);
        gridbagconstraints.anchor = 11;
        gridbagconstraints.fill = 1;
        jpanel.add(wrappingmultilinetextmessage, gridbagconstraints);
        gridbagconstraints = new GridBagConstraints();
        gridbagconstraints.gridx = 0;
        gridbagconstraints.gridy = 1;
        gridbagconstraints.weightx = 0.10000000000000001D;
        gridbagconstraints.weighty = 0.0D;
        gridbagconstraints.insets = new Insets(2, 10, 5, 5);
        gridbagconstraints.anchor = 11;
        gridbagconstraints.fill = 1;
        jpanel.add(wrappingmultilinetextmessage1, gridbagconstraints);
        gridbagconstraints = new GridBagConstraints();
        gridbagconstraints.gridx = 0;
        gridbagconstraints.gridy = 2;
        gridbagconstraints.weighty = 1.0D;
        gridbagconstraints.insets = new Insets(2, 10, 5, 5);
        gridbagconstraints.anchor = 11;
        gridbagconstraints.fill = 1;
        jpanel.add(jtextpane, gridbagconstraints);
        displayStatus();
        return jpanel;
    }

    private void displayStatus()
    {
        setStatus("Please READ this screen before selecting Continue");
    }

    private static String LINE_SEPARATOR = System.getProperty("line.separator");

}
