Package GUI

Source Code of GUI.DataInputWizard

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/*
* DataInputWizard.java
*
* Created on Sep 7, 2009, 11:32:37 AM
*/
package GUI;

import Core.Data;
import Core.DataManager;
import java.awt.HeadlessException;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.WindowConstants;

import javax.swing.table.TableModel;

/**
*
* @author M Shakeer Anver
*/
public class DataInputWizard extends javax.swing.JDialog {

    Data data;
    DataManager dataManager;
    TableModel dataTable;
    DefaultComboBoxModel elemenNumbersBox;
    String[] tableHeaders;
    boolean pileNodeValueIsChanged;
    boolean pileDataValueIsChanged;
    boolean manualEntry;
    mainForm mainForm;
    int numOfNodes;

    /** Creates new form DataInputWizard
     * @param parent The parent window
     * @param modal Set whether the wizard shall be modal
     */
    public DataInputWizard(mainForm parent, boolean modal) {
        super(parent, modal);
        initComponents();
        pileNodeValueIsChanged = false;
        pileDataValueIsChanged = false;
        manualEntry = true;
        mainForm = parent;
        numOfNodes = 1;
        dataManager = new DataManager(data);


    }
    /**
     * Returns the Tabbed Pane of the Data Input Wizard
     * @return Tabbed Pane of the Data Input Wizard
     */
    public JTabbedPane getDataTabPane(){
        return dataInputWizardLyPane;
    }

    /**
     * Returns the Pile Nodes Data Table
     * @return the Pile Nodes Data Table
     */
    public JTable getPileNodesDataTable() {
        return multipleViewTbl;
    }

    /**
     * Returns the current in-use data
     * @return Current data
     */
    public Data getData() {
        return data;
    }

    /**
     * Sets the data
     * @param data new data to be set
     */
    public void setData(Data data) {
        this.data = data;
        dataManager.setData(data);
        numOfElemTxtFld.setText(String.valueOf(data.getNumOfElements()));
        pileLengthTxtFld.setText(String.valueOf(data.getPileLength()));
        eiTxtFld.setText(String.valueOf(data.getEI()));
        pileDiaTxtFld.setText(String.valueOf(data.getPileDiameter()));
        //numofPilesTxtFld.setText(String.valueOf(data.getNumOfPiles()));
        poissonRationTxtFld.setText(String.valueOf(data.getPoissonRation()));
        iterNumTxtFld.setText(String.valueOf(data.getIterationNumber()));
        manualEntry = data.getNumOfElements() == 0;
        numOfNodes = data.getNumOfElements()+1;
        createElementNumberComboBox();
        prepareDataTable();


    }

    /**
     * Closes the wizard
     * @throws HeadlessException
     */
    private void closeWizard() throws HeadlessException {
        int elementNumber = itemNumberCmbBox.getSelectedIndex();
        try {
            if (pileNodeValueIsChanged || pileDataValueIsChanged) {
                int answer = askUser();
                if (answer == JOptionPane.YES_OPTION) {
                    if (pileDataValueIsChanged) {
                        applyPileDataChanges();
                    }
                    if (pileNodeValueIsChanged && elementNumber != -1) {
                        applyNodeDataChanges(elementNumber);
                    }
                    this.setVisible(false);
                }
            
            }
            this.setVisible(false);
        } catch (NumberFormatException ex) {
            errorLbl.setText("Empty values are not allowed!");
            JOptionPane.showMessageDialog(this, "Invalid Data Values, please double check.", "Error", JOptionPane.ERROR_MESSAGE);
            this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
        }
    }

    private void prepareDataTable() {
       
        try {
            dataManager.setData(data);
            dataTable = dataManager.getDataValuesTable().getModel();
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(this, ex.getMessage(),"WinSIS", JOptionPane.ERROR_MESSAGE);
        }
        multipleViewTbl.setModel(dataTable);
        multipleViewTbl.repaint();

    }

    private void createElementNumberComboBox() {
        Integer[] elementNumbers = new Integer[numOfNodes];
        for (int i = 0; i < numOfNodes; i++) {
            elementNumbers[i] = i;
        }
        elemenNumbersBox = new DefaultComboBoxModel(elementNumbers);
        itemNumberCmbBox.setModel(elemenNumbersBox);
        itemNumberCmbBox.setSelectedIndex(0);
        itemNumberCmbBox.repaint();
    }



    private boolean applyNodeDataChanges(int elementNumber) throws NumberFormatException {

        data.setPileNodeCo(elementNumber, Double.parseDouble(depthTxtFld.getText()));
        data.setModOfSubgradeReaction(elementNumber, Double.parseDouble(modTxtFld.getText()));
        data.setLateralSoilMovement(elementNumber, Double.parseDouble(lateralTxtFld.getText()));
        data.setLimitSoilPressure(elementNumber, Double.parseDouble(limitTxtFld.getText()));
        prepareDataTable();
       
        setData(data);
        mainForm.setDataIsChanged(true);
        pileNodeValueIsChanged = false;
        return true;

    }

    private boolean applyPileDataChanges() throws NumberFormatException {
        int newNumOfElements = Integer.parseInt(numOfElemTxtFld.getText());
        int difference = newNumOfElements - data.getNumOfElements();
        if (difference > 0) {
            for (int i =data.getNumOfElements()-1; i < newNumOfElements; i++) {
                data.addPileNodeCoordinate(0);
                data.addLateralSoilMovement(0);
                data.addLimitSoilPressure(0);
                data.addModOfSubgradeReaction(0);
            }
        }

        data.setNumOfElements(Integer.parseInt(numOfElemTxtFld.getText()));
        data.setPileLength(Double.parseDouble(pileLengthTxtFld.getText()));
        data.setEI(Double.parseDouble(eiTxtFld.getText()));
        data.setPileDiameter(Double.parseDouble(pileDiaTxtFld.getText()));
        data.setNumOfPiles(Integer.parseInt(numofPilesTxtFld.getText()));
        data.setPoissonRation(Double.parseDouble(poissonRationTxtFld.getText()));
        data.setIterationNumber(Integer.parseInt(iterNumTxtFld.getText()));
        setData(data);
        mainForm.setDataIsChanged(true);
        pileDataValueIsChanged = false;
        return true;
    }

    private int askUser() {
        int answer = JOptionPane.showConfirmDialog(this,
                "Do you want to save the changes?", "Save Changes",
                JOptionPane.YES_NO_OPTION,
                JOptionPane.QUESTION_MESSAGE);
        return answer;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel4 = new javax.swing.JPanel();
        dataInputWizardLyPane = new javax.swing.JTabbedPane();
        pileDataPnl = new javax.swing.JPanel();
        numOfElemLbl = new javax.swing.JLabel();
        pileLengthLbl = new javax.swing.JLabel();
        eiLbl = new javax.swing.JLabel();
        pileDiaLbl = new javax.swing.JLabel();
        numOfPilesLbl = new javax.swing.JLabel();
        poissonRationLbl = new javax.swing.JLabel();
        iterNumLbl = new javax.swing.JLabel();
        pileDataLogo = new javax.swing.JLabel();
        controlCommandLogo = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        pileDataNextBtn = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        errorLbl = new javax.swing.JLabel();
        numOfElemTxtFld = new javax.swing.JFormattedTextField();
        pileLengthTxtFld = new javax.swing.JFormattedTextField();
        eiTxtFld = new javax.swing.JFormattedTextField();
        pileDiaTxtFld = new javax.swing.JFormattedTextField();
        numofPilesTxtFld = new javax.swing.JFormattedTextField();
        poissonRationTxtFld = new javax.swing.JFormattedTextField();
        iterNumTxtFld = new javax.swing.JFormattedTextField();
        pileDataBackBtn = new javax.swing.JButton();
        pileDataCloseBtn = new javax.swing.JButton();
        pileNodeCoordPnl = new javax.swing.JPanel();
        pileNodeCoordNextBtn = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        multipleTableScrlPane = new javax.swing.JScrollPane();
        multipleViewTbl = new javax.swing.JTable();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        depthTxtFld = new javax.swing.JFormattedTextField();
        modTxtFld = new javax.swing.JFormattedTextField();
        lateralTxtFld = new javax.swing.JFormattedTextField();
        limitTxtFld = new javax.swing.JFormattedTextField();
        nextBtn = new javax.swing.JButton();
        backBtn = new javax.swing.JButton();
        itemNumberCmbBox = new javax.swing.JComboBox();
        pileNodeDataBackBtn = new javax.swing.JButton();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        nodeDataCloseBtn = new javax.swing.JButton();
        surfaceCoordinates = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        finishBtn = new javax.swing.JButton();
        pileCoBackBtn = new javax.swing.JButton();
        jSeparator3 = new javax.swing.JSeparator();
        jLabel17 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        setTitle("WinSIS - Data Input Wizard");
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        dataInputWizardLyPane.setEnabled(false);
        dataInputWizardLyPane.setMinimumSize(new java.awt.Dimension(200, 200));
        dataInputWizardLyPane.setPreferredSize(new java.awt.Dimension(200, 300));

        pileDataPnl.setFont(new java.awt.Font("Verdana", 1, 11));

        numOfElemLbl.setFont(new java.awt.Font("Verdana", 1, 11));
        numOfElemLbl.setText("Number of Elements");

        pileLengthLbl.setFont(new java.awt.Font("Verdana", 1, 11));
        pileLengthLbl.setText("Pile Length");

        eiLbl.setFont(new java.awt.Font("Verdana", 1, 11));
        eiLbl.setText("EI");

        pileDiaLbl.setFont(new java.awt.Font("Verdana", 1, 11));
        pileDiaLbl.setText("Pile Diameter");

        numOfPilesLbl.setFont(new java.awt.Font("Verdana", 1, 11));
        numOfPilesLbl.setText("Number of Piles");

        poissonRationLbl.setFont(new java.awt.Font("Verdana", 1, 11));
        poissonRationLbl.setText("Poisson Ratio");

        iterNumLbl.setFont(new java.awt.Font("Verdana", 1, 11));
        iterNumLbl.setText("Iteration Number");

        pileDataLogo.setFont(new java.awt.Font("Verdana", 1, 18));
        pileDataLogo.setText("Pile Data");

        controlCommandLogo.setText("Enter pile data and press 'NEXT' to proceed");

        jLabel10.setText(" (m)");

        jLabel11.setText(" (KN/m2)");

        jLabel12.setText(" (m)");

        pileDataNextBtn.setText("Next >");
        pileDataNextBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pileDataNextBtnActionPerformed(evt);
            }
        });

        errorLbl.setForeground(new java.awt.Color(255, 51, 51));

        numOfElemTxtFld.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(java.text.NumberFormat.getIntegerInstance())));
        numOfElemTxtFld.setNextFocusableComponent(pileLengthTxtFld);
        numOfElemTxtFld.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                numOfElemTxtFldActionPerformed(evt);
            }
        });
        numOfElemTxtFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                numOfElemTxtFldKeyTyped(evt);
            }
        });

        pileLengthTxtFld.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));
        pileLengthTxtFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                pileLengthTxtFldKeyTyped(evt);
            }
        });

        eiTxtFld.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));
        eiTxtFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                eiTxtFldKeyTyped(evt);
            }
        });

        pileDiaTxtFld.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));
        pileDiaTxtFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                pileDiaTxtFldKeyTyped(evt);
            }
        });

        numofPilesTxtFld.setEditable(false);
        numofPilesTxtFld.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(java.text.NumberFormat.getIntegerInstance())));
        numofPilesTxtFld.setText("1");
        numofPilesTxtFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                numofPilesTxtFldKeyTyped(evt);
            }
        });

        poissonRationTxtFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                poissonRationTxtFldKeyTyped(evt);
            }
        });

        iterNumTxtFld.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(java.text.NumberFormat.getIntegerInstance())));
        iterNumTxtFld.setNextFocusableComponent(pileDiaTxtFld);
        iterNumTxtFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                iterNumTxtFldKeyTyped(evt);
            }
        });

        pileDataBackBtn.setText("< Previous");
        pileDataBackBtn.setEnabled(false);

        pileDataCloseBtn.setText("Close");
        pileDataCloseBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pileDataCloseBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pileDataPnlLayout = new javax.swing.GroupLayout(pileDataPnl);
        pileDataPnl.setLayout(pileDataPnlLayout);
        pileDataPnlLayout.setHorizontalGroup(
            pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pileDataPnlLayout.createSequentialGroup()
                .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pileDataPnlLayout.createSequentialGroup()
                        .addGap(94, 94, 94)
                        .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(pileDataPnlLayout.createSequentialGroup()
                                .addGap(105, 105, 105)
                                .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(pileDataPnlLayout.createSequentialGroup()
                                        .addGap(51, 51, 51)
                                        .addComponent(pileDataLogo))
                                    .addComponent(controlCommandLogo)))
                            .addGroup(pileDataPnlLayout.createSequentialGroup()
                                .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(pileLengthLbl)
                                    .addComponent(eiLbl)
                                    .addComponent(pileDiaLbl)
                                    .addComponent(numOfElemLbl))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(pileDiaTxtFld)
                                    .addComponent(pileLengthTxtFld)
                                    .addComponent(numOfElemTxtFld, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE)
                                    .addComponent(eiTxtFld, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel12)
                                    .addGroup(pileDataPnlLayout.createSequentialGroup()
                                        .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel11)
                                            .addComponent(jLabel10))
                                        .addGap(29, 29, 29)
                                        .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(iterNumLbl)
                                            .addComponent(numOfPilesLbl)
                                            .addComponent(poissonRationLbl))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(poissonRationTxtFld, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE)
                                            .addComponent(iterNumTxtFld, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
                                            .addComponent(numofPilesTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)))))))
                    .addGroup(pileDataPnlLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(errorLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 325, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pileDataPnlLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 648, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pileDataPnlLayout.createSequentialGroup()
                .addContainerGap(435, Short.MAX_VALUE)
                .addComponent(pileDataCloseBtn)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pileDataBackBtn)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pileDataNextBtn)
                .addContainerGap())
        );
        pileDataPnlLayout.setVerticalGroup(
            pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pileDataPnlLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pileDataLogo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(controlCommandLogo)
                .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pileDataPnlLayout.createSequentialGroup()
                        .addGap(40, 40, 40)
                        .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pileDataPnlLayout.createSequentialGroup()
                                .addGap(34, 34, 34)
                                .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(pileLengthLbl)
                                    .addComponent(jLabel10)
                                    .addComponent(pileLengthTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(eiLbl)
                                    .addComponent(jLabel11)
                                    .addComponent(eiTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(pileDiaLbl)
                                    .addComponent(jLabel12)
                                    .addComponent(pileDiaTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pileDataPnlLayout.createSequentialGroup()
                                .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(numOfElemTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(numOfElemLbl))
                                .addGap(105, 105, 105))))
                    .addGroup(pileDataPnlLayout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(numofPilesTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(numOfPilesLbl))
                        .addGap(18, 18, 18)
                        .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(poissonRationTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(poissonRationLbl))
                        .addGap(18, 18, 18)
                        .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(iterNumTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(iterNumLbl))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 57, Short.MAX_VALUE)
                .addComponent(errorLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pileDataPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(pileDataBackBtn)
                    .addComponent(pileDataNextBtn)
                    .addComponent(pileDataCloseBtn))
                .addContainerGap())
        );

        dataInputWizardLyPane.addTab("Pile Data", pileDataPnl);

        pileNodeCoordPnl.setEnabled(false);
        pileNodeCoordPnl.setPreferredSize(new java.awt.Dimension(450, 400));

        pileNodeCoordNextBtn.setText("Next >");
        pileNodeCoordNextBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pileNodeCoordNextBtnActionPerformed(evt);
            }
        });

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);

        multipleViewTbl.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        multipleViewTbl.setEnabled(false);
        multipleViewTbl.setFillsViewportHeight(true);
        multipleViewTbl.setFocusable(false);
        multipleViewTbl.setName("multipleView"); // NOI18N
        multipleTableScrlPane.setViewportView(multipleViewTbl);

        jLabel5.setText("Pile Node No:");

        jLabel6.setText("Depth:");

        jLabel7.setText("Modulus of Subgrade Reaction:");

        jLabel8.setText("Lateral Soil Movement:");

        jLabel9.setText("Limit Soil Pressure:");

        depthTxtFld.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));
        depthTxtFld.setText("0");
        depthTxtFld.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                depthTxtFldMouseClicked(evt);
            }
        });
        depthTxtFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                depthTxtFldKeyTyped(evt);
            }
        });

        modTxtFld.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));
        modTxtFld.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                modTxtFldMouseClicked(evt);
            }
        });
        modTxtFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                modTxtFldKeyTyped(evt);
            }
        });

        lateralTxtFld.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.000"))));
        lateralTxtFld.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lateralTxtFldMouseClicked(evt);
            }
        });
        lateralTxtFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                lateralTxtFldKeyTyped(evt);
            }
        });

        limitTxtFld.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));
        limitTxtFld.setNextFocusableComponent(nextBtn);
        limitTxtFld.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                limitTxtFldMouseClicked(evt);
            }
        });
        limitTxtFld.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                limitTxtFldActionPerformed(evt);
            }
        });
        limitTxtFld.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                limitTxtFldFocusGained(evt);
            }
        });
        limitTxtFld.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                limitTxtFldKeyTyped(evt);
            }
        });

        nextBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next.png"))); // NOI18N
        nextBtn.setToolTipText("Next");
        nextBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nextBtnActionPerformed(evt);
            }
        });

        backBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/previous.png"))); // NOI18N
        backBtn.setToolTipText("Back");
        backBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                backBtnActionPerformed(evt);
            }
        });

        itemNumberCmbBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemNumberCmbBoxActionPerformed(evt);
            }
        });

        pileNodeDataBackBtn.setText("< Previous");
        pileNodeDataBackBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pileNodeDataBackBtnActionPerformed(evt);
            }
        });

        jLabel13.setText("(kN/m2)");

        jLabel14.setText("(m)");

        jLabel15.setText("(m)");

        jLabel16.setText("(kN/m2)");

        nodeDataCloseBtn.setText("Close");
        nodeDataCloseBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nodeDataCloseBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pileNodeCoordPnlLayout = new javax.swing.GroupLayout(pileNodeCoordPnl);
        pileNodeCoordPnl.setLayout(pileNodeCoordPnlLayout);
        pileNodeCoordPnlLayout.setHorizontalGroup(
            pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pileNodeCoordPnlLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pileNodeCoordPnlLayout.createSequentialGroup()
                        .addGroup(pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pileNodeCoordPnlLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addGroup(pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel8)
                                    .addComponent(jLabel9)
                                    .addComponent(jLabel6)
                                    .addGroup(pileNodeCoordPnlLayout.createSequentialGroup()
                                        .addComponent(limitTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel16))
                                    .addGroup(pileNodeCoordPnlLayout.createSequentialGroup()
                                        .addComponent(lateralTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel15))
                                    .addGroup(pileNodeCoordPnlLayout.createSequentialGroup()
                                        .addComponent(modTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel13))
                                    .addGroup(pileNodeCoordPnlLayout.createSequentialGroup()
                                        .addComponent(depthTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel14))
                                    .addComponent(jLabel7)
                                    .addComponent(nextBtn, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(pileNodeCoordPnlLayout.createSequentialGroup()
                                .addComponent(jLabel5)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(itemNumberCmbBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(backBtn))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(20, 20, 20)
                        .addComponent(multipleTableScrlPane, javax.swing.GroupLayout.DEFAULT_SIZE, 456, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pileNodeCoordPnlLayout.createSequentialGroup()
                        .addComponent(nodeDataCloseBtn)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pileNodeDataBackBtn)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pileNodeCoordNextBtn)))
                .addContainerGap())
        );
        pileNodeCoordPnlLayout.setVerticalGroup(
            pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pileNodeCoordPnlLayout.createSequentialGroup()
                .addGroup(pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, pileNodeCoordPnlLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE))
                    .addGroup(pileNodeCoordPnlLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(multipleTableScrlPane, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, pileNodeCoordPnlLayout.createSequentialGroup()
                        .addGap(16, 16, 16)
                        .addGroup(pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(itemNumberCmbBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jLabel6)
                        .addGap(4, 4, 4)
                        .addGroup(pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(depthTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel14))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel7)
                        .addGap(2, 2, 2)
                        .addGroup(pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(modTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel13))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel8)
                        .addGap(5, 5, 5)
                        .addGroup(pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lateralTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel15))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(limitTxtFld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel16))
                        .addGap(23, 23, 23)
                        .addGroup(pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(nextBtn, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE)
                            .addComponent(backBtn, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pileNodeCoordPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(pileNodeDataBackBtn)
                        .addComponent(nodeDataCloseBtn))
                    .addComponent(pileNodeCoordNextBtn))
                .addContainerGap())
        );

        dataInputWizardLyPane.addTab("Nodes Data", pileNodeCoordPnl);

        surfaceCoordinates.setEnabled(false);

        jLabel1.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        jLabel1.setText("X Surface Coordinate");

        jLabel2.setFont(new java.awt.Font("Verdana", 1, 11));
        jLabel2.setText("Y Surface Coordinate");

        jTextField1.setText("0");
        jTextField1.setEnabled(false);

        jTextField2.setText("0");
        jTextField2.setEnabled(false);

        jLabel3.setFont(new java.awt.Font("Verdana", 1, 10));
        jLabel3.setForeground(new java.awt.Color(204, 0, 0));
        jLabel3.setText("Attention : Currently supports single pile calculations only. ");

        jLabel4.setFont(new java.awt.Font("Verdana", 1, 18));
        jLabel4.setText("Surface Coordinates");

        finishBtn.setText("Finish");
        finishBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                finishBtnActionPerformed(evt);
            }
        });

        pileCoBackBtn.setText("< Previous");
        pileCoBackBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pileCoBackBtnActionPerformed(evt);
            }
        });

        jLabel17.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        jLabel17.setText("Pile Number:");

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1" }));

        javax.swing.GroupLayout surfaceCoordinatesLayout = new javax.swing.GroupLayout(surfaceCoordinates);
        surfaceCoordinates.setLayout(surfaceCoordinatesLayout);
        surfaceCoordinatesLayout.setHorizontalGroup(
            surfaceCoordinatesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(surfaceCoordinatesLayout.createSequentialGroup()
                .addGroup(surfaceCoordinatesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, surfaceCoordinatesLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(pileCoBackBtn)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(finishBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(surfaceCoordinatesLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE, 648, Short.MAX_VALUE))
                    .addGroup(surfaceCoordinatesLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel3))
                    .addGroup(surfaceCoordinatesLayout.createSequentialGroup()
                        .addGap(212, 212, 212)
                        .addGroup(surfaceCoordinatesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(surfaceCoordinatesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, surfaceCoordinatesLayout.createSequentialGroup()
                                    .addComponent(jLabel2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jTextField2))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, surfaceCoordinatesLayout.createSequentialGroup()
                                    .addGroup(surfaceCoordinatesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel1)
                                        .addComponent(jLabel17))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(surfaceCoordinatesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(jTextField1)
                                        .addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                            .addComponent(jLabel4))))
                .addContainerGap())
        );
        surfaceCoordinatesLayout.setVerticalGroup(
            surfaceCoordinatesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(surfaceCoordinatesLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel4)
                .addGap(66, 66, 66)
                .addGroup(surfaceCoordinatesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(surfaceCoordinatesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(surfaceCoordinatesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, Short.MAX_VALUE)
                .addComponent(jLabel3)
                .addGap(18, 18, 18)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(surfaceCoordinatesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(finishBtn)
                    .addComponent(pileCoBackBtn))
                .addContainerGap())
        );

        dataInputWizardLyPane.addTab("Surface Coordinates", surfaceCoordinates);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(dataInputWizardLyPane, javax.swing.GroupLayout.PREFERRED_SIZE, 673, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(dataInputWizardLyPane, javax.swing.GroupLayout.DEFAULT_SIZE, 377, Short.MAX_VALUE)
        );

        dataInputWizardLyPane.getAccessibleContext().setAccessibleName("");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void pileDataNextBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pileDataNextBtnActionPerformed

        this.setDefaultCloseOperation(HIDE_ON_CLOSE);
        int n = Integer.parseInt(numOfElemTxtFld.getText());
        try {
            if (n < 1) {
                errorLbl.setText("Number of elements cannot be less than 1");
                numofPilesTxtFld.selectAll();
            } else {
                if (pileDataValueIsChanged) {
                    int answer = askUser();
                    if (answer == JOptionPane.YES_OPTION) {
                        applyPileDataChanges();
                        mainForm.saveProject(false);
                    }
                }
                if (manualEntry) {
                    applyPileDataChanges();
                    for (int i = 0; i < data.getNumOfElements(); i++) {
                        data.setPileNodeCo(i, 0);
                        data.setModOfSubgradeReaction(i, 0);
                        data.setLateralSoilMovement(i, 0);
                        data.setLimitSoilPressure(i, 0);
                    }
                }


                mainForm.setData(data);
                errorLbl.setText(" ");
                dataInputWizardLyPane.setSelectedIndex(1);
               
            }
        } catch (NumberFormatException ex) {
            errorLbl.setText("Empty values are not allowed!");
        }
       







    }//GEN-LAST:event_pileDataNextBtnActionPerformed

    private void pileNodeCoordNextBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pileNodeCoordNextBtnActionPerformed
        this.setDefaultCloseOperation(HIDE_ON_CLOSE);
        int elementNumber = itemNumberCmbBox.getSelectedIndex();
        if (pileNodeValueIsChanged || pileDataValueIsChanged) {
            int answer = askUser();
            if (answer == JOptionPane.YES_OPTION) {
                if (pileDataValueIsChanged) {
                    applyPileDataChanges();
                    mainForm.saveProject(false);
                }
                if (pileNodeValueIsChanged) {
                    applyNodeDataChanges(elementNumber);
                }
            }



            mainForm.setData(data);
        }

        dataInputWizardLyPane.setSelectedIndex(2);





    }//GEN-LAST:event_pileNodeCoordNextBtnActionPerformed

    private void itemNumberCmbBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemNumberCmbBoxActionPerformed
        // TODO add your handling code here:
        int itemNumber = itemNumberCmbBox.getSelectedIndex();
        depthTxtFld.setValue(data.getPileNodeCoordinate(itemNumber));
        modTxtFld.setValue(data.getModOfSubgradeReaction(itemNumber));
        lateralTxtFld.setValue(data.getLateralSoilMovement(itemNumber));
        limitTxtFld.setValue(data.getLimitSoilPressure(itemNumber));

    }//GEN-LAST:event_itemNumberCmbBoxActionPerformed

    private void depthTxtFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_depthTxtFldKeyTyped
        pileNodeValueIsChanged = true;
    }//GEN-LAST:event_depthTxtFldKeyTyped

    private void modTxtFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_modTxtFldKeyTyped
        pileNodeValueIsChanged = true;
    }//GEN-LAST:event_modTxtFldKeyTyped

    private void lateralTxtFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_lateralTxtFldKeyTyped
        pileNodeValueIsChanged = true;
    }//GEN-LAST:event_lateralTxtFldKeyTyped

    private void limitTxtFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_limitTxtFldKeyTyped
        pileNodeValueIsChanged = true;
    }//GEN-LAST:event_limitTxtFldKeyTyped

    private void nextBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextBtnActionPerformed
        int elementNumber = itemNumberCmbBox.getSelectedIndex();
        if (pileNodeValueIsChanged) {
            int answer = askUser();
            if(answer == JOptionPane.YES_OPTION)
                applyNodeDataChanges(elementNumber);
        }


        if (elementNumber == itemNumberCmbBox.getItemCount() - 1) {
            elementNumber = 0;
        } else {
            elementNumber += 1;
        }
        itemNumberCmbBox.setSelectedIndex(elementNumber);
    }//GEN-LAST:event_nextBtnActionPerformed

    private void backBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backBtnActionPerformed
        int elementNumber = itemNumberCmbBox.getSelectedIndex();
        if (pileNodeValueIsChanged) {
            int answer = askUser();
            if (answer == JOptionPane.YES_OPTION) {
                applyNodeDataChanges(elementNumber);
            }
        }


        if (elementNumber == 0) {
            elementNumber = itemNumberCmbBox.getItemCount() - 1;
        } else {
            elementNumber -= 1;
        }
        itemNumberCmbBox.setSelectedIndex(elementNumber);
    }//GEN-LAST:event_backBtnActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        int elementNumber = itemNumberCmbBox.getSelectedIndex();
        boolean successful;
        try{
            if (pileNodeValueIsChanged || pileDataValueIsChanged) {
            int answer = askUser();
            if (answer == JOptionPane.YES_OPTION) {
                if (pileDataValueIsChanged) {
                    applyPileDataChanges();
                }
                if (pileNodeValueIsChanged && elementNumber != -1) {
                    applyNodeDataChanges(elementNumber);
                }
            }

        }
           
        }catch(NumberFormatException ex){
            errorLbl.setText("Empty values are not allowed!");
            JOptionPane.showMessageDialog(this, "Invalid Data Values, please double check.", "Error", JOptionPane.ERROR_MESSAGE);
            this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
        }


    }//GEN-LAST:event_formWindowClosing

    private void numOfElemTxtFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_numOfElemTxtFldKeyTyped
        pileDataValueIsChanged = true;
        errorLbl.setText(" ");
    }//GEN-LAST:event_numOfElemTxtFldKeyTyped

    private void pileLengthTxtFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_pileLengthTxtFldKeyTyped
        pileDataValueIsChanged = true;
        errorLbl.setText(" ");
    }//GEN-LAST:event_pileLengthTxtFldKeyTyped

    private void eiTxtFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_eiTxtFldKeyTyped
        pileDataValueIsChanged = true;
        errorLbl.setText(" ");
    }//GEN-LAST:event_eiTxtFldKeyTyped

    private void pileDiaTxtFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_pileDiaTxtFldKeyTyped
        pileDataValueIsChanged = true;
        errorLbl.setText(" ");
    }//GEN-LAST:event_pileDiaTxtFldKeyTyped

    private void numofPilesTxtFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_numofPilesTxtFldKeyTyped
        pileDataValueIsChanged = true;
        errorLbl.setText(" ");
    }//GEN-LAST:event_numofPilesTxtFldKeyTyped

    private void poissonRationTxtFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_poissonRationTxtFldKeyTyped
        pileDataValueIsChanged = true;
        errorLbl.setText(" ");
    }//GEN-LAST:event_poissonRationTxtFldKeyTyped

    private void iterNumTxtFldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_iterNumTxtFldKeyTyped
        pileDataValueIsChanged = true;
        errorLbl.setText(" ");
    }//GEN-LAST:event_iterNumTxtFldKeyTyped

    private void finishBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_finishBtnActionPerformed
        this.setVisible(false);
    }//GEN-LAST:event_finishBtnActionPerformed

    private void numOfElemTxtFldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numOfElemTxtFldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_numOfElemTxtFldActionPerformed

    private void pileNodeDataBackBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pileNodeDataBackBtnActionPerformed
        this.setDefaultCloseOperation(HIDE_ON_CLOSE);
        int elementNumber = itemNumberCmbBox.getSelectedIndex();
        if (pileNodeValueIsChanged || pileDataValueIsChanged) {
            int answer = askUser();
            if (answer == JOptionPane.YES_OPTION) {
                if (pileDataValueIsChanged) {
                    applyPileDataChanges();
                }
                if (pileNodeValueIsChanged) {
                    applyNodeDataChanges(elementNumber);
                }
            }



            mainForm.setData(data);
        }

        dataInputWizardLyPane.setSelectedIndex(0);


    }//GEN-LAST:event_pileNodeDataBackBtnActionPerformed

    private void pileCoBackBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pileCoBackBtnActionPerformed
        dataInputWizardLyPane.setSelectedIndex(1);
    }//GEN-LAST:event_pileCoBackBtnActionPerformed

    private void limitTxtFldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_limitTxtFldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_limitTxtFldActionPerformed

    private void limitTxtFldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_limitTxtFldFocusGained
        limitTxtFld.selectAll();
    }//GEN-LAST:event_limitTxtFldFocusGained

    private void depthTxtFldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_depthTxtFldMouseClicked
        depthTxtFld.selectAll();
    }//GEN-LAST:event_depthTxtFldMouseClicked

    private void modTxtFldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_modTxtFldMouseClicked
        modTxtFld.selectAll();
    }//GEN-LAST:event_modTxtFldMouseClicked

    private void lateralTxtFldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lateralTxtFldMouseClicked
        lateralTxtFld.selectAll();
    }//GEN-LAST:event_lateralTxtFldMouseClicked

    private void limitTxtFldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_limitTxtFldMouseClicked
        limitTxtFld.selectAll();
    }//GEN-LAST:event_limitTxtFldMouseClicked

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
       dataInputWizardLyPane.setSelectedIndex(0);
    }//GEN-LAST:event_formWindowOpened

    private void pileDataCloseBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pileDataCloseBtnActionPerformed
        closeWizard();
    }//GEN-LAST:event_pileDataCloseBtnActionPerformed

    private void nodeDataCloseBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nodeDataCloseBtnActionPerformed
      closeWizard();
    }//GEN-LAST:event_nodeDataCloseBtnActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton backBtn;
    private javax.swing.JLabel controlCommandLogo;
    private javax.swing.JTabbedPane dataInputWizardLyPane;
    private javax.swing.JFormattedTextField depthTxtFld;
    private javax.swing.JLabel eiLbl;
    private javax.swing.JFormattedTextField eiTxtFld;
    private javax.swing.JLabel errorLbl;
    private javax.swing.JButton finishBtn;
    private javax.swing.JComboBox itemNumberCmbBox;
    private javax.swing.JLabel iterNumLbl;
    private javax.swing.JFormattedTextField iterNumTxtFld;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JFormattedTextField lateralTxtFld;
    private javax.swing.JFormattedTextField limitTxtFld;
    private javax.swing.JFormattedTextField modTxtFld;
    private javax.swing.JScrollPane multipleTableScrlPane;
    private javax.swing.JTable multipleViewTbl;
    private javax.swing.JButton nextBtn;
    private javax.swing.JButton nodeDataCloseBtn;
    private javax.swing.JLabel numOfElemLbl;
    private javax.swing.JFormattedTextField numOfElemTxtFld;
    private javax.swing.JLabel numOfPilesLbl;
    private javax.swing.JFormattedTextField numofPilesTxtFld;
    private javax.swing.JButton pileCoBackBtn;
    private javax.swing.JButton pileDataBackBtn;
    private javax.swing.JButton pileDataCloseBtn;
    private javax.swing.JLabel pileDataLogo;
    private javax.swing.JButton pileDataNextBtn;
    private javax.swing.JPanel pileDataPnl;
    private javax.swing.JLabel pileDiaLbl;
    private javax.swing.JFormattedTextField pileDiaTxtFld;
    private javax.swing.JLabel pileLengthLbl;
    private javax.swing.JFormattedTextField pileLengthTxtFld;
    private javax.swing.JButton pileNodeCoordNextBtn;
    private javax.swing.JPanel pileNodeCoordPnl;
    private javax.swing.JButton pileNodeDataBackBtn;
    private javax.swing.JLabel poissonRationLbl;
    private javax.swing.JFormattedTextField poissonRationTxtFld;
    private javax.swing.JPanel surfaceCoordinates;
    // End of variables declaration//GEN-END:variables
}
TOP

Related Classes of GUI.DataInputWizard

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.