/**
 * This class creates a popup dialog box that displays help on using the Phase Properties class.
 * @version 3.0 (August 2007)
 * @author Mark S. Ghiorso, OFM-Research Inc.
 */
public class CalcHelp extends javax.swing.JDialog {
    
    /** 
     * Creates a class instance within a popup dialog box.
     * @param parent Parent frame for dialog box. Could be the Applet frame.
     * @param modal Sets modality of the dialog box.
     * @see javax.swing.JDialog
     */
    public CalcHelp(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    
    private void initComponents() {
        javax.swing.JTabbedPane MELTS;

        MELTS = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        jTextPane2 = new javax.swing.JTextPane();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();

        getContentPane().setLayout(new java.awt.CardLayout());

        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        });

        MELTS.setBackground(new java.awt.Color(255, 255, 255));
        MELTS.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
        MELTS.setName("MELTS");

        jPanel3.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

        jPanel3.setBackground(new java.awt.Color(255, 255, 255));
        jTextPane2.setText("Phase Properties Applet version 3.0 (August 2007):\n\n" +
	                   "    Select a phase from the <Phase:> pop-up menu.\n\n" +
			   "    To calculate thermodynamic component mole fractions from wt% composition entries:\n" +
			   "      (1) Enter composition of the phase (in wt% ) in the left-hand column of text entry boxes.\n" +
			   "      (2) Select <Convert Wt% -> X> from the <User action:> popup menu.\n" +
			   "      (3) The result of the calculation will be displayed in the right-hand column of text entry boxes.\n\n" +
			   "    To calculate wt% composition from thermodynamic component mole fractions:\n" +
			   "      (1) Enter composition of the phase (in moles or mole factions of endmember components) in the right-hand\n" +
			   "          column of text entry boxes.\n" +
			   "      (2) Select <Convert X -> Wt%> from the <User action> popup menu.\n" +
			   "      (3) The result of the calculation will be displayed in the left-hand column of text entry boxes.\n\n" +
			   "    To calculate thermodynamic properties of the phase:\n" +
			   "      (1) Enter composition of the phase (in moles or mole factions of endmember components) in the right-hand\n" +
			   "          column of text entry boxes.  If the phase has only one component, enter a <1> in the mole fraction box.\n" +
			   "      (2) Enter temperature (in K) in the text box to the right of the label <T [K]:>.\n" +
			   "      (3) Enter pressure (in bars) in the text box to the right of the label <P [bars]:>.\n" +
			   "      (4) Select <<X -> ThermoProp >> from the <User action> popup menu.\n" +
			   "      (5) The result of the calculation will be displayed in labeled text boxes in the lower half and right-hand\n" +
			   "          column of the applet.\n" +
			   "      (6) Note that the chemical potentials, Gibbs free energy and the enthalpy includes a standard state\n" +
			   "          contribution representing the apparent Gibbs free energy/enthalpy of formation at T and P from the elements\n" +
			   "          at 298.15K and 1 bar.\n" +
			   "      (7) Values of the Gibbs energy, enthalpy, entropy, volume, and heat capacity are reported as extensive\n" +
			   "          thermodynamic quantities.  This means that these values correspond to the number of moles of the phase\n" +
			   "          indicated in the text box labeled \"total moles.\"\n\n" +
			   "    Calculations may be performed and repeated in any sequence.");
        jPanel3.add(jTextPane2);

        MELTS.addTab("Phase Properties Applet", jPanel3);

        jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        jPanel6.add(jScrollPane1);

        getContentPane().add(MELTS, "card2");

        pack();
    }//GEN-END:initComponents
    
    /** Closes the dialog */
    private void closeDialog(java.awt.event.WindowEvent evt) {
        setVisible(false);
        dispose();
    }
    
    /**
     * Creates a standalone instance of this class.
     * @param args Command line arguments
     */
    public static void main(String args[]) {
        new CalcHelp(new javax.swing.JFrame(), true).show();
    }
    
    
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JTextPane jTextPane2;
    private javax.swing.JPanel jPanel6;
    
}
