15832144755
2022-03-17 bc131131c5c96f8cb3bed679d4a359820c22e335
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
package com.hxzkoa.json;
 
import java.awt.geom.Point2D;
import java.util.Arrays;
import java.util.Vector;
 
public class tb_fence {
    private int id;
    private String floor;
    private String type;
    private String bumen;
    private String name;
    private String zuobiao;
    private String shape;
    private String start;
    private String stop;
    private String addtime;
    private String color;
    private String baoliu1;
 
    public String getBaoliu1() {
        return baoliu1;
    }
 
    public void setBaoliu1(String baoliu1) {
        this.baoliu1 = baoliu1;
    }
 
    public int getId() {
        return id;
    }
 
    public void setId(int id) {
        this.id = id;
    }
 
    public String getFloor() {
        return floor;
    }
 
    public void setFloor(String floor) {
        this.floor = floor;
    }
 
    public String getType() {
        return type;
    }
 
    public void setType(String type) {
        this.type = type;
    }
 
    public String getBumen() {
        return bumen;
    }
 
    public void setBumen(String bumen) {
        this.bumen = bumen;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public String getZuobiao() {
        return zuobiao;
    }
 
    public void setZuobiao(String zuobiao) {
        this.zuobiao = zuobiao;
    }
 
    public String getShape() {
        return shape;
    }
 
    public void setShape(String shape) {
        this.shape = shape;
    }
 
    public String getStart() {
        return start;
    }
 
    public void setStart(String start) {
        this.start = start;
    }
 
    public String getStop() {
        return stop;
    }
 
    public void setStop(String stop) {
        this.stop = stop;
    }
 
    public String getAddtime() {
        return addtime;
    }
 
    public void setAddtime(String addtime) {
        this.addtime = addtime;
    }
 
    public String getColor() {
        return color;
    }
 
    public void setColor(String color) {
        this.color = color;
    }
 
    public Vector<Point2D.Double> getPts() {
        Vector<Point2D.Double> pts = new Vector<Point2D.Double>();
        String zuobiao = this.getZuobiao();// 坐标字符串
        String shape = this.getShape();
        String ju_xing = "矩形";
        if (ju_xing.equals(shape)) {
            String[] zb = zuobiao.split("\\,");// 用逗号分割
            Double x0 = Double.parseDouble(zb[0]);
            Double y0 = Double.parseDouble(zb[1]);
            Double x2 = Double.parseDouble(zb[2]);
            Double y2 = Double.parseDouble(zb[3]);
            Double x1 = x2;
            Double y1 = y0;
            Double x3 = x0;
            Double y3 = y2;
            Point2D.Double p0 = new Point2D.Double(x0, y0);
            Point2D.Double p1 = new Point2D.Double(x1, y1);
            Point2D.Double p2 = new Point2D.Double(x2, y2);
            Point2D.Double p3 = new Point2D.Double(x3, y3);
            pts.add(p0);
            pts.add(p1);
            pts.add(p2);
            pts.add(p3);
        } else {
            String[] zb = zuobiao.split("\\,");// 用逗号分割
            int bian = zb.length/2;
            for (int i = 0; i < bian; i++) {
//              String zbxy = zb[i];
                String[] xy = Arrays.copyOfRange(zb,2*i,2*i+2);// 以“,”分割字符串从而获得每个点的x和y
                Point2D.Double p = new Point2D.Double(Double.parseDouble(xy[0]), Double.parseDouble(xy[1]));
                pts.add(p);
            }
 
        }
        return pts;
    }
 
}