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
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
package LedShow;
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 javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JComboBox;
import javax.swing.JPanel;
import javax.swing.JTextField;
 
import ColorAndFont.UIColor;
import Method.IpIsTrue;
import PbuliClass.JButtonModel;
import PbuliClass.JCheckBoxModel;
import PbuliClass.JlableModel;
import PbuliClass.Leds;
import PbuliClass.ShowMessage;
import PbuliClass.jinternalFrame;
/**Êý¾Ýת·¢¹ÜÀí*/
public class LedSet extends jinternalFrame {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
 
 
    JlableModel ip_lable=new JlableModel("LED ipµØÖ·:");
    JlableModel port_lable=new JlableModel("¶Ë¿ÚºÅ:");
    JlableModel biaoti_lable=new JlableModel("±êÌâ:");
    JlableModel dtq_lable=new JlableModel("----------------¶¯Ì¬ÇøÏà¹ØÉèÖó¤¿í²»Äܳ¬¹ýLEDÆÁÄ»³¤¿í----------------");
 
    JlableModel need_show=new JlableModel("¿¼ÇÚÏÔʾÐÅÏ¢:");
    JlableModel gas_show=new JlableModel("ÆøÌåÏÔʾÐÅÏ¢:");
    JlableModel tayTime_lable=new JlableModel("Ò³ÃæÍ£Áôʱ¼ä(s):");
    JlableModel styles_lable=new JlableModel ("ÌØÐ§·ç¸ñÑ¡Ôñ:");
    JlableModel font_lable=new JlableModel("¿¼ÇÚ±êÌâ×ÖÌå:");
    JlableModel gengxintime_lable=new JlableModel("Êý¾Ý¸üÐÂÆµÂÊ(s):");
    JlableModel Jl_xy0=new JlableModel("×ó¡¢ÓÒ¶´ÆðµãX,Y×ø±ê:");
 
    JlableModel jl_ledwh=new JlableModel("LEDÆÁÄ»³¤¡¢¿í:");
    JTextField jf_ledw=new JTextField(Leds.get_tb_led().getLed_w());//LEDÆÁÄ»¿í¶È
    JTextField jf_ledh=new JTextField(Leds.get_tb_led().getLed_h());//LEDÆÁÄ»µÄ¸ß¶È
 
    JlableModel jl_table=new JlableModel("»æÖƱí¸ñµÄÐÐÊý¡¢ÁÐÊý(H,L):");
    JlableModel jl_jx=new JlableModel("¾ØÐÎÆðµã¡¢³¤¿í(x0,y0,w,h):");
    JlableModel jl_h1=new JlableModel("±êÌâÆ«ÒÆ¡¢×ÖÌå´óС(x,y,s):");
    JlableModel jl_h2=new JlableModel("µÚ2ÐÐÆ«ÒÆ¡¢×ÖÌå´óС(x,y,s):");
    JlableModel jl_h3=new JlableModel("µÚ3ÐÐÆ«ÒÆ¡¢×ÖÌå´óС(x,y,s):");
    JlableModel jl_h4=new JlableModel("ÄÚÈÝÐÐÆ«ÒÆ¡¢×ÖÌå´óС(x,y,s):");
 
 
    //±í¸ñÐÐÁÐ
    JTextField jt_th=new JTextField(Leds.get_tb_led().getTh());
    JTextField jt_tl=new JTextField(Leds.get_tb_led().getTl());
 
    JTextField Jt_x0=new JTextField(Leds.get_tb_led().getBaoliu1());
    JTextField Jt_x1=new JTextField(Leds.get_tb_led().getBaoliu2());
 
    //¾ØÐÎÆðµã×ø±ê³¤¿í(x,y,w,h)
    JTextField jt_jx=new JTextField(Leds.get_tb_led().getJx());
    JTextField jt_jy=new JTextField(Leds.get_tb_led().getJy());
    JTextField jt_jW=new JTextField(Leds.get_tb_led().getjW());
    JTextField jt_jh=new JTextField(Leds.get_tb_led().getJh());
 
    //µÚÒ»ÐÐ×ø±ê×ÖÌå´óС
    JTextField jt_title_x=new JTextField(Leds.get_tb_led().getTitle_x()); 
    JTextField jt_title_y=new JTextField(Leds.get_tb_led().getTitle_y());  
    JTextField jt_title_S=new JTextField(Leds.get_tb_led().getTitle_S());
 
    //µÚ2ÐÐ×ø±ê×ÖÌå´óС
    JTextField jt_time_x=new JTextField(Leds.get_tb_led().getTime_x()); 
    JTextField jt_time_y=new JTextField(Leds.get_tb_led().getTime_y()); 
    JTextField jt_time_s=new JTextField(Leds.get_tb_led().getTime_s()); 
 
    //µÚ3ÐÐ×ø±ê×ÖÌå´óС
    JTextField jt_kq_x=new JTextField(Leds.get_tb_led().getKq_x());   
    JTextField jt_kq_y=new JTextField(Leds.get_tb_led().getKq_y());   
    JTextField jt_kq_s=new JTextField(Leds.get_tb_led().getKq_s());
    JTextField jt_kq_g=new JTextField(Leds.get_tb_led().getKq_g());
 
    //µÚ4ÐÐ×ø±ê×ÖÌå´óС   
    JTextField jt_shx=new JTextField(Leds.get_tb_led().getShx());    
    JTextField jt_shy=new JTextField(Leds.get_tb_led().getShy());     
    JTextField jt_shs=new JTextField(Leds.get_tb_led().getShs());     
    JTextField jt_shg=new JTextField(Leds.get_tb_led().getShg());
 
 
 
    JTextField  ip_fileld=null;
    JTextField  port_fileld=null;
    JTextField  biaoti_fileld=null;
    JTextField  tayTime_fileld=null;
    JTextField font_fileld=null;
    JTextField  gengxintime_fileld=null;
    JComboBox<String> styles_box=null;
 
 
    JButtonModel openled_button=null;
    JButtonModel closed_button=null;
    JButtonModel liangdujia_button=null;//ÁÁ¶È¼Ó°´Å¥
    JButtonModel liangdujian_button=null;//ÁÁ¶È¼õ°´Å¥
    JButtonModel save_button=null;//±£´æ
    JButtonModel screen_conect_button=null;//Á¬½ÓÆÁÄ»
    JButtonModel time_button=null;//Á¬½ÓÆÁÄ»
 
    JCheckBoxModel jc_startLed=null;//¿ªÆôLEDͶÆÁ¹¦ÄÜ
    JCheckBoxModel jc_startleft=null;//¿ªÆô×óËíµÀ¿¼ÇÚ
    JCheckBoxModel jc_startright=null;//¿ªÆôÓÒËíµÀ¿¼ÇÚ
    JCheckBoxModel jc_starttime=null;//¿ªÆôʱ¼äÏÔʾ
    JCheckBoxModel jc_startgas=null;//¿ªÆôÆøÌåͶÆÁ
 
 
    JCheckBoxModel jc_show_name=null; 
    JCheckBoxModel jc_show_kahao=null; 
    JCheckBoxModel  jc_show_bumen=null;
    JCheckBoxModel  jc_show_quyu=null; 
    JCheckBoxModel  jc_show_time=null; 
    JCheckBoxModel  jc_show_distance=null;
    JCheckBoxModel  jc_gas_name=null;
    JCheckBoxModel  jc_gas_type=null; 
    JCheckBoxModel  jc_gas_nongdu=null; 
    JCheckBoxModel  jc_gas_quyu=null; 
    JCheckBoxModel  jc_gas_time=null;  
    JCheckBoxModel  jc_gas_state=null;
 
 
 
    JPanel mb=null;
    String open="1";//ĬÈÏLED´ò¿ª
    int light=8;
    int style_num=2;
 
 
 
 
 
    public LedSet() {//¹¹Ôì·½·¨
        this.setTitle("LEDͶÆÁÉèÖÃ");
        Container rq=getContentPane();//»ñÈ¡ÈÝÆ÷
        rq.setLayout(new BorderLayout());
        rq.setBackground(UIColor.getNorth_color());
        rq.add(getMb(),BorderLayout.CENTER);
        this.setFrameIcon(new ImageIcon("image/icon/LED.png"));//ÉèÖô°Ìåͼ±ê
        this.setSize(890,705);
 
    }
 
 
 
 
 
    public JTextField getIp_fileld() {
        if(ip_fileld==null) {
            ip_fileld=new JTextField(10);
            ip_fileld.setText(Leds.get_tb_led().getIp());
 
        }
        return ip_fileld;
    }
 
 
 
 
    public JTextField getPort_fileld() {
        if(port_fileld==null) {
            port_fileld=new JTextField(10);
            port_fileld.setText(Leds.get_tb_led().getPort());
        }
        return port_fileld;
    }
 
 
 
 
 
    public JTextField getBiaoti_fileld() {
        if(biaoti_fileld==null) {
            biaoti_fileld=new JTextField(10);
            biaoti_fileld.setText(Leds.get_tb_led().getTitle());
        }
        return biaoti_fileld;
    }
 
 
 
 
    public JButtonModel getOpenled_button() {
        if(openled_button==null) {
            openled_button=new JButtonModel("´ò¿ªÍ¶ÆÁ");
            openled_button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
                    open="1";
                    openled_button.setBackground(Color.green);
                    openled_button.setEnabled(false);
                    closed_button.setBackground(Color.gray);
                    closed_button.setEnabled(true);
                    Leds.alert_led_open(open);
                    LedCase.open_screen();//¿ª¹ØLEDÆÁÄ»
 
                }
            });
        }
        return openled_button;
    }
 
 
 
 
    public JButtonModel getClosed_button() {
        if(closed_button==null) {
            closed_button=new JButtonModel("¹Ø±ÕͶÆÁ");
            closed_button.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
                    open="0";
                    closed_button.setBackground(Color.green);
                    openled_button.setBackground(Color.gray);
                    closed_button.setEnabled(false);
                    openled_button.setEnabled(true);
                    Leds.alert_led_open(open);
                    LedCase.open_screen();//¿ª¹ØLEDÆÁÄ»
                }
            });
        }
        return closed_button;
    }
 
 
 
 
    public JButtonModel getLiangdujia_button() {
        if(liangdujia_button==null) {
            liangdujia_button=new JButtonModel("ÆÁÄ»ÁÁ¶È+");
            liangdujia_button.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
                    if(light<16) {
                        light++;
                        liangdujia_button.setText("ÆÁÄ»ÁÁ¶È+"+light);
                        liangdujian_button.setText("ÆÁÄ»ÁÁ¶È-");
                        Leds.alert_led_light(String.valueOf(light));
 
                    }else {
                        ShowMessage.zidingyi("µ±Ç°ÆÁÄ»ÁÁ¶ÈÒѾ­Îª×îÁÁÁËŶ£¡");
                        return;
                    }
 
                }
            });
        }
        return liangdujia_button;
    }
 
 
 
 
    public JButtonModel getLiangdujian_button() {
        if(liangdujian_button==null) {
            liangdujian_button=new JButtonModel("ÆÁÄ»ÁÁ¶È-");
            liangdujian_button.addActionListener(new ActionListener() {                
                @Override
                public void actionPerformed(ActionEvent e) {
                    // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
                    if(1<light) {
                        light--;
                        liangdujian_button.setText("ÆÁÄ»ÁÁ¶È-"+light);
                        liangdujia_button.setText("ÆÁÄ»ÁÁ¶È+");
                        Leds.alert_led_light(String.valueOf(light));
                    }else {
                        ShowMessage.zidingyi("µ±Ç°ÆÁÄ»ÁÁ¶ÈÒѾ­Îª×î°µÁËŶ£¡");
                        return;
                    }
                }
            });
        }
        return liangdujian_button;
    }
 
 
    public JButtonModel get_screen_connect() {
        if(screen_conect_button==null) {
            screen_conect_button=new JButtonModel("¿ªÊ¼½ÚÄ¿");
            screen_conect_button.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
                    try {
                        LedCase.ding_shi_qi();
                    } catch (Exception e1) {
                        // TODO ×Ô¶¯Éú³ÉµÄ catch ¿é
                        e1.printStackTrace();
                    }
                    screen_conect_button.setBackground(Color.yellow);
 
                }
            });
        }
        return screen_conect_button;
    }
 
    /**ʱ¼äУ׼°´Å¥*/
    public JButtonModel get_time() {
        if(time_button==null) {
            time_button=new JButtonModel("ʱ¼äУ׼");
            time_button.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
                    LedCase.time_jiaozhun();
                    time_button.setBackground(Color.blue);
 
                }
            });
        }
        return time_button;
 
    }
 
 
 
    public JButtonModel getSave_button() {
        if(save_button==null) {
            save_button=new JButtonModel("±£´æÉèÖÃ");
            save_button.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
                    String ip=ip_fileld.getText().trim();
                    String port=port_fileld.getText().trim();
                    String title=biaoti_fileld.getText().trim();
                    String tayTime=tayTime_fileld.getText().trim();
                    String gengxintime=gengxintime_fileld.getText().trim();
                    if(!IpIsTrue.ipCheck(ip)) {
                        ShowMessage.zidingyi("ipµØÖ·¸ñʽ²»ºÏ·¨Çë¼ì²é£¡");
                        return;
                    }
 
                    if(port.equals("")) {
                        ShowMessage.zidingyi("Êý¾Ý¶Ë¿Ú²»ÄÜΪ¿Õ£¡");
                        return;                        
                    }
 
 
                    String close="0";
                    if(jc_startLed.isSelected()) {
                        close="1";
                    }
 
                    String left="0";
                    if(jc_startleft.isSelected()) {
                        left="1";
                    }
 
                    String right="0";
                    if(jc_startright.isSelected()) {
                        right="1";
                    }
                    String time="0";
                    if(jc_starttime.isSelected()) {
                        time="1";
                    }
                    String gas="0";
                    if(jc_startgas.isSelected()) {
                        gas="1";
                    }
 
 
                    String show_name="0";
                    String show_kahao="0";
                    String show_bumen="0";   
                    String show_quyu="0";  
                    String show_time="0";  //½ø¶´Ê±¼ä
                    String show_distance="0";  
                    String gas_name="0";
                    String gas_type="0"; 
                    String gas_nongdu="0"; 
                    String gas_quyu="0";
                    String gas_time="0";   
                    String gas_state="0";
                    String timeshow="0";
 
 
                    if(jc_show_name.isSelected()) {
                        show_name="1";
                    }
 
                    if(jc_show_kahao.isSelected()) {
                        show_kahao="1";                          
                    }
 
                    if( jc_show_bumen.isSelected()) {
                        show_bumen="1";                         
                    }
 
                    if( jc_show_quyu.isSelected()) {
                        show_quyu="1"; 
                    }
 
                    if( jc_show_time.isSelected()) { 
                        show_time="1"; 
                    }
 
                    if( jc_show_distance.isSelected()) {
                        show_distance="1";
                    }
 
                    if( jc_gas_name.isSelected()) {
                        gas_name="1";
                    }
 
                    if( jc_gas_type.isSelected()) {
                        gas_type="1";
                    }
                    if( jc_gas_nongdu.isSelected()) {
                        gas_nongdu="1";
                    }
 
                    if( jc_gas_quyu.isSelected()) {
                        gas_quyu="1";
                    }
 
                    if( jc_gas_time.isSelected()) {
                        gas_time="1";
                    } 
 
                    if( jc_gas_state.isSelected()) {
                        gas_state="1";
                    }
 
                    //¿ªÆôʱ¼äÏÔʾ
                    if(jc_starttime.isSelected()) {
                        timeshow="1";
                    }
 
                    //±í¸ñÐÐÁÐ
                    String th=jt_th.getText().trim();
                    String tl=jt_tl.getText().trim();
 
                    String led_w=jf_ledw.getText().trim();
                    String led_h=jf_ledh.getText().trim();
 
 
                    //¾ØÐÎÆðµã×ø±ê³¤¿í(x,y,w,h)
                    String jx=jt_jx.getText().trim();
                    String jy=jt_jy.getText().trim();
                    String jW=jt_jW.getText().trim();
                    String jh=jt_jh.getText().trim();
 
                    int qx=Integer.parseInt(jx);
                    int qy=Integer.parseInt(jy);
 
                    int aw=Integer.parseInt(led_w);
                    int ah=Integer.parseInt(led_h);
 
                    int bw=Integer.parseInt(jW);
                    int bh=Integer.parseInt(jh);
 
                    if(bw>aw || bh>ah) {
                        ShowMessage.zidingyi_24("¾ØÐοòµÄ³¤¿í²»ÄÜ´óÓÚLEBÆÁÄ»³¤¿í...");
                        return;
                    }
 
                    if((qx+bw)>aw || (qy+bh)>ah) {
                        ShowMessage.zidingyi_24("¾ØÐÎÆðµã+³¤¿í²»ÄÜ´óÓÚÆÁÄ»³¤¿í...");
                        return;                        
                    }
 
                    //µÚÒ»ÐÐ×ø±ê×ÖÌå´óС
                    String title_x=jt_title_x.getText().trim(); 
                    String title_y=jt_title_y.getText().trim();  
                    String title_S=jt_title_S.getText().trim(); 
 
                    //µÚ2ÐÐ×ø±ê×ÖÌå´óС
                    String time_x=jt_time_x.getText().trim(); 
                    String time_y=jt_time_y.getText().trim(); 
                    String time_s=jt_time_s.getText().trim();
 
                    //µÚ3ÐÐ×ø±ê×ÖÌå´óС
                    String kq_x=jt_kq_x.getText().trim();
                    String kq_y=jt_kq_y.getText().trim(); 
                    String kq_s=jt_kq_s.getText().trim();
 
                    //µÚ4ÐÐ×ø±ê×ÖÌå´óС   
                    String shx= jt_shx.getText().trim();   
                    String shy=jt_shy.getText().trim();      
                    String shs= jt_shs.getText().trim(); 
 
                    //×ó¶´x0,ÓÒ¶´x0
 
                    String baoliu1=Jt_x0.getText().trim();
                    String baoliu2=Jt_x1.getText().trim();
 
                    Leds.alert_tb_led(
                            ip,           
                            port,   
                            open,   
                            close, 
                            String.valueOf(light),
                            title,                                                        
                            left,
                            right,
                            time,
                            gas,
                            tayTime,
                            gengxintime, 
                            title_x,
                            title_y,
                            title_S,
                            time_x,
                            time_y,
                            time_s,
                            kq_x,
                            kq_y,
                            kq_s,
                            "0",
                            shx,
                            shy,
                            shs,
                            "0",
                            led_w,
                            led_h,
                            show_name,  
                            show_kahao,  
                            show_bumen, 
                            show_quyu,
                            show_time,
                            show_distance,  
                            gas_name,
                            gas_type, 
                            gas_nongdu,  
                            gas_quyu,
                            gas_time,
                            gas_state, 
                            timeshow,
                            jx, 
                            jy, 
                            jW,   
                            jh,  
                            th,  
                            tl,
                            baoliu1,
                            baoliu2
                            );
 
                }
            });
        }
        return save_button;
    }
 
 
 
    public JCheckBoxModel getStartLed() {
        if(jc_startLed==null) {
            jc_startLed=new JCheckBoxModel("¿ªÆôLEDͶÆÁ¹¦ÄÜ",Leds.get_tb_led().getClose());
        }
        return jc_startLed;
    }
 
 
 
 
    //×óËíµÀ¿¼ÇÚÐÅÏ¢
    public JCheckBoxModel getStartleft() {
        if(jc_startleft==null) {
            jc_startleft=new JCheckBoxModel("¿ªÆô×óËíµÀͶÆÁ",Leds.get_tb_led().getLeft());            
        }
        return jc_startleft;
    }
 
    //×óËíµÀ¿¼ÇÚÐÅÏ¢
    public JCheckBoxModel getStartright() {
        if(jc_startright==null) {
            jc_startright=new JCheckBoxModel("¿ªÆôÓÒËíµÀͶÆÁ",Leds.get_tb_led().getRight());
 
        }
        return jc_startright;
    }
 
 
 
 
 
 
 
    public JCheckBoxModel getStarttime() {
        if(jc_starttime==null) {
            jc_starttime=new JCheckBoxModel("¿ªÆôʱ¼äÏÔʾ",Leds.get_tb_led().getTimeshow());
        }
        return jc_starttime;
    }
 
 
 
 
 
    public JCheckBoxModel getStartgas() {
        if(jc_startgas==null) {
            jc_startgas=new JCheckBoxModel("¿ªÆôÆøÌåͶÆÁ",Leds.get_tb_led().getGas());
        }
        return jc_startgas;
    }
 
 
 
    public JTextField getTayTime_fileld() {
        if(tayTime_fileld==null) {
            tayTime_fileld=new JTextField(Leds.get_tb_led().getTayTime());
        }
        return tayTime_fileld;
    }
 
 
 
 
    public JTextField getGengxintime_fileld() {
        if(gengxintime_fileld==null) {
            gengxintime_fileld=new JTextField(Leds.get_tb_led().getGengxintime());
        }
        return gengxintime_fileld;
    }
 
 
    public JComboBox<String> getStyles_box() {
        String[] styl= {"Ëæ»úÏÔʾ","¾²Ö¹ÏÔʾ","¿ìËÙ´ò³ö","Ïò×óÒÆ¶¯","Ïò×óÁ¬ÒÆ","ÏòÉÏÒÆ¶¯","ÏòÉÏÁ¬ÒÆ"};
        if(styles_box==null) {
            styles_box=new JComboBox<>();//´´½¨ÏÂÀ­¿ò¶ÔÏó
            styles_box.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 12));//ÉèÖÃ×ÖÌå            
            ComboBoxModel<String > coModel=new DefaultComboBoxModel<>(styl);//ÏÂÀ­ÁбíÄ£ÐÍ            
            styles_box.setModel(coModel);    
            styles_box.setSelectedIndex(3);//
            styles_box.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if(styles_box.getSelectedIndex()==0) {
                        style_num=0;
                    }else if(styles_box.getSelectedIndex()==1) {
                        style_num=1;
                    }else if(styles_box.getSelectedIndex()==2) {
                        style_num=2;
                    }else if(styles_box.getSelectedIndex()==3) {
                        style_num=3;
                    }else if(styles_box.getSelectedIndex()==4) {
                        style_num=4;
                    }else if(styles_box.getSelectedIndex()==5) {
                        style_num=5;
                    }else if(styles_box.getSelectedIndex()==6) {
                        style_num=6;
                    }
 
                }
            });
        }
        return styles_box;
    }
 
 
 
 
 
    public JPanel getMb() {
        if(mb==null) {
            int x=30;
            int y=20;
            int h=25;
            int g=20;
            int gao=290;
            int b=40;
 
            mb=new JPanel();
            mb.setLayout(null);
            mb.setBackground(UIColor.getNorth_color());
            mb.add(getLiangdujia_button());
            mb.add(getLiangdujian_button());
            mb.add(getIp_fileld());
            mb.add(getPort_fileld());
            mb.add(getBiaoti_fileld());
            mb.add(getStartleft());
            mb.add(getStartright());
            mb.add(getStarttime());
            mb.add(getStartgas());
            mb.add(getOpenled_button());
            mb.add(getClosed_button());//
            mb.add(getSave_button());
            mb.add(getStartLed());
            mb.add(get_screen_connect());
            mb.add(get_time());
            mb.add(ip_lable);
            mb.add(port_lable);
            mb.add(biaoti_lable);
            mb.add(dtq_lable);
            mb.add(tayTime_lable);
            mb.add(font_lable);
            mb.add(gengxintime_lable);
            mb.add(getTayTime_fileld());
            mb.add(getGengxintime_fileld());
            mb.add( getShow_name()); 
            mb.add( getShow_kahao());
            mb.add( getShow_bumen());
            mb.add( getShow_quyu());
            mb.add( getShow_time());
            mb.add( getShow_distance());
            mb.add( getGas_name());
            mb.add( getGas_type());
            mb.add( getGas_nongdu()); 
            mb.add( getGas_quyu());
            mb.add( getGas_time());
            mb.add( getGas_state());
            mb.add( need_show);
            mb.add( gas_show);
            mb.add( jl_table);
            mb.add( jl_jx);
            mb.add( jl_h1);
            mb.add( jl_h2);
            mb.add( jl_h3);
            mb.add( jl_h4);
            mb.add(Jl_xy0);
            mb.add(Jt_x0);
            mb.add(Jt_x1);
 
 
            //±í¸ñÐÐÁÐ
            mb.add(  jt_th);
            mb.add(  jt_tl);
 
 
            //¾ØÐÎÆðµã×ø±ê³¤¿í(x,y,w,h)
            mb.add(  jt_jx);
            mb.add(  jt_jy);
            mb.add(  jt_jW);
            mb.add(  jt_jh);
 
            //µÚÒ»ÐÐ×ø±ê×ÖÌå´óС
            mb.add(  jt_title_x); 
            mb.add(  jt_title_y);  
            mb.add(  jt_title_S);
 
            //µÚ2ÐÐ×ø±ê×ÖÌå´óС
            mb.add(  jt_time_x);
            mb.add(  jt_time_y); 
            mb.add(  jt_time_s);
 
            //µÚ3ÐÐ×ø±ê×ÖÌå´óС
            mb.add(  jt_kq_x);   
            mb.add(  jt_kq_y );
            mb.add(  jt_kq_s);
 
            //µÚ4ÐÐ×ø±ê×ÖÌå´óС   
            mb.add(  jt_shx  ); 
            mb.add(  jt_shy );   
            mb.add(  jt_shs  );
 
 
 
 
            //±í¸ñÐÐÁÐ
            jl_table.setBounds(x,gao+60, 200, h);
            jt_th.setBounds(x+200,gao+60,50,h);
            jt_tl.setBounds(x+250+g,gao+60,50, h);
 
 
            //¾ØÐÎÆðµã×ø±ê³¤¿í(x,y,w,h)
            jl_jx.setBounds(x, gao+60+b, 200, h);
            jt_jx.setBounds(x+200, gao+60+b,50, h);
            jt_jy.setBounds(x+250+g,gao+60+b,50, h);
            jt_jW.setBounds(x+300+2*g,gao+60+b,50, h);
            jt_jh.setBounds(x+350+3*g,gao+60+b,50, h);
 
            //µÚÒ»ÐÐ×ø±ê×ÖÌå´óС
            jl_h1.setBounds(x, gao+60+2*b, 200, h);
            jt_title_x .setBounds(x+200, gao+60+2*b,50, h);
            jt_title_y .setBounds(x+250+g,gao+60+2*b,50, h);
            jt_title_S.setBounds(x+300+2*g,gao+60+2*b,50, h);
 
            //µÚ2ÐÐ×ø±ê×ÖÌå´óС
            jl_h2.setBounds(x, gao+60+3*b, 200, h);
            jt_time_x.setBounds(x+200, gao+60+3*b,50, h);
            jt_time_y .setBounds(x+250+g,gao+60+3*b,50, h);
            jt_time_s.setBounds(x+300+2*g,gao+60+3*b,50, h);
 
            //µÚ3ÐÐ×ø±ê×ÖÌå´óС
            jl_h3.setBounds(x, gao+60+4*b, 200, h);
            jt_kq_x .setBounds(x+200, gao+60+4*b,50, h);
            jt_kq_y .setBounds(x+250+g,gao+60+4*b,50, h);
            jt_kq_s.setBounds(x+300+2*g,gao+60+4*b,50, h);
 
            //µÚ4ÐÐ×ø±ê×ÖÌå´óС  
            jl_h4.setBounds(x, gao+60+5*b, 200, h);
            jt_shx  .setBounds(x+200, gao+60+5*b,50, h);
            jt_shy .setBounds(x+250+g,gao+60+5*b,50, h);  
            jt_shs .setBounds(x+300+2*g,gao+60+5*b,50, h);
 
            need_show.setBounds(x,gao-5,100,h);
            jc_show_name.setBounds(130,gao-5,60,h); 
            jc_show_kahao.setBounds(200,gao-5,60,h);
            jc_show_bumen.setBounds(270,gao-5,60,h);
            jc_show_quyu.setBounds(350,gao-5,60,h);
            jc_show_time.setBounds(430,gao-5,100,h);
            jc_show_distance.setBounds(550,gao-5,100,h);
 
 
            gas_show.setBounds(x,gao+25,100,h);
            jc_gas_name.setBounds(130,gao+25,60,h);
            jc_gas_type.setBounds(200,gao+25,60,h);
            jc_gas_nongdu.setBounds(270,gao+25,60,h);
            jc_gas_quyu.setBounds(350,gao+25,60,h);
            jc_gas_time.setBounds(430,gao+25,100,h);
            jc_gas_state.setBounds(550,gao+25,100,h);
 
 
 
 
 
 
            //µÚÒ»ÐÐLEDipµØÖ·
            ip_lable.setBounds(x,y, 80, h);
            ip_fileld.setBounds(x+80+g,y,200, h);
 
            //¶Ë¿ÚºÅ
            port_lable.setBounds(x+280+2*g,y, 60, h);
            port_fileld.setBounds(x+340+2*g,y,80, h);
 
            //LEDÆÁÄ»³¤¿í
            jl_ledwh.setBounds(x+420+3*g,y,120, h);
            mb.add(jl_ledwh);
            mb.add(jf_ledw);
            mb.add(jf_ledh);
            jf_ledw.setBounds(x+540+3*g,y,50, h);
            jf_ledh.setBounds(x+590+4*g,y,50, h);
 
 
            //µÚ¶þÐÐ
            openled_button.setBounds(x,y+b, 80, h);
            closed_button.setBounds(x+80+g, y+b, 80, h);
            liangdujia_button.setBounds(x+160+2*g,y+b,100, h);
            liangdujian_button.setBounds(x+260+3*g,y+b,100, h);
            time_button.setBounds(x+360+4*g,y+b,120, h);
 
 
 
            //±êÌâ
            biaoti_lable.setBounds(x,y+2*b,40, h);
            biaoti_fileld.setBounds(x+40,y+2*b,600, h);
 
 
            //µÚÈýÐÐ
            jc_startleft.setBounds(x,y+3*b,130, h);
            jc_startright.setBounds(x+130+g,y+3*b,130, h);
            jc_starttime.setBounds(x+260+2*g,y+3*b,130, h);
            jc_startgas.setBounds(x+390+3*g,y+3*b,130, h);
            jc_startLed.setBounds(x+520+4*g,y+3*b,150, h);
 
 
 
            //Ò³ÃæÍ£Áôʱ¼ä
            dtq_lable.setBounds(x,200,700,h);
            tayTime_lable.setBounds(x,245,120,h);
            tayTime_fileld.setBounds(x+120,245,50,h);
 
            //Êý¾Ý¸üÐÂÆµÂÊ
            gengxintime_lable.setBounds(x+170+g,245,120,h);
            gengxintime_fileld.setBounds(x+290+g,245,40,h);
 
            Jl_xy0.setBounds(x+290+g+60,245,160,h);
            Jt_x0.setBounds(x+290+g+220,245,80,h);
            Jt_x1.setBounds(x+290+g+320,245,80,h);
 
 
            save_button.setBounds(270,gao+335,120,h);
            screen_conect_button.setBounds(450,gao+335,120, h);
 
 
 
 
            if(Leds.get_tb_led().getOpen().equals("1")) {
                openled_button.setBackground(Color.green);
            }else {
                closed_button.setBackground(Color.green);
            }
 
 
 
        }
        return mb;
    }
 
 
 
 
 
    public JCheckBoxModel getShow_name() {
        if(jc_show_name==null) {
            jc_show_name=new JCheckBoxModel("ÐÕÃû",Leds.get_tb_led().getShow_name());}
 
        return jc_show_name;
    }
 
 
 
 
 
    public JCheckBoxModel getShow_kahao() {
        if(jc_show_kahao==null) {
            jc_show_kahao=new JCheckBoxModel("¿¨ºÅ",Leds.get_tb_led().getShow_kahao());
        }
        return jc_show_kahao;
    }
 
 
 
 
 
    public JCheckBoxModel getShow_bumen() {
        if(jc_show_bumen==null) {
            jc_show_bumen=new JCheckBoxModel("²¿ÃÅ",Leds.get_tb_led().getShow_bumen());            
        }
        return jc_show_bumen;
    }
 
 
 
 
 
    public JCheckBoxModel getShow_quyu() {
        if(jc_show_quyu==null) {
            jc_show_quyu=new JCheckBoxModel("ÇøÓò",Leds.get_tb_led().getShow_quyu());            
        }
        return jc_show_quyu;
    }
 
 
 
 
 
    public JCheckBoxModel getShow_time() {
        if(jc_show_time==null) {
            jc_show_time=new JCheckBoxModel("½ø¶´Ê±¼ä",Leds.get_tb_led().getShow_time());            
        }
        return jc_show_time;
    }
 
 
 
 
 
    public JCheckBoxModel getShow_distance() {
        if(jc_show_distance==null) {
            jc_show_distance=new JCheckBoxModel("¶´¿Ú¾àÀë",Leds.get_tb_led().getShow_distance());            
        }
        return jc_show_distance;
    }
 
 
 
 
 
    public JCheckBoxModel getGas_name() {
        if(jc_gas_name==null) {
            jc_gas_name=new JCheckBoxModel("ÆøÌå",Leds.get_tb_led().getGas_name());
        }
        return jc_gas_name;
    }
 
 
 
 
 
    public JCheckBoxModel getGas_type() {
        if(jc_gas_type==null) {
            jc_gas_type=new JCheckBoxModel("ÀàÐÍ",Leds.get_tb_led().getGas_type());            
        }
        return jc_gas_type;
    }
 
 
 
 
 
    public JCheckBoxModel getGas_nongdu() {
        if(jc_gas_nongdu==null) {
            jc_gas_nongdu=new JCheckBoxModel("Ũ¶È",Leds.get_tb_led().getGas_nongdu());            
        }
        return jc_gas_nongdu;
    }
 
 
 
 
 
    public JCheckBoxModel getGas_quyu() {
        if(jc_gas_quyu==null) {
            jc_gas_quyu=new JCheckBoxModel("ÇøÓò",Leds.get_tb_led().getGas_quyu());            
        }
        return jc_gas_quyu;
    }
 
 
 
 
 
    public JCheckBoxModel getGas_time() {
        if(jc_gas_time==null) {
            jc_gas_time=new JCheckBoxModel("¸üÐÂʱ¼ä",Leds.get_tb_led().getGas_time());            
        }
        return jc_gas_time;
    }
 
 
 
 
 
    public JCheckBoxModel getGas_state() {
        if(jc_gas_state==null) {
            jc_gas_state=new JCheckBoxModel("¸æ¾¯×´Ì¬",Leds.get_tb_led().getGas_state());            
        }
        return jc_gas_state;
    }
 
 
 
}