| | |
| | | import java.awt.event.WindowEvent; |
| | | import java.awt.event.WindowListener; |
| | | import java.util.Vector; |
| | | |
| | | import javax.swing.ComboBoxModel; |
| | | import javax.swing.DefaultComboBoxModel; |
| | | import javax.swing.ImageIcon; |
| | | import javax.swing.JComboBox; |
| | | import javax.swing.JFrame; |
| | |
| | | import javax.swing.JTextArea; |
| | | import javax.swing.JTextField; |
| | | import javax.swing.table.DefaultTableModel; |
| | | |
| | | import data_model.Dell_lixian; |
| | | import data_model.Dell_shebei; |
| | | import data_model.Dell_system; |
| | |
| | | static int num=0; |
| | | JComboBox<String> datatype=null;//数据类型 |
| | | JComboBox<String> baseanchor=null;//选择基准站ID |
| | | static String datatypeis="全部数据类型"; |
| | | static boolean chushi_enhd=false; |
| | | static boolean start_jiexi=false; |
| | | static String tagid="0"; |
| | | JComboBox<String> box=null; |
| | | static String xieyi_type="1";//协议类型选择 |
| | | |
| | | public Index1() {//构造方法 |
| | | Toolkit toolkit = getToolkit();// 获得窗体工具包 |
| | |
| | | //mb.add(getTcpnum()); |
| | | mb.add(getUdpnum()); |
| | | mb.add(getBut_shuaxin1()); |
| | | mb.add(getBox()); |
| | | jl_UDP.setBounds(x+3, y,140,30); |
| | | //jl_tcp.setBounds(x+140, y,120,30); |
| | | //getTcpnum().setBounds(x+140+120+10, y,100,30); |
| | |
| | | |
| | | getBut_start().setBounds(x, y2+h1+20,100,40); |
| | | getBut_clear().setBounds(x+120, y2+h1+20,100,40); |
| | | getBox().setBounds(x+240, y2+h1+20,120,40); |
| | | |
| | | |
| | | |
| | |
| | | public static void baowen_show(String message,String ip,String datatype) { |
| | | if(showare) { |
| | | if(chooseip.equals("1") || ip.equals(chooseip)) { |
| | | if(datatypeis.equals("全部数据类型")) {// |
| | | if(xieyi_type.equals("1")) {// |
| | | are.append(GetNowTime.sss()+":"+message+"\n"); |
| | | are.setCaretPosition(are.getText().length()); |
| | | }else if(datatype.equals(datatypeis)) { |
| | | }else if(datatype.equals(xieyi_type)) { |
| | | are.append(message+"\n"); |
| | | are.setCaretPosition(are.getText().length()); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public JComboBox<String> getBox() { |
| | | if(box==null) { |
| | | box=new JComboBox<String>(); |
| | | String[] neixing= {"原始数据","解析后数据","HEX显示","ASCLL显示"}; |
| | | ComboBoxModel<String > coModel=new DefaultComboBoxModel<>(neixing);//下拉列表模型 |
| | | box.setModel(coModel); |
| | | box.setBackground(Color.white); |
| | | box.setSelectedIndex(2); |
| | | box.addActionListener(new ActionListener() { |
| | | public void actionPerformed(ActionEvent e) { |
| | | if(box.getSelectedIndex()==0) { |
| | | xieyi_type="1"; |
| | | }else if(box.getSelectedIndex()==1) { |
| | | xieyi_type="2"; |
| | | }else if(box.getSelectedIndex()==2) { |
| | | xieyi_type="3"; |
| | | }else if(box.getSelectedIndex()==3) { |
| | | xieyi_type="4"; |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | } |
| | | return box; |
| | | } |
| | | |
| | | public static String getXieyi_type() { |
| | | return xieyi_type; |
| | | } |
| | | |
| | | |
| | | |
| | | } |