DELL
2024-12-20 8e2b25637bf1d2a5f77dbad09cbac05d96453c64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
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);
                }
            }
        });
        
    }
}