1 | package oseam.seamarks;
|
---|
2 |
|
---|
3 | import javax.swing.*;
|
---|
4 |
|
---|
5 | import java.awt.*;
|
---|
6 | import java.awt.geom.Arc2D;
|
---|
7 |
|
---|
8 | import java.util.*;
|
---|
9 |
|
---|
10 | import org.openstreetmap.josm.Main;
|
---|
11 | import org.openstreetmap.josm.data.osm.Node;
|
---|
12 | import org.openstreetmap.josm.command.ChangePropertyCommand;
|
---|
13 |
|
---|
14 | import oseam.Messages;
|
---|
15 | import oseam.dialogs.OSeaMAction;
|
---|
16 |
|
---|
17 | public class SeaMark extends JPanel {
|
---|
18 |
|
---|
19 | public OSeaMAction dlg = null;
|
---|
20 |
|
---|
21 | public SeaMark(OSeaMAction dia) {
|
---|
22 | dlg = dia;
|
---|
23 | clrLight();
|
---|
24 | }
|
---|
25 |
|
---|
26 | public enum Reg {
|
---|
27 | A, B, C, R, X
|
---|
28 | }
|
---|
29 |
|
---|
30 | public static final EnumMap<Reg, String> RegSTR = new EnumMap<Reg, String>(Reg.class);
|
---|
31 | static {
|
---|
32 | RegSTR.put(Reg.A, "iala-a");
|
---|
33 | RegSTR.put(Reg.B, "iala-b");
|
---|
34 | RegSTR.put(Reg.C, "cevni");
|
---|
35 | RegSTR.put(Reg.R, "riwr");
|
---|
36 | RegSTR.put(Reg.X, "other");
|
---|
37 | }
|
---|
38 |
|
---|
39 | private Reg region = Reg.A;
|
---|
40 |
|
---|
41 | public Reg getRegion() {
|
---|
42 | return region;
|
---|
43 | }
|
---|
44 |
|
---|
45 | public void setRegion(Reg reg) {
|
---|
46 | region = reg;
|
---|
47 | }
|
---|
48 |
|
---|
49 | private String name = "";
|
---|
50 |
|
---|
51 | public String getName() {
|
---|
52 | return name;
|
---|
53 | }
|
---|
54 |
|
---|
55 | public void setName(String str) {
|
---|
56 | name = str.trim();
|
---|
57 | repaint();
|
---|
58 | }
|
---|
59 |
|
---|
60 | private String longName = "";
|
---|
61 |
|
---|
62 | public enum Obj {
|
---|
63 | UNKOBJ, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP,
|
---|
64 | BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP,
|
---|
65 | FLTCAR, FLTISD, FLTLAT, FLTSAW, FLTSPP,
|
---|
66 | LITMAJ, LITMIN, LITFLT, LITVES, LITHSE, LNDMRK,
|
---|
67 | MORFAC, SISTAW, SISTAT, OFSPLF
|
---|
68 | }
|
---|
69 |
|
---|
70 | public static final EnumMap<Obj, String> ObjSTR = new EnumMap<Obj, String>(Obj.class);
|
---|
71 | static {
|
---|
72 | ObjSTR.put(Obj.BCNCAR, "beacon_cardinal");
|
---|
73 | ObjSTR.put(Obj.BCNISD, "beacon_isolated_danger");
|
---|
74 | ObjSTR.put(Obj.BCNLAT, "beacon_lateral");
|
---|
75 | ObjSTR.put(Obj.BCNSAW, "beacon_safe_water");
|
---|
76 | ObjSTR.put(Obj.BCNSPP, "beacon_special_purpose");
|
---|
77 | ObjSTR.put(Obj.BOYCAR, "buoy_cardinal");
|
---|
78 | ObjSTR.put(Obj.BOYISD, "buoy_isolated_danger");
|
---|
79 | ObjSTR.put(Obj.BOYLAT, "buoy_lateral");
|
---|
80 | ObjSTR.put(Obj.BOYSAW, "buoy_safe_water");
|
---|
81 | ObjSTR.put(Obj.BOYSPP, "buoy_special_purpose");
|
---|
82 | ObjSTR.put(Obj.FLTCAR, "light_float");
|
---|
83 | ObjSTR.put(Obj.FLTLAT, "light_float");
|
---|
84 | ObjSTR.put(Obj.FLTSAW, "light_float");
|
---|
85 | ObjSTR.put(Obj.FLTISD, "light_float");
|
---|
86 | ObjSTR.put(Obj.FLTSPP, "light_float");
|
---|
87 | ObjSTR.put(Obj.LITMAJ, "light_major");
|
---|
88 | ObjSTR.put(Obj.LITMIN, "light_minor");
|
---|
89 | ObjSTR.put(Obj.LITFLT, "light_float");
|
---|
90 | ObjSTR.put(Obj.LITVES, "light_vessel");
|
---|
91 | ObjSTR.put(Obj.LNDMRK, "landmark");
|
---|
92 | ObjSTR.put(Obj.LITHSE, "landmark");
|
---|
93 | ObjSTR.put(Obj.MORFAC, "mooring");
|
---|
94 | ObjSTR.put(Obj.OFSPLF, "platform");
|
---|
95 | ObjSTR.put(Obj.SISTAW, "signal_station_warning");
|
---|
96 | ObjSTR.put(Obj.SISTAT, "signal_station_traffic");
|
---|
97 | }
|
---|
98 |
|
---|
99 | private Obj object = Obj.UNKOBJ;
|
---|
100 |
|
---|
101 | public Obj getObject() {
|
---|
102 | return object;
|
---|
103 | }
|
---|
104 |
|
---|
105 | public void setObject(Obj obj) {
|
---|
106 | object = obj;
|
---|
107 | if (obj == Obj.UNKOBJ) {
|
---|
108 | setCategory(Cat.NOCAT);
|
---|
109 | setShape(Shp.UNKSHP);
|
---|
110 | setColour(Ent.BODY, Col.UNKCOL);
|
---|
111 | setPattern(Ent.BODY, Pat.NOPAT);
|
---|
112 | setTopmark(Top.NOTOP);
|
---|
113 | setColour(Ent.TOPMARK, Col.UNKCOL);
|
---|
114 | setPattern(Ent.TOPMARK, Pat.NOPAT);
|
---|
115 | setFogSound(Fog.NOFOG);
|
---|
116 | setRadar(Rtb.NORTB);
|
---|
117 | setStatus(Sts.UNKSTS);
|
---|
118 | setConstr(Cns.UNKCNS);
|
---|
119 | setConsp(Con.UNKCON);
|
---|
120 | setRefl(Con.UNKCON);
|
---|
121 | setRef("");
|
---|
122 | setObjectHeight("");
|
---|
123 | setElevation("");
|
---|
124 | setInfo("");
|
---|
125 | setSource("");
|
---|
126 | setFixme("");
|
---|
127 | }
|
---|
128 | repaint();
|
---|
129 | }
|
---|
130 |
|
---|
131 | public enum Ent {
|
---|
132 | BODY, BUOY, BEACON, LFLOAT, TOPMARK, LIGHT, MOORING, STATION, PLATFORM
|
---|
133 | }
|
---|
134 |
|
---|
135 | public static final EnumMap<Obj, Ent> EntMAP = new EnumMap<Obj, Ent>(Obj.class);
|
---|
136 | static {
|
---|
137 | EntMAP.put(Obj.BCNCAR, Ent.BEACON);
|
---|
138 | EntMAP.put(Obj.BCNISD, Ent.BEACON);
|
---|
139 | EntMAP.put(Obj.BCNLAT, Ent.BEACON);
|
---|
140 | EntMAP.put(Obj.BCNSAW, Ent.BEACON);
|
---|
141 | EntMAP.put(Obj.BCNSPP, Ent.BEACON);
|
---|
142 | EntMAP.put(Obj.BOYCAR, Ent.BUOY);
|
---|
143 | EntMAP.put(Obj.BOYISD, Ent.BUOY);
|
---|
144 | EntMAP.put(Obj.BOYLAT, Ent.BUOY);
|
---|
145 | EntMAP.put(Obj.BOYSAW, Ent.BUOY);
|
---|
146 | EntMAP.put(Obj.BOYSPP, Ent.BUOY);
|
---|
147 | EntMAP.put(Obj.LITMAJ, Ent.LIGHT);
|
---|
148 | EntMAP.put(Obj.LITMIN, Ent.LIGHT);
|
---|
149 | EntMAP.put(Obj.LITFLT, Ent.LFLOAT);
|
---|
150 | EntMAP.put(Obj.FLTCAR, Ent.LFLOAT);
|
---|
151 | EntMAP.put(Obj.FLTLAT, Ent.LFLOAT);
|
---|
152 | EntMAP.put(Obj.FLTSAW, Ent.LFLOAT);
|
---|
153 | EntMAP.put(Obj.FLTISD, Ent.LFLOAT);
|
---|
154 | EntMAP.put(Obj.FLTSPP, Ent.LFLOAT);
|
---|
155 | EntMAP.put(Obj.LITVES, Ent.LFLOAT);
|
---|
156 | EntMAP.put(Obj.LITHSE, Ent.LIGHT);
|
---|
157 | EntMAP.put(Obj.LNDMRK, Ent.LIGHT);
|
---|
158 | EntMAP.put(Obj.MORFAC, Ent.MOORING);
|
---|
159 | EntMAP.put(Obj.OFSPLF, Ent.PLATFORM);
|
---|
160 | EntMAP.put(Obj.SISTAW, Ent.STATION);
|
---|
161 | EntMAP.put(Obj.SISTAT, Ent.STATION);
|
---|
162 | }
|
---|
163 |
|
---|
164 | public enum Grp {
|
---|
165 | NUL, LAT, CAR, SAW, ISD, SPP, LGT, SIS, PLF
|
---|
166 | }
|
---|
167 |
|
---|
168 | public static final EnumMap<Obj, Grp> GrpMAP = new EnumMap<Obj, Grp>(Obj.class);
|
---|
169 | static {
|
---|
170 | GrpMAP.put(Obj.UNKOBJ, Grp.NUL);
|
---|
171 | GrpMAP.put(Obj.BCNCAR, Grp.CAR);
|
---|
172 | GrpMAP.put(Obj.BCNISD, Grp.ISD);
|
---|
173 | GrpMAP.put(Obj.BCNLAT, Grp.LAT);
|
---|
174 | GrpMAP.put(Obj.BCNSAW, Grp.SAW);
|
---|
175 | GrpMAP.put(Obj.BCNSPP, Grp.SPP);
|
---|
176 | GrpMAP.put(Obj.BOYCAR, Grp.CAR);
|
---|
177 | GrpMAP.put(Obj.BOYISD, Grp.ISD);
|
---|
178 | GrpMAP.put(Obj.BOYLAT, Grp.LAT);
|
---|
179 | GrpMAP.put(Obj.BOYSAW, Grp.SAW);
|
---|
180 | GrpMAP.put(Obj.BOYSPP, Grp.SPP);
|
---|
181 | GrpMAP.put(Obj.FLTCAR, Grp.CAR);
|
---|
182 | GrpMAP.put(Obj.FLTLAT, Grp.LAT);
|
---|
183 | GrpMAP.put(Obj.FLTSAW, Grp.SAW);
|
---|
184 | GrpMAP.put(Obj.FLTISD, Grp.ISD);
|
---|
185 | GrpMAP.put(Obj.FLTSPP, Grp.SPP);
|
---|
186 | GrpMAP.put(Obj.LITFLT, Grp.LGT);
|
---|
187 | GrpMAP.put(Obj.LITMAJ, Grp.LGT);
|
---|
188 | GrpMAP.put(Obj.LITMIN, Grp.LGT);
|
---|
189 | GrpMAP.put(Obj.LITVES, Grp.LGT);
|
---|
190 | GrpMAP.put(Obj.LITHSE, Grp.LGT);
|
---|
191 | GrpMAP.put(Obj.LNDMRK, Grp.LGT);
|
---|
192 | GrpMAP.put(Obj.MORFAC, Grp.SPP);
|
---|
193 | GrpMAP.put(Obj.OFSPLF, Grp.PLF);
|
---|
194 | GrpMAP.put(Obj.SISTAW, Grp.SIS);
|
---|
195 | GrpMAP.put(Obj.SISTAT, Grp.SIS);
|
---|
196 | }
|
---|
197 |
|
---|
198 | public enum Cat {
|
---|
199 | NOCAT, LAM_PORT, LAM_STBD, LAM_PPORT, LAM_PSTBD, CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST,
|
---|
200 | ACH_URST, ACH_DEEP, ACH_TANK, ACH_EXPL, ACH_QUAR, ACH_SPLN, ACH_SCAN, ACH_SCMO, ACH_T24H, ACH_TLIM,
|
---|
201 | SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN, SPM_MOOR, SPM_LNBY,
|
---|
202 | SPM_LDNG, SPM_NOTC, SPM_TSS, SPM_FOUL, SPM_DIVE, SPM_FRRY, SPM_ANCH,
|
---|
203 | MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_BUOY,
|
---|
204 | SIS_PTCL, SIS_PTED, SIS_IPT, SIS_BRTH, SIS_DOCK, SIS_LOCK, SIS_FBAR, SIS_BRDG, SIS_DRDG, SIS_TRFC,
|
---|
205 | SIS_DNGR, SIS_OBST, SIS_CABL, SIS_MILY, SIS_DSTR, SIS_WTHR, SIS_STRM, SIS_ICE, SIS_TIME, SIS_TIDE,
|
---|
206 | SIS_TSTM, SIS_TGAG, SIS_TSCL, SIS_DIVE, SIS_LGAG, LIT_DIRF, LIT_LEDG,
|
---|
207 | LMK_CHMY, LMK_CARN, LMK_DSHA, LMK_FLGS, LMK_FLRS, LMK_MNMT, LMK_TOWR, LMK_WNDM, LMK_WTRT,
|
---|
208 | LMK_MAST, LMK_WNDS, LMK_CLMN, LMK_OBLK, LMK_STAT, LMK_CROS, LMK_DOME, LMK_SCNR, LMK_WNDL, LMK_SPIR,
|
---|
209 | OFP_OIL, OFP_PRD, OFP_OBS, OFP_ALP, OFP_SALM, OFP_MOR, OFP_ISL, OFP_FPSO, OFP_ACC, OFP_NCCB
|
---|
210 | }
|
---|
211 |
|
---|
212 | public static final EnumMap<Cat, String> CatSTR = new EnumMap<Cat, String>(Cat.class);
|
---|
213 | static {
|
---|
214 | CatSTR.put(Cat.LAM_PORT, "port");
|
---|
215 | CatSTR.put(Cat.LAM_STBD, "starboard");
|
---|
216 | CatSTR.put(Cat.LAM_PPORT, "preferred_channel_port");
|
---|
217 | CatSTR.put(Cat.LAM_PSTBD, "preferred_channel_starboard");
|
---|
218 | CatSTR.put(Cat.CAM_NORTH, "north");
|
---|
219 | CatSTR.put(Cat.CAM_EAST, "east");
|
---|
220 | CatSTR.put(Cat.CAM_SOUTH, "south");
|
---|
221 | CatSTR.put(Cat.CAM_WEST, "west");
|
---|
222 | CatSTR.put(Cat.SPM_UNKN, "unknown_purpose");
|
---|
223 | CatSTR.put(Cat.SPM_WARN, "warning");
|
---|
224 | CatSTR.put(Cat.SPM_CHBF, "channel_separation");
|
---|
225 | CatSTR.put(Cat.SPM_YCHT, "yachting");
|
---|
226 | CatSTR.put(Cat.SPM_CABL, "cable");
|
---|
227 | CatSTR.put(Cat.SPM_OFAL, "outfall");
|
---|
228 | CatSTR.put(Cat.SPM_ODAS, "odas");
|
---|
229 | CatSTR.put(Cat.SPM_RECN, "recreational");
|
---|
230 | CatSTR.put(Cat.SPM_MOOR, "mooring");
|
---|
231 | CatSTR.put(Cat.SPM_LNBY, "lanby");
|
---|
232 | CatSTR.put(Cat.SPM_LDNG, "leading");
|
---|
233 | CatSTR.put(Cat.SPM_NOTC, "notice");
|
---|
234 | CatSTR.put(Cat.SPM_TSS, "tss");
|
---|
235 | CatSTR.put(Cat.SPM_FOUL, "foul");
|
---|
236 | CatSTR.put(Cat.SPM_DIVE, "diving");
|
---|
237 | CatSTR.put(Cat.SPM_FRRY, "ferry");
|
---|
238 | CatSTR.put(Cat.SPM_ANCH, "anchorage");
|
---|
239 | CatSTR.put(Cat.MOR_DLPN, "dolphin");
|
---|
240 | CatSTR.put(Cat.MOR_DDPN, "deviation_dolphin");
|
---|
241 | CatSTR.put(Cat.MOR_BLRD, "bollard");
|
---|
242 | CatSTR.put(Cat.MOR_WALL, "wall");
|
---|
243 | CatSTR.put(Cat.MOR_POST, "post");
|
---|
244 | CatSTR.put(Cat.MOR_CHWR, "chain");
|
---|
245 | CatSTR.put(Cat.MOR_BUOY, "buoy");
|
---|
246 | CatSTR.put(Cat.SIS_PTCL, "control");
|
---|
247 | CatSTR.put(Cat.SIS_PTED, "entry");
|
---|
248 | CatSTR.put(Cat.SIS_IPT, "IPT");
|
---|
249 | CatSTR.put(Cat.SIS_BRTH, "berthing");
|
---|
250 | CatSTR.put(Cat.SIS_DOCK, "dock");
|
---|
251 | CatSTR.put(Cat.SIS_LOCK, "lock");
|
---|
252 | CatSTR.put(Cat.SIS_FBAR, "barrage");
|
---|
253 | CatSTR.put(Cat.SIS_BRDG, "bridge");
|
---|
254 | CatSTR.put(Cat.SIS_DRDG, "dredging");
|
---|
255 | CatSTR.put(Cat.SIS_TRFC, "traffic");
|
---|
256 | CatSTR.put(Cat.SIS_DNGR, "danger");
|
---|
257 | CatSTR.put(Cat.SIS_OBST, "obstruction");
|
---|
258 | CatSTR.put(Cat.SIS_CABL, "cable");
|
---|
259 | CatSTR.put(Cat.SIS_MILY, "military");
|
---|
260 | CatSTR.put(Cat.SIS_DSTR, "distress");
|
---|
261 | CatSTR.put(Cat.SIS_WTHR, "weather");
|
---|
262 | CatSTR.put(Cat.SIS_STRM, "storm");
|
---|
263 | CatSTR.put(Cat.SIS_ICE, "ice");
|
---|
264 | CatSTR.put(Cat.SIS_TIME, "time");
|
---|
265 | CatSTR.put(Cat.SIS_TIDE, "tide");
|
---|
266 | CatSTR.put(Cat.SIS_TSTM, "stream");
|
---|
267 | CatSTR.put(Cat.SIS_TGAG, "gauge");
|
---|
268 | CatSTR.put(Cat.SIS_TSCL, "scale");
|
---|
269 | CatSTR.put(Cat.SIS_DIVE, "diving");
|
---|
270 | CatSTR.put(Cat.SIS_LGAG, "level");
|
---|
271 | CatSTR.put(Cat.LMK_CHMY, "chimney");
|
---|
272 | CatSTR.put(Cat.LMK_CARN, "cairn");
|
---|
273 | CatSTR.put(Cat.LMK_DSHA, "dish_aerial");
|
---|
274 | CatSTR.put(Cat.LMK_FLGS, "flagstaff");
|
---|
275 | CatSTR.put(Cat.LMK_FLRS, "flare_stack");
|
---|
276 | CatSTR.put(Cat.LMK_MNMT, "monument");
|
---|
277 | CatSTR.put(Cat.LMK_TOWR, "tower");
|
---|
278 | CatSTR.put(Cat.LMK_WNDM, "windmotor");
|
---|
279 | CatSTR.put(Cat.LMK_WTRT, "water_tower");
|
---|
280 | CatSTR.put(Cat.LMK_MAST, "mast");
|
---|
281 | CatSTR.put(Cat.LMK_WNDS, "wind_sock");
|
---|
282 | CatSTR.put(Cat.LMK_CLMN, "column");
|
---|
283 | CatSTR.put(Cat.LMK_OBLK, "obelisk");
|
---|
284 | CatSTR.put(Cat.LMK_STAT, "statue");
|
---|
285 | CatSTR.put(Cat.LMK_CROS, "cross");
|
---|
286 | CatSTR.put(Cat.LMK_DOME, "dome");
|
---|
287 | CatSTR.put(Cat.LMK_SCNR, "radar");
|
---|
288 | CatSTR.put(Cat.LMK_WNDL, "windmill");
|
---|
289 | CatSTR.put(Cat.LMK_SPIR, "spire");
|
---|
290 | CatSTR.put(Cat.OFP_OIL, "oil");
|
---|
291 | CatSTR.put(Cat.OFP_PRD, "production");
|
---|
292 | CatSTR.put(Cat.OFP_OBS, "observation");
|
---|
293 | CatSTR.put(Cat.OFP_ALP, "alp");
|
---|
294 | CatSTR.put(Cat.OFP_SALM, "salm");
|
---|
295 | CatSTR.put(Cat.OFP_MOR, "mooring");
|
---|
296 | CatSTR.put(Cat.OFP_ISL, "island");
|
---|
297 | CatSTR.put(Cat.OFP_FPSO, "fpso");
|
---|
298 | CatSTR.put(Cat.OFP_ACC, "accommodation");
|
---|
299 | CatSTR.put(Cat.OFP_NCCB, "nccb");
|
---|
300 | }
|
---|
301 |
|
---|
302 | private Cat category = Cat.NOCAT;
|
---|
303 |
|
---|
304 | public Cat getCategory() {
|
---|
305 | return category;
|
---|
306 | }
|
---|
307 |
|
---|
308 | public void setCategory(Cat cat) {
|
---|
309 | category = cat;
|
---|
310 | repaint();
|
---|
311 | }
|
---|
312 |
|
---|
313 | public enum Shp {
|
---|
314 | UNKSHP, PILLAR, SPAR, CAN, CONI, SPHERI, BARREL, FLOAT, SUPER, BUOYANT, CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON
|
---|
315 | }
|
---|
316 |
|
---|
317 | public static final EnumMap<Shp, String> ShpSTR = new EnumMap<Shp, String>(Shp.class);
|
---|
318 | static {
|
---|
319 | ShpSTR.put(Shp.PILLAR, "pillar");
|
---|
320 | ShpSTR.put(Shp.SPAR, "spar");
|
---|
321 | ShpSTR.put(Shp.CAN, "can");
|
---|
322 | ShpSTR.put(Shp.CONI, "conical");
|
---|
323 | ShpSTR.put(Shp.SPHERI, "spherical");
|
---|
324 | ShpSTR.put(Shp.BARREL, "barrel");
|
---|
325 | ShpSTR.put(Shp.FLOAT, "float");
|
---|
326 | ShpSTR.put(Shp.SUPER, "super-buoy");
|
---|
327 | ShpSTR.put(Shp.BUOYANT, "buoyant");
|
---|
328 | ShpSTR.put(Shp.CAIRN, "cairn");
|
---|
329 | ShpSTR.put(Shp.PILE, "pile");
|
---|
330 | ShpSTR.put(Shp.LATTICE, "lattice");
|
---|
331 | ShpSTR.put(Shp.TOWER, "tower");
|
---|
332 | ShpSTR.put(Shp.STAKE, "stake");
|
---|
333 | ShpSTR.put(Shp.PERCH, "perch");
|
---|
334 | }
|
---|
335 |
|
---|
336 | private Shp shape = Shp.UNKSHP;
|
---|
337 |
|
---|
338 | public Shp getShape() {
|
---|
339 | return shape;
|
---|
340 | }
|
---|
341 |
|
---|
342 | public void setShape(Shp shp) {
|
---|
343 | shape = shp;
|
---|
344 | repaint();
|
---|
345 | }
|
---|
346 |
|
---|
347 | public enum Col {
|
---|
348 | UNKCOL, BLANK, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, GREY, BROWN, MAGENTA, PINK
|
---|
349 | }
|
---|
350 |
|
---|
351 | public static final EnumMap<Col, Color> ColMAP = new EnumMap<Col, Color>(Col.class);
|
---|
352 | static {
|
---|
353 | ColMAP.put(Col.UNKCOL, new Color(0xc0c0c0));
|
---|
354 | ColMAP.put(Col.WHITE, Color.WHITE);
|
---|
355 | ColMAP.put(Col.RED, Color.RED);
|
---|
356 | ColMAP.put(Col.ORANGE, Color.ORANGE);
|
---|
357 | ColMAP.put(Col.AMBER, new Color(0xfbf00f));
|
---|
358 | ColMAP.put(Col.YELLOW, Color.YELLOW);
|
---|
359 | ColMAP.put(Col.GREEN, Color.GREEN);
|
---|
360 | ColMAP.put(Col.BLUE, Color.BLUE);
|
---|
361 | ColMAP.put(Col.VIOLET, new Color(0x8f00ff));
|
---|
362 | ColMAP.put(Col.BLACK, Color.BLACK);
|
---|
363 | ColMAP.put(Col.GREY, Color.GRAY);
|
---|
364 | ColMAP.put(Col.BROWN, new Color(0xa45a58));
|
---|
365 | ColMAP.put(Col.MAGENTA, Color.MAGENTA);
|
---|
366 | ColMAP.put(Col.PINK, Color.PINK);
|
---|
367 | }
|
---|
368 |
|
---|
369 | public static final EnumMap<Col, String> ColSTR = new EnumMap<Col, String>(Col.class);
|
---|
370 | static {
|
---|
371 | ColSTR.put(Col.WHITE, "white");
|
---|
372 | ColSTR.put(Col.RED, "red");
|
---|
373 | ColSTR.put(Col.ORANGE, "orange");
|
---|
374 | ColSTR.put(Col.AMBER, "amber");
|
---|
375 | ColSTR.put(Col.YELLOW, "yellow");
|
---|
376 | ColSTR.put(Col.GREEN, "green");
|
---|
377 | ColSTR.put(Col.BLUE, "blue");
|
---|
378 | ColSTR.put(Col.VIOLET, "violet");
|
---|
379 | ColSTR.put(Col.BLACK, "black");
|
---|
380 | ColSTR.put(Col.GREY, "grey");
|
---|
381 | ColSTR.put(Col.BROWN, "brown");
|
---|
382 | ColSTR.put(Col.MAGENTA, "magenta");
|
---|
383 | ColSTR.put(Col.PINK, "pink");
|
---|
384 | }
|
---|
385 |
|
---|
386 | public Col getColour(Ent ent, int idx) {
|
---|
387 | if (ent == Ent.BODY)
|
---|
388 | return getObjColour(idx);
|
---|
389 | else
|
---|
390 | return getTopColour(idx);
|
---|
391 | }
|
---|
392 |
|
---|
393 | public void setColour(Ent ent, Col col) {
|
---|
394 | if (ent == Ent.BODY)
|
---|
395 | setObjColour(col);
|
---|
396 | else
|
---|
397 | setTopColour(col);
|
---|
398 | }
|
---|
399 |
|
---|
400 | public void setColour(Ent ent, int idx, Col col) {
|
---|
401 | if (ent == Ent.BODY)
|
---|
402 | setObjColour(idx, col);
|
---|
403 | else
|
---|
404 | setTopColour(idx, col);
|
---|
405 | }
|
---|
406 |
|
---|
407 | public void addColour(Ent ent, int idx, Col col) {
|
---|
408 | if (ent == Ent.BODY)
|
---|
409 | addObjColour(idx, col);
|
---|
410 | else
|
---|
411 | addTopColour(idx, col);
|
---|
412 | }
|
---|
413 |
|
---|
414 | public void subColour(Ent ent, int idx) {
|
---|
415 | if (ent == Ent.BODY)
|
---|
416 | subObjColour(idx);
|
---|
417 | else
|
---|
418 | subTopColour(idx);
|
---|
419 | }
|
---|
420 |
|
---|
421 | private ArrayList<Col> bodyColour = new ArrayList<Col>();
|
---|
422 |
|
---|
423 | public Col getObjColour(int i) {
|
---|
424 | if (i < bodyColour.size())
|
---|
425 | return bodyColour.get(i);
|
---|
426 | else
|
---|
427 | return Col.UNKCOL;
|
---|
428 | }
|
---|
429 |
|
---|
430 | public void setObjColour(Col col) {
|
---|
431 | bodyColour.clear();
|
---|
432 | bodyColour.add(col);
|
---|
433 | repaint();
|
---|
434 | }
|
---|
435 |
|
---|
436 | public void setObjColour(int i, Col col) {
|
---|
437 | if (i < bodyColour.size())
|
---|
438 | bodyColour.set(i, col);
|
---|
439 | repaint();
|
---|
440 | }
|
---|
441 |
|
---|
442 | public void addObjColour(int i, Col col) {
|
---|
443 | if (bodyColour.size() >= i)
|
---|
444 | bodyColour.add(i, col);
|
---|
445 | repaint();
|
---|
446 | }
|
---|
447 |
|
---|
448 | public void addObjColour(Col col) {
|
---|
449 | bodyColour.add(col);
|
---|
450 | repaint();
|
---|
451 | }
|
---|
452 |
|
---|
453 | public void subObjColour(int i) {
|
---|
454 | if (bodyColour.size() > i)
|
---|
455 | bodyColour.remove(i);
|
---|
456 | repaint();
|
---|
457 | }
|
---|
458 |
|
---|
459 | private ArrayList<Col> topmarkColour = new ArrayList<Col>();
|
---|
460 |
|
---|
461 | public Col getTopColour(int i) {
|
---|
462 | if (i < topmarkColour.size())
|
---|
463 | return topmarkColour.get(i);
|
---|
464 | else
|
---|
465 | return Col.UNKCOL;
|
---|
466 | }
|
---|
467 |
|
---|
468 | public void setTopColour(Col col) {
|
---|
469 | topmarkColour.clear();
|
---|
470 | topmarkColour.add(col);
|
---|
471 | repaint();
|
---|
472 | }
|
---|
473 |
|
---|
474 | public void setTopColour(int i, Col col) {
|
---|
475 | if (topmarkColour.size() > i)
|
---|
476 | topmarkColour.set(i, col);
|
---|
477 | repaint();
|
---|
478 | }
|
---|
479 |
|
---|
480 | public void addTopColour(int i, Col col) {
|
---|
481 | if (topmarkColour.size() >= i)
|
---|
482 | topmarkColour.add(i, col);
|
---|
483 | repaint();
|
---|
484 | }
|
---|
485 |
|
---|
486 | public void addTopColour(Col col) {
|
---|
487 | topmarkColour.add(col);
|
---|
488 | repaint();
|
---|
489 | }
|
---|
490 |
|
---|
491 | public void subTopColour(int i) {
|
---|
492 | if (topmarkColour.size() > i)
|
---|
493 | topmarkColour.remove(i);
|
---|
494 | repaint();
|
---|
495 | }
|
---|
496 |
|
---|
497 | public enum Chr {
|
---|
498 | UNKCHR, FIXED, FLASH, LFLASH, QUICK, VQUICK, UQUICK, ISOPHASED, OCCULTING, MORSE, ALTERNATING, IQUICK, IVQUICK, IUQUICK
|
---|
499 | }
|
---|
500 |
|
---|
501 | public static final Map<EnumSet<Chr>, String> ChrMAP = new HashMap<EnumSet<Chr>, String>();
|
---|
502 | static {
|
---|
503 | ChrMAP.put(EnumSet.of(Chr.FIXED), "F");
|
---|
504 | ChrMAP.put(EnumSet.of(Chr.FLASH), "Fl");
|
---|
505 | ChrMAP.put(EnumSet.of(Chr.LFLASH), "LFl");
|
---|
506 | ChrMAP.put(EnumSet.of(Chr.QUICK), "Q");
|
---|
507 | ChrMAP.put(EnumSet.of(Chr.VQUICK), "VQ");
|
---|
508 | ChrMAP.put(EnumSet.of(Chr.UQUICK), "UQ");
|
---|
509 | ChrMAP.put(EnumSet.of(Chr.ISOPHASED), "Iso");
|
---|
510 | ChrMAP.put(EnumSet.of(Chr.OCCULTING), "Oc");
|
---|
511 | ChrMAP.put(EnumSet.of(Chr.IQUICK), "IQ");
|
---|
512 | ChrMAP.put(EnumSet.of(Chr.IVQUICK), "IVQ");
|
---|
513 | ChrMAP.put(EnumSet.of(Chr.IUQUICK), "IUQ");
|
---|
514 | ChrMAP.put(EnumSet.of(Chr.MORSE), "Mo");
|
---|
515 | ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.FLASH), "FFl");
|
---|
516 | ChrMAP.put(EnumSet.of(Chr.FLASH, Chr.LFLASH), "FlLFl");
|
---|
517 | ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.OCCULTING), "FOc");
|
---|
518 | ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LFLASH), "FLFl");
|
---|
519 | ChrMAP.put(EnumSet.of(Chr.OCCULTING, Chr.FLASH), "OcFl");
|
---|
520 | ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LFLASH), "Q+LFl");
|
---|
521 | ChrMAP.put(EnumSet.of(Chr.VQUICK, Chr.LFLASH), "VQ+LFl");
|
---|
522 | ChrMAP.put(EnumSet.of(Chr.UQUICK, Chr.LFLASH), "UQ+LFl");
|
---|
523 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING), "Al");
|
---|
524 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc");
|
---|
525 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LFLASH), "Al.LFl");
|
---|
526 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl");
|
---|
527 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED), "Al.F");
|
---|
528 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED, Chr.FLASH), "Al.FFl");
|
---|
529 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.ISOPHASED), "Al.Iso");
|
---|
530 | }
|
---|
531 |
|
---|
532 | public enum Vis {
|
---|
533 | UNKVIS, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS
|
---|
534 | }
|
---|
535 |
|
---|
536 | public static final EnumMap<Vis, String> VisSTR = new EnumMap<Vis, String>(Vis.class);
|
---|
537 | static {
|
---|
538 | VisSTR.put(Vis.HIGH, "high");
|
---|
539 | VisSTR.put(Vis.LOW, "low");
|
---|
540 | VisSTR.put(Vis.FAINT, "faint");
|
---|
541 | VisSTR.put(Vis.INTEN, "intensified");
|
---|
542 | VisSTR.put(Vis.UNINTEN, "unintensified");
|
---|
543 | VisSTR.put(Vis.REST, "restricted");
|
---|
544 | VisSTR.put(Vis.OBS, "obscured");
|
---|
545 | VisSTR.put(Vis.PARTOBS, "part_obscured");
|
---|
546 | }
|
---|
547 |
|
---|
548 | public enum Lit {
|
---|
549 | UNKLIT, VERT, HORIZ, DIR, UPPER, LOWER, LEAD, REAR, FRONT, AERO, AIROBS, FOGDET, FLOOD, STRIP, SUBS, SPOT, MOIRE, EMERG, BEAR
|
---|
550 | }
|
---|
551 |
|
---|
552 | public static final EnumMap<Lit, String> LitSTR = new EnumMap<Lit, String>(Lit.class);
|
---|
553 | static {
|
---|
554 | LitSTR.put(Lit.VERT, "vertical");
|
---|
555 | LitSTR.put(Lit.HORIZ, "horizontal");
|
---|
556 | LitSTR.put(Lit.DIR, "directional");
|
---|
557 | LitSTR.put(Lit.UPPER, "upper");
|
---|
558 | LitSTR.put(Lit.LOWER, "lower");
|
---|
559 | LitSTR.put(Lit.LEAD, "leading");
|
---|
560 | LitSTR.put(Lit.REAR, "rear");
|
---|
561 | LitSTR.put(Lit.FRONT, "front");
|
---|
562 | LitSTR.put(Lit.AERO, "aero");
|
---|
563 | LitSTR.put(Lit.AIROBS, "air_obstruction");
|
---|
564 | LitSTR.put(Lit.FOGDET, "fog_detector");
|
---|
565 | LitSTR.put(Lit.FLOOD, "floodlight");
|
---|
566 | LitSTR.put(Lit.STRIP, "striplight");
|
---|
567 | LitSTR.put(Lit.SUBS, "subsidairy");
|
---|
568 | LitSTR.put(Lit.SPOT, "spotlight");
|
---|
569 | LitSTR.put(Lit.MOIRE, "moire");
|
---|
570 | LitSTR.put(Lit.EMERG, "emergency");
|
---|
571 | LitSTR.put(Lit.BEAR, "bearing");
|
---|
572 | }
|
---|
573 |
|
---|
574 | public enum Exh {
|
---|
575 | UNKEXH, H24, DAY, NIGHT, FOG, WARN, STORM
|
---|
576 | }
|
---|
577 |
|
---|
578 | public static final EnumMap<Exh, String> ExhSTR = new EnumMap<Exh, String>(Exh.class);
|
---|
579 | static {
|
---|
580 | ExhSTR.put(Exh.H24, "24h");
|
---|
581 | ExhSTR.put(Exh.DAY, "day");
|
---|
582 | ExhSTR.put(Exh.NIGHT, "night");
|
---|
583 | ExhSTR.put(Exh.FOG, "fog");
|
---|
584 | ExhSTR.put(Exh.WARN, "warning");
|
---|
585 | ExhSTR.put(Exh.STORM, "storm");
|
---|
586 | }
|
---|
587 |
|
---|
588 | public enum Att {
|
---|
589 | COL, CHR, GRP, SEQ, PER, LIT, BEG, END, RAD, HGT, RNG, VIS, EXH, ORT, MLT, ALT
|
---|
590 | }
|
---|
591 |
|
---|
592 | public Object[] sector = { Col.UNKCOL, "", "", "", "", Lit.UNKLIT, "", "",
|
---|
593 | "", "", "", Vis.UNKVIS, Exh.UNKEXH, "", "", Col.UNKCOL };
|
---|
594 |
|
---|
595 | private ArrayList<Object[]> sectors = new ArrayList<Object[]>();
|
---|
596 |
|
---|
597 | public int getSectorCount() {
|
---|
598 | return sectors.size();
|
---|
599 | }
|
---|
600 |
|
---|
601 | public boolean isSectored() {
|
---|
602 | return (sectors.size() > 1);
|
---|
603 | }
|
---|
604 |
|
---|
605 | public Object getLightAtt(Att att, int i) {
|
---|
606 | return getLightAtt(att.ordinal(), i);
|
---|
607 | }
|
---|
608 |
|
---|
609 | public Object getLightAtt(int att, int i) {
|
---|
610 | if (i < sectors.size())
|
---|
611 | return sectors.get(i)[att];
|
---|
612 | else
|
---|
613 | return null;
|
---|
614 | }
|
---|
615 |
|
---|
616 | public void setLightAtt(Att att, int i, Object obj) {
|
---|
617 | setLightAtt(att.ordinal(), i, obj);
|
---|
618 | }
|
---|
619 |
|
---|
620 | public void setLightAtt(int att, int i, Object obj) {
|
---|
621 | if (sectors.size() == i)
|
---|
622 | addLight(i);
|
---|
623 | if (sectors.size() > i)
|
---|
624 | switch (att) {
|
---|
625 | case 4:
|
---|
626 | case 9:
|
---|
627 | case 10:
|
---|
628 | case 14:
|
---|
629 | sectors.get(i)[att] = validDecimal((String)obj);
|
---|
630 | break;
|
---|
631 | case 6:
|
---|
632 | case 7:
|
---|
633 | case 13:
|
---|
634 | sectors.get(i)[att] = validDecimal((String)obj, 360);
|
---|
635 | break;
|
---|
636 | default:
|
---|
637 | sectors.get(i)[att] = obj;
|
---|
638 | }
|
---|
639 | repaint();
|
---|
640 | }
|
---|
641 |
|
---|
642 | public void addLight(int i) {
|
---|
643 | if (sectors.size() >= i) {
|
---|
644 | if (sectors.size() == 0)
|
---|
645 | sectors.add(sector.clone());
|
---|
646 | else
|
---|
647 | sectors.add(i, sectors.get(0).clone());
|
---|
648 | }
|
---|
649 | }
|
---|
650 |
|
---|
651 | public void nulLight(int i) {
|
---|
652 | if (i == 0) {
|
---|
653 | clrLight();
|
---|
654 | } else {
|
---|
655 | sectors.add(i, sector.clone());
|
---|
656 | }
|
---|
657 | }
|
---|
658 |
|
---|
659 | public void addLight() {
|
---|
660 | if (sectors.size() == 0)
|
---|
661 | sectors.add(sector.clone());
|
---|
662 | else
|
---|
663 | sectors.add(sectors.get(0).clone());
|
---|
664 | }
|
---|
665 |
|
---|
666 | public void delLight(int i) {
|
---|
667 | if (sectors.size() > i)
|
---|
668 | sectors.remove(i);
|
---|
669 | repaint();
|
---|
670 | }
|
---|
671 |
|
---|
672 | public void clrLight() {
|
---|
673 | sectors.clear();
|
---|
674 | addLight();
|
---|
675 | setLightRef("");
|
---|
676 | repaint();
|
---|
677 | }
|
---|
678 |
|
---|
679 | public enum Pat {
|
---|
680 | NOPAT, HSTRP, VSTRP, DIAG, SQUARED, BORDER, CROSS
|
---|
681 | }
|
---|
682 |
|
---|
683 | public static final EnumMap<Pat, String> PatSTR = new EnumMap<Pat, String>(Pat.class);
|
---|
684 | static {
|
---|
685 | PatSTR.put(Pat.HSTRP, "horizontal");
|
---|
686 | PatSTR.put(Pat.VSTRP, "vertical");
|
---|
687 | PatSTR.put(Pat.DIAG, "diagonal");
|
---|
688 | PatSTR.put(Pat.SQUARED, "squared");
|
---|
689 | PatSTR.put(Pat.BORDER, "border");
|
---|
690 | PatSTR.put(Pat.CROSS, "cross");
|
---|
691 | }
|
---|
692 |
|
---|
693 | public Pat getPattern(Ent ent) {
|
---|
694 | if (ent == Ent.BODY)
|
---|
695 | return getObjPattern();
|
---|
696 | else
|
---|
697 | return getTopPattern();
|
---|
698 | }
|
---|
699 |
|
---|
700 | public void setPattern(Ent ent, Pat pat) {
|
---|
701 | if (ent == Ent.BODY)
|
---|
702 | setObjPattern(pat);
|
---|
703 | else
|
---|
704 | setTopPattern(pat);
|
---|
705 | }
|
---|
706 |
|
---|
707 | private Pat bodyPattern = Pat.NOPAT;
|
---|
708 |
|
---|
709 | public Pat getObjPattern() {
|
---|
710 | return bodyPattern;
|
---|
711 | }
|
---|
712 |
|
---|
713 | public void setObjPattern(Pat pat) {
|
---|
714 | bodyPattern = pat;
|
---|
715 | }
|
---|
716 |
|
---|
717 | private Pat topPattern = Pat.NOPAT;
|
---|
718 |
|
---|
719 | public Pat getTopPattern() {
|
---|
720 | return topPattern;
|
---|
721 | }
|
---|
722 |
|
---|
723 | public void setTopPattern(Pat pat) {
|
---|
724 | topPattern = pat;
|
---|
725 | }
|
---|
726 |
|
---|
727 | public enum Top {
|
---|
728 | NOTOP, CAN, CONE, SPHERE, X_SHAPE, NORTH, SOUTH, EAST, WEST, SPHERES2, BOARD, RHOMBUS, CIRCLE, TRIANGLE, TRIANGLE_INV, SQUARE
|
---|
729 | }
|
---|
730 |
|
---|
731 | public static final EnumMap<Top, String> TopSTR = new EnumMap<Top, String>(Top.class);
|
---|
732 | static {
|
---|
733 | TopSTR.put(Top.CAN, "cylinder");
|
---|
734 | TopSTR.put(Top.CONE, "cone, point up");
|
---|
735 | TopSTR.put(Top.SPHERE, "sphere");
|
---|
736 | TopSTR.put(Top.X_SHAPE, "x-shape");
|
---|
737 | TopSTR.put(Top.NORTH, "2 cones up");
|
---|
738 | TopSTR.put(Top.SOUTH, "2 cones down");
|
---|
739 | TopSTR.put(Top.EAST, "2 cones base together");
|
---|
740 | TopSTR.put(Top.WEST, "2 cones point together");
|
---|
741 | TopSTR.put(Top.SPHERES2, "2 spheres");
|
---|
742 | TopSTR.put(Top.BOARD, "board");
|
---|
743 | TopSTR.put(Top.RHOMBUS, "rhombus");
|
---|
744 | TopSTR.put(Top.CIRCLE, "circle");
|
---|
745 | TopSTR.put(Top.TRIANGLE, "triangle, point up");
|
---|
746 | TopSTR.put(Top.TRIANGLE_INV, "triangle, point down");
|
---|
747 | TopSTR.put(Top.SQUARE, "square");
|
---|
748 | }
|
---|
749 |
|
---|
750 | private Top topShape = Top.NOTOP;
|
---|
751 |
|
---|
752 | public Top getTopmark() {
|
---|
753 | return topShape;
|
---|
754 | }
|
---|
755 |
|
---|
756 | public void setTopmark(Top top) {
|
---|
757 | topShape = top;
|
---|
758 | repaint();
|
---|
759 | }
|
---|
760 |
|
---|
761 | public enum Rtb {
|
---|
762 | NORTB, REFLECTOR, RACON, RAMARK, LEADING
|
---|
763 | }
|
---|
764 |
|
---|
765 | public static final EnumMap<Rtb, String> RtbSTR = new EnumMap<Rtb, String>(Rtb.class);
|
---|
766 | static {
|
---|
767 | RtbSTR.put(Rtb.RACON, "racon");
|
---|
768 | RtbSTR.put(Rtb.RAMARK, "ramark");
|
---|
769 | RtbSTR.put(Rtb.LEADING, "leading");
|
---|
770 | }
|
---|
771 |
|
---|
772 | private Rtb RaType = Rtb.NORTB;
|
---|
773 |
|
---|
774 | public Rtb getRadar() {
|
---|
775 | return RaType;
|
---|
776 | }
|
---|
777 |
|
---|
778 | public void setRadar(Rtb type) {
|
---|
779 | RaType = type;
|
---|
780 | if (type == Rtb.NORTB) {
|
---|
781 | setRaconGroup("");
|
---|
782 | setRaconSequence("");
|
---|
783 | setRaconPeriod("");
|
---|
784 | setRaconRange("");
|
---|
785 | setRaconSector1("");
|
---|
786 | setRaconSector2("");
|
---|
787 | }
|
---|
788 | repaint();
|
---|
789 | }
|
---|
790 |
|
---|
791 | private String raconGroup = "";
|
---|
792 |
|
---|
793 | public String getRaconGroup() {
|
---|
794 | return raconGroup;
|
---|
795 | }
|
---|
796 |
|
---|
797 | public void setRaconGroup(String grp) {
|
---|
798 | raconGroup = grp;
|
---|
799 | repaint();
|
---|
800 | }
|
---|
801 |
|
---|
802 | private String raconSequence = "";
|
---|
803 |
|
---|
804 | public String getRaconSequence() {
|
---|
805 | return raconSequence;
|
---|
806 | }
|
---|
807 |
|
---|
808 | public void setRaconSequence(String seq) {
|
---|
809 | raconSequence = seq;
|
---|
810 | repaint();
|
---|
811 | }
|
---|
812 |
|
---|
813 | private String raconPeriod = "";
|
---|
814 |
|
---|
815 | public String getRaconPeriod() {
|
---|
816 | return raconPeriod;
|
---|
817 | }
|
---|
818 |
|
---|
819 | public void setRaconPeriod(String per) {
|
---|
820 | raconPeriod = validDecimal(per);
|
---|
821 | repaint();
|
---|
822 | }
|
---|
823 |
|
---|
824 | private String raconRange = "";
|
---|
825 |
|
---|
826 | public String getRaconRange() {
|
---|
827 | return raconRange;
|
---|
828 | }
|
---|
829 |
|
---|
830 | public void setRaconRange(String rng) {
|
---|
831 | raconRange = validDecimal(rng);
|
---|
832 | repaint();
|
---|
833 | }
|
---|
834 |
|
---|
835 | private String raconSector1 = "";
|
---|
836 |
|
---|
837 | public String getRaconSector1() {
|
---|
838 | return raconSector1;
|
---|
839 | }
|
---|
840 |
|
---|
841 | public void setRaconSector1(String sec) {
|
---|
842 | raconSector1 = validDecimal(sec);
|
---|
843 | repaint();
|
---|
844 | }
|
---|
845 |
|
---|
846 | private String raconSector2 = "";
|
---|
847 |
|
---|
848 | public String getRaconSector2() {
|
---|
849 | return raconSector2;
|
---|
850 | }
|
---|
851 |
|
---|
852 | public void setRaconSector2(String sec) {
|
---|
853 | raconSector2 = validDecimal(sec);
|
---|
854 | repaint();
|
---|
855 | }
|
---|
856 |
|
---|
857 | public enum Fog {
|
---|
858 | NOFOG, FOGSIG, HORN, SIREN, DIA, BELL, WHIS, GONG, EXPLOS
|
---|
859 | }
|
---|
860 |
|
---|
861 | public static final EnumMap<Fog, String> FogSTR = new EnumMap<Fog, String>(Fog.class);
|
---|
862 | static {
|
---|
863 | FogSTR.put(Fog.FOGSIG, "yes");
|
---|
864 | FogSTR.put(Fog.HORN, "horn");
|
---|
865 | FogSTR.put(Fog.SIREN, "siren");
|
---|
866 | FogSTR.put(Fog.DIA, "diaphone");
|
---|
867 | FogSTR.put(Fog.BELL, "bell");
|
---|
868 | FogSTR.put(Fog.WHIS, "whistle");
|
---|
869 | FogSTR.put(Fog.GONG, "gong");
|
---|
870 | FogSTR.put(Fog.EXPLOS, "explosion");
|
---|
871 | }
|
---|
872 |
|
---|
873 | private Fog fogSound = Fog.NOFOG;
|
---|
874 |
|
---|
875 | public Fog getFogSound() {
|
---|
876 | return fogSound;
|
---|
877 | }
|
---|
878 |
|
---|
879 | public void setFogSound(Fog sound) {
|
---|
880 | fogSound = sound;
|
---|
881 | if (sound == Fog.NOFOG) {
|
---|
882 | setFogGroup("");
|
---|
883 | setFogSequence("");
|
---|
884 | setFogPeriod("");
|
---|
885 | setFogRange("");
|
---|
886 | }
|
---|
887 | repaint();
|
---|
888 | }
|
---|
889 |
|
---|
890 | private String fogGroup = "";
|
---|
891 |
|
---|
892 | public String getFogGroup() {
|
---|
893 | return fogGroup;
|
---|
894 | }
|
---|
895 |
|
---|
896 | public void setFogGroup(String grp) {
|
---|
897 | fogGroup = grp;
|
---|
898 | repaint();
|
---|
899 | }
|
---|
900 |
|
---|
901 | private String fogSequence = "";
|
---|
902 |
|
---|
903 | public String getFogSequence() {
|
---|
904 | return fogSequence;
|
---|
905 | }
|
---|
906 |
|
---|
907 | public void setFogSequence(String seq) {
|
---|
908 | fogSequence = seq;
|
---|
909 | repaint();
|
---|
910 | }
|
---|
911 |
|
---|
912 | private String fogRange = "";
|
---|
913 |
|
---|
914 | public String getFogRange() {
|
---|
915 | return fogRange;
|
---|
916 | }
|
---|
917 |
|
---|
918 | public void setFogRange(String rng) {
|
---|
919 | fogRange = validDecimal(rng);
|
---|
920 | repaint();
|
---|
921 | }
|
---|
922 |
|
---|
923 | private String fogPeriod = "";
|
---|
924 |
|
---|
925 | public String getFogPeriod() {
|
---|
926 | return fogPeriod;
|
---|
927 | }
|
---|
928 |
|
---|
929 | public void setFogPeriod(String per) {
|
---|
930 | fogPeriod = validDecimal(per);
|
---|
931 | repaint();
|
---|
932 | }
|
---|
933 |
|
---|
934 | public enum Sts {
|
---|
935 | UNKSTS, PERM, OCC, REC, NIU, INT, RESV, TEMP, PRIV, MAND, DEST, EXT, ILLUM, HIST, PUB, SYNC, WATCH, UNWAT, DOUBT
|
---|
936 | }
|
---|
937 |
|
---|
938 | public static final EnumMap<Sts, String> StsSTR = new EnumMap<Sts, String>(Sts.class);
|
---|
939 | static {
|
---|
940 | StsSTR.put(Sts.PERM, "permanent");
|
---|
941 | StsSTR.put(Sts.OCC, "occasional");
|
---|
942 | StsSTR.put(Sts.REC, "recommended");
|
---|
943 | StsSTR.put(Sts.NIU, "not_in_use");
|
---|
944 | StsSTR.put(Sts.INT, "intermittent");
|
---|
945 | StsSTR.put(Sts.RESV, "reserved");
|
---|
946 | StsSTR.put(Sts.TEMP, "tempory");
|
---|
947 | StsSTR.put(Sts.PRIV, "private");
|
---|
948 | StsSTR.put(Sts.MAND, "mandatory");
|
---|
949 | StsSTR.put(Sts.DEST, "destroyed");
|
---|
950 | StsSTR.put(Sts.EXT, "extinguished");
|
---|
951 | StsSTR.put(Sts.ILLUM, "illuminated");
|
---|
952 | StsSTR.put(Sts.HIST, "historic");
|
---|
953 | StsSTR.put(Sts.PUB, "public");
|
---|
954 | StsSTR.put(Sts.SYNC, "synchronized");
|
---|
955 | StsSTR.put(Sts.WATCH, "watched");
|
---|
956 | StsSTR.put(Sts.UNWAT, "unwatched");
|
---|
957 | StsSTR.put(Sts.DOUBT, "existence_doubtful");
|
---|
958 | }
|
---|
959 |
|
---|
960 | private Sts status = Sts.UNKSTS;
|
---|
961 |
|
---|
962 | public Sts getStatus() {
|
---|
963 | return status;
|
---|
964 | }
|
---|
965 |
|
---|
966 | public void setStatus(Sts sts) {
|
---|
967 | status = sts;
|
---|
968 | }
|
---|
969 |
|
---|
970 | public enum Cns {
|
---|
971 | UNKCNS, BRICK, CONC, BOULD, HSURF, USURF, WOOD, METAL, GRP, PAINT
|
---|
972 | }
|
---|
973 |
|
---|
974 | public static final EnumMap<Cns, String> CnsSTR = new EnumMap<Cns, String>(Cns.class);
|
---|
975 | static {
|
---|
976 | CnsSTR.put(Cns.BRICK, "masonry");
|
---|
977 | CnsSTR.put(Cns.CONC, "concreted");
|
---|
978 | CnsSTR.put(Cns.BOULD, "boulders");
|
---|
979 | CnsSTR.put(Cns.HSURF, "hard_surfaced");
|
---|
980 | CnsSTR.put(Cns.USURF, "unsurfaced");
|
---|
981 | CnsSTR.put(Cns.WOOD, "wooden");
|
---|
982 | CnsSTR.put(Cns.METAL, "metal");
|
---|
983 | CnsSTR.put(Cns.GRP, "grp");
|
---|
984 | CnsSTR.put(Cns.PAINT, "painted");
|
---|
985 | }
|
---|
986 |
|
---|
987 | private Cns construction = Cns.UNKCNS;
|
---|
988 |
|
---|
989 | public Cns getConstr() {
|
---|
990 | return construction;
|
---|
991 | }
|
---|
992 |
|
---|
993 | public void setConstr(Cns cns) {
|
---|
994 | construction = cns;
|
---|
995 | }
|
---|
996 |
|
---|
997 | public enum Con {
|
---|
998 | UNKCON, CONSP, NCONS, REFL
|
---|
999 | }
|
---|
1000 |
|
---|
1001 | public static final EnumMap<Con, String> ConSTR = new EnumMap<Con, String>(Con.class);
|
---|
1002 | static {
|
---|
1003 | ConSTR.put(Con.CONSP, "conspicuous");
|
---|
1004 | ConSTR.put(Con.NCONS, "not_conspicuous");
|
---|
1005 | ConSTR.put(Con.REFL, "reflector");
|
---|
1006 | }
|
---|
1007 |
|
---|
1008 | private Con conspicuity = Con.UNKCON;
|
---|
1009 |
|
---|
1010 | public Con getConsp() {
|
---|
1011 | return conspicuity;
|
---|
1012 | }
|
---|
1013 |
|
---|
1014 | public void setConsp(Con con) {
|
---|
1015 | conspicuity = con;
|
---|
1016 | }
|
---|
1017 |
|
---|
1018 | private Con reflectivity = Con.UNKCON;
|
---|
1019 |
|
---|
1020 | public Con getRefl() {
|
---|
1021 | return reflectivity;
|
---|
1022 | }
|
---|
1023 |
|
---|
1024 | public void setRefl(Con con) {
|
---|
1025 | reflectivity = con;
|
---|
1026 | }
|
---|
1027 |
|
---|
1028 | public String information = "";
|
---|
1029 |
|
---|
1030 | public String getInfo() {
|
---|
1031 | return information;
|
---|
1032 | }
|
---|
1033 |
|
---|
1034 | public void setInfo(String str) {
|
---|
1035 | information = str.trim();
|
---|
1036 | }
|
---|
1037 |
|
---|
1038 | public String source = "";
|
---|
1039 |
|
---|
1040 | public String getSource() {
|
---|
1041 | return source;
|
---|
1042 | }
|
---|
1043 |
|
---|
1044 | public void setSource(String str) {
|
---|
1045 | source = str.trim();
|
---|
1046 | }
|
---|
1047 |
|
---|
1048 | public String elevation = "";
|
---|
1049 |
|
---|
1050 | public String getElevation() {
|
---|
1051 | return elevation;
|
---|
1052 | }
|
---|
1053 |
|
---|
1054 | public void setElevation(String str) {
|
---|
1055 | elevation = validDecimal(str);
|
---|
1056 | }
|
---|
1057 |
|
---|
1058 | public String height = "";
|
---|
1059 |
|
---|
1060 | public String getObjectHeight() {
|
---|
1061 | return height;
|
---|
1062 | }
|
---|
1063 |
|
---|
1064 | public void setObjectHeight(String str) {
|
---|
1065 | height = validDecimal(str);
|
---|
1066 | }
|
---|
1067 |
|
---|
1068 | public String ref = "";
|
---|
1069 |
|
---|
1070 | public String getRef() {
|
---|
1071 | return ref;
|
---|
1072 | }
|
---|
1073 |
|
---|
1074 | public void setRef(String str) {
|
---|
1075 | ref = str;
|
---|
1076 | }
|
---|
1077 |
|
---|
1078 | public String lightRef = "";
|
---|
1079 |
|
---|
1080 | public String getLightRef() {
|
---|
1081 | return lightRef;
|
---|
1082 | }
|
---|
1083 |
|
---|
1084 | public void setLightRef(String str) {
|
---|
1085 | lightRef = str;
|
---|
1086 | }
|
---|
1087 |
|
---|
1088 | public String fixme = "";
|
---|
1089 |
|
---|
1090 | public String getFixme() {
|
---|
1091 | return fixme;
|
---|
1092 | }
|
---|
1093 |
|
---|
1094 | public void setFixme(String str) {
|
---|
1095 | fixme = str;
|
---|
1096 | }
|
---|
1097 |
|
---|
1098 | public boolean testValid() {
|
---|
1099 | boolean tmp = false;
|
---|
1100 | dlg.manager.showVisualMessage("");
|
---|
1101 | switch (getObject()) {
|
---|
1102 | case BCNCAR:
|
---|
1103 | case BCNLAT:
|
---|
1104 | case BOYCAR:
|
---|
1105 | case BOYLAT:
|
---|
1106 | if ((getCategory() != Cat.NOCAT) && (getShape() != Shp.UNKSHP))
|
---|
1107 | tmp = true;
|
---|
1108 | break;
|
---|
1109 | case BCNISD:
|
---|
1110 | case BCNSAW:
|
---|
1111 | case BCNSPP:
|
---|
1112 | case BOYISD:
|
---|
1113 | case BOYSAW:
|
---|
1114 | case BOYSPP:
|
---|
1115 | if (getShape() != Shp.UNKSHP)
|
---|
1116 | tmp = true;
|
---|
1117 | break;
|
---|
1118 | case FLTCAR:
|
---|
1119 | case FLTISD:
|
---|
1120 | case FLTLAT:
|
---|
1121 | case FLTSAW:
|
---|
1122 | case FLTSPP:
|
---|
1123 | if (getObjColour(0) != Col.UNKCOL)
|
---|
1124 | tmp = true;
|
---|
1125 | break;
|
---|
1126 | case LITMAJ:
|
---|
1127 | case LITMIN:
|
---|
1128 | case LITFLT:
|
---|
1129 | case LITVES:
|
---|
1130 | case LITHSE:
|
---|
1131 | case MORFAC:
|
---|
1132 | case SISTAW:
|
---|
1133 | case SISTAT:
|
---|
1134 | case OFSPLF:
|
---|
1135 | tmp = true;
|
---|
1136 | break;
|
---|
1137 | case LNDMRK:
|
---|
1138 | if (getCategory() != Cat.NOCAT)
|
---|
1139 | tmp = true;
|
---|
1140 | break;
|
---|
1141 | }
|
---|
1142 | if (tmp) {
|
---|
1143 | dlg.panelMain.moreButton.setVisible(true);
|
---|
1144 | dlg.panelMain.saveButton.setEnabled(true);
|
---|
1145 | Ent ent = EntMAP.get(getObject());
|
---|
1146 | dlg.panelMain.topButton.setEnabled((ent == Ent.BUOY)
|
---|
1147 | || (ent == Ent.BEACON) || (ent == Ent.LFLOAT));
|
---|
1148 | dlg.panelMain.fogButton.setEnabled(true);
|
---|
1149 | dlg.panelMain.radButton.setEnabled(true);
|
---|
1150 | dlg.panelMain.litButton.setEnabled(true);
|
---|
1151 | return true;
|
---|
1152 | } else {
|
---|
1153 | dlg.panelMain.moreButton.setVisible(false);
|
---|
1154 | dlg.panelMain.moreButton.setText(">>");
|
---|
1155 | dlg.panelMain.topButton.setEnabled(false);
|
---|
1156 | dlg.panelMain.fogButton.setEnabled(false);
|
---|
1157 | dlg.panelMain.radButton.setEnabled(false);
|
---|
1158 | dlg.panelMain.litButton.setEnabled(false);
|
---|
1159 | dlg.manager.showVisualMessage("Seamark not recognised");
|
---|
1160 | return false;
|
---|
1161 | }
|
---|
1162 | }
|
---|
1163 |
|
---|
1164 | public void clearSign() {
|
---|
1165 | setObject(Obj.UNKOBJ);
|
---|
1166 | setName("");
|
---|
1167 | clrLight();
|
---|
1168 | dlg.panelMain.syncPanel();
|
---|
1169 | repaint();
|
---|
1170 | }
|
---|
1171 |
|
---|
1172 | public String validDecimal(String str) {
|
---|
1173 | str = str.trim().replace(',', '.');
|
---|
1174 | if (!(str.isEmpty()) && !(str.matches("^[+-]??\\d+(\\.\\d+)??$"))) {
|
---|
1175 | dlg.manager.showVisualMessage(Messages.getString("NotDecimal"));
|
---|
1176 | return "";
|
---|
1177 | } else {
|
---|
1178 | dlg.manager.showVisualMessage("");
|
---|
1179 | return str;
|
---|
1180 | }
|
---|
1181 | }
|
---|
1182 |
|
---|
1183 | public String validDecimal(String str, float max) {
|
---|
1184 | str = validDecimal(str);
|
---|
1185 | if (!(str.isEmpty()) && (new Float(str) > max)) {
|
---|
1186 | dlg.manager.showVisualMessage(Messages.getString("TooBig") + " (" + max + ")");
|
---|
1187 | return "";
|
---|
1188 | } else {
|
---|
1189 | dlg.manager.showVisualMessage("");
|
---|
1190 | return str;
|
---|
1191 | }
|
---|
1192 | }
|
---|
1193 |
|
---|
1194 | public void parseMark(Node node) {
|
---|
1195 | dlg.manager.showVisualMessage("");
|
---|
1196 | String str = Main.pref.get("smedplugin.IALA");
|
---|
1197 | if (str.equals("C"))
|
---|
1198 | setRegion(Reg.C);
|
---|
1199 | else if (str.equals("B"))
|
---|
1200 | setRegion(Reg.B);
|
---|
1201 | else
|
---|
1202 | setRegion(Reg.A);
|
---|
1203 |
|
---|
1204 | Map<String, String> keys = node.getKeys();
|
---|
1205 |
|
---|
1206 | str = "";
|
---|
1207 | if (keys.containsKey("seamark:type"))
|
---|
1208 | str = keys.get("seamark:type");
|
---|
1209 |
|
---|
1210 | setObject(Obj.UNKOBJ);
|
---|
1211 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1212 | if (ObjSTR.get(obj).equals(str)) {
|
---|
1213 | setObject(obj);
|
---|
1214 | }
|
---|
1215 | }
|
---|
1216 |
|
---|
1217 | if (str.equals("")) {
|
---|
1218 | dlg.manager.showVisualMessage("No seamark");
|
---|
1219 | }
|
---|
1220 | if (getObject() == Obj.UNKOBJ) {
|
---|
1221 | dlg.manager.showVisualMessage("Seamark not recognised");
|
---|
1222 | }
|
---|
1223 |
|
---|
1224 | setName("");
|
---|
1225 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1226 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":name")) {
|
---|
1227 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":name");
|
---|
1228 | setName(str);
|
---|
1229 | }
|
---|
1230 | }
|
---|
1231 | if (keys.containsKey("seamark:name")) {
|
---|
1232 | str = keys.get("seamark:name");
|
---|
1233 | setName(str);
|
---|
1234 | }
|
---|
1235 | if (getName().isEmpty()) {
|
---|
1236 | if (keys.containsKey("name")) {
|
---|
1237 | str = keys.get("name");
|
---|
1238 | setName(str);
|
---|
1239 | }
|
---|
1240 | }
|
---|
1241 |
|
---|
1242 | if (keys.containsKey("seamark:longname"))
|
---|
1243 | longName = keys.get("seamark:longname");
|
---|
1244 | else
|
---|
1245 | longName = "";
|
---|
1246 |
|
---|
1247 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1248 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":category")) {
|
---|
1249 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":category");
|
---|
1250 | setCategory(Cat.NOCAT);
|
---|
1251 | for (Cat cat : CatSTR.keySet()) {
|
---|
1252 | if (CatSTR.get(cat).equals(str)) {
|
---|
1253 | setCategory(cat);
|
---|
1254 | }
|
---|
1255 | }
|
---|
1256 | }
|
---|
1257 | }
|
---|
1258 |
|
---|
1259 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1260 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":shape")) {
|
---|
1261 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":shape");
|
---|
1262 | setShape(Shp.UNKSHP);
|
---|
1263 | for (Shp shp : ShpSTR.keySet()) {
|
---|
1264 | if (ShpSTR.get(shp).equals(str)) {
|
---|
1265 | setShape(shp);
|
---|
1266 | }
|
---|
1267 | }
|
---|
1268 | }
|
---|
1269 | }
|
---|
1270 | if (getShape() == Shp.UNKSHP) {
|
---|
1271 | if (EntMAP.get(getObject()) == Ent.BUOY)
|
---|
1272 | setShape(Shp.BUOY);
|
---|
1273 | if (EntMAP.get(getObject()) == Ent.BEACON)
|
---|
1274 | setShape(Shp.BEACON);
|
---|
1275 | if (EntMAP.get(getObject()) == Ent.LFLOAT)
|
---|
1276 | if (getObject() == Obj.LITVES)
|
---|
1277 | setShape(Shp.SUPER);
|
---|
1278 | else
|
---|
1279 | setShape(Shp.FLOAT);
|
---|
1280 | }
|
---|
1281 |
|
---|
1282 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1283 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":colour")) {
|
---|
1284 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":colour");
|
---|
1285 | bodyColour.clear();
|
---|
1286 | for (String item : str.split(";")) {
|
---|
1287 | for (Col col : ColSTR.keySet()) {
|
---|
1288 | if (ColSTR.get(col).equals(item)) {
|
---|
1289 | bodyColour.add(col);
|
---|
1290 | }
|
---|
1291 | }
|
---|
1292 | }
|
---|
1293 | }
|
---|
1294 | }
|
---|
1295 |
|
---|
1296 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1297 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":colour_pattern")) {
|
---|
1298 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":colour_pattern");
|
---|
1299 | setObjPattern(Pat.NOPAT);
|
---|
1300 | for (Pat pat : PatSTR.keySet()) {
|
---|
1301 | if (PatSTR.get(pat).equals(str)) {
|
---|
1302 | setObjPattern(pat);
|
---|
1303 | }
|
---|
1304 | }
|
---|
1305 | }
|
---|
1306 |
|
---|
1307 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":height")) {
|
---|
1308 | setObjectHeight(keys.get("seamark:" + ObjSTR.get(obj) + ":height"));
|
---|
1309 | }
|
---|
1310 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":elevation")) {
|
---|
1311 | setElevation(keys.get("seamark:" + ObjSTR.get(obj) + ":elevation"));
|
---|
1312 | }
|
---|
1313 | }
|
---|
1314 |
|
---|
1315 | if ((getObject() == Obj.LNDMRK) && (getCategory() == Cat.NOCAT)) {
|
---|
1316 | setObject(Obj.LITHSE);
|
---|
1317 | }
|
---|
1318 |
|
---|
1319 | if (getObject() == Obj.LITFLT) {
|
---|
1320 | switch (getObjColour(0)) {
|
---|
1321 | case RED:
|
---|
1322 | if ((getObjColour(1) == Col.WHITE) && (getObjColour(2) == Col.UNKCOL)) {
|
---|
1323 | setObject(Obj.FLTSAW);
|
---|
1324 | setCategory(Cat.NOCAT);
|
---|
1325 | } else if (getObjColour(1) == Col.UNKCOL) {
|
---|
1326 | setObject(Obj.FLTLAT);
|
---|
1327 | if (getRegion() == Reg.B) {
|
---|
1328 | setCategory(Cat.LAM_STBD);
|
---|
1329 | } else {
|
---|
1330 | setCategory(Cat.LAM_PORT);
|
---|
1331 | }
|
---|
1332 | } else if ((getObjColour(1) == Col.GREEN)
|
---|
1333 | && (getObjColour(2) == Col.RED)) {
|
---|
1334 | setObject(Obj.FLTLAT);
|
---|
1335 | if (getRegion() == Reg.B) {
|
---|
1336 | setCategory(Cat.LAM_PSTBD);
|
---|
1337 | } else {
|
---|
1338 | setCategory(Cat.LAM_PPORT);
|
---|
1339 | }
|
---|
1340 | } else if ((getObjColour(1) == Col.WHITE)
|
---|
1341 | && (getObjColour(2) == Col.RED)) {
|
---|
1342 | setObject(Obj.FLTLAT);
|
---|
1343 | setCategory(Cat.LAM_PORT);
|
---|
1344 | } else {
|
---|
1345 | setObject(Obj.FLTSPP);
|
---|
1346 | setCategory(Cat.NOCAT);
|
---|
1347 | }
|
---|
1348 | break;
|
---|
1349 | case GREEN:
|
---|
1350 | if (getObjColour(1) == Col.UNKCOL) {
|
---|
1351 | setObject(Obj.FLTLAT);
|
---|
1352 | if (getRegion() == Reg.B) {
|
---|
1353 | setCategory(Cat.LAM_PORT);
|
---|
1354 | } else {
|
---|
1355 | setCategory(Cat.LAM_STBD);
|
---|
1356 | }
|
---|
1357 | } else if ((getObjColour(1) == Col.RED)
|
---|
1358 | && (getObjColour(2) == Col.GREEN)) {
|
---|
1359 | setObject(Obj.FLTLAT);
|
---|
1360 | if (getRegion() == Reg.B) {
|
---|
1361 | setCategory(Cat.LAM_PPORT);
|
---|
1362 | } else {
|
---|
1363 | setCategory(Cat.LAM_PSTBD);
|
---|
1364 | }
|
---|
1365 | } else if ((getObjColour(1) == Col.WHITE)
|
---|
1366 | && (getObjColour(2) == Col.GREEN)) {
|
---|
1367 | setObject(Obj.FLTLAT);
|
---|
1368 | setCategory(Cat.LAM_STBD);
|
---|
1369 | } else {
|
---|
1370 | setObject(Obj.FLTSPP);
|
---|
1371 | setCategory(Cat.NOCAT);
|
---|
1372 | }
|
---|
1373 | break;
|
---|
1374 | case YELLOW:
|
---|
1375 | if (getObjColour(1) == Col.BLACK) {
|
---|
1376 | setObject(Obj.FLTCAR);
|
---|
1377 | if (getObjColour(2) == Col.YELLOW) {
|
---|
1378 | setCategory(Cat.CAM_WEST);
|
---|
1379 | } else {
|
---|
1380 | setCategory(Cat.CAM_SOUTH);
|
---|
1381 | }
|
---|
1382 | } else {
|
---|
1383 | setObject(Obj.FLTSPP);
|
---|
1384 | setCategory(Cat.NOCAT);
|
---|
1385 | }
|
---|
1386 | break;
|
---|
1387 | case BLACK:
|
---|
1388 | if (getObjColour(1) == Col.RED) {
|
---|
1389 | setObject(Obj.FLTISD);
|
---|
1390 | setCategory(Cat.NOCAT);
|
---|
1391 | } else if (getObjColour(1) == Col.YELLOW) {
|
---|
1392 | setObject(Obj.FLTCAR);
|
---|
1393 | if (getObjColour(2) == Col.BLACK) {
|
---|
1394 | setCategory(Cat.CAM_EAST);
|
---|
1395 | } else {
|
---|
1396 | setCategory(Cat.CAM_NORTH);
|
---|
1397 | }
|
---|
1398 | } else {
|
---|
1399 | setObject(Obj.FLTSPP);
|
---|
1400 | setCategory(Cat.NOCAT);
|
---|
1401 | }
|
---|
1402 | break;
|
---|
1403 | default:
|
---|
1404 | setCategory(Cat.NOCAT);
|
---|
1405 | }
|
---|
1406 | }
|
---|
1407 |
|
---|
1408 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1409 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":system")) {
|
---|
1410 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":system");
|
---|
1411 | if (str.equals("iala-a"))
|
---|
1412 | setRegion(Reg.A);
|
---|
1413 | else if (str.equals("iala-b"))
|
---|
1414 | setRegion(Reg.B);
|
---|
1415 | else
|
---|
1416 | setRegion(Reg.C);
|
---|
1417 | } else if (GrpMAP.get(object) == Grp.LAT) {
|
---|
1418 | switch (getCategory()) {
|
---|
1419 | case LAM_PORT:
|
---|
1420 | if (getObjColour(0) == Col.RED) {
|
---|
1421 | if (getObjColour(1) == Col.WHITE)
|
---|
1422 | setRegion(Reg.C);
|
---|
1423 | else
|
---|
1424 | setRegion(Reg.A);
|
---|
1425 | }
|
---|
1426 | if (getObjColour(0) == Col.GREEN)
|
---|
1427 | setRegion(Reg.B);
|
---|
1428 | break;
|
---|
1429 | case LAM_PPORT:
|
---|
1430 | if (getObjColour(0) == Col.RED) {
|
---|
1431 | if (getObjColour(3) == Col.GREEN)
|
---|
1432 | setRegion(Reg.C);
|
---|
1433 | else
|
---|
1434 | setRegion(Reg.A);
|
---|
1435 | }
|
---|
1436 | if (getObjColour(0) == Col.GREEN)
|
---|
1437 | setRegion(Reg.B);
|
---|
1438 | break;
|
---|
1439 | case LAM_STBD:
|
---|
1440 | if (getObjColour(0) == Col.GREEN) {
|
---|
1441 | if (getObjColour(1) == Col.WHITE)
|
---|
1442 | setRegion(Reg.C);
|
---|
1443 | else
|
---|
1444 | setRegion(Reg.A);
|
---|
1445 | }
|
---|
1446 | if (getObjColour(0) == Col.RED)
|
---|
1447 | setRegion(Reg.B);
|
---|
1448 | break;
|
---|
1449 | case LAM_PSTBD:
|
---|
1450 | if (getObjColour(0) == Col.GREEN)
|
---|
1451 | setRegion(Reg.A);
|
---|
1452 | if (getObjColour(0) == Col.RED) {
|
---|
1453 | if (getObjColour(3) == Col.GREEN)
|
---|
1454 | setRegion(Reg.C);
|
---|
1455 | else
|
---|
1456 | setRegion(Reg.B);
|
---|
1457 | }
|
---|
1458 | break;
|
---|
1459 | }
|
---|
1460 | }
|
---|
1461 | }
|
---|
1462 |
|
---|
1463 | if (keys.containsKey("seamark:topmark:shape")) {
|
---|
1464 | str = keys.get("seamark:topmark:shape");
|
---|
1465 | setTopmark(Top.NOTOP);
|
---|
1466 | for (Top top : TopSTR.keySet()) {
|
---|
1467 | if (TopSTR.get(top).equals(str)) {
|
---|
1468 | setTopmark(top);
|
---|
1469 | }
|
---|
1470 | }
|
---|
1471 | }
|
---|
1472 | if (keys.containsKey("seamark:topmark:colour")) {
|
---|
1473 | str = keys.get("seamark:topmark:colour");
|
---|
1474 | setTopColour(Col.UNKCOL);
|
---|
1475 | for (Col col : ColSTR.keySet()) {
|
---|
1476 | if (ColSTR.get(col).equals(str)) {
|
---|
1477 | setTopColour(col);
|
---|
1478 | }
|
---|
1479 | }
|
---|
1480 | }
|
---|
1481 | if (keys.containsKey("seamark:topmark:colour_pattern")) {
|
---|
1482 | str = keys.get("seamark:topmark:colour_pattern");
|
---|
1483 | setTopPattern(Pat.NOPAT);
|
---|
1484 | for (Pat pat : PatSTR.keySet()) {
|
---|
1485 | if (PatSTR.get(pat).equals(str)) {
|
---|
1486 | setTopPattern(pat);
|
---|
1487 | }
|
---|
1488 | }
|
---|
1489 | }
|
---|
1490 |
|
---|
1491 | clrLight();
|
---|
1492 | for (int i = 0; i < 30; i++) {
|
---|
1493 | String secStr = (i == 0) ? "" : (":" + Integer.toString(i));
|
---|
1494 | if (keys.containsKey("seamark:light" + secStr + ":colour")) {
|
---|
1495 | nulLight(i);
|
---|
1496 | str = keys.get("seamark:light" + secStr + ":colour");
|
---|
1497 | if (str.contains(";")) {
|
---|
1498 | String strs[] = str.split(";");
|
---|
1499 | for (Col col : ColSTR.keySet())
|
---|
1500 | if (ColSTR.get(col).equals(strs[1]))
|
---|
1501 | setLightAtt(Att.ALT, i, col);
|
---|
1502 | str = strs[0];
|
---|
1503 | }
|
---|
1504 | for (Col col : ColSTR.keySet())
|
---|
1505 | if (ColSTR.get(col).equals(str))
|
---|
1506 | setLightAtt(Att.COL, i, col);
|
---|
1507 | }
|
---|
1508 | if (keys.containsKey("seamark:light" + secStr + ":character")) {
|
---|
1509 | str = keys.get("seamark:light" + secStr + ":character");
|
---|
1510 | if (str.contains("(") && str.contains(")")) {
|
---|
1511 | int i1 = str.indexOf("(");
|
---|
1512 | int i2 = str.indexOf(")");
|
---|
1513 | setLightAtt(Att.GRP, i, str.substring((i1+1), i2));
|
---|
1514 | str = str.substring(0, i1) + str.substring((i2+1), str.length());
|
---|
1515 | }
|
---|
1516 | setLightAtt(Att.CHR, i, str);
|
---|
1517 | }
|
---|
1518 | if (keys.containsKey("seamark:light" + secStr + ":group"))
|
---|
1519 | setLightAtt(Att.GRP, i, keys.get("seamark:light" + secStr + ":group"));
|
---|
1520 | if (keys.containsKey("seamark:light" + secStr + ":sequence"))
|
---|
1521 | setLightAtt(Att.SEQ, i, keys.get("seamark:light" + secStr + ":sequence"));
|
---|
1522 | if (keys.containsKey("seamark:light" + secStr + ":period"))
|
---|
1523 | setLightAtt(Att.PER, i, keys.get("seamark:light" + secStr + ":period"));
|
---|
1524 | if (keys.containsKey("seamark:light" + secStr + ":category")) {
|
---|
1525 | str = keys.get("seamark:light" + secStr + ":category");
|
---|
1526 | if (str.equals("vert"))
|
---|
1527 | str = "vertical";
|
---|
1528 | if (str.equals("horiz"))
|
---|
1529 | str = "horizontal";
|
---|
1530 | for (Lit lit : LitSTR.keySet())
|
---|
1531 | if (LitSTR.get(lit).equals(str))
|
---|
1532 | setLightAtt(Att.LIT, i, lit);
|
---|
1533 | }
|
---|
1534 | if (keys.containsKey("seamark:light" + secStr + ":sector_start"))
|
---|
1535 | setLightAtt(Att.BEG, i, keys.get("seamark:light" + secStr + ":sector_start"));
|
---|
1536 | if (keys.containsKey("seamark:light" + secStr + ":sector_end"))
|
---|
1537 | setLightAtt(Att.END, i, keys.get("seamark:light" + secStr + ":sector_end"));
|
---|
1538 | if (keys.containsKey("seamark:light" + secStr + ":radius"))
|
---|
1539 | setLightAtt(Att.RAD, i, keys.get("seamark:light" + secStr + ":radius"));
|
---|
1540 | if (keys.containsKey("seamark:light" + secStr + ":height"))
|
---|
1541 | setLightAtt(Att.HGT, i, keys.get("seamark:light" + secStr + ":height"));
|
---|
1542 | if (keys.containsKey("seamark:light" + secStr + ":range"))
|
---|
1543 | setLightAtt(Att.RNG, i, keys.get("seamark:light" + secStr + ":range"));
|
---|
1544 | if (keys.containsKey("seamark:light" + secStr + ":visibility")) {
|
---|
1545 | str = keys.get("seamark:light" + secStr + ":visibility");
|
---|
1546 | for (Vis vis : VisSTR.keySet())
|
---|
1547 | if (VisSTR.get(vis).equals(str))
|
---|
1548 | setLightAtt(Att.VIS, i, vis);
|
---|
1549 | }
|
---|
1550 | if (keys.containsKey("seamark:light" + secStr + ":exhibition")) {
|
---|
1551 | str = keys.get("seamark:light" + secStr + ":exhibition");
|
---|
1552 | for (Exh exh : ExhSTR.keySet())
|
---|
1553 | if (ExhSTR.get(exh).equals(str))
|
---|
1554 | setLightAtt(Att.EXH, i, exh);
|
---|
1555 | }
|
---|
1556 | if (keys.containsKey("seamark:light" + secStr + ":orientation"))
|
---|
1557 | setLightAtt(Att.ORT, i, keys.get("seamark:light" + secStr + ":orientation"));
|
---|
1558 | if (keys.containsKey("seamark:light" + secStr + ":multiple"))
|
---|
1559 | setLightAtt(Att.MLT, i, keys.get("seamark:light" + secStr + ":multiple"));
|
---|
1560 |
|
---|
1561 | if (sectors.size() == i)
|
---|
1562 | break;
|
---|
1563 | }
|
---|
1564 |
|
---|
1565 | if (keys.containsKey("seamark:fog_signal")) {
|
---|
1566 | setFogSound(Fog.FOGSIG);
|
---|
1567 | }
|
---|
1568 | if (keys.containsKey("seamark:fog_signal:category")) {
|
---|
1569 | str = keys.get("seamark:fog_signal:category");
|
---|
1570 | setFogSound(Fog.NOFOG);
|
---|
1571 | for (Fog fog : FogSTR.keySet()) {
|
---|
1572 | if (FogSTR.get(fog).equals(str)) {
|
---|
1573 | setFogSound(fog);
|
---|
1574 | }
|
---|
1575 | }
|
---|
1576 | }
|
---|
1577 | if (keys.containsKey("seamark:fog_signal:group")) {
|
---|
1578 | setFogGroup(keys.get("seamark:fog_signal:group"));
|
---|
1579 | }
|
---|
1580 | if (keys.containsKey("seamark:fog_signal:period")) {
|
---|
1581 | setFogPeriod(keys.get("seamark:fog_signal:period"));
|
---|
1582 | }
|
---|
1583 | if (keys.containsKey("seamark:fog_signal:sequence")) {
|
---|
1584 | setFogSequence(keys.get("seamark:fog_signal:sequence"));
|
---|
1585 | }
|
---|
1586 | if (keys.containsKey("seamark:fog_signal:range")) {
|
---|
1587 | setFogRange(keys.get("seamark:fog_signal:range"));
|
---|
1588 | }
|
---|
1589 |
|
---|
1590 | if (keys.containsKey("seamark:radar_reflector")) {
|
---|
1591 | setRadar(Rtb.REFLECTOR);
|
---|
1592 | }
|
---|
1593 | if (keys.containsKey("seamark:radar_transponder:category")) {
|
---|
1594 | str = keys.get("seamark:radar_transponder:category");
|
---|
1595 | setRadar(Rtb.NORTB);
|
---|
1596 | for (Rtb rtb : RtbSTR.keySet()) {
|
---|
1597 | if (RtbSTR.get(rtb).equals(str)) {
|
---|
1598 | setRadar(rtb);
|
---|
1599 | }
|
---|
1600 | }
|
---|
1601 | }
|
---|
1602 | if (keys.containsKey("seamark:radar_transponder:group")) {
|
---|
1603 | setRaconGroup(keys.get("seamark:radar_transponder:group"));
|
---|
1604 | }
|
---|
1605 | if (keys.containsKey("seamark:radar_transponder:period")) {
|
---|
1606 | setRaconPeriod(keys.get("seamark:radar_transponder:period"));
|
---|
1607 | }
|
---|
1608 | if (keys.containsKey("seamark:radar_transponder:sequence")) {
|
---|
1609 | setRaconSequence(keys.get("seamark:radar_transponder:sequence"));
|
---|
1610 | }
|
---|
1611 | if (keys.containsKey("seamark:radar_transponder:range")) {
|
---|
1612 | setRaconRange(keys.get("seamark:radar_transponder:range"));
|
---|
1613 | }
|
---|
1614 | if (keys.containsKey("seamark:radar_transponder:sector_start")) {
|
---|
1615 | setRaconSector1(keys.get("seamark:radar_transponder:sector_start"));
|
---|
1616 | }
|
---|
1617 | if (keys.containsKey("seamark:radar_transponder:sector_end")) {
|
---|
1618 | setRaconSector2(keys.get("seamark:radar_transponder:sector_end"));
|
---|
1619 | }
|
---|
1620 |
|
---|
1621 | if (keys.containsKey("seamark:information")) {
|
---|
1622 | setInfo(keys.get("seamark:information"));
|
---|
1623 | }
|
---|
1624 | if (keys.containsKey("seamark:light:information")) {
|
---|
1625 | setInfo(getInfo() + keys.get("seamark:light:information"));
|
---|
1626 | }
|
---|
1627 | if (keys.containsKey("seamark:" + ObjSTR.get(getObject()) + "information")) {
|
---|
1628 | setInfo(getInfo() + keys.get("seamark:" + ObjSTR.get(getObject()) + "information"));
|
---|
1629 | }
|
---|
1630 | if (keys.containsKey("seamark:source")) {
|
---|
1631 | setSource(keys.get("seamark:source"));
|
---|
1632 | }
|
---|
1633 | if (keys.containsKey("seamark:light:source")) {
|
---|
1634 | setSource(getSource() + keys.get("seamark:light:source"));
|
---|
1635 | }
|
---|
1636 | if (keys.containsKey("seamark:" + ObjSTR.get(getObject()) + "source")) {
|
---|
1637 | setSource(getSource() + keys.get("seamark:" + ObjSTR.get(getObject()) + "source"));
|
---|
1638 | }
|
---|
1639 | if (keys.containsKey("seamark:height")) {
|
---|
1640 | setObjectHeight(keys.get("seamark:height"));
|
---|
1641 | }
|
---|
1642 | if (keys.containsKey("seamark:elevation")) {
|
---|
1643 | setElevation(keys.get("seamark:elevation"));
|
---|
1644 | }
|
---|
1645 | if (keys.containsKey("seamark:status")) {
|
---|
1646 | str = keys.get("seamark:status");
|
---|
1647 | setStatus(Sts.UNKSTS);
|
---|
1648 | for (Sts sts : StsSTR.keySet()) {
|
---|
1649 | if (StsSTR.get(sts).equals(str)) {
|
---|
1650 | setStatus(sts);
|
---|
1651 | }
|
---|
1652 | }
|
---|
1653 | }
|
---|
1654 | if (keys.containsKey("seamark:construction")) {
|
---|
1655 | str = keys.get("seamark:construction");
|
---|
1656 | setConstr(Cns.UNKCNS);
|
---|
1657 | for (Cns cns : CnsSTR.keySet()) {
|
---|
1658 | if (CnsSTR.get(cns).equals(str)) {
|
---|
1659 | setConstr(cns);
|
---|
1660 | }
|
---|
1661 | }
|
---|
1662 | }
|
---|
1663 | if (keys.containsKey("seamark:conspicuity")) {
|
---|
1664 | str = keys.get("seamark:conspicuity");
|
---|
1665 | setConsp(Con.UNKCON);
|
---|
1666 | for (Con con : ConSTR.keySet()) {
|
---|
1667 | if (ConSTR.get(con).equals(str)) {
|
---|
1668 | setConsp(con);
|
---|
1669 | }
|
---|
1670 | }
|
---|
1671 | }
|
---|
1672 | if (keys.containsKey("seamark:reflectivity")) {
|
---|
1673 | str = keys.get("seamark:reflectivity");
|
---|
1674 | setRefl(Con.UNKCON);
|
---|
1675 | for (Con con : ConSTR.keySet()) {
|
---|
1676 | if (ConSTR.get(con).equals(str)) {
|
---|
1677 | setRefl(con);
|
---|
1678 | }
|
---|
1679 | }
|
---|
1680 | }
|
---|
1681 |
|
---|
1682 | if (keys.containsKey("seamark:ref")) {
|
---|
1683 | setRef(keys.get("seamark:ref"));
|
---|
1684 | }
|
---|
1685 | if (keys.containsKey("seamark:reference")) {
|
---|
1686 | setRef(keys.get("seamark:reference"));
|
---|
1687 | }
|
---|
1688 | if (keys.containsKey("seamark:light:ref")) {
|
---|
1689 | setLightRef(keys.get("seamark:light:ref"));
|
---|
1690 | }
|
---|
1691 | if (keys.containsKey("seamark:light:reference")) {
|
---|
1692 | setLightRef(keys.get("seamark:light:reference"));
|
---|
1693 | }
|
---|
1694 | if (keys.containsKey("seamark:fixme")) {
|
---|
1695 | setFixme(keys.get("seamark:fixme"));
|
---|
1696 | }
|
---|
1697 |
|
---|
1698 | dlg.panelMain.syncPanel();
|
---|
1699 | }
|
---|
1700 |
|
---|
1701 | public void paintComponent(Graphics g) {
|
---|
1702 | super.paintComponent(g);
|
---|
1703 |
|
---|
1704 | if (dlg.node == null) return;
|
---|
1705 |
|
---|
1706 | Graphics2D g2 = (Graphics2D) g;
|
---|
1707 |
|
---|
1708 | String colStr;
|
---|
1709 | String lblStr;
|
---|
1710 | String imgStr = "/images/";
|
---|
1711 | if (getShape() != Shp.UNKSHP) {
|
---|
1712 | switch (getShape()) {
|
---|
1713 | case TOWER:
|
---|
1714 | imgStr += "Tower";
|
---|
1715 | break;
|
---|
1716 | case BUOY:
|
---|
1717 | case PILLAR:
|
---|
1718 | imgStr += "Pillar";
|
---|
1719 | break;
|
---|
1720 | case SPAR:
|
---|
1721 | imgStr += "Spar";
|
---|
1722 | break;
|
---|
1723 | case CAN:
|
---|
1724 | imgStr += "Can";
|
---|
1725 | break;
|
---|
1726 | case CONI:
|
---|
1727 | imgStr += "Cone";
|
---|
1728 | break;
|
---|
1729 | case SPHERI:
|
---|
1730 | imgStr += "Sphere";
|
---|
1731 | break;
|
---|
1732 | case BARREL:
|
---|
1733 | imgStr += "Barrel";
|
---|
1734 | break;
|
---|
1735 | case CAIRN:
|
---|
1736 | imgStr += "Cairn";
|
---|
1737 | break;
|
---|
1738 | case FLOAT:
|
---|
1739 | imgStr += "Float";
|
---|
1740 | break;
|
---|
1741 | case BEACON:
|
---|
1742 | case PILE:
|
---|
1743 | case LATTICE:
|
---|
1744 | case BUOYANT:
|
---|
1745 | imgStr += "Beacon";
|
---|
1746 | break;
|
---|
1747 | case SUPER:
|
---|
1748 | imgStr += "Super";
|
---|
1749 | break;
|
---|
1750 | case STAKE:
|
---|
1751 | case POLE:
|
---|
1752 | case POST:
|
---|
1753 | imgStr += "Stake";
|
---|
1754 | break;
|
---|
1755 | case PERCH:
|
---|
1756 | if (getCategory() == Cat.LAM_PORT) {
|
---|
1757 | imgStr += "Perch_Port";
|
---|
1758 | } else {
|
---|
1759 | imgStr += "Perch_Starboard";
|
---|
1760 | }
|
---|
1761 | break;
|
---|
1762 | }
|
---|
1763 | colStr = imgStr;
|
---|
1764 | lblStr = "";
|
---|
1765 | for (Col col : bodyColour) {
|
---|
1766 | switch (col) {
|
---|
1767 | case WHITE:
|
---|
1768 | colStr += "_White";
|
---|
1769 | lblStr += "W";
|
---|
1770 | break;
|
---|
1771 | case RED:
|
---|
1772 | colStr += "_Red";
|
---|
1773 | lblStr += "R";
|
---|
1774 | break;
|
---|
1775 | case ORANGE:
|
---|
1776 | colStr += "_Orange";
|
---|
1777 | lblStr += "Or";
|
---|
1778 | break;
|
---|
1779 | case AMBER:
|
---|
1780 | colStr += "_Amber";
|
---|
1781 | lblStr += "Am";
|
---|
1782 | break;
|
---|
1783 | case YELLOW:
|
---|
1784 | colStr += "_Yellow";
|
---|
1785 | lblStr += "Y";
|
---|
1786 | break;
|
---|
1787 | case GREEN:
|
---|
1788 | colStr += "_Green";
|
---|
1789 | lblStr += "G";
|
---|
1790 | break;
|
---|
1791 | case BLUE:
|
---|
1792 | colStr += "_Blue";
|
---|
1793 | lblStr += "Bu";
|
---|
1794 | break;
|
---|
1795 | case VIOLET:
|
---|
1796 | colStr += "_Violet";
|
---|
1797 | lblStr += "Vi";
|
---|
1798 | break;
|
---|
1799 | case BLACK:
|
---|
1800 | colStr += "_Black";
|
---|
1801 | lblStr += "B";
|
---|
1802 | break;
|
---|
1803 | case GREY:
|
---|
1804 | colStr += "_Grey";
|
---|
1805 | lblStr += "Gr";
|
---|
1806 | break;
|
---|
1807 | case BROWN:
|
---|
1808 | colStr += "_Brown";
|
---|
1809 | lblStr += "Br";
|
---|
1810 | break;
|
---|
1811 | case MAGENTA:
|
---|
1812 | colStr += "_Magenta";
|
---|
1813 | lblStr += "Mg";
|
---|
1814 | break;
|
---|
1815 | case PINK:
|
---|
1816 | colStr += "_Pink";
|
---|
1817 | lblStr += "Pk";
|
---|
1818 | break;
|
---|
1819 | }
|
---|
1820 | }
|
---|
1821 | if (!imgStr.equals("/images/")) {
|
---|
1822 | colStr += ".png";
|
---|
1823 | if (getClass().getResource(colStr) == null) {
|
---|
1824 | System.out.println("Missing image: " + colStr);
|
---|
1825 | imgStr += ".png";
|
---|
1826 | if (getClass().getResource(imgStr) == null) {
|
---|
1827 | System.out.println("Missing image: " + imgStr);
|
---|
1828 | } else {
|
---|
1829 | g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
|
---|
1830 | g2.drawString(lblStr, 75, 110);
|
---|
1831 | }
|
---|
1832 | } else {
|
---|
1833 | g2.drawImage(new ImageIcon(getClass().getResource(colStr)).getImage(), 7, -15, null);
|
---|
1834 | }
|
---|
1835 | }
|
---|
1836 | } else if (getObject() != Obj.UNKOBJ) {
|
---|
1837 | switch (getObject()) {
|
---|
1838 | case LNDMRK:
|
---|
1839 | switch (getCategory()) {
|
---|
1840 | case LMK_CHMY:
|
---|
1841 | imgStr += "Chimney";
|
---|
1842 | break;
|
---|
1843 | case LMK_CARN:
|
---|
1844 | imgStr += "Cairn";
|
---|
1845 | break;
|
---|
1846 | case LMK_DSHA:
|
---|
1847 | imgStr += "DishAerial";
|
---|
1848 | break;
|
---|
1849 | case LMK_FLGS:
|
---|
1850 | imgStr += "Flagstaff";
|
---|
1851 | break;
|
---|
1852 | case LMK_FLRS:
|
---|
1853 | imgStr += "FlareStack";
|
---|
1854 | break;
|
---|
1855 | case LMK_MNMT:
|
---|
1856 | imgStr += "Monument";
|
---|
1857 | break;
|
---|
1858 | case LMK_MAST:
|
---|
1859 | imgStr += "RadioMast";
|
---|
1860 | break;
|
---|
1861 | case LMK_TOWR:
|
---|
1862 | imgStr += "LandTower";
|
---|
1863 | break;
|
---|
1864 | case LMK_WNDM:
|
---|
1865 | imgStr += "Wind_Motor";
|
---|
1866 | break;
|
---|
1867 | case LMK_WTRT:
|
---|
1868 | imgStr += "WaterTower";
|
---|
1869 | break;
|
---|
1870 | }
|
---|
1871 | break;
|
---|
1872 | case LITHSE:
|
---|
1873 | imgStr += "Light_House";
|
---|
1874 | break;
|
---|
1875 | case LITMAJ:
|
---|
1876 | imgStr += "Light_Major";
|
---|
1877 | break;
|
---|
1878 | case LITMIN:
|
---|
1879 | imgStr += "Light_Minor";
|
---|
1880 | break;
|
---|
1881 | case LITFLT:
|
---|
1882 | imgStr += "Float";
|
---|
1883 | break;
|
---|
1884 | case LITVES:
|
---|
1885 | imgStr += "Super";
|
---|
1886 | break;
|
---|
1887 | case SISTAW:
|
---|
1888 | imgStr += "Signal_Station";
|
---|
1889 | break;
|
---|
1890 | case SISTAT:
|
---|
1891 | imgStr += "Signal_Station";
|
---|
1892 | break;
|
---|
1893 | case OFSPLF:
|
---|
1894 | imgStr += "Platform";
|
---|
1895 | break;
|
---|
1896 | }
|
---|
1897 | if (!imgStr.equals("/images/")) {
|
---|
1898 | imgStr += ".png";
|
---|
1899 | if (getClass().getResource(imgStr) == null) {
|
---|
1900 | System.out.println("Missing image: " + imgStr);
|
---|
1901 | } else {
|
---|
1902 | g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
|
---|
1903 | }
|
---|
1904 | }
|
---|
1905 | }
|
---|
1906 |
|
---|
1907 | if (getTopmark() != Top.NOTOP) {
|
---|
1908 | imgStr = "/images/Top_";
|
---|
1909 | switch (getTopmark()) {
|
---|
1910 | case CAN:
|
---|
1911 | imgStr += "Can";
|
---|
1912 | break;
|
---|
1913 | case CONE:
|
---|
1914 | imgStr += "Cone";
|
---|
1915 | break;
|
---|
1916 | case SPHERE:
|
---|
1917 | imgStr += "Sphere";
|
---|
1918 | break;
|
---|
1919 | case X_SHAPE:
|
---|
1920 | imgStr += "X";
|
---|
1921 | break;
|
---|
1922 | case NORTH:
|
---|
1923 | imgStr += "North";
|
---|
1924 | break;
|
---|
1925 | case SOUTH:
|
---|
1926 | imgStr += "South";
|
---|
1927 | break;
|
---|
1928 | case EAST:
|
---|
1929 | imgStr += "East";
|
---|
1930 | break;
|
---|
1931 | case WEST:
|
---|
1932 | imgStr += "West";
|
---|
1933 | break;
|
---|
1934 | case SPHERES2:
|
---|
1935 | imgStr += "Isol";
|
---|
1936 | break;
|
---|
1937 | }
|
---|
1938 | colStr = imgStr;
|
---|
1939 | for (Col col : topmarkColour) {
|
---|
1940 | switch (col) {
|
---|
1941 | case WHITE:
|
---|
1942 | colStr += "_White";
|
---|
1943 | break;
|
---|
1944 | case RED:
|
---|
1945 | colStr += "_Red";
|
---|
1946 | break;
|
---|
1947 | case ORANGE:
|
---|
1948 | colStr += "_Orange";
|
---|
1949 | break;
|
---|
1950 | case AMBER:
|
---|
1951 | colStr += "_Amber";
|
---|
1952 | break;
|
---|
1953 | case YELLOW:
|
---|
1954 | colStr += "_Yellow";
|
---|
1955 | break;
|
---|
1956 | case GREEN:
|
---|
1957 | colStr += "_Green";
|
---|
1958 | break;
|
---|
1959 | case BLUE:
|
---|
1960 | colStr += "_Blue";
|
---|
1961 | break;
|
---|
1962 | case VIOLET:
|
---|
1963 | colStr += "_Violet";
|
---|
1964 | break;
|
---|
1965 | case BLACK:
|
---|
1966 | colStr += "_Black";
|
---|
1967 | break;
|
---|
1968 | }
|
---|
1969 | }
|
---|
1970 | switch (getShape()) {
|
---|
1971 | case CAN:
|
---|
1972 | case CONI:
|
---|
1973 | case SPHERI:
|
---|
1974 | case BARREL:
|
---|
1975 | imgStr += "_Buoy_Small";
|
---|
1976 | colStr += "_Buoy_Small";
|
---|
1977 | break;
|
---|
1978 | case PILLAR:
|
---|
1979 | case SPAR:
|
---|
1980 | imgStr += "_Buoy";
|
---|
1981 | colStr += "_Buoy";
|
---|
1982 | break;
|
---|
1983 | case FLOAT:
|
---|
1984 | case SUPER:
|
---|
1985 | imgStr += "_Float";
|
---|
1986 | colStr += "_Float";
|
---|
1987 | break;
|
---|
1988 | case BUOYANT:
|
---|
1989 | case CAIRN:
|
---|
1990 | case PILE:
|
---|
1991 | case LATTICE:
|
---|
1992 | case TOWER:
|
---|
1993 | case STAKE:
|
---|
1994 | case POLE:
|
---|
1995 | case POST:
|
---|
1996 | case BEACON:
|
---|
1997 | imgStr += "_Beacon";
|
---|
1998 | colStr += "_Beacon";
|
---|
1999 | break;
|
---|
2000 | }
|
---|
2001 | colStr += ".png";
|
---|
2002 | if (getClass().getResource(colStr) == null) {
|
---|
2003 | System.out.println("Missing image: " + colStr);
|
---|
2004 | imgStr += ".png";
|
---|
2005 | if (getClass().getResource(imgStr) == null) {
|
---|
2006 | System.out.println("Missing image: " + imgStr);
|
---|
2007 | return;
|
---|
2008 | } else {
|
---|
2009 | g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
|
---|
2010 | }
|
---|
2011 | } else {
|
---|
2012 | g2.drawImage(new ImageIcon(getClass().getResource(colStr)).getImage(), 7, -15, null);
|
---|
2013 | }
|
---|
2014 | }
|
---|
2015 |
|
---|
2016 | for (int i = 1; i < sectors.size(); i++) {
|
---|
2017 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
---|
2018 | g2.setStroke(new BasicStroke(6.0f));
|
---|
2019 | if (!((String)getLightAtt(Att.BEG, i)).isEmpty() && !((String)getLightAtt(Att.END, i)).isEmpty()) {
|
---|
2020 | if (getLightAtt(Att.COL, i) != Col.UNKCOL) {
|
---|
2021 | g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i)));
|
---|
2022 | Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.BEG, i));
|
---|
2023 | Double da = 270 - Double.parseDouble((String)getLightAtt(Att.END, i)) - a0;
|
---|
2024 | da -= da > 0 ? 360 : 0;
|
---|
2025 | g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN));
|
---|
2026 | }
|
---|
2027 | if (getLightAtt(Att.ALT, i) != Col.UNKCOL) {
|
---|
2028 | g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i)));
|
---|
2029 | Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.BEG, i));
|
---|
2030 | Double da = 270 - Double.parseDouble((String)getLightAtt(Att.END, i)) - a0;
|
---|
2031 | da -= da > 0 ? 360 : 0;
|
---|
2032 | g2.draw(new Arc2D.Double(17, 20, 130, 130, a0, da, Arc2D.OPEN));
|
---|
2033 | }
|
---|
2034 | } else if ((getLightAtt(Att.LIT, i) == Lit.DIR) && !((String)getLightAtt(Att.ORT, i)).isEmpty()) {
|
---|
2035 | if (getLightAtt(Att.COL, i) != Col.UNKCOL) {
|
---|
2036 | g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i)));
|
---|
2037 | Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.ORT, i)) + 2.0;
|
---|
2038 | Double da = -4.0;
|
---|
2039 | g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN));
|
---|
2040 | }
|
---|
2041 | if (getLightAtt(Att.ALT, i) != Col.UNKCOL) {
|
---|
2042 | g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i)));
|
---|
2043 | Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.ORT, i)) + 2.0;
|
---|
2044 | Double da = -4.0;
|
---|
2045 | g2.draw(new Arc2D.Double(17, 20, 130, 130, a0, da, Arc2D.OPEN));
|
---|
2046 | }
|
---|
2047 | }
|
---|
2048 | }
|
---|
2049 | g2.setPaint(Color.BLACK);
|
---|
2050 | if ((getLightAtt(Att.COL, 0) != Col.UNKCOL) || !(((String)getLightAtt(Att.CHR, 0)).isEmpty())) {
|
---|
2051 | if (sectors.size() == 1) {
|
---|
2052 | if (((String) getLightAtt(Att.CHR, 0)).contains("Al")) {
|
---|
2053 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png")).getImage(), 7, -15, null);
|
---|
2054 | } else {
|
---|
2055 | switch ((Col) getLightAtt(Att.COL, 0)) {
|
---|
2056 | case RED:
|
---|
2057 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Red_120.png")).getImage(), 7, -15, null);
|
---|
2058 | break;
|
---|
2059 | case GREEN:
|
---|
2060 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Green_120.png")).getImage(), 7, -15, null);
|
---|
2061 | break;
|
---|
2062 | case WHITE:
|
---|
2063 | case YELLOW:
|
---|
2064 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_White_120.png")).getImage(), 7, -15, null);
|
---|
2065 | break;
|
---|
2066 | default:
|
---|
2067 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png")).getImage(), 7, -15, null);
|
---|
2068 | }
|
---|
2069 | }
|
---|
2070 | }
|
---|
2071 | String c = (String) getLightAtt(Att.CHR, 0);
|
---|
2072 | String tmp = "";
|
---|
2073 | if (c.contains("+")) {
|
---|
2074 | int i1 = c.indexOf("+");
|
---|
2075 | tmp = c.substring(i1, c.length());
|
---|
2076 | c = c.substring(0, i1);
|
---|
2077 | if (!((String) getLightAtt(Att.GRP, 0)).isEmpty()) {
|
---|
2078 | c += "(" + (String) getLightAtt(Att.GRP, 0) + ")";
|
---|
2079 | }
|
---|
2080 | if (tmp != null)
|
---|
2081 | c += tmp;
|
---|
2082 | } else if (!((String) getLightAtt(Att.GRP, 0)).isEmpty())
|
---|
2083 | c += "(" + (String) getLightAtt(Att.GRP, 0) + ")";
|
---|
2084 | switch ((Col) getLightAtt(Att.COL, 0)) {
|
---|
2085 | case WHITE:
|
---|
2086 | c += ".W";
|
---|
2087 | break;
|
---|
2088 | case YELLOW:
|
---|
2089 | c += ".Y";
|
---|
2090 | break;
|
---|
2091 | case RED:
|
---|
2092 | c += ".R";
|
---|
2093 | break;
|
---|
2094 | case GREEN:
|
---|
2095 | c += ".G";
|
---|
2096 | break;
|
---|
2097 | case AMBER:
|
---|
2098 | c += ".Am";
|
---|
2099 | break;
|
---|
2100 | case ORANGE:
|
---|
2101 | c += ".Or";
|
---|
2102 | break;
|
---|
2103 | case BLUE:
|
---|
2104 | c += ".Bu";
|
---|
2105 | break;
|
---|
2106 | case VIOLET:
|
---|
2107 | c += ".Vi";
|
---|
2108 | break;
|
---|
2109 | }
|
---|
2110 | switch ((Col) getLightAtt(Att.ALT, 0)) {
|
---|
2111 | case WHITE:
|
---|
2112 | c += "W";
|
---|
2113 | break;
|
---|
2114 | case YELLOW:
|
---|
2115 | c += "Y";
|
---|
2116 | break;
|
---|
2117 | case RED:
|
---|
2118 | c += "R";
|
---|
2119 | break;
|
---|
2120 | case GREEN:
|
---|
2121 | c += "G";
|
---|
2122 | break;
|
---|
2123 | case AMBER:
|
---|
2124 | c += "Am";
|
---|
2125 | break;
|
---|
2126 | case ORANGE:
|
---|
2127 | c += "Or";
|
---|
2128 | break;
|
---|
2129 | case BLUE:
|
---|
2130 | c += "Bu";
|
---|
2131 | break;
|
---|
2132 | case VIOLET:
|
---|
2133 | c += "Vi";
|
---|
2134 | break;
|
---|
2135 | }
|
---|
2136 | tmp = (String) getLightAtt(Att.MLT, 0);
|
---|
2137 | if (!tmp.isEmpty())
|
---|
2138 | c = tmp + c;
|
---|
2139 | if (getLightAtt(Att.LIT, 0) != Lit.UNKLIT) {
|
---|
2140 | switch ((Lit)getLightAtt(Att.LIT, 0)) {
|
---|
2141 | case VERT:
|
---|
2142 | c += "(Vert)";
|
---|
2143 | break;
|
---|
2144 | case HORIZ:
|
---|
2145 | c += "(Horiz)";
|
---|
2146 | break;
|
---|
2147 | }
|
---|
2148 | }
|
---|
2149 | tmp = (String) getLightAtt(Att.PER, 0);
|
---|
2150 | if (!tmp.isEmpty())
|
---|
2151 | c += " " + tmp + "s";
|
---|
2152 | g2.drawString(c, 100, 70);
|
---|
2153 | }
|
---|
2154 |
|
---|
2155 | if (getFogSound() != Fog.NOFOG) {
|
---|
2156 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Fog_Signal.png")).getImage(), 7, -15, null);
|
---|
2157 | String str = "";
|
---|
2158 | if (getFogSound() != Fog.FOGSIG)
|
---|
2159 | switch (getFogSound()) {
|
---|
2160 | case HORN:
|
---|
2161 | str = "Horn";
|
---|
2162 | break;
|
---|
2163 | case SIREN:
|
---|
2164 | str = "Siren";
|
---|
2165 | break;
|
---|
2166 | case DIA:
|
---|
2167 | str = "Dia";
|
---|
2168 | break;
|
---|
2169 | case BELL:
|
---|
2170 | str = "Bell";
|
---|
2171 | break;
|
---|
2172 | case WHIS:
|
---|
2173 | str = "Whis";
|
---|
2174 | break;
|
---|
2175 | case GONG:
|
---|
2176 | str = "Gong";
|
---|
2177 | break;
|
---|
2178 | case EXPLOS:
|
---|
2179 | str = "Explos";
|
---|
2180 | break;
|
---|
2181 | }
|
---|
2182 | if (!getFogGroup().isEmpty())
|
---|
2183 | str += ("(" + getFogGroup() + ")");
|
---|
2184 | else
|
---|
2185 | str += " ";
|
---|
2186 | if (!getFogPeriod().isEmpty())
|
---|
2187 | str += getFogPeriod() + "s";
|
---|
2188 | g2.drawString(str, 0, 70);
|
---|
2189 | }
|
---|
2190 |
|
---|
2191 | if (RaType != Rtb.NORTB) {
|
---|
2192 | if (getRadar() == Rtb.REFLECTOR) {
|
---|
2193 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png")).getImage(), 7, -15, null);
|
---|
2194 | } else {
|
---|
2195 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Station.png")).getImage(), 7, -15, null);
|
---|
2196 | String str = "";
|
---|
2197 | if (getRadar() == Rtb.RAMARK)
|
---|
2198 | str += "Ramark";
|
---|
2199 | else
|
---|
2200 | str += "Racon";
|
---|
2201 | if (!getRaconGroup().isEmpty())
|
---|
2202 | str += ("(" + getRaconGroup() + ")");
|
---|
2203 | else
|
---|
2204 | str += " ";
|
---|
2205 | if (!getRaconPeriod().isEmpty())
|
---|
2206 | str += getRaconPeriod() + "s";
|
---|
2207 | g2.drawString(str, 0, 50);
|
---|
2208 | }
|
---|
2209 | }
|
---|
2210 | }
|
---|
2211 |
|
---|
2212 | public void saveSign(Node node) {
|
---|
2213 |
|
---|
2214 | if (getObject() != Obj.UNKOBJ) {
|
---|
2215 |
|
---|
2216 | Main.pref.put("smedplugin.IALA", getRegion() == Reg.C ? "C" : (getRegion() == Reg.B ? "B" : "A"));
|
---|
2217 |
|
---|
2218 | for (String str : node.getKeys().keySet()) {
|
---|
2219 | if (str.trim().matches("^seamark:\\S+"))
|
---|
2220 | Main.main.undoRedo.add(new ChangePropertyCommand(node, str, null));
|
---|
2221 | }
|
---|
2222 |
|
---|
2223 | if (!getName().isEmpty())
|
---|
2224 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:name", getName()));
|
---|
2225 |
|
---|
2226 | if (!longName.isEmpty())
|
---|
2227 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:longname", longName));
|
---|
2228 |
|
---|
2229 | String objStr = ObjSTR.get(object);
|
---|
2230 | if (objStr != null) {
|
---|
2231 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:type", objStr));
|
---|
2232 |
|
---|
2233 | if (getShape() != Shp.FLOAT) {
|
---|
2234 | String str = CatSTR.get(getCategory());
|
---|
2235 | if (str != null)
|
---|
2236 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":category", str));
|
---|
2237 | if ((getShape() != Shp.BUOY) && (getShape() != Shp.BEACON))
|
---|
2238 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":shape", ShpSTR.get(getShape())));
|
---|
2239 | }
|
---|
2240 |
|
---|
2241 | if ((getObjColour(0) != Col.UNKCOL) && getShape() != Shp.PERCH) {
|
---|
2242 | String str = ColSTR.get(getObjColour(0));
|
---|
2243 | for (int i = 1; bodyColour.size() > i; i++) {
|
---|
2244 | str += (";" + ColSTR.get(getObjColour(i)));
|
---|
2245 | }
|
---|
2246 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour", str));
|
---|
2247 | }
|
---|
2248 |
|
---|
2249 | if (getObjPattern() != Pat.NOPAT) {
|
---|
2250 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatSTR.get(getObjPattern())));
|
---|
2251 | }
|
---|
2252 |
|
---|
2253 | if ((GrpMAP.get(object) == Grp.LAT) && (getShape() != Shp.PERCH)
|
---|
2254 | || (getObject() == Obj.FLTLAT)) {
|
---|
2255 | switch (region) {
|
---|
2256 | case A:
|
---|
2257 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-a"));
|
---|
2258 | break;
|
---|
2259 | case B:
|
---|
2260 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-b"));
|
---|
2261 | break;
|
---|
2262 | case C:
|
---|
2263 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "other"));
|
---|
2264 | break;
|
---|
2265 | }
|
---|
2266 | }
|
---|
2267 | if (!getObjectHeight().isEmpty()) {
|
---|
2268 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":height", getObjectHeight()));
|
---|
2269 | }
|
---|
2270 | if (!getElevation().isEmpty()) {
|
---|
2271 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":elevation", getElevation()));
|
---|
2272 | }
|
---|
2273 | }
|
---|
2274 | if (getTopmark() != Top.NOTOP) {
|
---|
2275 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:shape", TopSTR.get(getTopmark())));
|
---|
2276 | if (getTopPattern() != Pat.NOPAT)
|
---|
2277 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour_pattern", PatSTR.get(getTopPattern())));
|
---|
2278 | if (getTopColour(0) != Col.UNKCOL) {
|
---|
2279 | String str = ColSTR.get(getTopColour(0));
|
---|
2280 | for (int i = 1; topmarkColour.size() > i; i++) {
|
---|
2281 | str += (";" + ColSTR.get(getTopColour(i)));
|
---|
2282 | }
|
---|
2283 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour", str));
|
---|
2284 | }
|
---|
2285 | }
|
---|
2286 |
|
---|
2287 | for (int i = 0; i < sectors.size(); i++) {
|
---|
2288 | String secStr = (i == 0) ? "" : (":" + Integer.toString(i));
|
---|
2289 | if (sectors.get(i)[0] != Col.UNKCOL)
|
---|
2290 | if ((sectors.get(i)[15] != Col.UNKCOL) && ((String)sectors.get(i)[1]).contains("Al"))
|
---|
2291 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", (ColSTR.get(sectors.get(i)[0]))
|
---|
2292 | + ";" + ColSTR.get(sectors.get(i)[15])));
|
---|
2293 | else
|
---|
2294 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", ColSTR.get(sectors.get(i)[0])));
|
---|
2295 | if (!((String) sectors.get(i)[1]).isEmpty())
|
---|
2296 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":character", (String) sectors.get(i)[1]));
|
---|
2297 | if (!((String) sectors.get(i)[2]).isEmpty())
|
---|
2298 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":group", (String) sectors.get(i)[2]));
|
---|
2299 | if (!((String) sectors.get(i)[3]).isEmpty())
|
---|
2300 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sequence", (String) sectors.get(i)[3]));
|
---|
2301 | if (!((String) sectors.get(i)[4]).isEmpty())
|
---|
2302 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(i)[4]));
|
---|
2303 | if (sectors.get(i)[5] != Lit.UNKLIT)
|
---|
2304 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", LitSTR.get(sectors.get(i)[5])));
|
---|
2305 | if (!((String) sectors.get(i)[6]).isEmpty())
|
---|
2306 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_start", (String) sectors.get(i)[6]));
|
---|
2307 | if (!((String) sectors.get(i)[7]).isEmpty())
|
---|
2308 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_end", (String) sectors.get(i)[7]));
|
---|
2309 | if (!((String) sectors.get(i)[8]).isEmpty())
|
---|
2310 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":radius", (String) sectors.get(i)[8]));
|
---|
2311 | if (!((String) sectors.get(i)[9]).isEmpty())
|
---|
2312 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":height", (String) sectors.get(i)[9]));
|
---|
2313 | if (!((String) sectors.get(i)[10]).isEmpty())
|
---|
2314 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(i)[10]));
|
---|
2315 | if (sectors.get(i)[11] != Vis.UNKVIS)
|
---|
2316 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", VisSTR.get(sectors.get(i)[11])));
|
---|
2317 | if (sectors.get(i)[12] != Exh.UNKEXH)
|
---|
2318 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", ExhSTR.get(sectors.get(i)[12])));
|
---|
2319 | if (!((String) sectors.get(i)[13]).isEmpty())
|
---|
2320 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":orientation", (String) sectors.get(i)[13]));
|
---|
2321 | if (!((String) sectors.get(i)[14]).isEmpty())
|
---|
2322 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String) sectors.get(i)[14]));
|
---|
2323 | }
|
---|
2324 |
|
---|
2325 | if (getFogSound() != Fog.NOFOG) {
|
---|
2326 | if (getFogSound() == Fog.FOGSIG)
|
---|
2327 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal", "yes"));
|
---|
2328 | else
|
---|
2329 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:category", FogSTR.get(getFogSound())));
|
---|
2330 | if (!getFogGroup().isEmpty()) {
|
---|
2331 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:group", getFogGroup()));
|
---|
2332 | }
|
---|
2333 | if (!getFogPeriod().isEmpty()) {
|
---|
2334 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:period", getFogPeriod()));
|
---|
2335 | }
|
---|
2336 | if (!getFogSequence().isEmpty()) {
|
---|
2337 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:sequence", getFogSequence()));
|
---|
2338 | }
|
---|
2339 | if (!getFogRange().isEmpty()) {
|
---|
2340 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:range", getFogRange()));
|
---|
2341 | }
|
---|
2342 | }
|
---|
2343 |
|
---|
2344 | if (RaType != Rtb.NORTB) {
|
---|
2345 | if (getRadar() == Rtb.REFLECTOR) {
|
---|
2346 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_reflector", "yes"));
|
---|
2347 | } else {
|
---|
2348 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:category", RtbSTR.get(getRadar())));
|
---|
2349 | if (!getRaconGroup().isEmpty()) {
|
---|
2350 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:group", getRaconGroup()));
|
---|
2351 | }
|
---|
2352 | if (!getRaconPeriod().isEmpty()) {
|
---|
2353 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:period", getRaconPeriod()));
|
---|
2354 | }
|
---|
2355 | if (!getRaconSequence().isEmpty()) {
|
---|
2356 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sequence", getRaconSequence()));
|
---|
2357 | }
|
---|
2358 | if (!getRaconRange().isEmpty()) {
|
---|
2359 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:range", getRaconRange()));
|
---|
2360 | }
|
---|
2361 | if ((!getRaconSector1().isEmpty()) && (!getRaconSector2().isEmpty())) {
|
---|
2362 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_start", getRaconSector1()));
|
---|
2363 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_end", getRaconSector2()));
|
---|
2364 | }
|
---|
2365 | }
|
---|
2366 | }
|
---|
2367 |
|
---|
2368 | if (!getInfo().isEmpty()) {
|
---|
2369 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:information", getInfo()));
|
---|
2370 | }
|
---|
2371 | if (!getSource().isEmpty()) {
|
---|
2372 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:source", getSource()));
|
---|
2373 | }
|
---|
2374 | if (getStatus() != Sts.UNKSTS) {
|
---|
2375 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:status", StsSTR.get(getStatus())));
|
---|
2376 | }
|
---|
2377 | if (getConstr() != Cns.UNKCNS) {
|
---|
2378 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:construction", CnsSTR.get(getConstr())));
|
---|
2379 | }
|
---|
2380 | if (getConsp() != Con.UNKCON) {
|
---|
2381 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:conspicuity", ConSTR.get(getConsp())));
|
---|
2382 | }
|
---|
2383 | if (getRefl() != Con.UNKCON) {
|
---|
2384 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reflectivity", ConSTR.get(getRefl())));
|
---|
2385 | }
|
---|
2386 | if (!getRef().isEmpty()) {
|
---|
2387 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reference", getRef()));
|
---|
2388 | }
|
---|
2389 | if (!getLightRef().isEmpty()) {
|
---|
2390 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:reference", getLightRef()));
|
---|
2391 | }
|
---|
2392 | if (!getFixme().isEmpty()) {
|
---|
2393 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fixme", getFixme()));
|
---|
2394 | }
|
---|
2395 | }
|
---|
2396 | }
|
---|
2397 |
|
---|
2398 | }
|
---|