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
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
package Frame;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.Stroke;
import java.awt.event.*;
import java.util.List;
import java.util.Timer;
import java.util.Vector;
import javax.swing.*;
import BaoWen.Juge_indoor;
import ColorAndFont.ChooseColor;
import ColorAndFont.UIColor;
import ColorAndFont.buttonTitle;
import DataBase.DatabaseManagement;
import DrawImage.Drawok;
import JNADell.DellJAN;
import Method.GetColor;
import Method.GetNowTime;
import Method.Map_suo_fang;
import PbuliClass.BuMens;
import PbuliClass.JButtonModel;
import PbuliClass.JlableModel;
import PbuliClass.Polygon;
import PbuliClass.Rectangle;
import PbuliClass.ShowMessage;
import PbuliClass.Systems;
import PbuliClass.jinternalFrame;
import Xunjian.Dell_xunjianset;
import anchor.Anchor;
import anchor.Anchor_Dell;
import fence.Fences;
import person.Person;
import person.person_Dell;
import tbDataModel.TbMap;
import tbDataModel_Dell.Dell_Fenceinout;
import tbDataModel_Dell.Dell_Polygon;
import tbDataModel_Dell.Dell_tbline;
import tbDataModel_Dell.FontChoose;
import tbDataModel_Dell.Map_Dell;
import tbDataModel_Dell.Tools;
 
@SuppressWarnings("rawtypes")
/**¸ÃÀàÓÃÓÚ»æÖÆÎ§À¸*/
public class Fence extends jinternalFrame {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    JPanel leftJpanel = null;//×ó²àÃæ°å
    JTextField searchFileld = null;//ËÑË÷Îı¾¿ò
    JButtonModel huizhi = null;//»æÖÆ
    JButtonModel baocun = null;//±£´æ
    JButtonModel quxiao = null;//È¡Ïû
    JButtonModel jbt_bjsure = null;//È·¶¨
    JlableModel chooseMap;//Ñ¡Ôñͼ²ã
    JlableModel jl_xingzhuang=new JlableModel("ΧÀ¸ÐÎ×´:");
    JlableModel jl_banjing=new JlableModel("Ô²Ðΰ뾶:");
    JTextField nameField;//ÊäÈëΧÀ¸Ãû³ÆÎı¾¿ò
    JTextField jt_banjing=new JTextField();
    JTextField group = new JTextField("·ÇһάÏß²»ÐèÒªÌîд", 5);    
    MapManage map = new MapManage();
    JComboBox<String> comboBox = null;//Ñ¡Ôñͼ²ãÏÂÀ­¿ò
    JComboBox<String> leixingBox = null;//Ñ¡ÔñΧÀ¸ÀàÐÍÏÂÀ­¿ò
    JComboBox<String> departmentBox = null;//Ñ¡Ôñ²¿ÃÅÀàÐÍÏÂÀ­¿ò
    JComboBox<String> colorBox = null;//Ñ¡Ôñ²¿ÃÅΧÀ¸ÑÕÉ«ÏÂÀ­¿ò
    JComboBox<String> jc_xingzhuang = null;//Ñ¡ÔñΧÀ¸ÐÎ×´    
    String imageAdress = null;//ͼƬµØÖ·
    Vector<String> row = null;//µØÍ¼Ãû³ÆµÄ¼¯ºÏ
    Mycanvas mycanvas = null;
    Image image = null;//µØÍ¼
    JTextField zuobiao = null;//Êó±êµÄÊµÊ±×ø±ê
    String zuobiaoText;//¹â±êµãµÄ
    int width;
    int height;
    int new_width;//ͼƬµÄ¿í
    int new_height;//ͼƬµÄ¸ß
    double map_true_width;//µØÍ¼Êµ¼Ê³¤¶È
    double map_true_height;//µØÍ¼Êµ¼Ê¸ß¶È
    double x_bi;//ͼƬµÄxÏñËØµãºÍʵ¼Ê³¤µÄ±ÈÖµ
    double y_bi;//ͼƬµÄyÏñËØµãºÍʵ¼Ê¿íµÄ±ÈÖµ
    int x0;//ͼƬÆðµã×ø±êx
    int y0;//ͼƬÆðµã×ø±êy
    JTextArea zuo_biao_ji = null;//×ø±êΧÀ¸×ø±ê¼¯ºÏ
    int rspx;//¾ØÐÎÆðµãX×ø±ê
    int rspy;//¾ØÐÎÆðµãY×ø±ê
    int repx;//¾ØÐÎÖÕµãX×ø±ê
    int repy;//¾ØÐÎÖÕµãY×ø±ê
    boolean huizhiStart = false;
    String reczb;//¾ØÐÎΧÀ¸×ø±ê
    String reczbjwd;//¾ØÐÎΧÀ¸×ø±ê,¾­Î³¶ÈµÄ¶È¸ñʽ
    String shape;//ΧÀ¸ÐÎ×´
    String zuid;//×éID
    Rectangle rectang;//¾ØÐζÔÏó
    Polygon polygons;//¶à±ßÐζÔÏó
    List<Rectangle> rec;//¾ØÐζÔÏóµÄ¼¯ºÏ
    List<Polygon> polygs;//¶à±ßÐζÔÏóµÄ¼¯ºÏ
    int rWidth;//¾ØÐεÄеĿí¶È
    int rHeight;//¾ØÐεÄеĸ߶È
    int new_rWidth;//¾ØÐεÄпí¶È
    int new_rHeight;//¾ØÐεÄи߶È
    int rx0;//¾ØÐεÄX0
    int ry0;//¾ØÐεÄY0
    int m; //¶à±ßÐÎÊýÁ¿
    Font font = new Font("ËÎÌå", Font.BOLD, 14);
    String xuanze = "ºìÉ«";//Ñ¡ÔñµÄÑÕÉ«
    int mouseclicknum = 0;//Êó±êµã»÷µÄ´ÎÊý
    List listRec;//½«ÁбíÖÐËùÓнá¹û¼¯¸øµ½list¼¯ºÏ
    List listPoly;//½«ÁбíÖÐËùÓжà±ßÐνá¹û¼¯¸øµ½list¼¯ºÏ
    int xingzhuang=0;//0±íʾ¾ØÐΣ¬1±íʾ¶à±ßÐΣ¬2±íʾԲÐΣ¬3±íʾһάÏß
    String xzstr="¾ØÐÎ";
    Color color;
    Stroke stroke;//ÉèÖû­±Ê
    int framey;//µ±Ç°Ãæ°å¸ß¶È
    int framex;//µ±Ç°Ãæ°åµÄ¿í¶È
    String floor = "0";
    String allFloor = "0";//¶ÔËùÓÐͼ²ãÉúЧ  2023.08.21 zsh
 
 
    //Êó±êÒÆ¶¯Ê±ºò¶ÔÓ¦µÄʵʱµÄXY×ø±ê
    int xpos = 0;//ÏñËØµã¶ÔÓ¦µÄÊµÊ±×ø±êx
    int ypos = 0;//ÏñËØµã¶ÔÓ¦µÄÊµÊ±×ø±êy
 
    int xpy = 0;//µØÍ¼Ô­µãX·½ÏòµÄÆ«ÒÆÁ¿
    int ypy = 0;//µØÍ¼Ô­µãy·½ÏòµÄÆ«ÒÆÁ¿
 
    int x_cursor;//Êó±ê¶ÔÓ¦µÄÏñËØµã
    int y_cursor;//Êó±ê¶ÔÓ¦µÄÏñËØµã
 
    Color grenn = new Color(50, 205, 50, 150);
    double bi=1;//ͼƬËõ·Å±ÈÀý
 
    //¶à±ßÐεÄÁÙʱÊý¾Ý±£´æ
    Vector<Integer> xpointvc = new Vector<Integer>();//X×ø±êµÄ¼¯ºÏ
    Vector<Integer> ypointvc = new Vector<Integer>();//X×ø±êµÄ¼¯ºÏ
    Vector<String> xpointvcjd = new Vector<String>();//¾­Î³¶È×ø±ê¾­¶È×ø±êµÄ¼¯ºÏ
    Vector<String> ypointvcwd = new Vector<String>();//¾­Î³¶È×ø±êγ¶È×ø±êµÄ¼¯ºÏ
    int pointnum = 0;//¶¨µãµÄÊýÁ¿
 
    //¾ØÐεÄÁÙʱÊý¾Ý±£´æ
    Vector<Integer> xjuxingc = new Vector<Integer>();//¾ØÐÎX×ø±êµÄ¼¯ºÏ
    Vector<Integer> yjuxingc = new Vector<Integer>();//¾ØÐÎY×ø±êµÄ¼¯ºÏ
    int pointjuxingnum = 0;//¾ØÐ樵ãµÄÊýÁ¿
    double[] juxing_wh = new double[2];
 
    //һάÏßµÄÁÙʱÊý¾Ý±£´æ
    Vector<Integer> xline = new Vector<Integer>();//һάÏßX×ø±êµÄ¼¯ºÏ
    Vector<Integer> yline = new Vector<Integer>();//һάÏßY×ø±êµÄ¼¯ºÏ
    Vector<String> xlinejd = new Vector<String>();//¾­Î³¶È×ø±ê¾­¶È×ø±êµÄ¼¯ºÏ
    Vector<String> ylinewd = new Vector<String>();//¾­Î³¶È×ø±êγ¶È×ø±êµÄ¼¯ºÏ
    int pointlinenum = 0;//һάÏß¶¨µãµÄÊýÁ¿
 
    //Ô²ÐÎÁÙʱ±£´æ
    int xyuangvc = 0;//X×ø±ê
    int yyuangvc = 0;//Y×ø±ê
    int bj=0;//°ë¾¶¼¯ºÏ
 
 
    Color ancid = ChooseColor.getColo("À¶É«", 255);
 
    /**¹¹Ôì´úÂë¿éÓÃÓÚ³õʼ»¯±äÁ¿*/ {
        stroke = new BasicStroke(2);//ÉèÖû­±Ê
        color = Color.red;
 
    }
 
 
    public Fence() {
        if (Map_Dell.getMap_vector().size() != 0) {//Èç¹ûµØÍ¼¶ÔÏó²»Îª¿ÕÔòÔËÐÐ
            TbMap map = Map_Dell.get_map("0");
            if (map != null) {
                String name = map.getMapname();//»ñÈ¡µØÍ¼Ãû³Æ
                image = new ImageIcon("image/mapfile/" + name).getImage();
                map_true_width = map.getX_Truelength();//µØÍ¼X·½Ïòʵ³¤
                map_true_height = map.getY_Truewidth();//µØÍ¼Y·½Ïòʵ³¤
                width = image.getWidth(this);//ͼƬxÏñËØ
                height = image.getHeight(this);//ͼyÏñËØ
                new_width = width;
                new_height = height;
                x0 = 0;
                y0 = 0;
                xpy = map.getX0_length();
                ypy = map.getY0_width();
            }
        } else {
            ShowMessage.zidingyi_24("µØÍ¼²»´æÔÚ,ÇëÏÈÉÏ´«µØÍ¼£¡");
            this.dispose();
            return;
        }
 
        x_bi = map_true_width / new_width;
        y_bi = map_true_height / new_height;
        Container rq = getContentPane();//»ñÈ¡ÈÝÆ÷
        rq.setLayout(new BorderLayout());
        rq.setBackground(UIColor.getNorth_color());
        mycanvas = new Mycanvas();//³õʼ»¯»æÍ¼Ãæ°å¶ÔÏó0
        String title = "ΧÀ¸»æÖÆ";
        if (Systems.sys().getLanguage().equals("English")) {
            title = "Fence drawing";
        }
 
        this.setTitle(title);
        this.setSize(1100, 760);
        this.setFrameIcon(new ImageIcon("image/icon/fenceicon.png"));//ÉèÖô°Ìåͼ±ê
        rq.add(getLeftJpanel(), BorderLayout.WEST);
        rq.add(mycanvas, BorderLayout.CENTER);
    }
 
 
    /**
     * »ñÈ¡±±²¿Ãæ°å
     */
    public JPanel getLeftJpanel() {
        if (leftJpanel == null) {
            leftJpanel = new JPanel(new BorderLayout());
            JPanel mb1 = new JPanel();
            mb1.setLayout(null);
            JlableModel lx = new JlableModel();
            lx.setText("ΧÀ¸ÀàÐÍ:");
            JlableModel gl = new JlableModel();
            gl.setText("¹ØÁª²¿ÃÅ:");
            JlableModel name = new JlableModel();
            name.setText("ÇøÓòÃû³Æ:");
            JlableModel fenceColor = new JlableModel();
            fenceColor.setText("ΧÀ¸ÑÕÉ«:");
            nameField = new JTextField(5);
            JlableModel namegroup = new JlableModel();
            namegroup.setText("С×éId:");
            int x=10;
            int y=15;            
            int width=80;
            int width2=120;
            int x2=x+width;
            int h=25;
            //Ñ¡Ôñͼ²ã
            getChooseMap().setBounds(x, y,width,h);
            getComboBox().setBounds(x2,y,width2,h);
 
 
            //ΧÀ¸ÀàÐÍ
            int y1=y+h+30;
            lx.setBounds(x,y1,width, h);
            getLeixngBox().setBounds(x2,y1,width2, h);
 
            //¹ØÁª¶ÔÏó
            int y2=y+2*(30+h);
            gl.setBounds(x,y2,width, h);
            getDepartmentBox().setBounds(x2,y2,width2, h);
 
            //ÇøÓòÃû³Æ
            int y3=y+3*(30+h);
            name.setBounds(x,y3, 70, h);
            nameField.setBounds(x2,y3,width2, h);
 
            //ÐÎ×´
            int y4=y+4*(30+h);
            mb1.add(jl_xingzhuang);
            mb1.add(getJc_xingzhuang());
            jl_xingzhuang.setBounds(x,y4,width, h);
            getJc_xingzhuang().setBounds(x2,y4,width2, h);
            jt_banjing.setEnabled(false);
 
            int y5=y+5*(30+h);
            jl_banjing.setBounds(x,y5,width, h);
            jt_banjing.setBounds(x2,y5,width2, h);
            mb1.add(jl_banjing);
            mb1.add(jt_banjing);
            jt_banjing.setEnabled(false);
 
            //×éID
            int y6=y+6*(30+h);
            namegroup.setBounds(x,y6,width, h);
            getGroup().setBounds(x2,y6,width2, h);    
 
            //ΧÀ¸ÑÕÉ«
            int y7=y+7*(30+h);
            fenceColor.setBounds(x,y7,width, h);
            getColorBox().setBounds(x2,y7,width2, h);            
 
            //»æÖư´¼ü
            int y8=y+8*(30+h);
            getHuizhi().setBounds(x, y8, 50, h);//»æÖư´¼ü            
            getBaocun().setBounds(73,y8, 50, h);//±£´æ°´¼ü            
            getQuxiao().setBounds(136,y8, 50, h);//È¡Ïû°´¼ü
 
            int y9=y+9*(30+h);
            getZuo_biao_ji().setBounds(x,y9, 190, 140);            
            mb1.add(getChooseMap());//Ñ¡Ôñͼ²ã
            mb1.add(getComboBox());//Ìí¼ÓÏÂÀ­Áбí¿ò
            mb1.add(lx);//Ìí¼ÓÏÂÀ­Áбí¿ò
            mb1.add(getLeixngBox());//Ìí¼ÓÀàÐÍÑ¡ÔòÏÂÀ­Áбí¿ò
            mb1.add(gl);//Ìí¼Ó¹ØÁª¶ÔÏó
            mb1.add(getDepartmentBox());//Ìí¼Ó¹ØÁª¶ÔÏó
            mb1.add(name);//Ìí¼ÓÇøÓòÃû³Æ
            mb1.add(nameField);//Ãû³ÆÊäÈë¿ò
            mb1.add(namegroup);//Ìí×éID
            mb1.add(getGroup());//×éIdÊäÈë¿ò
            mb1.add(fenceColor);//Ìí¼ÓΧÀ¸ÑÕÉ«
            mb1.add(getColorBox());//Ìí¼ÓÑÕɫѡÔñÏÂÀ­¿ò
            mb1.add(getHuizhi());//Ìí¼Ó»æÖư´Å¥
            mb1.add(getBaocun());//Ìí¼ÓÈ·¶¨°´Å¥
            mb1.add(getQuxiao());//Ìí¼ÓÈ¡Ïû°´Å¥
            mb1.add(getZuo_biao_ji());//Ìí¼Ó×ø±ê¼¯ºÏ
            leftJpanel.add(getZuobiao(), BorderLayout.NORTH);
            leftJpanel.add(mb1, BorderLayout.CENTER);
        }
 
        return leftJpanel;
    }
 
    /**
     * »ñÈ¡×ø±êµÄ¼¯ºÏ
     */
    public JTextArea getZuo_biao_ji() {
        if (zuo_biao_ji == null) {
            zuo_biao_ji = new JTextArea(5, 5);
        }
        return zuo_biao_ji;
 
    }
 
    /**
     * »ñÈ¡»æÖư´Å¥µÄ·½·¨
     */
    public JButtonModel getHuizhi() {
        if (huizhi == null) {
            huizhi = new JButtonModel("»æÖÆ");
            huizhi.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    chushihua();
                    String name = nameField.getText();
 
                    if (name.equals("")) {
                        ShowMessage.zidingyi("ΧÀ¸Ãû³Æ²»ÄÜΪ¿Õ£¡");
                        return;
                    }
                    if(xingzhuang==3) {
                        zuid= group.getText();
                        if (zuid==null || zuid.length()<1 || zuid.length()>8) {
                            ShowMessage.zidingyi("һάÏß×éId²»ºÏ·¨Çë¼ì²é£¡");
                            return;
                        }
                    }
 
                    // Èç¹û´æÔÚÏàͬµÄΧÀ¸Ãû³ÆÔòÖ´ÐÐ
                    if (Dell_Polygon.found(name) != null) {
                        ShowMessage.zidingyi(name + "ÒѾ­´æÔÚ²»ÄÜÖØ¸´Ìí¼Ó£¡");
                        return;
                    }
 
                    huizhi.setBackground(UIColor.getGrenn());
                    if (xingzhuang==0) {                        
                        getZuo_biao_ji().setText("µØÍ¼Éϵ¥»÷Êó±ê×ó¼ü¼ü\nÈ·¶¨ÆðµãºÍÖÕµã");
                    } else if (xingzhuang==1) {                        
                        getZuo_biao_ji().setText("µ¥»÷Êó±ê×ó¼ü»æÖƱպ϶à±ßÐΣ¡");
 
                    } else if (xingzhuang==2) {                        
                        getZuo_biao_ji().setText("µ¥»÷Êó±ê×ó¼ü»æÖÆÔ²ÐΣ¡");
                        String bjstr=jt_banjing.getText().trim();
                        if(bjstr.length()<1) {
                            ShowMessage.zidingyi("ÊäÈëÔ²Ðΰ뾶µ¥Î»ÀåÃ×");
                            return;
                        }
                        bj=Integer.parseInt(bjstr);
 
                    }else if(xingzhuang==3) {
                        getZuo_biao_ji().setText("µ¥»÷Êó±ê×ó¼ü»æÖÆÒ»Î¬Ïߣ¡");
                    }
                    int selectedIndex = leixingBox.getSelectedIndex();
                    if (selectedIndex == 14 && xingzhuang==0) {
                        ShowMessage.zidingyi("Î§Ç½ÇøÓò²»Ö§³Ö¾ØÐÎ");
                        return;
                    }
 
                    huizhiStart = true;
                    mycanvas.repaint();
 
                }
            });
        }
        return huizhi;
    }
 
    /**
     * »ñÈ¡±£´æ°´Å¥µÄ·½·¨
     */
    public JButtonModel getBaocun() {
        if (baocun == null) {
            baocun = new JButtonModel(buttonTitle.getSave());
            baocun.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    huizhiStart = false;//µã»÷Íê±£´æºóÐèÒªÔٴεã»÷»æÖƲÅÄÜ¿ªÊ¼ÏÂÒ»¸öΧÀ¸µÄ»æÖÆ
                    String floor = (String) getComboBox().getSelectedItem();
                    if (floor.equals("ËùÓÐͼ²ã")){
                        floor="0";
                    }
                    String type = (String) getLeixngBox().getSelectedItem();
                    if (type.equals("¿¼ÇÚÇøÓò")&&!Systems.isSuidaomoshi()){
                        ShowMessage.zidingyi_24("»æÖÆ¿¼ÇÚΧÀ¸Ð迪ÆôËíµÀ¶¨Î»");
                        return;
                    }
                    String bumen = (String) getDepartmentBox().getSelectedItem();
                    String name = nameField.getText();
 
                    if (name.equals("")) {
                        ShowMessage.zidingyi("ΧÀ¸Ãû³Æ²»ÄÜΪ¿Õ£¡");
                        return;
                    }
 
                    // Èç¹û´æÔÚÏàͬµÄΧÀ¸Ãû³ÆÔòÖ´ÐÐ
                    if (Dell_Polygon.found(name) != null) {
                        ShowMessage.zidingyi_24(name + "ÒѾ­´æÔÚ²»ÄÜÖØ¸´Ìí¼Ó£¡");
                        return;
                    }
                    String start = "00:00:00";
                    String stop = "23:59:59";
                    String color = (String) getColorBox().getSelectedItem();
 
                    //×ø±ê¼¯ºÏ
                    StringBuffer zuobiaos = new StringBuffer();
 
                    //Èç¹ûÑ¡ÖеÄÊǾØÐÎ
                    if (xingzhuang==0) {
                        if (pointjuxingnum == 2) {
                            int x1 = xjuxingc.get(0);
                            int y1 = yjuxingc.get(0);
                            int x3 = xjuxingc.get(1);
                            int y3 = yjuxingc.get(1);
                            int x2 = x3;
                            int y2 = y1;
                            int x4 = x1;
                            int y4 = y3;
                            reczb = x1 + "," + y1 + "," + x3 + "," + y3;//¾ØÐÎΧÀ¸×ø±ê  
                            shape = "¾ØÐÎ";
                            zuobiaos.append(x1 + "," + y1 + ";" + x2 + "," + y2 + ";" + x3 + "," + y3 + ";" + x4 + "," + y4);
                            reczbjwd = getjxjwd(x1, y1, x2, y2, x3, y3, x4, y4, floor);//¶È¸ñʽµÄΧÀ¸×ø±ê                            
                            Dell_Polygon.add_a_fence_tomap(floor,type,bumen,name,reczb,shape,start,stop,color,allFloor);
                        }
 
                    } else if (xingzhuang==1) {
                        if (pointnum > 2) {
                            shape = "¶à±ßÐÎ";
                            reczb = getzuobiaos(xpointvc, ypointvc).toString();
                            Dell_Polygon.add_a_fence_tomap(floor,type,bumen,name,reczb,shape,start,stop,color,allFloor);
                            reczbjwd = getzuobiaosjwd(xpointvcjd, ypointvcwd).toString();
                        }
                    } else if(xingzhuang==2) {
                        shape = "Ô²ÐÎ";
                        reczb=xyuangvc+","+yyuangvc+","+bj;
                        Dell_Polygon.add_a_fence_tomap(floor,type,bumen,name,reczb,shape,start,stop,color,allFloor);
 
                    } else if (xingzhuang==3) {
                        if (type.equals("¶¨Î»ÇøÓò")) {
                            int s = Tools.suanfaVersion();
                            if (s < 43) {
                                ShowMessage.zidingyi_24("µ±Ç°Ëã·¨°æ±¾Îª" + DellJAN.getSuanfaversion() + ",Çë¸ü»»2.0.43ÒÔÉϵİ汾");
                                chushihua();
                                return;
                            }
                            shape = "һάÏß";                            
                            reczb = getzuobiaos(xline, yline).toString();                            
                            reczbjwd = getzuobiaosjwd(xlinejd, ylinewd).toString();
                            zuid= group.getText();
                            if (zuid==null || zuid.length()<1 || zuid.length()>8) {
                                ShowMessage.zidingyi("һάÏß×éId²»ºÏ·¨Çë¼ì²é£¡");
                                return;
                            }
                            Dell_Polygon.add_a_fence_tomap(floor,type,bumen,name,reczb,shape,start,stop,color,allFloor);
                        }
                    }
                    if (shape != null) {
                        //baoliu8¾­Î³¶È¶È¸ñÊ½×ø±ê¸ñʽ
                        String[] ziduan = {"floor", "type", "bumen", "name", "zuobiao", "shape", "start", "stop",
                                "addtime", "color", "baoliu7", "baoliu8","baoliu10", "baoliu11","baoliu12"};
                        String[] zhi = {floor, type, bumen, name, reczb, shape, start, stop, 
                                GetNowTime.now(), color, "1", reczbjwd,allFloor,"-1","-1"};
 
                        if (DatabaseManagement.insertfast("tb_fence", ziduan, zhi)) {
                            Fences.add_tbfence(floor, type, bumen, name, reczb, shape,
                                    start, stop, GetNowTime.now(), color, "CS",allFloor);
                            ShowMessage.zidingyi("ΧÀ¸±£´æ" + name + "³É¹¦!");
                            if (type.equals("Ѳ¼ìÇøÓò")) {
                                Dell_xunjianset.insert(name);
                            } else if (type.equals("¶¨Î»ÇøÓò")) {
                                if (shape.equals("¾ØÐÎ")) {
                                    Dell_Fenceinout.insert(name, zuobiaos.toString(), shape, floor, 0,allFloor);
                                } else if (shape.equals("¶à±ßÐÎ")) {
                                    Dell_Fenceinout.insert(name, reczb, shape, floor, 0,allFloor);
                                } else if (shape.equals("һάÏß")) {
                                    int size = xline.size();
                                    int[] xs = new int[size];
                                    int[] ys = new int[size];
                                    for (int i = 0; i < size; i++) {
                                        xs[i] = xline.get(i);
                                        ys[i] = yline.get(i);
                                    }
                                    if (type.equals("¶¨Î»ÇøÓò")) {
                                        Dell_tbline.insert_line(name, floor,zuid, String.valueOf(size), xs, ys, "1",allFloor);
                                    }
                                }
                            } else if (type.equals("ÎÞÐ§ÇøÓò")) {
                                if (shape.equals("¾ØÐÎ")) {
                                    Dell_Fenceinout.insert(name, zuobiaos.toString(), shape, floor, 3,allFloor);
                                } else if (shape.equals("¶à±ßÐÎ")) {
                                    Dell_Fenceinout.insert(name, reczb, shape, floor, 3,allFloor);
                                }
                            }
                            chushihua();
                            zuo_biao_ji.setText("±£´æÎ§À¸³É¹¦");
                        }
                    } else {
                        ShowMessage.zidingyi("дÈëÊý¾Ý¿â³ö´í£¡");
                    }
 
                }
            });
        }
        return baocun;
    }
 
    /**
     * »ñȡȡÏû°´Å¥µÄ·½·¨
     */
    public JButtonModel getQuxiao() {
        if (quxiao == null) {
            quxiao = new JButtonModel("È¡Ïû");
            quxiao.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    getZuo_biao_ji().setText("");
                    chushihua();
                }
            });
        }
        return quxiao;
    }
 
 
    /**
     * »ñȡѡÔñ²¿ÃÅÏÂÀ­¿ò
     */
    public JComboBox<String> getDepartmentBox() {
 
        if (departmentBox == null) {
            departmentBox = new JComboBox<>();//´´½¨ÏÂÀ­¿ò¶ÔÏó
            departmentBox.setBackground(Color.white);
            departmentBox.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 12));//ÉèÖÃ×ÖÌå
            if (BuMens.getBumenNames() == null) {
                return departmentBox;
            }
            ComboBoxModel<String> coModel = new DefaultComboBoxModel<>(BuMens.getBumenNames());//ÏÂÀ­ÁбíÄ£ÐÍ
            departmentBox.setModel(coModel);
            departmentBox.updateUI();//¸üÐÂUI
 
        }
 
        return departmentBox;
    }
 
 
    public JlableModel getChooseMap() {
        if (chooseMap == null) {
            chooseMap = new JlableModel();
            chooseMap.setText("Ñ¡Ôñͼ²ã:");            
        }
        return chooseMap;
    }
 
    /**
     * »ñȡѡÔñͼ²ãÏÂÀ­Áбí¿ò
     */
    public JComboBox<String> getComboBox() {
        ComboBoxModel<String> coModel = new DefaultComboBoxModel<>(Map_Dell.get_all_floor());//ÏÂÀ­ÁбíÄ£ÐÍ
        if (comboBox == null) {
            comboBox = new JComboBox<>();//´´½¨ÏÂÀ­¿ò¶ÔÏótagComboBox
            comboBox.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 12));//ÉèÖÃ×ÖÌå
            comboBox.setBackground(Color.white);
            comboBox.setModel(coModel);
            comboBox.setSelectedIndex(0);
            comboBox.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent e) {
                    if (e.getStateChange() == ItemEvent.SELECTED) {
                        floor = (String) getComboBox().getSelectedItem();//ͼƬËùÔڵIJã
                        if (floor.equals("ËùÓÐͼ²ã")){
                            allFloor="1";
                            floor="0";
                        }else {
                            allFloor="0";
                        }
                        TbMap map = Map_Dell.get_map(floor);
                        if(map !=null) {
                            String name = map.getMapname();//»ñÈ¡µØÍ¼Ãû³Æ
                            image = new ImageIcon("image/mapfile/" + name).getImage();
                            map_true_width = Map_Dell.get_map(floor).getX_Truelength();//µØÍ¼X·½Ïòʵ³¤
                            map_true_height = Map_Dell.get_map(floor).getY_Truewidth();//µØÍ¼Y·½Ïòʵ³¤
                            width = Map_Dell.get_map(floor).getX_Pixel();//ͼƬxÏñËØ
                            height = Map_Dell.get_map(floor).getY_Pixel();//ͼyÏñËØ
                            new_width = width;
                            new_height = height;
                            x_bi = map_true_width / new_width;
                            y_bi = map_true_height / new_height;
                            x0 = 0;
                            y0 = 0;
                            xpy = Map_Dell.get_map(floor).getX0_length();
                            ypy = Map_Dell.get_map(floor).getY0_width();
                        }
                    }
                    mycanvas.repaint();
                }
            });
 
 
        }
        return comboBox;
    }
 
 
    public JComboBox<String> getLeixngBox() {
        if (leixingBox == null) {
            String[] leixing = {"¿¼ÇÚÇøÓò", "½øÈë¸æ¾¯", "³öÈ¥¸æ¾¯", "³¬Ô±±¨¾¯", "³¬Ê±±¨¾¯", "Ѳ¼ìÇøÓò", "¶¨Î»ÇøÓò",
                    "ÊÒÄÚÇøÓò", "Çл»ÇøÓò", "ÊÓÆµÇøÓò", "ÎÞÐ§ÇøÓò", "×÷񵂿Óò", "½øÃŸ澯", "³öß澯", "Î§Ç½ÇøÓò"};
            leixingBox = new JComboBox<>(leixing);//´´½¨ÏÂÀ­¿ò¶ÔÏótagComboBox
            leixingBox.setFont(new Font("TimesRoman", Font.PLAIN, 13));//ÉèÖÃ×ÖÌå
            leixingBox.setBackground(Color.white);
            leixingBox.setEnabled(true);
 
        }
        return leixingBox;
 
    }
 
    //×éid
    public JTextField getGroup() {
        group.setForeground(Color.gray);
        group.addFocusListener(new FocusAdapter() {
            @Override
            public void focusGained(FocusEvent e) {
 
                group.setText("");
                group.setForeground(Color.black);
            }
        });
        return group;
    }
 
    public JComboBox<String> getColorBox() {
        if (colorBox == null) {
            String[] ys = {"ºìÉ«", "À¶É«", "ÂÌÉ«", "ºÚÉ«", "°×É«", "Æ·ºì"};
            colorBox = new JComboBox<>(ys);//´´½¨ÏÂÀ­¿ò¶ÔÏótagComboBox
            colorBox.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 12));//ÉèÖÃ×ÖÌå
            colorBox.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    xuanze = (String) colorBox.getSelectedItem();
                }
            });
        }
        return colorBox;
 
    }
 
 
 
 
 
    /**
     * »ñÈ¡µØÍ¼
     */
    public Image getImage() {
        return image;
    }
 
    /**
     * ÉèÖõØÍ¼
     */
    public void setImage(String imageAdress) {
        image = new ImageIcon(imageAdress).getImage();//»ñÈ¡µØÍ¼
    }
 
    public JTextField getZuobiao() {
        if (zuobiao == null) {
            zuobiao = new JTextField(20);
        }
        return zuobiao;
    }
 
    /**
     * ÄÚ²¿µÄ»­²¼
     */
    class Mycanvas extends Canvas implements MouseListener, MouseMotionListener, MouseWheelListener {
        /**
         *
         */
        private static final long serialVersionUID = 1L;        
        int countnum = 200;
        Point origin;
        int orix;
        int oriy;
        int rox;
        int roy;
        boolean dian = false;
        boolean title = false;
        String zuobiao;
        Timer timer = new Timer();//н¨¶¨Ê±Æ÷£¬Ë«»÷¼ì²â¼ä¸ôΪ500ms
        boolean flag = false;//Ë«»÷ʼþÒÑÖ´ÐÐʱÖÃÎªÕæ
        int clickNum = 1;        //ָʾÊó±êµã»÷´ÎÊý£¬Ä¬ÈÏΪµ¥»÷
 
        Image ImageBuffer = null;
        Graphics GraImage = null;
 
        public void update(Graphics g) {        //¸²¸Çupdate·½·¨£¬½ØÈ¡Ä¬Èϵĵ÷Óùý³Ì
            ImageBuffer = createImage(this.getWidth(), this.getHeight());    //´´½¨Í¼Ðλº³åÇø
            GraImage = ImageBuffer.getGraphics();        //»ñȡͼÐλº³åÇøµÄͼÐÎÉÏÏÂÎÄ
            paint(GraImage);        //ÓÃpaint·½·¨ÖбàдµÄ»æÍ¼¹ý³Ì¶ÔͼÐλº³åÇø»æÍ¼
            GraImage.dispose();        //ÊÍ·ÅͼÐÎÉÏÏÂÎÄ×ÊÔ´
            g.drawImage(ImageBuffer, 0, 0, this);    //½«Í¼Ðλº³åÇø»æÖƵ½ÆÁÄ»ÉÏ
        }
 
 
        public Mycanvas() {            
            origin = new Point();
            addMouseWheelListener(this);
            addMouseListener(this);
            addMouseMotionListener(this);
        }
 
 
        public void paint(Graphics g) {
            Graphics2D g2 = (Graphics2D) g;
            g2.drawImage(image, x0, y0, new_width, new_height, this);
            framey = this.getSize().height;//µ±Ç°Ãæ°åµÄ¸ß¶È
            framex = this.getSize().width;
 
 
            if (true) {    //»æÖÆÔ­µã
                g2.setColor(Color.red);
                g2.fillOval(x0, y0, 8, 8);
                /**»æÖÆÒѾ­´æÔÚµÄΧÀ¸¶ÔÏó**/
                Drawok.fence(floor, x_bi, y_bi, x0, y0, xpy, ypy, g2,bi);
                //»æÖÆ×ø±êʵʱ
                drawxy(g2);
                //»æÖƱêÇ©¶ÔÏó
                drawperson(g2);
            }
 
            /**»æÖÆÁÙʱ¾ØÐÎ*/
            if (huizhiStart && xingzhuang==0) {
                drawjuxing(g2, pointjuxingnum, xjuxingc, yjuxingc);
            }
 
            //Èç¹ûÑ¡Ôñ¶à±ßÐÎÔòÖ´ÐлæÖƶà±ßÐÎ
            if (huizhiStart && xingzhuang==1) {
                drawduobianxing(g2, pointnum, xpointvc, ypointvc);
            }
 
            //Èç¹ûÑ¡ÔñһάÏß
            if (huizhiStart && xingzhuang==3) {
                drawLine(g2, pointlinenum, xline, yline);
            }
 
            //Èç¹ûÑ¡Ôñ»æÖÆÔ²ÐÎ
            if (huizhiStart && xingzhuang==2) {
                draw_yuan(g2);
            }
 
 
 
            //»æÖÆ»ùÕ¾
            draw_anchor(g2, floor);
        }
 
 
        public void mouseReleased(MouseEvent e) {//°´¼üÊÍ·Å
            setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            this.repaint();
 
        }
 
        //°´¼ü°´ÏÂ
        public void mousePressed(MouseEvent e) {
            origin.x = e.getX(); //»ñµÃÊó±êµã»÷ʱºòµÄX×ø±ê
            origin.y = e.getY();//»ñµÃÊó±êµã»÷ʱºòµÄY×ø±ê
            orix = x0;//½«µ±Ç°Í¼Æ¬µÄÆðµã×ø±êX¸øorix
            oriy = y0;//½«µ±Ç°Í¼Æ¬µÄÆðµã×ø±êX¸øoriy
            rox = rx0;//½«¾ØÐÎµÄÆôµã×ø±ê¸øROX
            roy = ry0;//½«¾ØÐÎµÄÆôµã×ø±ê¸øROX
        }
 
        public void mouseExited(MouseEvent e) {//Êó±êÍ˳ö
 
        }
 
        public void mouseEntered(MouseEvent e) {//Êó±ê½øÈë
            setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
 
        }
 
 
        /**
         * Êó±êµã»÷ʼþ
         */
        public void mouseClicked(MouseEvent e) {//Êó±êµã»÷
            //µã»÷Êó±ê×ó¼üͬʱѡÔñµÄÊǾØÐβ¢ÇÒµã»÷ÁË¿ªÊ¼»æÖÆ
            if (e.getButton() == MouseEvent.BUTTON1 && huizhiStart) {
                int xpoint = (new Double((e.getX() - x0) * x_bi)).intValue() + xpy;//ÏñËØµã¶ÔÓ¦µÄÊµÊ±×ø±êx;
                int ypoint = (new Double((e.getY() - y0) * y_bi)).intValue() + ypy;//ÏñËØµã¶ÔÓ¦µÄÊµÊ±×ø±êy;
                if (xingzhuang==0) {                    
                    if (mouseclicknum == 0) {
                        xjuxingc.add(xpoint);
                        yjuxingc.add(ypoint);
                        pointjuxingnum = 1;
                        mouseclicknum = 1;
                        zuo_biao_ji.setText("»æÖƵÚ" + pointjuxingnum + "¸öµã\n xy=" + xpoint + ";" + xpoint);
                    } else if (mouseclicknum == 1) {
                        mouseclicknum = 2;
                        xjuxingc.add(xpoint);
                        yjuxingc.add(ypoint);
                        pointjuxingnum = 2;
                        zuo_biao_ji.setText("ΧÀ¸ÒѾ­»æÖÆÍê³Éµã»÷±£´æ");
                    }
 
                } else if (xingzhuang==1) {
                    pointnum++;                    
                    xpointvc.add(xpoint);
                    ypointvc.add(ypoint);
                    String[] jw = Juge_indoor.xy2d(xpoint + "", ypoint + "", floor);//XY×ø±êתΪ¾­Î³¶È
                    xpointvcjd.add(jw[0]);//XY×ø±êתΪ¾­Î³¶È¾­¶È¼¯ºÏ
                    ypointvcwd.add(jw[1]);//XY×ø±êתΪ¾­Î³¶Èγ¶È¼¯ºÏ                    
                    getZuo_biao_ji().setText("»æÖƵÚ" + pointnum + "¸öµã\n xy=" + xpoint + ";" + xpoint);
                } else if(xingzhuang==2){
                    mouseclicknum=2;
                    xyuangvc=xpoint;
                    yyuangvc=ypoint;
                    getZuo_biao_ji().setText("Ô²ÐÄ×ø±ê" + "xy=" + xpoint + ";" + xpoint);
 
                } else  if (xingzhuang==3) {
                    pointlinenum++;
                    xline.add(xpoint);
                    yline.add(ypoint);
                    String[] jw = Juge_indoor.xy2d(xpoint + "", ypoint + "", floor);//XY×ø±êתΪ¾­Î³¶È
                    xlinejd.add(jw[0]);//XY×ø±êתΪ¾­Î³¶È¾­¶È¼¯ºÏ
                    ylinewd.add(jw[1]);//XY×ø±êתΪ¾­Î³¶Èγ¶È¼¯ºÏ
                    getZuo_biao_ji().setText("»æÖƵÚ" + pointlinenum + "¸öµã\n xy=" + xpoint + ";" + xpoint);
                }
                this.repaint();
            }
        }
 
 
        public void mouseDragged(MouseEvent e) {
            setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
            //Ãæ°åеÄ×ø±êλÖà = Òƶ¯Ç°×ø±êλÖÃ+£¨Êó±êÖ¸Õëµ±Ç°×ø±ê-Êó±ê°´ÏÂʱָÕëµÄλÖã©
            x0 = e.getX() - origin.x + orix;
            y0 = e.getY() - origin.y + oriy;
            rx0 = e.getX() - origin.x + rox;
            ry0 = e.getY() - origin.y + roy;
            this.repaint();
 
        }
 
 
        /**
         * Êó±êÒÆ¶¯Ê¼þ¼àÌý
         */
        public void mouseMoved(MouseEvent e) {
            x_cursor = e.getX();//Êó±ê¶ÔÓ¦µÄÏñËØµã
            y_cursor = e.getY();//Êó±ê¶ÔÓ¦µÄÏñËØµã
            xpos = (new Double((x_cursor - x0) * x_bi)).intValue() + xpy;//ÏñËØµã¶ÔÓ¦µÄÊµÊ±×ø±êx
            ypos = (new Double((y_cursor - y0) * y_bi)).intValue() + ypy;//ÏñËØµã¶ÔÓ¦µÄÊµÊ±×ø±êy
            zuobiaoText = "  ×ø±ê£ºX=" + xpos + "  Y=" + ypos + "(" + x_cursor + ";" + y_cursor + ")";
            getZuobiao().setText(zuobiaoText);
 
            if (mouseclicknum == 1 && huizhiStart) {                
                if(xingzhuang==0) {
                    juxing_wh[0] = (new Double((x_cursor - x0) * x_bi)).intValue() + xpy;//ÏñËØµã¶ÔÓ¦µÄÊµÊ±×ø±êx;
                    juxing_wh[1] = (new Double((y_cursor - y0) * y_bi)).intValue() + ypy;//ÏñËØµã¶ÔÓ¦µÄÊµÊ±×ø±êy
                }
            }            
            if(mouseclicknum > 1 && huizhiStart) {
                if(xingzhuang==2) {
                    bj=Integer.parseInt(jt_banjing.getText());
                }
            }
            this.repaint();
        }
 
 
        /**
         * Êó±ê¹öÂÖ¹ö¶¯Ê¼þ¼àÌý
         */
        public void mouseWheelMoved(MouseWheelEvent e) {//Êó±ê¹öÂÖ¹ö¶¯¼àÌý
            //e.getWheelRotation()>0±íʾÊó±ê¹öÂÖÏòÍâ¹ö¶¯Ð¡ÓÚ0±íʾÏòÄÚ¹ö¶¯
 
            int xh1 = e.getX();
            int yh1 = e.getY();
            double bi0 = bi;
            int xr = x0;
            int yr = y0;
 
            if (e.getWheelRotation() > 0 && countnum > 0) {//ËõСͼƬ
                countnum = countnum - 50;
                bi = Map_suo_fang.get_bi(countnum);
 
            }
 
            if (e.getWheelRotation() < 0 && countnum < 600) {//·Å´óͼƬ
                countnum = countnum + 50;
                bi = Map_suo_fang.get_bi(countnum);
            }
 
            new_width = new Double(width * bi).intValue();
            new_height = new Double(height * bi).intValue();
            new_rWidth = new Double(rWidth * bi).intValue();//¾ØÐεĿí¶È
            new_rHeight = new Double(rHeight * bi).intValue();//¾ØÐεĿí¶È
            x_bi = map_true_width / new_width;//µØÍ¼µÄʵ¼Ê³¤¶ÈºÍеĿí¶È±ÈÖµ
            y_bi = map_true_height / new_height;//µØÍ¼Êµ¼Ê¸ß¶ÈºÍеĸ߶ȱÈÖµ
            rx0 = new Double(rspx / x_bi + x0).intValue();//¾ØÐÎÆðµã×ø±êx
            ry0 = new Double(rspy / y_bi + y0).intValue();//¾ØÐÎÆðµã×ø±êy
            x0 = new Double(xh1 - (xh1 - xr) * bi / bi0).intValue();
            y0 = new Double(yh1 - (yh1 - yr) * bi / bi0).intValue();
            this.repaint();
        }
 
    }
 
    /**
     * µ¯³ö²Ëµ¥
     */
    public JPopupMenu popupMenu() {
        JPopupMenu popupMenu = new JPopupMenu();// ´´½¨µ¯³öʽ²Ëµ¥¶ÔÏó
        popupMenu.setBorderPainted(false);
        JMenuItem center = new JMenuItem("Ô­µã¾ÓÖÐ");//´´½¨²Ëµ¥Ïî
        center.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                // TODO ×Ô¶¯Éú³ÉµÄ·½·¨´æ¸ù
                x0 = framex / 2;
                y0 = framey / 2;
                mycanvas.repaint();
            }
        });
        popupMenu.add(center);
        return popupMenu;
    }
 
    /**
     * »æÖÆÊµÊ±×ø±ê±³¾°¿ò
     */
    public void drawxy(Graphics2D g2) {
        g2.setColor(grenn);//ÂÌÉ«
        g2.fillRoundRect(50, 10, 140, 60, 10, 10);
        g2.setFont(FontChoose.ziti(14));
        g2.setColor(Color.white);
        g2.setFont(FontChoose.ziti(18));
        g2.drawString("x:" + xpos, 60, 35);
        g2.drawString("y:" + ypos, 60, 55);
        //»æÖƵ±Ç°Êó±êµÄλÖÃ
        g2.setColor(Color.red);
        g2.fillOval(xtonowx(xpos), ytonowy(ypos), 8, 8);
 
    }
 
    /**
     * »æÖƱêÇ©¶ÔÏó
     */
    public void drawperson(Graphics2D g2) {
        if (person_Dell.getPerson_vector().size() != 0) {
            for (int i = 0; i < person_Dell.getPerson_vector().size(); i++) {
                Person person = person_Dell.getPerson_vector().get(i);
                if (person == null) {
                    continue;
                }
                String online = person.getP_online();
                if (online.equals("0")) {
                    continue;
                }
                if (!person.getP_floor().equals(floor)) {
                    continue;
                }
                int posx = person.getP_x();
                int posy = person.getP_y();
                int x = xtonowx(posx);
                int y = ytonowy(posy);
                int tbw = person.getP_image().getIconWidth();
                int tbh = person.getP_image().getIconHeight();
                //»æÖƱêÇ©
                g2.drawImage(person.getP_image().getImage(), x - tbw / 2, y - tbh, tbw, tbh, this);
                g2.setColor(GetColor.getGreen());//ÂÌÉ«
                g2.fillRoundRect(x - 45, y - tbh - 40, 90, 30, 3, 3);
                g2.setColor(Color.BLACK);
                g2.setFont(font);
                g2.drawString(person.getP_name(), x - 40, y - tbh - 20);
                g2.drawString(person.getP_tagid(), x + 10, y - tbh - 20);
 
            }
        }
    }
 
    /**
     * ½«µ±Ç°×ø±êתΪͼÉÏλÖõķ½·¨
     */
    public int xtonowx(int posx) {
        int posx_x0 = posx - Map_Dell.get_map(floor).getX0_length();
        double xx = (posx_x0 / x_bi) + x0;
        int x = (int) xx;
        return x;
    }
 
    /**
     * ½«µ±Ç°×ø±êתΪͼÉÏλÖõķ½·¨
     */
    public int ytonowy(int posy) {
        int posy_y0 = posy - Map_Dell.get_map(floor).getY0_width();
        double yy = (posy_y0 / y_bi) + y0;
        int y = (int) yy;
        return y;
    }
 
    /**
     * »æÖƶà±ßÐÎ
     */
    public void drawduobianxing(
            Graphics2D g2,
            int pointnum,
            Vector<Integer> xpointvc,
            Vector<Integer> ypointvc) {
        g2.setColor(Color.RED);
        g2.setStroke(stroke);
        if (pointnum > 2) {//»æÖƶà±ßÐÎ
            g2.setColor(ChooseColor.getColo(xuanze, 90));
            int[] xPoints = new int[pointnum];
            int[] yPoints = new int[pointnum];
            for (int i = 0; i < pointnum; i++) {
                xPoints[i] = xpointvc.get(i);
                yPoints[i] = ypointvc.get(i);
                xPoints[i] = (new Double((xPoints[i] - xpy) / x_bi)).intValue() + x0;
                yPoints[i] = (new Double((yPoints[i] - ypy) / y_bi)).intValue() + y0;
 
            }
            g2.fillPolygon(xPoints, yPoints, pointnum);
        } else if (pointnum == 2) {//»æÖÆÖ±Ïß
            int x1 = xpointvc.get(0);
            int x2 = xpointvc.get(1);
            int y1 = ypointvc.get(0);
            int y2 = ypointvc.get(1);
            x1 = (new Double((x1 - xpy) / x_bi)).intValue() + x0;
            x2 = (new Double((x2 - xpy) / x_bi)).intValue() + x0;
            y1 = (new Double((y1 - ypy) / y_bi)).intValue() + y0;
            y2 = (new Double((y2 - ypy) / y_bi)).intValue() + y0;
            g2.drawLine(x1, y1, x2, y2);
 
        } else if (pointnum == 1) {//»æÖÆÔ²ÐÎ
            int x1 = xpointvc.get(0);
            int y1 = ypointvc.get(0);
            x1 = (new Double((x1 - xpy) / x_bi)).intValue() + x0;
            y1 = (new Double((y1 - ypy) / y_bi)).intValue() + y0;
            g2.fillOval(x1 - 3, y1 - 3, 6, 6);
        }
    }
 
    /**
     * »æÖÆÒ»Î¬Ïß
     */
    public void drawLine(Graphics2D g2, int pointnum, Vector<Integer> xpointvc, Vector<Integer> ypointvc) {
        g2.setColor(Color.RED);
        g2.setStroke(stroke);
        g2.setColor(ChooseColor.getColo(xuanze, 90));
        int[] xPoints = new int[pointnum];
        int[] yPoints = new int[pointnum];
        for (int i = 0; i < pointnum; i++) {
            xPoints[i] = xpointvc.get(i);
            yPoints[i] = ypointvc.get(i);
            xPoints[i] = (new Double((xPoints[i] - xpy) / x_bi)).intValue() + x0;
            yPoints[i] = (new Double((yPoints[i] - ypy) / y_bi)).intValue() + y0;
 
        }
        g2.drawPolyline(xPoints, yPoints, pointnum);
 
    }
 
    /**»æÖÆÔ²ÐÎ*/
    public void draw_yuan(Graphics2D g2) {
        int posx = (new Double((xyuangvc - xpy) / x_bi)).intValue() + x0;
        int posy = (new Double((yyuangvc - ypy) / y_bi)).intValue() + y0;
        int r1=2*(new Double(bj/x_bi)).intValue();
        int r2=2*(new Double(bj/y_bi)).intValue();
        g2.setColor(ChooseColor.getColo(xuanze, 90));
        g2.fillOval(posx-4, posy-4,8,8);            
        g2.fillOval(posx-r1/2, posy-r2/2,r1,r2); 
    }
    /**
     * »æÖƾØÐÎ
     */
    public void drawjuxing(
            Graphics2D g2,
            int pointnum,
            Vector<Integer> xpointvc,
            Vector<Integer> ypointvc) {
        g2.setColor(Color.RED);
        g2.setStroke(stroke);
        if (pointnum == 1) {
            int x1 = xpointvc.get(0);
            int y1 = ypointvc.get(0);
            if (mouseclicknum == 1) {
                g2.setColor(ChooseColor.getColo(xuanze, 90));
                int posx = (new Double((x1 - xpy) / x_bi)).intValue() + x0;
                int posy = (new Double((y1 - ypy) / y_bi)).intValue() + y0;
                int x2 = new Double(juxing_wh[0]).intValue();
                int y2 = new Double(juxing_wh[1]).intValue();
                int posw = (new Double((x2 - x1) / x_bi)).intValue();
                int posh = (new Double((y2 - y1) / y_bi)).intValue();
                g2.fillRect(posx, posy, posw, posh);
            } else {
                int posx = (new Double((x1 - xpy) / x_bi)).intValue() + x0;
                int posy = (new Double((y1 - ypy) / y_bi)).intValue() + y0;
                g2.fillOval(posx - 3, posy - 3, 6, 6);
            }
 
 
        } else if (pointnum == 2) {
            g2.setColor(ChooseColor.getColo(xuanze, 90));
            int x1 = xpointvc.get(0);
            int x2 = xpointvc.get(1);
            int y1 = ypointvc.get(0);
            int y2 = ypointvc.get(1);
            int posx = (new Double((x1 - xpy) / x_bi)).intValue() + x0;
            int posy = (new Double((y1 - ypy) / y_bi)).intValue() + y0;
            int posw = (new Double((x2 - x1) / x_bi)).intValue();
            int posh = (new Double((y2 - y1) / y_bi)).intValue();
            g2.fillRect(posx, posy, posw, posh);
        }
 
    }
 
    /**
     * »ñÈ¡×ø±êµÄ¼¯ºÏ
     */
    public double[] getpoint(Vector<Integer> pointvc) {
        int size = pointvc.size();
        double[] point = new double[size];
        for (int i = 0; i < size; i++) {
            point[i] = pointvc.get(i);
        }
        return point;
    }
 
    /**
     * XY×ø±êµÄ¼¯ºÏ
     */
    public StringBuffer getzuobiaos(Vector<Integer> xpointvc, Vector<Integer> ypointvc) {
        StringBuffer zuobiaos = new StringBuffer();
        int size = xpointvc.size();
        for (int i = 0; i < size; i++) {
            int x = xpointvc.get(i);
            int y = ypointvc.get(i);
            String xy = x + "," + y;
            if (i == size - 1) {
                zuobiaos.append(xy);
            } else {
                zuobiaos.append(xy + ";");
            }
        }
        return zuobiaos;
    }
 
    /**
     * »ñÈ¡¾­Î³¶È×ø±êµÄ×Ö·û´®
     */
    public StringBuffer getzuobiaosjwd(Vector<String> xpointvc, Vector<String> ypointvc) {
        StringBuffer zuobiaos = new StringBuffer();
        int size = xpointvc.size();
        for (int i = 0; i < size; i++) {
            String jd = xpointvc.get(i);
            String wd = ypointvc.get(i);
            String xy = jd + "," + wd;
            if (i == size - 1) {
                zuobiaos.append(xy);
            } else {
                zuobiaos.append(xy + ";");
            }
        }
        return zuobiaos;
    }
 
    /**
     * ³õʼ»¯
     */
    public void chushihua() {
 
        mouseclicknum = 0;
        pointnum = 0;//¶¨µãµÄÊýÁ¿
        pointjuxingnum = 0;
        pointlinenum = 0;
        xpointvc.removeAllElements();
        ypointvc.removeAllElements();
        xjuxingc.removeAllElements();
        yjuxingc.removeAllElements();
        xline.removeAllElements();
        yline.removeAllElements();
        mycanvas.repaint();
    }
 
    /**
     * »æÖÆ»ùÕ¾¶ÔÏó
     */
    public void draw_anchor(Graphics2D g2, String mapfloor) {
        int size2 = Anchor_Dell.getAnchor_vector().size();
        if (size2 != 0) {
            for (int k = 0; k < size2; k++) {
                Anchor anchor = Anchor_Dell.getAnchor_vector().get(k);
                if (mapfloor.equals(anchor.getAnc_floor())) {
                    String axs = anchor.getAnc_x();
                    String ays = anchor.getAnc_y();
                    double axd = Double.valueOf(axs);
                    double ayd = Double.valueOf(ays);
                    int acx = (int) axd;
                    int acy = (int) ayd;
                    int anx = get_xpos(mapfloor, acx);
                    int any = get_ypos(mapfloor, acy);
                    if (anchor.getAnc_image() != null) {
                        int anwidth = anchor.getAnc_image().getWidth(this);
                        int anheight = anchor.getAnc_image().getHeight(this);
                        //Èç¹û»ùÕ¾ÊDZ»Ñ¡ÖеĻùÕ¾
                        if (AnchorManage.getChoose_anchor().equals(anchor.getAnc_id())) {
                            g2.drawImage(Anchor_Dell.getCeju(), anx - anwidth / 2, any - anheight, anwidth, anheight, this);
                        } else {
                            g2.drawImage(anchor.getAnc_image(), anx - anwidth / 2, any - anheight, anwidth, anheight, this);
                        }
                        g2.setFont(FontChoose.ziti(14));
                        g2.setColor(ancid);
                        g2.drawString(anchor.getAnc_id(), anx - 15, any - anheight - 6);
                        g2.setFont(FontChoose.ziti(14));
                        g2.setColor(Color.gray);
                        String anx1 = anchor.getAnc_x();
                        String any1 = anchor.getAnc_y();
                        String anzb = "[" + anx1 + "," + any1 + "]";
                        g2.drawString(anzb, anx - 20, any + 14);
                    }
                }
            }
        }
    }
 
    /**
     * »ñÈ¡ÔÚµØÍ¼ÖеÄX×ø±ê
     */
    public int get_xpos(String mapfloor, int x) {
        double anc_x = x - Map_Dell.get_map(mapfloor).getX0_length();
        double xx = (anc_x / x_bi) + x0;
        int anx = (int) Math.round(xx);
        return anx;
    }
 
    /**
     * »ñÈ¡ÔÚµØÍ¼ÖеÄY×ø±ê
     */
    public int get_ypos(String mapfloor, int y) {
        double anc_y = y - Map_Dell.get_map(mapfloor).getY0_width();
        double yy = (anc_y / y_bi) + y0;
        int any = (int) Math.round(yy);
        return any;
    }
 
    /**
     * »ñÈ¡¾ØÐÎΧÀ¸µÄ¾­Î³¶È×ø±ê
     */
    public static String getjxjwd(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, String floor) {
        String ax = x1 + "";
        String ay = y1 + "";
        String bx = x2 + "";
        String by = y2 + "";
        String cx = x3 + "";
        String cy = y3 + "";
        String dx = x4 + "";
        String dy = y4 + "";
        String[] xy1 = Juge_indoor.xy2d(ax, ay, floor);
        ax = xy1[0];
        ay = xy1[1];
        String[] xy2 = Juge_indoor.xy2d(bx, by, floor);
        bx = xy2[0];
        by = xy2[1];
        String[] xy3 = Juge_indoor.xy2d(cx, cy, floor);
        cx = xy3[0];
        cy = xy3[1];
        String[] xy4 = Juge_indoor.xy2d(dx, dy, floor);
        dx = xy4[0];
        dy = xy4[1];
        String reczb = ax + "," + ay + ";" + bx + "," + by + ";" + cx + "," + cy + ";" + dx + "," + dy;//¾ØÐÎΧÀ¸×ø±ê
        return reczb;
    }
 
 
    public JComboBox<String> getJc_xingzhuang() {
        if (jc_xingzhuang == null) {
            jc_xingzhuang = new JComboBox<>();//´´½¨ÏÂÀ­¿ò¶ÔÏó
            jc_xingzhuang.setBackground(Color.white);
            jc_xingzhuang.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 12));//ÉèÖÃ×ÖÌå
            String[] a0= {"¾ØÐÎ","¶à±ßÐÎ","Ô²ÐÎ","һάÏß"};
            ComboBoxModel<String> coModel = new DefaultComboBoxModel<>(a0);//ÏÂÀ­ÁбíÄ£ÐÍ
            jc_xingzhuang.setModel(coModel);
            jc_xingzhuang.updateUI();//¸üÐÂUI
            jc_xingzhuang.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    xingzhuang=jc_xingzhuang.getSelectedIndex();
                    xzstr=(String) jc_xingzhuang.getSelectedItem();    
                    if(xingzhuang==3) {
                        getLeixngBox().setSelectedIndex(6);
                        getLeixngBox().setEnabled(false);
                        jt_banjing.setEnabled(false);
                    }else if(xingzhuang==2){
                        jt_banjing.setEnabled(true);
                    }else {
                        getLeixngBox().setEnabled(true);
                        jt_banjing.setEnabled(false);
                    }
                }
            });
 
        }
        return jc_xingzhuang;
    }
 
 
 
 
}