package clig;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import javax.swing.border.*;
import java.util.*;
import java.io.FileInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.FileOutputStream;
import java.io.DataOutputStream;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class MainFrame
extends JFrame {
private ConnDB dbConnect = new ConnDB();
JPanel contentPane;
JMenuBar jMenuBar1 = new JMenuBar();
JMenu jMenuSystems = new JMenu();
JMenuItem systemExit = new JMenuItem();
JMenu jMenuHelps = new JMenu();
JMenuItem jMenuHelpAbout = new JMenuItem();
JToolBar jToolBar = new JToolBar();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
ImageIcon image1;
ImageIcon image2;
ImageIcon image3;
BorderLayout borderLayout1 = new BorderLayout();
JPanel jPanel1 = new JPanel();
BorderLayout borderLayout2 = new BorderLayout();
JSplitPane jSplitPane1 = new JSplitPane();
JScrollPane jScrollPane1 = new JScrollPane();
JScrollPane jScrollPane2 = new JScrollPane();
JTextArea jTextArea1 = new JTextArea();
JList jList1;
JPanel jPanel2 = new JPanel();
BoxLayout2 boxLayout21 = new BoxLayout2();
JPanel infoPanel = new JPanel();
JComboBox jTxtFld_DBDriver = new JComboBox();
DefaultListModel defaultListModel1 = new DefaultListModel();
BoxLayout2 boxLayout23 = new BoxLayout2();
JLabel jLbl_DBTables = new JLabel();
JTextField jTxtFld_tables = new JTextField();
JButton jBttn_add = new JButton();
JButton jBttn_Export = new JButton();
JPanel jPanel3 = new JPanel();
BoxLayout2 boxLayout24 = new BoxLayout2();
JLabel jLbl_DBDriver = new JLabel();
JButton jBttn_test = new JButton();
JLabel jLbl_testStatus = new JLabel();
JPanel jPanel4 = new JPanel();
JLabel jLbl_DBInstance = new JLabel();
JComboBox jTxtFld_DBInstance = new JComboBox();
JButton jBttn_delete = new JButton();
TitledBorder titledBorder1;
XYLayout xYLayout1 = new XYLayout();
JPanel jPanel5 = new JPanel();
JLabel jLbl_pass = new JLabel();
JPasswordField jPsswdFld_pass = new JPasswordField();
JLabel jLbl_user = new JLabel();
JTextField jTxtFld_user = new JTextField();
XYLayout xYLayout2 = new XYLayout();
JButton jBttn_SaveAS = new JButton();
JPopupMenu jPopupListEdit = new JPopupMenu();
JMenuItem pAdd = new JMenuItem();
JMenuItem pEdit = new JMenuItem();
JTabbedPane jTabbedPane1 = new JTabbedPane();
JPanel jPanel6 = new JPanel();
JPanel jPanel7 = new JPanel();
JMenuItem pDelete = new JMenuItem();
JMenuItem pExport = new JMenuItem();
XYLayout xYLayout3 = new XYLayout();
XYLayout xYLayout4 = new XYLayout();
JMenuItem pTextCut = new JMenuItem();
JMenuItem pTextPaste = new JMenuItem();
JMenuItem pTextCopy = new JMenuItem();
JMenuItem pTextSelectAll = new JMenuItem();
JPopupMenu jPopupTextArea = new JPopupMenu();
JFileChooser saveFile = new JFileChooser();
JFileChooser selectDriver = new JFileChooser();
JMenuItem driverManage = new JMenuItem();
JMenu jMenuDrivers = new JMenu();
JMenu jMenu1 = new JMenu();
JMenuItem jMenuItem1 = new JMenuItem();
JMenuItem driverLoad = new JMenuItem();
//Construct the frame
public MainFrame() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
jList1 = new JList(defaultListModel1);
titledBorder1 = new TitledBorder("");
jList1.setModel(defaultListModel1);
// jList1.setSelectedIndex(-1);
jList1.setSelectionForeground(Color.white);
jList1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jList1.addMouseListener(new MainFrame_jList1_mouseAdapter(this));
image1 = new ImageIcon(clig.
MainFrame.class.getResource("/images/openFile.png"));
image2 = new ImageIcon(clig.
MainFrame.class.getResource("/images/closeFile.png"));
image3 = new ImageIcon(clig.
MainFrame.class.getResource("/images/help.png"));
contentPane = (JPanel)this.getContentPane();
contentPane.setLayout(borderLayout1);
this.setSize(new Dimension(528, 542));
this.setTitle("DataSnap");
jMenuSystems.setText("System");
jMenuSystems.setActionCommand("System");
jMenuSystems.setMnemonic('S');
systemExit.setText("Exit");
systemExit.setMnemonic(KeyEvent.VK_E);
systemExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke('Q', java.awt.event.KeyEvent.CTRL_MASK, false));
systemExit.addActionListener(new MainFrame_systemExit_ActionAdapter(this));
jMenuHelps.setText("Help");
jMenuHelps.setMnemonic(KeyEvent.VK_H);
jMenuHelpAbout.setText("About");
jMenuHelpAbout.setMnemonic(KeyEvent.VK_A);
jMenuHelpAbout.addActionListener(new MainFrame_jMenuHelpAbout_ActionAdapter(this));
jButton1.setIcon(image1);
jButton1.setToolTipText("Open File");
jButton2.setIcon(image2);
jButton2.setToolTipText("Close File");
jButton3.setIcon(image3);
jButton3.setToolTipText("Help");
jPanel1.setBackground(Color.lightGray);
jPanel1.setLayout(borderLayout2);
jSplitPane1.setContinuousLayout(false);
jSplitPane1.setDividerSize(5);
jSplitPane1.setLeftComponent(jScrollPane1);
jSplitPane1.setRightComponent(jScrollPane2);
// jSplitPane1.setTopComponent(jScrollPane1);
jSplitPane1.setAlignmentX( (float) 0.1);
jScrollPane1.setAlignmentX( (float) 0.5);
jScrollPane1.setAutoscrolls(false);
jTextArea1.setEditable(true);
jTextArea1.setText("");
jTextArea1.addMouseListener(new MainFrame_jTextArea1_mouseAdapter(this));
jScrollPane2.setAlignmentX( (float) 0.5);
jPanel2.setLayout(boxLayout23);
jTxtFld_DBDriver.setPreferredSize(new Dimension(6, 22));
jTxtFld_DBDriver.setEditable(true);
jTxtFld_DBDriver.addFocusListener(new
MainFrame_jTxtFld_DBDriver_focusAdapter(this));
jTxtFld_DBDriver.addKeyListener(new MainFrame_jTxtFld_DBDriver_keyAdapter(this));
infoPanel.setLayout(xYLayout1);
jLbl_DBTables.setText("数据表名:");
jBttn_add.setEnabled(false);
jBttn_add.setText("添加");
jBttn_add.addActionListener(new MainFrame_jBttn_add_actionAdapter(this));
jTxtFld_tables.setEditable(true);
jTxtFld_tables.setText("");
jTxtFld_tables.addFocusListener(new MainFrame_jTxtFld_tables_focusAdapter(this));
jTxtFld_tables.addKeyListener(new MainFrame_jTxtFld_tables_keyAdapter(this));
jBttn_Export.setEnabled(false);
jBttn_Export.setToolTipText("导出所有表的insert语句");
jBttn_Export.setText("导出");
jBttn_Export.addActionListener(new MainFrame_jBttn_Export_actionAdapter(this));
jLbl_DBDriver.setText("数据库驱动:");
jBttn_test.setEnabled(true);
jBttn_test.setText("连 结");
jBttn_test.addActionListener(new MainFrame_jBttn_test_actionAdapter(this));
jLbl_testStatus.setText("连接状态");
jPanel3.setLayout(xYLayout4);
jPanel4.setLayout(xYLayout3);
jLbl_DBInstance.setText("数据库实例:");
jBttn_delete.setEnabled(false);
jBttn_delete.setContentAreaFilled(true);
jBttn_delete.setText("删除");
jBttn_delete.addActionListener(new MainFrame_jBttn_delete_actionAdapter(this));
jTxtFld_DBInstance.setEnabled(true);
jTxtFld_DBInstance.setEditable(true);
jTxtFld_DBInstance.addMouseListener(new MainFrame_jTxtFld_DBI_mouseAdapter(this));
jTxtFld_DBInstance.addKeyListener(new MainFrame_jTxtFld_DBI_keyAdapter(this));
infoPanel.setBorder(BorderFactory.createLin