1 | package org.medias.eccad.modele; |
---|
2 | |
---|
3 | import java.text.NumberFormat; |
---|
4 | |
---|
5 | public class Zone { |
---|
6 | private double northbc; |
---|
7 | private double southbc; |
---|
8 | private double eastbc; |
---|
9 | private double westbc; |
---|
10 | NumberFormat numberFormat; |
---|
11 | |
---|
12 | public Zone(double northbc, double southbc, double eastbc, double westbc) { |
---|
13 | super(); |
---|
14 | this.northbc = northbc; |
---|
15 | this.southbc = southbc; |
---|
16 | this.eastbc = eastbc; |
---|
17 | this.westbc = westbc; |
---|
18 | numberFormat = NumberFormat.getNumberInstance(); |
---|
19 | numberFormat.setMaximumFractionDigits(2); |
---|
20 | } |
---|
21 | |
---|
22 | public Zone() { |
---|
23 | super(); |
---|
24 | this.northbc = 0; |
---|
25 | this.southbc = 0; |
---|
26 | this.eastbc = 0; |
---|
27 | this.westbc = 0; |
---|
28 | numberFormat = NumberFormat.getNumberInstance(); |
---|
29 | numberFormat.setMaximumFractionDigits(2); |
---|
30 | } |
---|
31 | |
---|
32 | |
---|
33 | |
---|
34 | |
---|
35 | |
---|
36 | |
---|
37 | |
---|
38 | |
---|
39 | public double getEastbc() { |
---|
40 | return eastbc; |
---|
41 | } |
---|
42 | public void setEastbc(double eastbc) { |
---|
43 | this.eastbc = eastbc; |
---|
44 | } |
---|
45 | public double getNorthbc() { |
---|
46 | return northbc; |
---|
47 | } |
---|
48 | public void setNorthbc(double northbc) { |
---|
49 | this.northbc = northbc; |
---|
50 | } |
---|
51 | public double getSouthbc() { |
---|
52 | return southbc; |
---|
53 | } |
---|
54 | public void setSouthbc(double southbc) { |
---|
55 | this.southbc = southbc; |
---|
56 | } |
---|
57 | public double getWestbc() { |
---|
58 | return westbc; |
---|
59 | } |
---|
60 | public void setWestbc(double westbc) { |
---|
61 | this.westbc = westbc; |
---|
62 | } |
---|
63 | |
---|
64 | public String toString() { |
---|
65 | String retour = ""; |
---|
66 | retour += northbc + ":" + southbc + ":" + eastbc + ":" + westbc; |
---|
67 | |
---|
68 | return retour; |
---|
69 | } |
---|
70 | |
---|
71 | public String getEastbcN() { |
---|
72 | if (eastbc > 180) |
---|
73 | return "180"; |
---|
74 | return numberFormat.format(eastbc); |
---|
75 | |
---|
76 | } |
---|
77 | |
---|
78 | public void setEastbcN(String eastbcN) { |
---|
79 | |
---|
80 | } |
---|
81 | |
---|
82 | public String getNorthbcN() { |
---|
83 | if (northbc > 90) |
---|
84 | return "90"; |
---|
85 | return numberFormat.format(northbc); |
---|
86 | } |
---|
87 | |
---|
88 | public void setNorthbcN(String northbcN) { |
---|
89 | |
---|
90 | } |
---|
91 | |
---|
92 | public String getSouthbcN() { |
---|
93 | if (southbc < -90) |
---|
94 | return "-90"; |
---|
95 | else |
---|
96 | return numberFormat.format(southbc); |
---|
97 | } |
---|
98 | |
---|
99 | public void setSouthbcN(String southbcN) { |
---|
100 | |
---|
101 | } |
---|
102 | |
---|
103 | public String getWestbcN() { |
---|
104 | if (westbc < -180) |
---|
105 | return "-180"; |
---|
106 | else |
---|
107 | return numberFormat.format(westbc); |
---|
108 | } |
---|
109 | |
---|
110 | public void setWestbcN(String westbcN) { |
---|
111 | |
---|
112 | } |
---|
113 | |
---|
114 | } |
---|