/*
 * TablePreview.java
 *
 * Created on June 9, 2006, 8:20 AM
 */

package usda.weru.util.gui;

import com.klg.jclass.table.JCTableEnum;
import de.schlichtherle.io.File;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileFilter;
import usda.weru.util.table.WepsTableMeta;
import com.klg.jclass.table.EditableTableDataModel;
import com.klg.jclass.table.data.AbstractDataSource;
import java.util.ArrayList;
import java.util.List;
import usda.weru.util.table.Column;
import usda.weru.util.table.WepsTableEnum;
import usda.weru.util.table.WepsTableMeta;
import org.jdom.Element;
import usda.weru.util.table.Helper;
import java.beans.PropertyChangeEvent;

/**
 *
 * @author  Joseph Levin
 */
public class Config_n extends javax.swing.JFrame {
    private File c_xmlFile = new File("c:/weps.wrk/weps1.install/tables/configheader.xml");
    
    public Config_n(){
        initComponents();
        setTitle("Config_n");
    }  

    /** 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.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        BG_units = new javax.swing.ButtonGroup();
        tablePanel = new javax.swing.JPanel();
        wepsTable = new usda.weru.util.table.WepsTable();
        JMB_main = new javax.swing.JMenuBar();
        JM_file = new javax.swing.JMenu();
        JMI_open = new javax.swing.JMenuItem();
        JMI_save = new javax.swing.JMenuItem();
        JMI_saveAs = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JSeparator();
        JMI_exit = new javax.swing.JMenuItem();
        JM_units = new javax.swing.JMenu();
        JRBMI_us = new javax.swing.JRadioButtonMenuItem();
        JRBMI_si = new javax.swing.JRadioButtonMenuItem();
        JM_help = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Table Preview");
        tablePanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        org.jdesktop.layout.GroupLayout tablePanelLayout = new org.jdesktop.layout.GroupLayout(tablePanel);
        tablePanel.setLayout(tablePanelLayout);
        tablePanelLayout.setHorizontalGroup(
            tablePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(wepsTable, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 758, Short.MAX_VALUE)
        );
        tablePanelLayout.setVerticalGroup(
            tablePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(wepsTable, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 545, Short.MAX_VALUE)
        );

        JM_file.setText("File");
        JM_file.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JM_fileActionPerformed(evt);
            }
        });

        JMI_open.setMnemonic('o');
        JMI_open.setText("Open");
        JMI_open.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JMI_openActionPerformed(evt);
            }
        });

        JM_file.add(JMI_open);

        JMI_save.setMnemonic('s');
        JMI_save.setText("Save");
        JMI_save.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JMI_saveActionPerformed(evt);
            }
        });

        JM_file.add(JMI_save);

        JMI_saveAs.setMnemonic('a');
        JMI_saveAs.setText("saveAs");
        JMI_saveAs.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JMI_saveAsActionPerformed(evt);
            }
        });

        JM_file.add(JMI_saveAs);

        JM_file.add(jSeparator1);

        JMI_exit.setMnemonic('x');
        JMI_exit.setText("Exit");
        JMI_exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JMI_exitActionPerformed(evt);
            }
        });

        JM_file.add(JMI_exit);

        JMB_main.add(JM_file);

        JM_units.setText("Menu");
        BG_units.add(JRBMI_us);
        JRBMI_us.setMnemonic('u');
        JRBMI_us.setText("US");
        JRBMI_us.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JRBMI_usActionPerformed(evt);
            }
        });

        JM_units.add(JRBMI_us);

        BG_units.add(JRBMI_si);
        JRBMI_si.setMnemonic('s');
        JRBMI_si.setText("SI");
        JRBMI_si.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JRBMI_siActionPerformed(evt);
            }
        });

        JM_units.add(JRBMI_si);

        JMB_main.add(JM_units);

        JM_help.setText("Help");
        JMB_main.add(JM_help);

        setJMenuBar(JMB_main);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(tablePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(tablePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-790)/2, (screenSize.height-626)/2, 790, 626);
    }// </editor-fold>//GEN-END:initComponents

    protected void JRBMI_siActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JRBMI_siActionPerformed
    }//GEN-LAST:event_JRBMI_siActionPerformed

    protected void JRBMI_usActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JRBMI_usActionPerformed
    }//GEN-LAST:event_JRBMI_usActionPerformed

    protected void JMI_exitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JMI_exitActionPerformed
    }//GEN-LAST:event_JMI_exitActionPerformed

    protected void JMI_saveAsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JMI_saveAsActionPerformed
    }//GEN-LAST:event_JMI_saveAsActionPerformed

    protected void JMI_saveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JMI_saveActionPerformed
    }//GEN-LAST:event_JMI_saveActionPerformed

    protected void JMI_openActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JMI_openActionPerformed
    }//GEN-LAST:event_JMI_openActionPerformed

    protected void JM_fileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JM_fileActionPerformed
    }//GEN-LAST:event_JM_fileActionPerformed
    
    /**
     * @param args You can pass the file name of the xml table to use.
     */
    public static void main(final String[] args) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Config_n().setVisible(true);
            }
        });
   }
    

    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    protected javax.swing.ButtonGroup BG_units;
    protected javax.swing.JMenuBar JMB_main;
    protected javax.swing.JMenuItem JMI_exit;
    protected javax.swing.JMenuItem JMI_open;
    protected javax.swing.JMenuItem JMI_save;
    protected javax.swing.JMenuItem JMI_saveAs;
    protected javax.swing.JMenu JM_file;
    protected javax.swing.JMenu JM_help;
    protected javax.swing.JMenu JM_units;
    protected javax.swing.JRadioButtonMenuItem JRBMI_si;
    protected javax.swing.JRadioButtonMenuItem JRBMI_us;
    protected javax.swing.JSeparator jSeparator1;
    protected javax.swing.JPanel tablePanel;
    protected usda.weru.util.table.WepsTable wepsTable;
    // End of variables declaration//GEN-END:variables
    
}
