package main;
|
|
import java.awt.BorderLayout;
|
import java.awt.Dimension;
|
import java.awt.EventQueue;
|
import java.awt.Font;
|
import java.awt.Toolkit;
|
|
import javax.swing.JFrame;
|
import javax.swing.JPanel;
|
import javax.swing.JTabbedPane;
|
import javax.swing.WindowConstants;
|
import javax.swing.event.ChangeEvent;
|
import javax.swing.event.ChangeListener;
|
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.Logger;
|
|
/**
|
* ¹¤¿Ø°æ±¾,¶àºÏÒ»°æ±¾µ÷ÊÔ¹¤¾ß
|
* @author DELL
|
*
|
*/
|
public class main_window_industrial{
|
|
private static final long serialVersionUID = 474825076033661007L;
|
|
public static final int APP_FBS9600 = 0; //»ã¼¯Ä£¿é
|
public static final int APP_BTS4810 = 1; //BTS4810
|
public static final int APP_IEC61850 = 2; //IEC61850
|
|
|
private JPanel jPanel;
|
private JFrame main_frame;
|
|
private JTabbedPane main_tab;
|
|
static Logger m_Log = null;
|
|
static {
|
System.setProperty("log4j.configurationFile", "log4j2_batt_dev.xml");
|
}
|
|
public main_window_industrial() {
|
initGUI();
|
}
|
|
private void initGUI() {
|
main_frame = new JFrame();
|
|
main_frame.setFont(new Font("ËÎÌå", Font.PLAIN, 12));
|
//frmSerialport.setResizable(false);
|
|
main_frame.setIconImage(Toolkit.getDefaultToolkit().getImage(main_window_computer.class.getResource("/main/12164006.png")));
|
main_frame.setBounds(100, 100, 1030, 640);
|
main_frame.setMinimumSize(new Dimension(1030, 640) );
|
main_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
main_frame.setLocationRelativeTo(null);
|
|
//main_frame.setUndecorated(true);// °Ñ±ß¿òÈ¥ÁË£¬ÓÅ»¯µÄЧ¹ûÄÜ¿´µÄ¸üÃ÷ÏÔ
|
main_frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
|
jPanel = new JPanel();
|
//jPanel.setBackground(Color.ORANGE);
|
jPanel.setLayout(new BorderLayout());
|
main_frame.getContentPane().add(jPanel, BorderLayout.CENTER);
|
|
//ÉèÖÃ×óÓҽṹģʽ
|
main_tab = new JTabbedPane(JTabbedPane.LEFT);
|
main_tab.setUI(new MyTabbedPaneUI());
|
|
JPanel jPanel1 = new JPanel();
|
|
|
JPanel jPanel2 = new JPanel();
|
|
|
JPanel jPanel3 = new JPanel();
|
|
|
main_tab.add(jPanel1, "»ã¼¯Ä£¿é");
|
main_tab.add(jPanel2, "BTS4810");
|
main_tab.add(jPanel3, "IEC61850");
|
|
//×ó²àÈí¼þÇл»
|
main_tab.addChangeListener(new ChangeListener() {
|
public void stateChanged(ChangeEvent arg0) {
|
|
int sel_index = main_tab.getSelectedIndex();;
|
if(APP_FBS9600 == sel_index) {
|
//»ã¼¯Ä£¿éµ÷ÊÔ¹¤¾ß
|
|
|
}else if(APP_BTS4810 == sel_index) {
|
//BTS4810µ÷ÊÔ¹¤¾ß
|
|
}else if(APP_IEC61850 == sel_index) {
|
//IEC61850µ÷ÊÔ¹¤¾ß
|
|
}
|
}
|
});
|
|
|
|
jPanel.add(main_tab, BorderLayout.CENTER);
|
//½çÃæ¾ÓÖÐÏÔʾ
|
main_frame.setLocationRelativeTo(null);
|
}
|
|
|
|
public static void main(String[] args) {
|
m_Log = LogManager.getLogger(main_window_computer.class);
|
EventQueue.invokeLater(new Runnable() {
|
public void run() {
|
try {
|
main_window_industrial paneFrame = new main_window_industrial();
|
|
paneFrame.main_frame.setVisible(true);
|
} catch (Exception e) {
|
m_Log.error(e.toString(), e);
|
}
|
}
|
});
|
|
}
|
}
|