zsh_root
2024-01-02 7b595546af704983dbafcd0d385c8768ddacefc2
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
package Frame;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.IOException;
import java.util.Iterator;
import java.util.Vector;
import javax.swing.ImageIcon;
import javax.swing.JCheckBox;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;
import javax.swing.event.InternalFrameEvent;
import javax.swing.event.InternalFrameListener;
import javax.swing.table.DefaultTableModel;
import ColorAndFont.ChooseFont;
import ColorAndFont.English;
import ColorAndFont.UIColor;
import ColorAndFont.buttonTitle;
import Judge.JugeNumber;
import Method.GetNowTime;
import Method.JComboBoxModel;
import PbuliClass.JButtonModel;
import PbuliClass.JlableModel;
import PbuliClass.ShowMessage;
import PbuliClass.Systems;
import PbuliClass.greateTables;
import PbuliClass.jinternalFrame;
import anchor.Anchor_Dell;
import tbDataModel.S2data;
import tbDataModel_Dell.DellS2;
import tbDataModel_Dell.Dell_Wifi;
 
/* ´ËÀàÓÃÓÚÍøÂçÄ£¿éS2Ïà¹ØÉèÖÃ*/
public class S2Manage extends jinternalFrame{    
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
 
    Container rq;
    String ip=null;
    JlableModel  jl_name=new JlableModel("Óû§Ãû:");
    JlableModel  jl_pass=new JlableModel("ÃÜ    Âë:");
    JlableModel  jl_shebeiname=new JlableModel("É豸ID:");
    JlableModel  jl_port=new JlableModel("Ä¿±ê¶Ë¿Ú:");
    JlableModel  jl_model=new JlableModel("¹¤×÷ģʽ:");
    JlableModel  jl_ip=new JlableModel("¾²Ì¬IP:");
    JlableModel  jl_wangguan=new JlableModel("Íø    ¹Ø:");
    JlableModel  jl_ziwang=new JlableModel("×ÓÍøÑÚÂë:");
    JlableModel  jl_fuwuip=new JlableModel("Ä¿±êIP:");
    JlableModel  jl_MAC=new JlableModel("MACµØÖ·:");
    JlableModel  jl_bendiport=new JlableModel("±¾µØ¶Ë¿Ú:");
    JlableModel  jl_botelv=new JlableModel("²¨ÌØÂÊ:");
 
    static JTextField  jt_name=new JTextField();
    static JTextField  jt_pass=new JTextField();
    static JTextField  jt_shebeiname=new JTextField();
    static JTextField  jt_port=new JTextField();
    static JComboBoxModel jb_xieyi=null;//ЭÒéÀàÐÍ
    static JTextField  jt_ip=new JTextField();
    static JTextField  jt_wangguan=new JTextField();
    static JTextField  jt_ziwang=new JTextField();
    static JTextField  jt_fuwuip=new JTextField();
    static JTextField  jt_MAC=new JTextField();    
    static JTextField  jt_bendiport=new JTextField();    
    static JTextField  jt_botelv=new JTextField();
    
    String mac=null;
 
    static JTextArea textArea=null;
 
    JButtonModel jbt_serch=null;//ËÑË÷°´Å¥
    JButtonModel jbt_help=null;//°ïÖú
    JButtonModel jbt_save=null;//±£´æ
    JButtonModel jbt_clear=null;//Çå¿Õ
    JButtonModel jbt_reboot=null;//ÖØÆô
    JButtonModel jbt_reset=null;//»Ö¸´³ö³§ÉèÖÃ
    JButtonModel jbt_alertall=null;//ÐÞ¸ÄÈ«²¿
    JButtonModel jbt_openwlan=null;//´ò¿ªÍøÂç
    
 
    JCheckBox jc_ip=null;
    JCheckBox jc_wangguan=null;
    JCheckBox jc_adress=null;
 
 
    JPanel jp_mb=null;//Äϲ¿Ãæ°å
    JScrollPane gd=null;//¹ö¶¯Ãæ°å
    JScrollPane gd2=null;//¹ö¶¯Ãæ°å
    JTable table=null;//ÉêÃ÷±í¸ñ
    static DefaultTableModel tableModel=null;//ÉùÃ÷±í¸ñÄ£ÐÍ
 
    Vector<Vector<String>> rowData=null;
    static boolean alertall=false;
    static int caozuotyep=0;
 
    JComboBoxModel box_anchorid=null;//»ùÕ¾µÄ¼¯ºÏ
    JTextField jf_ancip=new JTextField("255.255.255.255");
    String anchorid=null;
    String path=null;
 
 
    public S2Manage() {
        String title="ÍøÂçÉèÖÃ";
        if(Systems.sys().getLanguage().equals("English")) {
            title="Anchor Network settings";
        }
        this.setBounds(175, 0, 850,540);
        this.setTitle(title);
        rq=getContentPane();//»ñÈ¡ÈÝÆ÷
        rq.setLayout(new BorderLayout());
        rq.setBackground(Color.white);
        rq.add(getJp_mb());
        this.setFrameIcon(new ImageIcon("image/icon/anchoricon.png"));//ÉèÖô°Ìåͼ±ê
        rowData=new Vector<>();    
        jt_name.setEnabled(false);
        jt_pass.setEnabled(false);
        this.addInternalFrameListener(new InternalFrameListener() {
            public void internalFrameOpened(InternalFrameEvent e) {                
            }
 
            public void internalFrameIconified(InternalFrameEvent e) {
 
            }
 
            public void internalFrameDeiconified(InternalFrameEvent e) {
 
            }
 
            public void internalFrameDeactivated(InternalFrameEvent e) {                
            }
 
            public void internalFrameClosing(InternalFrameEvent e) {
            }
 
            public void internalFrameClosed(InternalFrameEvent e) {
                textArea=null;
                tableModel=null;
                DellS2.getRow().removeAllElements();
                cleartx();
                alertall=false;
            }
 
            public void internalFrameActivated(InternalFrameEvent e) {
 
            }
        });
 
    }
 
 
    public JPanel getJp_mb() {
        if(jp_mb==null) {
            jp_mb=new JPanel();
            jp_mb.setBackground(UIColor.getNorth_color());
            jp_mb.setLayout(null);
            jp_mb.add(getJbt_serch());
            jp_mb.add(getJbt_help() );
            jp_mb.add(getGd());
            jp_mb.add(getJbt_save());
            jp_mb.add(getGd2());
            jp_mb.add(getJbt_clear());
            jp_mb.add(getJbt_reboot() );
            jp_mb.add(getJbt_reset() );
            jp_mb.add(getJc_ip());
            jp_mb.add(getJc_wangguan());
            jp_mb.add(getJc_adress());
            jp_mb.add(getJbt_alertall());
            jp_mb.add(getJbt_openwlan());
            jp_mb.add(jl_bendiport);
            jp_mb.add(jt_bendiport);
            jp_mb.add(getBox_anchorid());
            jp_mb.add(jf_ancip);
            jp_mb.add(jl_botelv);
            jp_mb.add(jt_botelv);
            
 
            int x1=410;
            int y1=50;
 
            int x2=630;
            int y2=50;
 
            box_anchorid.setBounds(10,10, 100, 25);
            jf_ancip.setBounds(130,10,200, 25);
            
            
 
 
            gd.setBounds(10, y1,380,380);
            jbt_serch.setBounds(10,y1+400, 60, 25);                        
            jbt_save.setBounds(80, y1+400, 60, 25);            
            jbt_alertall.setBounds(150, y1+400, 90, 25);
            jbt_reset.setBounds(250, y1+400,60, 25);
            jbt_reboot.setBounds(320,y1+400,60, 25);
            jbt_openwlan.setBounds(580,y1+400,80, 25);
            jbt_clear.setBounds(670, y1+400,60, 25);
            jbt_help.setBounds(740, y1+400, 60, 25);
 
 
            gd2.setBounds(x1, y1+240, 400, 130);    
 
 
 
            jp_mb.add(jt_name);
            jp_mb.add(jt_pass);
            jp_mb.add(jt_shebeiname);
            jp_mb.add(jt_port);
            jp_mb.add(getJb_xieyi());
            jp_mb.add(jt_ip);
            jp_mb.add(jt_wangguan);
            jp_mb.add(jt_ziwang);
            jp_mb.add(jt_fuwuip);
            jp_mb.add(jt_MAC);
            jp_mb.add(jl_name);
            jp_mb.add(jl_pass);
            jp_mb.add(jl_shebeiname);
            jp_mb.add(jl_port);
            jp_mb.add(jl_model);
            jp_mb.add(jl_ip);
            jp_mb.add(jl_wangguan);
            jp_mb.add(jl_ziwang);
            jp_mb.add(jl_fuwuip);
            jp_mb.add(jl_MAC);
 
 
 
            //Óû§Ãû
            jl_name.setBounds(x1, y1, 80, 25);
            jt_name.setBounds(x1+80, y1, 100, 25);
 
            //ÃÜÂë
            jl_pass.setBounds(x1,y1+40, 80, 25);
            jt_pass.setBounds(x1+80, y1+40, 100, 25);
 
            //É豸Ãû³Æ
            jl_shebeiname.setBounds(x1, y1+80, 80, 25);
            jt_shebeiname.setBounds(x1+80, y1+80,100, 25);
 
            //·þÎñÆ÷¶Ë¿Ú
            jl_port.setBounds(x1, y1+120, 80, 25);
            jt_port.setBounds(x1+80, y1+120,100, 25);
 
            //¹¤×÷ģʽ
            jl_model.setBounds(x1, y1+160, 80, 25);
            jb_xieyi.setBounds(x1+80, y1+160,100, 25);
 
            //±¾µØ¶Ë¿Ú
            jl_bendiport.setBounds(x1, y1+200, 80, 25);
            jt_bendiport.setBounds(x1+80, y1+200,100, 25);
 
            //ipµØÖ·
            jl_ip.setBounds(x2, y2, 80, 25);
            jt_ip.setBounds(x2+80, y2,100, 25);
            jc_ip.setBounds(x2+185, y2,20, 25);
 
            //Íø¹Ø
            jl_wangguan.setBounds(x2, y2+40, 80, 25);
            jt_wangguan.setBounds(x2+80, y2+40,100, 25);
            jc_wangguan.setBounds(x2+185, y2+40,20, 25);
 
            //×ÓÍøÑÚÂë
            jl_ziwang.setBounds(x2, y2+80, 80, 25);
            jt_ziwang.setBounds(x2+80, y2+80,100, 25);
 
            //·þÎñÆ÷IPµØÖ·
            jl_fuwuip.setBounds(x2, y2+120, 80, 25);
            jt_fuwuip.setBounds(x2+80, y2+120,100, 25);
            jc_adress.setBounds(x2+185, y2+120,20, 25);
 
            //MACµØÖ·
            jl_MAC.setBounds(x2, y2+160, 80, 25);
            jt_MAC.setBounds(x2+80, y2+160,100, 25);
            
            //²¨ÌØÂÊ
            jl_botelv.setBounds(x2, y1+200, 80, 25);
            jt_botelv.setBounds(x2+80, y1+200,100, 25);
 
 
        }
        return jp_mb;
    }
 
 
    /**ËÑË÷°´Å¥*/
    public JButtonModel getJbt_serch() {
        if(jbt_serch==null) {
            jbt_serch=new JButtonModel("ËÑ  Ë÷");
            jbt_serch.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    alertall=false;
                    jc_adress.setSelected(false);
                    jc_ip.setSelected(false);
                    jc_wangguan.setSelected(false);
                    DellS2.getRow().removeAllElements();
                    updateTable();
                    String ip=jf_ancip.getText().trim();
                    if(ip.length()<6) {
                        ShowMessage.zidingyi("ÇëÊäÈëÕýÈ·µÄipµØÖ·"+ip);
                    }
                    DellS2.serch(ip);    
 
                }
            });
 
        }
        return jbt_serch;
    }
 
    /**°ïÖú°´Å¥*/
    public JButtonModel getJbt_help() {
        if(jbt_help==null) {
            jbt_help=new JButtonModel("more");
            jbt_help.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        Runtime.getRuntime().exec("cmd /c systemFiles\\IP\\anchormage.exe");
                    } catch (IOException e1) {
                        e1.printStackTrace();
                        ShowMessage.zidingyi("´ò¿ªÊ§°Ü£¡");
                    }
                }
            });
 
        }
        return jbt_help;
    }
 
    /**±£´æ²ÎÊý*/
    public JButtonModel getJbt_save() {
        if(jbt_save==null) {
            jbt_save=new JButtonModel(buttonTitle.getSave());
            jbt_save.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    String mokuaiid=jt_shebeiname.getText();
                    String ip=jt_ip.getText();                    
                    String wangguan=jt_wangguan.getText();
                    String ziwang=jt_ziwang.getText();
                    //ЭÒéÀàÐÍ
                    String model="00";
                    //²¨ÌØÂÊ
                    String btl=jt_botelv.getText().trim();
 
                    String type=(String) jb_xieyi.getSelectedItem();
                    if(type.equals("TCP-Client")) {
                        model="01";
                    }
 
                    String fuwuport=jt_port.getText().trim();
 
                    if(!JugeNumber.isDigit(fuwuport)) {
                        ShowMessage.zidingyi(fuwuport+"Ä¿±ê¶Ë¿Ú±ØÐëȫΪÊý×Ö...");
                        return;
                    }
 
                    ShowMessage.isIpAdress(ip);
                    ShowMessage.isIpAdress(wangguan);
                    ShowMessage.isIpAdress(ziwang);
                    String adress=jt_fuwuip.getText().trim();
                    String macid=jt_MAC.getText();    
                    if(macid.length() !=12) {
                        ShowMessage.zidingyi(macid+"MACµØÖ·ÓÐÎó£¡");
                        return;
                    }
                    DellS2.alert_s2(ip, wangguan, ziwang, mokuaiid, macid);
                    //´®¿Ú²ÎÊýÍøÂçÉèÖÃ
                    DellS2.alert_s2_chuankou(adress, macid,model,fuwuport,btl);
                    //Ö´ÐÐÖØÆôÉ豸²Ù×÷
                    DellS2.reads2peizhi((byte)0x02,macid);
 
                }
            });
        }
        return jbt_save;
    }
    
    
    
    
 
    /**ˢбí¸ñ·½·¨*/
    public void updateTable() {    
        if(tableModel !=null) {
            tableModel.getDataVector().clear();
            getRowData(DellS2.getRow());
            gd.validate();
        }
    }
 
    /**Ìí¼Ó±í¸ñÐÐÏòÁ¿Êý¾Ý·½·¨*/ 
    public void getRowData( Vector<S2data>  s2_vector ) {
        Iterator<S2data> iterator = s2_vector.iterator();//´´½¨µü´úÆ÷
 
        while (iterator.hasNext()) {//µü´úÆ÷´æÔÚÔªËØ            
            Vector<String> row = new Vector<>();
            S2data s2 =  iterator.next();//½«µü´úÆ÷ÀïÃæµÄÔªËØ¸øµ½list¼¯ºÏ
            row.add(s2.getIp());
            row.add(s2.getName());
            row.add(s2.getMac());
            row.add(s2.getVersion());            
            tableModel.addRow(row);
        }    
    }
 
 
 
    public JScrollPane getGd() {
        if(gd==null) {
            gd=new JScrollPane(getTable());
            gd.getViewport().setBackground(UIColor.getNorth_color());
        }
        return gd;
    }
 
    public JScrollPane getGd2() {
        if(gd2==null) {
            gd2=new JScrollPane(get_text_area());
        }
        return gd2;
    }
 
    /**»ñÈ¡»ùÕ¾±í¸ñµÄ·½·¨*/    
    public JTable getTable() {
        if(table==null) {            
            //Ìí¼Ó±í¸ñÁÐÏòÁ¿
            String[] name1= {"É豸ip","É豸Ãû³Æ","MACµØÖ·","°æ±¾"};//±í¸ñÁÐÃû
            String[] name2= {"Device ip","device name","MAC address","version"};//±í¸ñÁÐÃû
            String[] columnNames=English.columnNames(name1, name2);
            Vector<String> columnName=new Vector<>();
            for(int i=0;i<columnNames.length;i++){
                columnName.add(columnNames[i]);            
            }
 
 
            greateTables tables=new greateTables();
 
            if(tableModel==null) {
                tableModel=new DefaultTableModel(rowData, columnName){  
                    /**
                     * 
                     */
                    private static final long serialVersionUID = 1L;
 
                    //  ÊµÏÖÈÃÕû¸ö±í¸ñ²»²»ÔÊÐí±»±à¼­
                    public boolean isCellEditable(int row,int column){  
                        return false;  
                    }  
                };
                table=tables.getTable(tableModel);
                //ÉèÖÃÖ»ÄÜÑ¡Öе¥ÐÐ
                table.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                //¸ø±í¸ñÌí¼Ó¼àÌýʼþ
                //¸øtable¼ÓÉÏÒ»¸öÊó±êʼþ¼àÌýÆ÷¶ÔÏó
                table.addMouseListener(new MouseListener() {
                    public void mouseReleased(MouseEvent e) {
                        // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
 
                    }
 
                    @Override
                    public void mousePressed(MouseEvent e) {
                        // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
 
                    }
 
                    @Override
                    public void mouseExited(MouseEvent e) {
                        // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
 
                    }
 
                    @Override
                    public void mouseEntered(MouseEvent e) {
                        // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
 
                    }
 
                    @Override
                    public void mouseClicked(MouseEvent e) {
                        alertall=false;
                        cleartx();
                        int row=table.getSelectedRow();
                        if(row<0) {
                            ShowMessage.zidingyi("µ±Ç°Ñ¡ÖÐÐÐΪ£º"+row);
                            return;
                        }
                        mac=(String) table.getValueAt(row, 2);
                        ip=(String) table.getValueAt(row, 0);
                        DellS2.reads2peizhi((byte)0x03,mac);                        
 
                    }
                }); 
 
            }
 
        }
        return table;
 
    }
 
 
 
    public static JTextArea get_text_area() {
        if(textArea==null) {
            textArea=new JTextArea(10,2);
            textArea.setBackground(Color.white);
            textArea.setForeground(Color.black);
            textArea.setFont(ChooseFont.getFont(12));
 
        }
        return textArea;
    }
 
 
    public JButtonModel getJbt_clear() {
 
        if(jbt_clear==null) {
            jbt_clear=new JButtonModel("Çå  ¿Õ");
            jbt_clear.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    textArea.setText("");
                }
            });
        }
        return jbt_clear;
    }
 
 
 
    public static DefaultTableModel getTableModel() {
        return tableModel;
    }
 
 
    public static JTextField getJt_name() {
        return jt_name;
    }
 
 
    public static JTextField getJt_pass() {
        return jt_pass;
    }
 
 
    public static JTextField getJt_shebeiname() {
        return jt_shebeiname;
    }
 
 
    public static JTextField getJt_port() {
        return jt_port;
    }
 
 
    public static JTextField getJt_ip() {
        return jt_ip;
    }
 
 
    public static JTextField getJt_wangguan() {
        return jt_wangguan;
    }
 
 
    public static JTextField getJt_ziwang() {
        return jt_ziwang;
    }
 
 
    public static JTextField getJt_fuwuip() {
        return jt_fuwuip;
    }
 
 
    public static JTextField getJt_MAC() {
        return jt_MAC;
    }
 
 
    public static JTextField getJt_bendiport() {
        return jt_bendiport;
    }
 
 
    public static void setJt_name(JTextField jt_name) {
        S2Manage.jt_name = jt_name;
    }
 
    public void  cleartx() {
        jt_name.setText("");
        jt_pass.setText("");
        jt_shebeiname.setText("");
        jt_bendiport.setText("");
        jt_port.setText("");
        jb_xieyi.setSelectedIndex(0);
        jt_ip.setText("");
        jt_wangguan.setText("");
        jt_ziwang.setText("");
        jt_fuwuip.setText("");
        jt_MAC.setText("");
    }
 
 
    public JButtonModel getJbt_reboot() {
        if(jbt_reboot==null) {
            jbt_reboot=new JButtonModel("ÖØ Æô");
            jbt_reboot.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if(mac==null) {
                        ShowMessage.zidingyi("ûÓÐÑ¡ÖÐÉ豸");
                        return;
                    }
                    DellS2.reads2peizhi((byte)0x02,mac);    
 
                }
            });
        }
        return jbt_reboot;
    }
 
 
    public JButtonModel getJbt_reset() {
        if(jbt_reset==null) {
            jbt_reset=new JButtonModel("ÖØ ÖÃ");
            jbt_reset.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if(mac==null) {
                        ShowMessage.zidingyi("ûÓÐÑ¡ÖÐÉ豸");
                        return;
                    }
//                    DellS2.reads2peizhi((byte)0x0b,mac);
                }
            });
        }
        return jbt_reset;
    }
 
 
    public JCheckBox getJc_ip() {
        if(jc_ip==null) {
            jc_ip=new JCheckBox();
            jc_ip.setBackground(UIColor.getNorth_color());
            jc_ip.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    DellS2.getalls2();    
 
                }
            });
        }
        return jc_ip;
    }
 
 
    public JCheckBox getJc_wangguan() {
        if(jc_wangguan==null) {
            jc_wangguan=new JCheckBox();
            jc_wangguan.setBackground(UIColor.getNorth_color());
            jc_wangguan.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    DellS2.getalls2();    
 
                }
            });
        }
        return jc_wangguan;
    }
 
 
    public JCheckBox getJc_adress() {
        if(jc_adress==null) {
            jc_adress=new JCheckBox();
            jc_adress.setBackground(UIColor.getNorth_color());
            jc_adress.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    DellS2.getalls2();    
 
                }
            });
        }
        return jc_adress;
    }
 
 
    public JButtonModel getJbt_alertall() {
        if(jbt_alertall==null) {
            jbt_alertall=new JButtonModel("È«²¿ÐÞ¸Ä");
            jbt_alertall.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
 
                    if(!jc_adress.isSelected() && !jc_wangguan.isSelected() && !jc_ip.isSelected()) {
                        ShowMessage.zidingyi("ÇëÑ¡ÖÐÐèÒªÐ޸ĵÄÄÚÈÝ·½¿òÄÚ´ò¹³£¡");
                        return;
                    }
 
                    alertall=true;
 
                    String ip=jt_ip.getText().trim();                    
                    String wangguan=jt_wangguan.getText().trim();
                    String adress=jt_fuwuip.getText().trim();
                    ShowMessage.isIpAdress(ip);
                    ShowMessage.isIpAdress(wangguan);
                    String botelv=jt_botelv.getText().trim();
 
 
                    if(!jc_adress.isSelected()) {
                        adress="1";
                    }
 
                    if( !jc_wangguan.isSelected()) {
                        wangguan="1";
                    } 
 
                    if(!jc_ip.isSelected()) {
                        ip="1";
                    } 
 
                    String port=jt_port.getText().trim();
                    if(!JugeNumber.isDigit(port)) {
                        port="8234";
                    }
 
                    DellS2.alertall_S2(ip, wangguan, adress,port,botelv); 
                }
            });
        }
        return jbt_alertall;
    }
 
 
    public static boolean isAlertall() {
        return alertall;
    }
 
 
    public static void setAlertall(boolean alertall) {
        S2Manage.alertall = alertall;
    }
 
    /**ЭÒéÀàÐÍ*/
    public static JComboBoxModel getJb_xieyi() {
        if(jb_xieyi==null) {
            String[] neirong= {"UDP-Client","TCP-Client","TCP-Server","UDP-Server"};
            jb_xieyi=new JComboBoxModel(neirong);
            if (Dell_Wifi.getMoren().getXieyitype()==null){
                return jb_xieyi;
            }
            if(Dell_Wifi.getMoren().getXieyitype().equals("UDP")) {
                jb_xieyi.setSelectedIndex(0);
            }else {
                jb_xieyi.setSelectedIndex(1);
            }
        }
        return jb_xieyi;
    }
 
 
    public JButtonModel getJbt_openwlan() {
        if(jbt_openwlan==null) {
            jbt_openwlan=new JButtonModel(English.name("´ò¿ªÍøÒ³", "Open"));
            jbt_openwlan.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if(ip==null) {
                        ShowMessage.zidingyi("ûÓÐÑ¡ÖÐÐèÒª´ò¿ªµÄÉ豸£¡");
                        return;
                    }
 
                    try {
                        String url ="http://"+ip;
                        java.net.URI uri = java.net.URI.create(url);
                        // »ñÈ¡µ±Ç°ÏµÍ³×ÀÃæÀ©Õ¹
                        java.awt.Desktop dp = java.awt.Desktop.getDesktop();
                        // ÅжÏϵͳ×ÀÃæÊÇ·ñÖ§³ÖÒªÖ´ÐеŦÄÜ
                        if (dp.isSupported(java.awt.Desktop.Action.BROWSE)) {
                            dp.browse(uri);
                            // »ñȡϵͳĬÈÏä¯ÀÀÆ÷´ò¿ªÁ´½Ó
                        }
                    } catch (NullPointerException e1) {
                        // ´ËΪuriΪ¿ÕʱÅ׳öÒì³£
                        e1.printStackTrace();
                    } catch (IOException e1) {
                        // ´ËΪÎÞ·¨»ñȡϵͳĬÈÏä¯ÀÀÆ÷
                        e1.printStackTrace();
                    }
                }
            });
 
        }
        return jbt_openwlan;
    }
 
 
    public static int getCaozuotyep() {
        return caozuotyep;
    }
 
 
    public static void setCaozuotyep(int caozuotyep) {
        S2Manage.caozuotyep = caozuotyep;
    }
 
 
    /**»ñÈ¡»ùÕ¾µÄIDÏÂÀ­¿ò*/
    public JComboBoxModel getBox_anchorid() {
        if( box_anchorid==null) {
            box_anchorid=new JComboBoxModel(Anchor_Dell.get_anchorid3());
            box_anchorid.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 12));//ÉèÖÃ×ÖÌå
            box_anchorid.setEnabled(true);
            //ÏÂÀ­¿ò¿ÉÒÔÊäÈë
            box_anchorid.setEditable(true);
            box_anchorid.addActionListener(new ActionListener() {                
                @Override
                public void actionPerformed(ActionEvent e) {
 
                    anchorid=(String) box_anchorid.getSelectedItem();
                    if(anchorid.equals("ËùÓлùÕ¾")){
                        jf_ancip.setText("255.255.255.255");
                    }else if(anchorid.equals("Ñ¡Ôñ»ùÕ¾")){
                        jf_ancip.setText("255.255.255.255");
                    }else{
                        String ip=Anchor_Dell.get_anchor(anchorid).getAnc_ip();
                        if(ip ==null) {
                            jf_ancip.setText("");
                            return;
                        }else {
                            jf_ancip.setText(ip);
                        }
                        
                    }
                }
            });
        }
        return box_anchorid;
    }
 
 
    public static JTextField getJt_botelv() {
        return jt_botelv;
    }
 
 
    
    /**Ìí¼ÓÎı¾*/
    public static void addmesg(String message) {
        textArea.append(GetNowTime.HH_MM_SS()+":"+message+"/n");
        textArea.setCaretPosition(textArea.getText().length());
    }
}