1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package seamarks;
|
---|
3 |
|
---|
4 | import java.awt.BasicStroke;
|
---|
5 | import java.awt.Color;
|
---|
6 | import java.awt.Graphics;
|
---|
7 | import java.awt.Graphics2D;
|
---|
8 | import java.awt.RenderingHints;
|
---|
9 | import java.awt.geom.Arc2D;
|
---|
10 | import java.util.ArrayList;
|
---|
11 | import java.util.EnumMap;
|
---|
12 | import java.util.EnumSet;
|
---|
13 | import java.util.HashMap;
|
---|
14 | import java.util.Map;
|
---|
15 |
|
---|
16 | import javax.swing.ImageIcon;
|
---|
17 | import javax.swing.JPanel;
|
---|
18 |
|
---|
19 | import org.openstreetmap.josm.Main;
|
---|
20 | import org.openstreetmap.josm.command.ChangePropertyCommand;
|
---|
21 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
22 |
|
---|
23 | import messages.Messages;
|
---|
24 | import panels.PanelMain;
|
---|
25 | import smed.SmedAction;
|
---|
26 |
|
---|
27 | public class SeaMark extends JPanel {
|
---|
28 |
|
---|
29 | public SmedAction dlg = null;
|
---|
30 |
|
---|
31 | public SeaMark(SmedAction dia) {
|
---|
32 | dlg = dia;
|
---|
33 | clrLight();
|
---|
34 | }
|
---|
35 |
|
---|
36 | public enum Reg {
|
---|
37 | A, B, C, R, X
|
---|
38 | }
|
---|
39 |
|
---|
40 | public static final EnumMap<Reg, String> RegSTR = new EnumMap<>(Reg.class);
|
---|
41 | static {
|
---|
42 | RegSTR.put(Reg.A, "iala-a");
|
---|
43 | RegSTR.put(Reg.B, "iala-b");
|
---|
44 | RegSTR.put(Reg.C, "cevni");
|
---|
45 | RegSTR.put(Reg.R, "riwr");
|
---|
46 | RegSTR.put(Reg.X, "other");
|
---|
47 | }
|
---|
48 |
|
---|
49 | private Reg region = Reg.A;
|
---|
50 |
|
---|
51 | public Reg getRegion() {
|
---|
52 | return region;
|
---|
53 | }
|
---|
54 |
|
---|
55 | public void setRegion(Reg reg) {
|
---|
56 | region = reg;
|
---|
57 | }
|
---|
58 |
|
---|
59 | private String name = "";
|
---|
60 |
|
---|
61 | @Override
|
---|
62 | public String getName() {
|
---|
63 | return name;
|
---|
64 | }
|
---|
65 |
|
---|
66 | @Override
|
---|
67 | public void setName(String str) {
|
---|
68 | name = str.trim();
|
---|
69 | repaint();
|
---|
70 | }
|
---|
71 |
|
---|
72 | public enum Obj {
|
---|
73 | UNKOBJ, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP,
|
---|
74 | BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, NOTMRK,
|
---|
75 | FLTCAR, FLTISD, FLTLAT, FLTSAW, FLTSPP,
|
---|
76 | LITMAJ, LITMIN, LITFLT, LITVES, LITHSE, LNDMRK,
|
---|
77 | MORFAC, BOYINB, SISTAW, SISTAT, OFSPLF,
|
---|
78 | CGUSTA, PILBOP, RSCSTA, RDOSTA, RADSTA
|
---|
79 | }
|
---|
80 |
|
---|
81 | public static final EnumMap<Obj, String> ObjSTR = new EnumMap<>(Obj.class);
|
---|
82 | static {
|
---|
83 | ObjSTR.put(Obj.BCNCAR, "beacon_cardinal");
|
---|
84 | ObjSTR.put(Obj.BCNISD, "beacon_isolated_danger");
|
---|
85 | ObjSTR.put(Obj.BCNLAT, "beacon_lateral");
|
---|
86 | ObjSTR.put(Obj.BCNSAW, "beacon_safe_water");
|
---|
87 | ObjSTR.put(Obj.BCNSPP, "beacon_special_purpose");
|
---|
88 | ObjSTR.put(Obj.BOYCAR, "buoy_cardinal");
|
---|
89 | ObjSTR.put(Obj.BOYISD, "buoy_isolated_danger");
|
---|
90 | ObjSTR.put(Obj.BOYLAT, "buoy_lateral");
|
---|
91 | ObjSTR.put(Obj.BOYSAW, "buoy_safe_water");
|
---|
92 | ObjSTR.put(Obj.BOYSPP, "buoy_special_purpose");
|
---|
93 | ObjSTR.put(Obj.FLTCAR, "light_float");
|
---|
94 | ObjSTR.put(Obj.FLTLAT, "light_float");
|
---|
95 | ObjSTR.put(Obj.FLTSAW, "light_float");
|
---|
96 | ObjSTR.put(Obj.FLTISD, "light_float");
|
---|
97 | ObjSTR.put(Obj.FLTSPP, "light_float");
|
---|
98 | ObjSTR.put(Obj.LITMAJ, "light_major");
|
---|
99 | ObjSTR.put(Obj.LITMIN, "light_minor");
|
---|
100 | ObjSTR.put(Obj.LITFLT, "light_float");
|
---|
101 | ObjSTR.put(Obj.LITVES, "light_vessel");
|
---|
102 | ObjSTR.put(Obj.NOTMRK, "notice");
|
---|
103 | ObjSTR.put(Obj.LNDMRK, "landmark");
|
---|
104 | ObjSTR.put(Obj.LITHSE, "landmark");
|
---|
105 | ObjSTR.put(Obj.MORFAC, "mooring");
|
---|
106 | ObjSTR.put(Obj.BOYINB, "buoy_installation");
|
---|
107 | ObjSTR.put(Obj.OFSPLF, "platform");
|
---|
108 | ObjSTR.put(Obj.SISTAW, "signal_station_warning");
|
---|
109 | ObjSTR.put(Obj.SISTAT, "signal_station_traffic");
|
---|
110 | ObjSTR.put(Obj.CGUSTA, "coastguard_station");
|
---|
111 | ObjSTR.put(Obj.PILBOP, "pilot_boarding");
|
---|
112 | ObjSTR.put(Obj.RSCSTA, "rescue_station");
|
---|
113 | ObjSTR.put(Obj.RDOSTA, "radio_station");
|
---|
114 | ObjSTR.put(Obj.RADSTA, "radar_station");
|
---|
115 | }
|
---|
116 |
|
---|
117 | private Obj object = Obj.UNKOBJ;
|
---|
118 |
|
---|
119 | public Obj getObject() {
|
---|
120 | return object;
|
---|
121 | }
|
---|
122 |
|
---|
123 | public void setObject(Obj obj) {
|
---|
124 | object = obj;
|
---|
125 | if (obj == Obj.UNKOBJ) {
|
---|
126 | setCategory(Cat.NOCAT);
|
---|
127 | setFunc(Fnc.UNKFNC);
|
---|
128 | setShape(Shp.UNKSHP);
|
---|
129 | setColour(Ent.BODY, Col.UNKCOL);
|
---|
130 | setPattern(Ent.BODY, Pat.NOPAT);
|
---|
131 | setTopmark(Top.NOTOP);
|
---|
132 | setColour(Ent.TOPMARK, Col.UNKCOL);
|
---|
133 | setPattern(Ent.TOPMARK, Pat.NOPAT);
|
---|
134 | }
|
---|
135 | repaint();
|
---|
136 | }
|
---|
137 |
|
---|
138 | public enum Ent {
|
---|
139 | BODY, BUOY, BEACON, LFLOAT, TOPMARK, LIGHT, MOORING, STATION, PLATFORM, NOTICE
|
---|
140 | }
|
---|
141 |
|
---|
142 | public static final EnumMap<Obj, Ent> EntMAP = new EnumMap<>(Obj.class);
|
---|
143 | static {
|
---|
144 | EntMAP.put(Obj.BCNCAR, Ent.BEACON);
|
---|
145 | EntMAP.put(Obj.BCNISD, Ent.BEACON);
|
---|
146 | EntMAP.put(Obj.BCNLAT, Ent.BEACON);
|
---|
147 | EntMAP.put(Obj.BCNSAW, Ent.BEACON);
|
---|
148 | EntMAP.put(Obj.BCNSPP, Ent.BEACON);
|
---|
149 | EntMAP.put(Obj.BOYCAR, Ent.BUOY);
|
---|
150 | EntMAP.put(Obj.BOYISD, Ent.BUOY);
|
---|
151 | EntMAP.put(Obj.BOYLAT, Ent.BUOY);
|
---|
152 | EntMAP.put(Obj.BOYSAW, Ent.BUOY);
|
---|
153 | EntMAP.put(Obj.BOYSPP, Ent.BUOY);
|
---|
154 | EntMAP.put(Obj.LITMAJ, Ent.LIGHT);
|
---|
155 | EntMAP.put(Obj.LITMIN, Ent.LIGHT);
|
---|
156 | EntMAP.put(Obj.LITFLT, Ent.LFLOAT);
|
---|
157 | EntMAP.put(Obj.FLTCAR, Ent.LFLOAT);
|
---|
158 | EntMAP.put(Obj.FLTLAT, Ent.LFLOAT);
|
---|
159 | EntMAP.put(Obj.FLTSAW, Ent.LFLOAT);
|
---|
160 | EntMAP.put(Obj.FLTISD, Ent.LFLOAT);
|
---|
161 | EntMAP.put(Obj.FLTSPP, Ent.LFLOAT);
|
---|
162 | EntMAP.put(Obj.LITVES, Ent.LFLOAT);
|
---|
163 | EntMAP.put(Obj.LITHSE, Ent.LIGHT);
|
---|
164 | EntMAP.put(Obj.LNDMRK, Ent.LIGHT);
|
---|
165 | EntMAP.put(Obj.MORFAC, Ent.MOORING);
|
---|
166 | EntMAP.put(Obj.BOYINB, Ent.MOORING);
|
---|
167 | EntMAP.put(Obj.OFSPLF, Ent.PLATFORM);
|
---|
168 | EntMAP.put(Obj.SISTAW, Ent.STATION);
|
---|
169 | EntMAP.put(Obj.SISTAT, Ent.STATION);
|
---|
170 | EntMAP.put(Obj.CGUSTA, Ent.STATION);
|
---|
171 | EntMAP.put(Obj.PILBOP, Ent.STATION);
|
---|
172 | EntMAP.put(Obj.RSCSTA, Ent.STATION);
|
---|
173 | EntMAP.put(Obj.RDOSTA, Ent.STATION);
|
---|
174 | EntMAP.put(Obj.RADSTA, Ent.STATION);
|
---|
175 | EntMAP.put(Obj.NOTMRK, Ent.NOTICE);
|
---|
176 | }
|
---|
177 |
|
---|
178 | public enum Grp {
|
---|
179 | NUL, LAT, CAR, SAW, ISD, SPP, LGT, STN, PLF, NTC
|
---|
180 | }
|
---|
181 |
|
---|
182 | public static final EnumMap<Obj, Grp> GrpMAP = new EnumMap<>(Obj.class);
|
---|
183 | static {
|
---|
184 | GrpMAP.put(Obj.UNKOBJ, Grp.NUL);
|
---|
185 | GrpMAP.put(Obj.BCNCAR, Grp.CAR);
|
---|
186 | GrpMAP.put(Obj.BCNISD, Grp.ISD);
|
---|
187 | GrpMAP.put(Obj.BCNLAT, Grp.LAT);
|
---|
188 | GrpMAP.put(Obj.BCNSAW, Grp.SAW);
|
---|
189 | GrpMAP.put(Obj.BCNSPP, Grp.SPP);
|
---|
190 | GrpMAP.put(Obj.BOYCAR, Grp.CAR);
|
---|
191 | GrpMAP.put(Obj.BOYISD, Grp.ISD);
|
---|
192 | GrpMAP.put(Obj.BOYLAT, Grp.LAT);
|
---|
193 | GrpMAP.put(Obj.BOYSAW, Grp.SAW);
|
---|
194 | GrpMAP.put(Obj.BOYSPP, Grp.SPP);
|
---|
195 | GrpMAP.put(Obj.FLTCAR, Grp.CAR);
|
---|
196 | GrpMAP.put(Obj.FLTLAT, Grp.LAT);
|
---|
197 | GrpMAP.put(Obj.FLTSAW, Grp.SAW);
|
---|
198 | GrpMAP.put(Obj.FLTISD, Grp.ISD);
|
---|
199 | GrpMAP.put(Obj.FLTSPP, Grp.SPP);
|
---|
200 | GrpMAP.put(Obj.LITFLT, Grp.LGT);
|
---|
201 | GrpMAP.put(Obj.LITMAJ, Grp.LGT);
|
---|
202 | GrpMAP.put(Obj.LITMIN, Grp.LGT);
|
---|
203 | GrpMAP.put(Obj.LITVES, Grp.LGT);
|
---|
204 | GrpMAP.put(Obj.LITHSE, Grp.LGT);
|
---|
205 | GrpMAP.put(Obj.LNDMRK, Grp.LGT);
|
---|
206 | GrpMAP.put(Obj.MORFAC, Grp.SPP);
|
---|
207 | GrpMAP.put(Obj.BOYINB, Grp.SPP);
|
---|
208 | GrpMAP.put(Obj.OFSPLF, Grp.PLF);
|
---|
209 | GrpMAP.put(Obj.SISTAW, Grp.STN);
|
---|
210 | GrpMAP.put(Obj.SISTAT, Grp.STN);
|
---|
211 | GrpMAP.put(Obj.CGUSTA, Grp.STN);
|
---|
212 | GrpMAP.put(Obj.PILBOP, Grp.STN);
|
---|
213 | GrpMAP.put(Obj.RSCSTA, Grp.STN);
|
---|
214 | GrpMAP.put(Obj.RDOSTA, Grp.STN);
|
---|
215 | GrpMAP.put(Obj.RADSTA, Grp.STN);
|
---|
216 | GrpMAP.put(Obj.NOTMRK, Grp.NTC);
|
---|
217 | }
|
---|
218 |
|
---|
219 | public enum Cat {
|
---|
220 | NOCAT, LAM_PORT, LAM_STBD, LAM_PPORT, LAM_PSTBD, CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST,
|
---|
221 | ACH_URST, ACH_DEEP, ACH_TANK, ACH_EXPL, ACH_QUAR, ACH_SPLN, ACH_SCAN, ACH_SCMO, ACH_T24H, ACH_TLIM,
|
---|
222 | SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN, SPM_MOOR, SPM_LNBY,
|
---|
223 | SPM_LDNG, SPM_NOTC, SPM_TSS, SPM_FOUL, SPM_DIVE, SPM_FRRY, SPM_ANCH,
|
---|
224 | MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_ROPE, MOR_AUTO, MOR_BUOY, INB_CALM, INB_SBM,
|
---|
225 | SIS_PTCL, SIS_PTED, SIS_IPT, SIS_BRTH, SIS_DOCK, SIS_LOCK, SIS_FBAR, SIS_BRDG, SIS_DRDG, SIS_TRFC,
|
---|
226 | SIS_DNGR, SIS_OBST, SIS_CABL, SIS_MILY, SIS_DSTR, SIS_WTHR, SIS_STRM, SIS_ICE, SIS_TIME, SIS_TIDE,
|
---|
227 | SIS_TSTM, SIS_TGAG, SIS_TSCL, SIS_DIVE, SIS_LGAG, LIT_DIRF, LIT_LEDG,
|
---|
228 | LMK_CHMY, LMK_CARN, LMK_DSHA, LMK_FLGS, LMK_FLRS, LMK_MNMT, LMK_TOWR, LMK_WNDM, LMK_WTRT, LMK_MNRT,
|
---|
229 | LMK_MAST, LMK_WNDS, LMK_CLMN, LMK_OBLK, LMK_STAT, LMK_CROS, LMK_DOME, LMK_SCNR, LMK_WNDL, LMK_SPIR,
|
---|
230 | OFP_OIL, OFP_PRD, OFP_OBS, OFP_ALP, OFP_SALM, OFP_MOR, OFP_ISL, OFP_FPSO, OFP_ACC, OFP_NCCB,
|
---|
231 | RSC_LFB, RSC_RKT, RSC_RSW, RSC_RIT, RSC_MLB, RSC_RAD, RSC_FAE, RSC_SPL, RSC_AIR, RSC_TUG,
|
---|
232 | RAS_SRV, RAS_CST, PIL_VESS, PIL_HELI, PIL_SHORE,
|
---|
233 | NTC_A1, NTC_A1a, NTC_A2, NTC_A3, NTC_A4, NTC_A4_1, NTC_A5, NTC_A5_1, NTC_A6, NTC_A7, NTC_A8, NTC_A9,
|
---|
234 | NTC_A10a, NTC_A10b, NTC_A12, NTC_A13, NTC_A14, NTC_A15, NTC_A16, NTC_A17, NTC_A18, NTC_A19, NTC_A20,
|
---|
235 | NTC_B1a, NTC_B1b, NTC_B2a, NTC_B2b, NTC_B3a, NTC_B3b, NTC_B4a, NTC_B4b, NTC_B5, NTC_B6, NTC_B7, NTC_B8, NTC_B9a, NTC_B9b, NTC_B11,
|
---|
236 | NTC_C1, NTC_C2, NTC_C3, NTC_C4, NTC_C5a, NTC_C5b, NTC_D1a, NTC_D1b, NTC_D2a, NTC_D2b, NTC_D3a, NTC_D3b,
|
---|
237 | NOROS, ROS_UNKN, ROS_OMNI, ROS_DIRL, ROS_ROTP, ROS_CNSL, ROS_RDF, ROS_QTG, ROS_AERO, ROS_DECA, ROS_LORN,
|
---|
238 | ROS_DGPS, ROS_TORN, ROS_OMGA, ROS_SYLD, ROS_CHKA,
|
---|
239 | ROS_PCOM, ROS_COMB, ROS_FACS, ROS_TIME, ROS_PAIS, ROS_SAIS, ROS_VAIS, ROS_VANC, ROS_VASC, ROS_VAEC, ROS_VAWC,
|
---|
240 | ROS_VAPL, ROS_VASL, ROS_VAID, ROS_VASW, ROS_VASP, ROS_VAWK
|
---|
241 | }
|
---|
242 |
|
---|
243 | public static final EnumMap<Cat, String> CatSTR = new EnumMap<>(Cat.class);
|
---|
244 | static {
|
---|
245 | CatSTR.put(Cat.LAM_PORT, "port");
|
---|
246 | CatSTR.put(Cat.LAM_STBD, "starboard");
|
---|
247 | CatSTR.put(Cat.LAM_PPORT, "preferred_channel_port");
|
---|
248 | CatSTR.put(Cat.LAM_PSTBD, "preferred_channel_starboard");
|
---|
249 | CatSTR.put(Cat.CAM_NORTH, "north");
|
---|
250 | CatSTR.put(Cat.CAM_EAST, "east");
|
---|
251 | CatSTR.put(Cat.CAM_SOUTH, "south");
|
---|
252 | CatSTR.put(Cat.CAM_WEST, "west");
|
---|
253 | CatSTR.put(Cat.SPM_UNKN, "unknown_purpose");
|
---|
254 | CatSTR.put(Cat.SPM_WARN, "warning");
|
---|
255 | CatSTR.put(Cat.SPM_CHBF, "channel_separation");
|
---|
256 | CatSTR.put(Cat.SPM_YCHT, "yachting");
|
---|
257 | CatSTR.put(Cat.SPM_CABL, "cable");
|
---|
258 | CatSTR.put(Cat.SPM_OFAL, "outfall");
|
---|
259 | CatSTR.put(Cat.SPM_ODAS, "odas");
|
---|
260 | CatSTR.put(Cat.SPM_RECN, "recreation_zone");
|
---|
261 | CatSTR.put(Cat.SPM_MOOR, "mooring");
|
---|
262 | CatSTR.put(Cat.SPM_LNBY, "lanby");
|
---|
263 | CatSTR.put(Cat.SPM_LDNG, "leading");
|
---|
264 | CatSTR.put(Cat.SPM_NOTC, "notice");
|
---|
265 | CatSTR.put(Cat.SPM_TSS, "tss");
|
---|
266 | CatSTR.put(Cat.SPM_FOUL, "foul_ground");
|
---|
267 | CatSTR.put(Cat.SPM_DIVE, "diving");
|
---|
268 | CatSTR.put(Cat.SPM_FRRY, "ferry_crossing");
|
---|
269 | CatSTR.put(Cat.SPM_ANCH, "anchorage");
|
---|
270 | CatSTR.put(Cat.MOR_DLPN, "dolphin");
|
---|
271 | CatSTR.put(Cat.MOR_DDPN, "deviation_dolphin");
|
---|
272 | CatSTR.put(Cat.MOR_BLRD, "bollard");
|
---|
273 | CatSTR.put(Cat.MOR_WALL, "wall");
|
---|
274 | CatSTR.put(Cat.MOR_POST, "post");
|
---|
275 | CatSTR.put(Cat.MOR_CHWR, "chain");
|
---|
276 | CatSTR.put(Cat.MOR_ROPE, "shore_rope");
|
---|
277 | CatSTR.put(Cat.MOR_AUTO, "automatic");
|
---|
278 | CatSTR.put(Cat.MOR_BUOY, "buoy");
|
---|
279 | CatSTR.put(Cat.INB_CALM, "calm");
|
---|
280 | CatSTR.put(Cat.INB_SBM, "sbm");
|
---|
281 | CatSTR.put(Cat.SIS_PTCL, "port_control");
|
---|
282 | CatSTR.put(Cat.SIS_PTED, "port_entry");
|
---|
283 | CatSTR.put(Cat.SIS_IPT, "ipt");
|
---|
284 | CatSTR.put(Cat.SIS_BRTH, "berthing");
|
---|
285 | CatSTR.put(Cat.SIS_DOCK, "dock");
|
---|
286 | CatSTR.put(Cat.SIS_LOCK, "lock");
|
---|
287 | CatSTR.put(Cat.SIS_FBAR, "barrage");
|
---|
288 | CatSTR.put(Cat.SIS_BRDG, "bridge");
|
---|
289 | CatSTR.put(Cat.SIS_DRDG, "dredging");
|
---|
290 | CatSTR.put(Cat.SIS_TRFC, "traffic");
|
---|
291 | CatSTR.put(Cat.SIS_DNGR, "danger");
|
---|
292 | CatSTR.put(Cat.SIS_OBST, "obstruction");
|
---|
293 | CatSTR.put(Cat.SIS_CABL, "cable");
|
---|
294 | CatSTR.put(Cat.SIS_MILY, "military");
|
---|
295 | CatSTR.put(Cat.SIS_DSTR, "distress");
|
---|
296 | CatSTR.put(Cat.SIS_WTHR, "weather");
|
---|
297 | CatSTR.put(Cat.SIS_STRM, "storm");
|
---|
298 | CatSTR.put(Cat.SIS_ICE, "ice");
|
---|
299 | CatSTR.put(Cat.SIS_TIME, "time");
|
---|
300 | CatSTR.put(Cat.SIS_TIDE, "tide");
|
---|
301 | CatSTR.put(Cat.SIS_TSTM, "stream");
|
---|
302 | CatSTR.put(Cat.SIS_TGAG, "gauge");
|
---|
303 | CatSTR.put(Cat.SIS_TSCL, "scale");
|
---|
304 | CatSTR.put(Cat.SIS_DIVE, "diving");
|
---|
305 | CatSTR.put(Cat.SIS_LGAG, "level");
|
---|
306 | CatSTR.put(Cat.LMK_CHMY, "chimney");
|
---|
307 | CatSTR.put(Cat.LMK_CARN, "cairn");
|
---|
308 | CatSTR.put(Cat.LMK_DSHA, "dish_aerial");
|
---|
309 | CatSTR.put(Cat.LMK_FLGS, "flagstaff");
|
---|
310 | CatSTR.put(Cat.LMK_FLRS, "flare_stack");
|
---|
311 | CatSTR.put(Cat.LMK_MNMT, "monument");
|
---|
312 | CatSTR.put(Cat.LMK_TOWR, "tower");
|
---|
313 | CatSTR.put(Cat.LMK_WNDM, "windmotor");
|
---|
314 | CatSTR.put(Cat.LMK_WTRT, "water_tower");
|
---|
315 | CatSTR.put(Cat.LMK_MAST, "mast");
|
---|
316 | CatSTR.put(Cat.LMK_WNDS, "windsock");
|
---|
317 | CatSTR.put(Cat.LMK_CLMN, "column");
|
---|
318 | CatSTR.put(Cat.LMK_OBLK, "obelisk");
|
---|
319 | CatSTR.put(Cat.LMK_STAT, "statue");
|
---|
320 | CatSTR.put(Cat.LMK_CROS, "cross");
|
---|
321 | CatSTR.put(Cat.LMK_DOME, "dome");
|
---|
322 | CatSTR.put(Cat.LMK_SCNR, "radar_scanner");
|
---|
323 | CatSTR.put(Cat.LMK_WNDL, "windmill");
|
---|
324 | CatSTR.put(Cat.LMK_SPIR, "spire");
|
---|
325 | CatSTR.put(Cat.LMK_MNRT, "minaret");
|
---|
326 | CatSTR.put(Cat.OFP_OIL, "oil");
|
---|
327 | CatSTR.put(Cat.OFP_PRD, "production");
|
---|
328 | CatSTR.put(Cat.OFP_OBS, "observation");
|
---|
329 | CatSTR.put(Cat.OFP_ALP, "alp");
|
---|
330 | CatSTR.put(Cat.OFP_SALM, "salm");
|
---|
331 | CatSTR.put(Cat.OFP_MOR, "mooring");
|
---|
332 | CatSTR.put(Cat.OFP_ISL, "island");
|
---|
333 | CatSTR.put(Cat.OFP_FPSO, "fpso");
|
---|
334 | CatSTR.put(Cat.OFP_ACC, "accommodation");
|
---|
335 | CatSTR.put(Cat.OFP_NCCB, "nccb");
|
---|
336 | CatSTR.put(Cat.PIL_VESS, "cruising_vessel");
|
---|
337 | CatSTR.put(Cat.PIL_HELI, "helicopter");
|
---|
338 | CatSTR.put(Cat.PIL_SHORE, "from_shore");
|
---|
339 | CatSTR.put(Cat.RSC_LFB, "lifeboat");
|
---|
340 | CatSTR.put(Cat.RSC_RKT, "rocket");
|
---|
341 | CatSTR.put(Cat.RSC_RSW, "refuge_shipwrecked");
|
---|
342 | CatSTR.put(Cat.RSC_RIT, "refuge_intertidal");
|
---|
343 | CatSTR.put(Cat.RSC_MLB, "lifeboat_moored");
|
---|
344 | CatSTR.put(Cat.RSC_RAD, "radio");
|
---|
345 | CatSTR.put(Cat.RSC_FAE, "firstaid");
|
---|
346 | CatSTR.put(Cat.RSC_SPL, "seaplane");
|
---|
347 | CatSTR.put(Cat.RSC_AIR, "aircraft");
|
---|
348 | CatSTR.put(Cat.RSC_TUG, "tug");
|
---|
349 | CatSTR.put(Cat.RAS_SRV, "surveillance");
|
---|
350 | CatSTR.put(Cat.RAS_CST, "coast");
|
---|
351 | CatSTR.put(Cat.ROS_OMNI, "omnidirectional");
|
---|
352 | CatSTR.put(Cat.ROS_DIRL, "directional");
|
---|
353 | CatSTR.put(Cat.ROS_ROTP, "rotating_pattern");
|
---|
354 | CatSTR.put(Cat.ROS_CNSL, "consol");
|
---|
355 | CatSTR.put(Cat.ROS_RDF, "rdf");
|
---|
356 | CatSTR.put(Cat.ROS_QTG, "qtg");
|
---|
357 | CatSTR.put(Cat.ROS_AERO, "aeronautical");
|
---|
358 | CatSTR.put(Cat.ROS_DECA, "decca");
|
---|
359 | CatSTR.put(Cat.ROS_LORN, "loran");
|
---|
360 | CatSTR.put(Cat.ROS_DGPS, "dgps");
|
---|
361 | CatSTR.put(Cat.ROS_TORN, "toran");
|
---|
362 | CatSTR.put(Cat.ROS_OMGA, "omega");
|
---|
363 | CatSTR.put(Cat.ROS_SYLD, "syledis");
|
---|
364 | CatSTR.put(Cat.ROS_CHKA, "chiaka");
|
---|
365 | CatSTR.put(Cat.ROS_PCOM, "public_communication");
|
---|
366 | CatSTR.put(Cat.ROS_COMB, "commercial_broadcast");
|
---|
367 | CatSTR.put(Cat.ROS_FACS, "facsimile");
|
---|
368 | CatSTR.put(Cat.ROS_TIME, "time_signal");
|
---|
369 | CatSTR.put(Cat.ROS_PAIS, "ais");
|
---|
370 | CatSTR.put(Cat.ROS_SAIS, "s-ais");
|
---|
371 | CatSTR.put(Cat.ROS_VAIS, "v-ais");
|
---|
372 | CatSTR.put(Cat.ROS_VANC, "v-ais_north_cardinal");
|
---|
373 | CatSTR.put(Cat.ROS_VASC, "v-ais_south_cardinal");
|
---|
374 | CatSTR.put(Cat.ROS_VAEC, "v-ais_east_cardinal");
|
---|
375 | CatSTR.put(Cat.ROS_VAWC, "v-ais_west_cardinal");
|
---|
376 | CatSTR.put(Cat.ROS_VAPL, "v-ais_port_lateral");
|
---|
377 | CatSTR.put(Cat.ROS_VASL, "v-ais_starboard_lateral");
|
---|
378 | CatSTR.put(Cat.ROS_VAID, "v-ais_isolated_danger");
|
---|
379 | CatSTR.put(Cat.ROS_VASW, "v-ais_safe_water");
|
---|
380 | CatSTR.put(Cat.ROS_VASP, "v-ais_special_purpose");
|
---|
381 | CatSTR.put(Cat.ROS_VAWK, "v-ais_wreck");
|
---|
382 | CatSTR.put(Cat.NTC_A1, "no_entry");
|
---|
383 | CatSTR.put(Cat.NTC_A1a, "closed_area");
|
---|
384 | CatSTR.put(Cat.NTC_A2, "no_overtaking");
|
---|
385 | CatSTR.put(Cat.NTC_A3, "no_convoy_overtaking");
|
---|
386 | CatSTR.put(Cat.NTC_A4, "no_passing");
|
---|
387 | CatSTR.put(Cat.NTC_A4, "no_convoy_passing");
|
---|
388 | CatSTR.put(Cat.NTC_A5, "no_berthing");
|
---|
389 | CatSTR.put(Cat.NTC_A5_1, "no_berthing_lateral_limit");
|
---|
390 | CatSTR.put(Cat.NTC_A6, "no_anchoring");
|
---|
391 | CatSTR.put(Cat.NTC_A7, "no_mooring");
|
---|
392 | CatSTR.put(Cat.NTC_A8, "no_turning");
|
---|
393 | CatSTR.put(Cat.NTC_A9, "no_wash");
|
---|
394 | CatSTR.put(Cat.NTC_A10a, "no_passage_left");
|
---|
395 | CatSTR.put(Cat.NTC_A10b, "no_passage_right");
|
---|
396 | CatSTR.put(Cat.NTC_A12, "no_motor_craft");
|
---|
397 | CatSTR.put(Cat.NTC_A13, "no_sport_craft");
|
---|
398 | CatSTR.put(Cat.NTC_A14, "no_waterskiing");
|
---|
399 | CatSTR.put(Cat.NTC_A15, "no_sailing_craft");
|
---|
400 | CatSTR.put(Cat.NTC_A16, "no_unpowered_craft");
|
---|
401 | CatSTR.put(Cat.NTC_A17, "no_sailboards");
|
---|
402 | CatSTR.put(Cat.NTC_A18, "no_high_speeds");
|
---|
403 | CatSTR.put(Cat.NTC_A19, "no_launching_beaching");
|
---|
404 | CatSTR.put(Cat.NTC_A20, "no_waterbikes");
|
---|
405 | CatSTR.put(Cat.NTC_B1a, "");
|
---|
406 | CatSTR.put(Cat.NTC_B1b, "");
|
---|
407 | CatSTR.put(Cat.NTC_B2a, "");
|
---|
408 | CatSTR.put(Cat.NTC_B2a, "");
|
---|
409 | CatSTR.put(Cat.NTC_B3a, "");
|
---|
410 | CatSTR.put(Cat.NTC_B3a, "");
|
---|
411 | CatSTR.put(Cat.NTC_B4a, "");
|
---|
412 | CatSTR.put(Cat.NTC_B4a, "");
|
---|
413 | CatSTR.put(Cat.NTC_B5, "");
|
---|
414 | CatSTR.put(Cat.NTC_B6, "");
|
---|
415 | CatSTR.put(Cat.NTC_B7, "");
|
---|
416 | CatSTR.put(Cat.NTC_B8, "");
|
---|
417 | CatSTR.put(Cat.NTC_B9a, "");
|
---|
418 | CatSTR.put(Cat.NTC_B9b, "");
|
---|
419 | CatSTR.put(Cat.NTC_B11, "");
|
---|
420 | CatSTR.put(Cat.NTC_C1, "");
|
---|
421 | CatSTR.put(Cat.NTC_C2, "");
|
---|
422 | CatSTR.put(Cat.NTC_C3, "");
|
---|
423 | CatSTR.put(Cat.NTC_C4, "");
|
---|
424 | CatSTR.put(Cat.NTC_C5a, "");
|
---|
425 | CatSTR.put(Cat.NTC_C5b, "");
|
---|
426 | CatSTR.put(Cat.NTC_D1a, "");
|
---|
427 | CatSTR.put(Cat.NTC_D1b, "");
|
---|
428 | CatSTR.put(Cat.NTC_D2a, "");
|
---|
429 | CatSTR.put(Cat.NTC_D2b, "");
|
---|
430 | CatSTR.put(Cat.NTC_D3a, "");
|
---|
431 | CatSTR.put(Cat.NTC_D3b, "");
|
---|
432 | }
|
---|
433 |
|
---|
434 | private Cat category = Cat.NOCAT;
|
---|
435 |
|
---|
436 | public Cat getCategory() {
|
---|
437 | return category;
|
---|
438 | }
|
---|
439 |
|
---|
440 | public void setCategory(Cat cat) {
|
---|
441 | category = cat;
|
---|
442 | repaint();
|
---|
443 | }
|
---|
444 |
|
---|
445 | public enum Shp {
|
---|
446 | UNKSHP, PILLAR, SPAR, CAN, CONI, SPHERI, BARREL, FLOAT, SUPER, BUOYANT,
|
---|
447 | CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON
|
---|
448 | }
|
---|
449 |
|
---|
450 | public static final EnumMap<Shp, String> ShpSTR = new EnumMap<>(Shp.class);
|
---|
451 | static {
|
---|
452 | ShpSTR.put(Shp.PILLAR, "pillar");
|
---|
453 | ShpSTR.put(Shp.SPAR, "spar");
|
---|
454 | ShpSTR.put(Shp.CAN, "can");
|
---|
455 | ShpSTR.put(Shp.CONI, "conical");
|
---|
456 | ShpSTR.put(Shp.SPHERI, "spherical");
|
---|
457 | ShpSTR.put(Shp.BARREL, "barrel");
|
---|
458 | ShpSTR.put(Shp.FLOAT, "float");
|
---|
459 | ShpSTR.put(Shp.SUPER, "super-buoy");
|
---|
460 | ShpSTR.put(Shp.BUOYANT, "buoyant");
|
---|
461 | ShpSTR.put(Shp.CAIRN, "cairn");
|
---|
462 | ShpSTR.put(Shp.PILE, "pile");
|
---|
463 | ShpSTR.put(Shp.LATTICE, "lattice");
|
---|
464 | ShpSTR.put(Shp.TOWER, "tower");
|
---|
465 | ShpSTR.put(Shp.STAKE, "stake");
|
---|
466 | ShpSTR.put(Shp.PERCH, "perch");
|
---|
467 | }
|
---|
468 |
|
---|
469 | private Shp shape = Shp.UNKSHP;
|
---|
470 |
|
---|
471 | public Shp getShape() {
|
---|
472 | return shape;
|
---|
473 | }
|
---|
474 |
|
---|
475 | public void setShape(Shp shp) {
|
---|
476 | shape = shp;
|
---|
477 | repaint();
|
---|
478 | }
|
---|
479 |
|
---|
480 | public enum Col {
|
---|
481 | UNKCOL, BLANK, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, GREY, BROWN, MAGENTA, PINK
|
---|
482 | }
|
---|
483 |
|
---|
484 | public static final EnumMap<Col, Color> ColMAP = new EnumMap<>(Col.class);
|
---|
485 | static {
|
---|
486 | ColMAP.put(Col.UNKCOL, new Color(0xc0c0c0));
|
---|
487 | ColMAP.put(Col.WHITE, Color.WHITE);
|
---|
488 | ColMAP.put(Col.RED, Color.RED);
|
---|
489 | ColMAP.put(Col.ORANGE, Color.ORANGE);
|
---|
490 | ColMAP.put(Col.AMBER, new Color(0xfbf00f));
|
---|
491 | ColMAP.put(Col.YELLOW, Color.YELLOW);
|
---|
492 | ColMAP.put(Col.GREEN, Color.GREEN);
|
---|
493 | ColMAP.put(Col.BLUE, Color.BLUE);
|
---|
494 | ColMAP.put(Col.VIOLET, new Color(0x8f00ff));
|
---|
495 | ColMAP.put(Col.BLACK, Color.BLACK);
|
---|
496 | ColMAP.put(Col.GREY, Color.GRAY);
|
---|
497 | ColMAP.put(Col.BROWN, new Color(0xa45a58));
|
---|
498 | ColMAP.put(Col.MAGENTA, Color.MAGENTA);
|
---|
499 | ColMAP.put(Col.PINK, Color.PINK);
|
---|
500 | }
|
---|
501 |
|
---|
502 | public static final EnumMap<Col, String> ColSTR = new EnumMap<>(Col.class);
|
---|
503 | static {
|
---|
504 | ColSTR.put(Col.WHITE, "white");
|
---|
505 | ColSTR.put(Col.RED, "red");
|
---|
506 | ColSTR.put(Col.ORANGE, "orange");
|
---|
507 | ColSTR.put(Col.AMBER, "amber");
|
---|
508 | ColSTR.put(Col.YELLOW, "yellow");
|
---|
509 | ColSTR.put(Col.GREEN, "green");
|
---|
510 | ColSTR.put(Col.BLUE, "blue");
|
---|
511 | ColSTR.put(Col.VIOLET, "violet");
|
---|
512 | ColSTR.put(Col.BLACK, "black");
|
---|
513 | ColSTR.put(Col.GREY, "grey");
|
---|
514 | ColSTR.put(Col.BROWN, "brown");
|
---|
515 | ColSTR.put(Col.MAGENTA, "magenta");
|
---|
516 | ColSTR.put(Col.PINK, "pink");
|
---|
517 | }
|
---|
518 |
|
---|
519 | public Col getColour(Ent ent, int idx) {
|
---|
520 | if (ent == Ent.BODY)
|
---|
521 | return getObjColour(idx);
|
---|
522 | else
|
---|
523 | return getTopColour(idx);
|
---|
524 | }
|
---|
525 |
|
---|
526 | public void setColour(Ent ent, Col col) {
|
---|
527 | if (ent == Ent.BODY) {
|
---|
528 | setObjColour(col);
|
---|
529 | } else {
|
---|
530 | setTopColour(col);
|
---|
531 | }
|
---|
532 | }
|
---|
533 |
|
---|
534 | public void setColour(Ent ent, int idx, Col col) {
|
---|
535 | if (ent == Ent.BODY) {
|
---|
536 | setObjColour(idx, col);
|
---|
537 | } else {
|
---|
538 | setTopColour(idx, col);
|
---|
539 | }
|
---|
540 | }
|
---|
541 |
|
---|
542 | public void addColour(Ent ent, int idx, Col col) {
|
---|
543 | if (ent == Ent.BODY) {
|
---|
544 | addObjColour(idx, col);
|
---|
545 | } else {
|
---|
546 | addTopColour(idx, col);
|
---|
547 | }
|
---|
548 | }
|
---|
549 |
|
---|
550 | public void subColour(Ent ent, int idx) {
|
---|
551 | if (ent == Ent.BODY) {
|
---|
552 | subObjColour(idx);
|
---|
553 | } else {
|
---|
554 | subTopColour(idx);
|
---|
555 | }
|
---|
556 | }
|
---|
557 |
|
---|
558 | private ArrayList<Col> bodyColour = new ArrayList<>();
|
---|
559 |
|
---|
560 | public Col getObjColour(int i) {
|
---|
561 | if (i < bodyColour.size())
|
---|
562 | return bodyColour.get(i);
|
---|
563 | else
|
---|
564 | return Col.UNKCOL;
|
---|
565 | }
|
---|
566 |
|
---|
567 | public void setObjColour(Col col) {
|
---|
568 | bodyColour.clear();
|
---|
569 | bodyColour.add(col);
|
---|
570 | repaint();
|
---|
571 | }
|
---|
572 |
|
---|
573 | public void setObjColour(int i, Col col) {
|
---|
574 | if (i < bodyColour.size()) {
|
---|
575 | bodyColour.set(i, col);
|
---|
576 | }
|
---|
577 | repaint();
|
---|
578 | }
|
---|
579 |
|
---|
580 | public void addObjColour(int i, Col col) {
|
---|
581 | if (bodyColour.size() >= i) {
|
---|
582 | bodyColour.add(i, col);
|
---|
583 | }
|
---|
584 | repaint();
|
---|
585 | }
|
---|
586 |
|
---|
587 | public void addObjColour(Col col) {
|
---|
588 | bodyColour.add(col);
|
---|
589 | repaint();
|
---|
590 | }
|
---|
591 |
|
---|
592 | public void subObjColour(int i) {
|
---|
593 | if (bodyColour.size() > i) {
|
---|
594 | bodyColour.remove(i);
|
---|
595 | }
|
---|
596 | repaint();
|
---|
597 | }
|
---|
598 |
|
---|
599 | private ArrayList<Col> topmarkColour = new ArrayList<>();
|
---|
600 |
|
---|
601 | public Col getTopColour(int i) {
|
---|
602 | if (i < topmarkColour.size())
|
---|
603 | return topmarkColour.get(i);
|
---|
604 | else
|
---|
605 | return Col.UNKCOL;
|
---|
606 | }
|
---|
607 |
|
---|
608 | public void setTopColour(Col col) {
|
---|
609 | topmarkColour.clear();
|
---|
610 | topmarkColour.add(col);
|
---|
611 | repaint();
|
---|
612 | }
|
---|
613 |
|
---|
614 | public void setTopColour(int i, Col col) {
|
---|
615 | if (topmarkColour.size() > i) {
|
---|
616 | topmarkColour.set(i, col);
|
---|
617 | }
|
---|
618 | repaint();
|
---|
619 | }
|
---|
620 |
|
---|
621 | public void addTopColour(int i, Col col) {
|
---|
622 | if (topmarkColour.size() >= i) {
|
---|
623 | topmarkColour.add(i, col);
|
---|
624 | }
|
---|
625 | repaint();
|
---|
626 | }
|
---|
627 |
|
---|
628 | public void addTopColour(Col col) {
|
---|
629 | topmarkColour.add(col);
|
---|
630 | repaint();
|
---|
631 | }
|
---|
632 |
|
---|
633 | public void subTopColour(int i) {
|
---|
634 | if (topmarkColour.size() > i) {
|
---|
635 | topmarkColour.remove(i);
|
---|
636 | }
|
---|
637 | repaint();
|
---|
638 | }
|
---|
639 |
|
---|
640 | public enum Chr {
|
---|
641 | UNKCHR, FIXED, FLASH, LFLASH, QUICK, VQUICK, UQUICK, ISOPHASED, OCCULTING, MORSE, ALTERNATING, IQUICK, IVQUICK, IUQUICK
|
---|
642 | }
|
---|
643 |
|
---|
644 | public static final Map<EnumSet<Chr>, String> ChrMAP = new HashMap<>();
|
---|
645 | static {
|
---|
646 | ChrMAP.put(EnumSet.of(Chr.FIXED), "F");
|
---|
647 | ChrMAP.put(EnumSet.of(Chr.FLASH), "Fl");
|
---|
648 | ChrMAP.put(EnumSet.of(Chr.LFLASH), "LFl");
|
---|
649 | ChrMAP.put(EnumSet.of(Chr.QUICK), "Q");
|
---|
650 | ChrMAP.put(EnumSet.of(Chr.VQUICK), "VQ");
|
---|
651 | ChrMAP.put(EnumSet.of(Chr.UQUICK), "UQ");
|
---|
652 | ChrMAP.put(EnumSet.of(Chr.ISOPHASED), "Iso");
|
---|
653 | ChrMAP.put(EnumSet.of(Chr.OCCULTING), "Oc");
|
---|
654 | ChrMAP.put(EnumSet.of(Chr.IQUICK), "IQ");
|
---|
655 | ChrMAP.put(EnumSet.of(Chr.IVQUICK), "IVQ");
|
---|
656 | ChrMAP.put(EnumSet.of(Chr.IUQUICK), "IUQ");
|
---|
657 | ChrMAP.put(EnumSet.of(Chr.MORSE), "Mo");
|
---|
658 | ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.FLASH), "FFl");
|
---|
659 | ChrMAP.put(EnumSet.of(Chr.FLASH, Chr.LFLASH), "FlLFl");
|
---|
660 | ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.OCCULTING), "FOc");
|
---|
661 | ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LFLASH), "FLFl");
|
---|
662 | ChrMAP.put(EnumSet.of(Chr.OCCULTING, Chr.FLASH), "OcFl");
|
---|
663 | ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LFLASH), "Q+LFl");
|
---|
664 | ChrMAP.put(EnumSet.of(Chr.VQUICK, Chr.LFLASH), "VQ+LFl");
|
---|
665 | ChrMAP.put(EnumSet.of(Chr.UQUICK, Chr.LFLASH), "UQ+LFl");
|
---|
666 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING), "Al");
|
---|
667 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc");
|
---|
668 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LFLASH), "Al.LFl");
|
---|
669 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl");
|
---|
670 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED), "Al.F");
|
---|
671 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED, Chr.FLASH), "Al.FFl");
|
---|
672 | ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.ISOPHASED), "Al.Iso");
|
---|
673 | }
|
---|
674 |
|
---|
675 | public enum Vis {
|
---|
676 | UNKVIS, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS
|
---|
677 | }
|
---|
678 |
|
---|
679 | public static final EnumMap<Vis, String> VisSTR = new EnumMap<>(Vis.class);
|
---|
680 | static {
|
---|
681 | VisSTR.put(Vis.HIGH, "high");
|
---|
682 | VisSTR.put(Vis.LOW, "low");
|
---|
683 | VisSTR.put(Vis.FAINT, "faint");
|
---|
684 | VisSTR.put(Vis.INTEN, "intensified");
|
---|
685 | VisSTR.put(Vis.UNINTEN, "unintensified");
|
---|
686 | VisSTR.put(Vis.REST, "restricted");
|
---|
687 | VisSTR.put(Vis.OBS, "obscured");
|
---|
688 | VisSTR.put(Vis.PARTOBS, "part_obscured");
|
---|
689 | }
|
---|
690 |
|
---|
691 | public enum Lit {
|
---|
692 | UNKLIT, VERT, HORIZ, DIR, UPPER, LOWER, LEAD, REAR, FRONT, AERO, AIROBS, FOGDET, FLOOD, STRIP, SUBS, SPOT, MOIRE, EMERG, BEAR
|
---|
693 | }
|
---|
694 |
|
---|
695 | public static final EnumMap<Lit, String> LitSTR = new EnumMap<>(Lit.class);
|
---|
696 | static {
|
---|
697 | LitSTR.put(Lit.VERT, "vertical");
|
---|
698 | LitSTR.put(Lit.HORIZ, "horizontal");
|
---|
699 | LitSTR.put(Lit.DIR, "directional");
|
---|
700 | LitSTR.put(Lit.UPPER, "upper");
|
---|
701 | LitSTR.put(Lit.LOWER, "lower");
|
---|
702 | LitSTR.put(Lit.LEAD, "leading");
|
---|
703 | LitSTR.put(Lit.REAR, "rear");
|
---|
704 | LitSTR.put(Lit.FRONT, "front");
|
---|
705 | LitSTR.put(Lit.AERO, "aero");
|
---|
706 | LitSTR.put(Lit.AIROBS, "air_obstruction");
|
---|
707 | LitSTR.put(Lit.FOGDET, "fog_detector");
|
---|
708 | LitSTR.put(Lit.FLOOD, "floodlight");
|
---|
709 | LitSTR.put(Lit.STRIP, "striplight");
|
---|
710 | LitSTR.put(Lit.SUBS, "subsidairy");
|
---|
711 | LitSTR.put(Lit.SPOT, "spotlight");
|
---|
712 | LitSTR.put(Lit.MOIRE, "moire");
|
---|
713 | LitSTR.put(Lit.EMERG, "emergency");
|
---|
714 | LitSTR.put(Lit.BEAR, "bearing");
|
---|
715 | }
|
---|
716 |
|
---|
717 | public enum Exh {
|
---|
718 | UNKEXH, H24, DAY, NIGHT, FOG, WARN, STORM
|
---|
719 | }
|
---|
720 |
|
---|
721 | public static final EnumMap<Exh, String> ExhSTR = new EnumMap<>(Exh.class);
|
---|
722 | static {
|
---|
723 | ExhSTR.put(Exh.H24, "24h");
|
---|
724 | ExhSTR.put(Exh.DAY, "day");
|
---|
725 | ExhSTR.put(Exh.NIGHT, "night");
|
---|
726 | ExhSTR.put(Exh.FOG, "fog");
|
---|
727 | ExhSTR.put(Exh.WARN, "warning");
|
---|
728 | ExhSTR.put(Exh.STORM, "storm");
|
---|
729 | }
|
---|
730 |
|
---|
731 | public enum Att {
|
---|
732 | COL, CHR, GRP, SEQ, PER, LIT, BEG, END, RAD, HGT, RNG, VIS, EXH, ORT, MLT, ALT
|
---|
733 | }
|
---|
734 |
|
---|
735 | public Object[] sector = {Col.UNKCOL, "", "", "", "", Lit.UNKLIT, "", "",
|
---|
736 | "", "", "", Vis.UNKVIS, Exh.UNKEXH, "", "", Col.UNKCOL };
|
---|
737 |
|
---|
738 | private ArrayList<Object[]> sectors = new ArrayList<>();
|
---|
739 |
|
---|
740 | public int getSectorCount() {
|
---|
741 | return sectors.size();
|
---|
742 | }
|
---|
743 |
|
---|
744 | public boolean isSectored() {
|
---|
745 | return (sectors.size() > 1);
|
---|
746 | }
|
---|
747 |
|
---|
748 | public Object getLightAtt(Att att, int i) {
|
---|
749 | return getLightAtt(att.ordinal(), i);
|
---|
750 | }
|
---|
751 |
|
---|
752 | public Object getLightAtt(int att, int i) {
|
---|
753 | if (i < sectors.size())
|
---|
754 | return sectors.get(i)[att];
|
---|
755 | else
|
---|
756 | return null;
|
---|
757 | }
|
---|
758 |
|
---|
759 | public void setLightAtt(Att att, int i, Object obj) {
|
---|
760 | setLightAtt(att.ordinal(), i, obj);
|
---|
761 | }
|
---|
762 |
|
---|
763 | public void setLightAtt(int att, int i, Object obj) {
|
---|
764 | if (sectors.size() == i) {
|
---|
765 | addLight(i);
|
---|
766 | }
|
---|
767 | if (sectors.size() > i) {
|
---|
768 | switch (att) {
|
---|
769 | case 4:
|
---|
770 | case 8:
|
---|
771 | case 9:
|
---|
772 | case 10:
|
---|
773 | sectors.get(i)[att] = validDecimal((String) obj);
|
---|
774 | break;
|
---|
775 | case 6:
|
---|
776 | case 7:
|
---|
777 | case 13:
|
---|
778 | sectors.get(i)[att] = validDecimal((String) obj, 360);
|
---|
779 | break;
|
---|
780 | default:
|
---|
781 | sectors.get(i)[att] = obj;
|
---|
782 | }
|
---|
783 | }
|
---|
784 | repaint();
|
---|
785 | }
|
---|
786 |
|
---|
787 | public void addLight(int i) {
|
---|
788 | if (sectors.size() >= i) {
|
---|
789 | if (sectors.size() == 0) {
|
---|
790 | sectors.add(sector.clone());
|
---|
791 | } else {
|
---|
792 | sectors.add(i, sectors.get(0).clone());
|
---|
793 | }
|
---|
794 | }
|
---|
795 | }
|
---|
796 |
|
---|
797 | public void nulLight(int i) {
|
---|
798 | if (i == 0) {
|
---|
799 | clrLight();
|
---|
800 | } else {
|
---|
801 | sectors.add(i, sector.clone());
|
---|
802 | }
|
---|
803 | }
|
---|
804 |
|
---|
805 | public void addLight() {
|
---|
806 | if (sectors.size() == 0) {
|
---|
807 | sectors.add(sector.clone());
|
---|
808 | } else {
|
---|
809 | sectors.add(sectors.get(0).clone());
|
---|
810 | }
|
---|
811 | }
|
---|
812 |
|
---|
813 | public void delLight(int i) {
|
---|
814 | if (sectors.size() > i) {
|
---|
815 | sectors.remove(i);
|
---|
816 | }
|
---|
817 | repaint();
|
---|
818 | }
|
---|
819 |
|
---|
820 | public void clrLight() {
|
---|
821 | sectors.clear();
|
---|
822 | addLight();
|
---|
823 | setLightRef("");
|
---|
824 | repaint();
|
---|
825 | }
|
---|
826 |
|
---|
827 | public enum Pat {
|
---|
828 | NOPAT, HSTRP, VSTRP, DIAG, SQUARED, BORDER, CROSS, SALTIRE
|
---|
829 | }
|
---|
830 |
|
---|
831 | public static final EnumMap<Pat, String> PatSTR = new EnumMap<>(Pat.class);
|
---|
832 | static {
|
---|
833 | PatSTR.put(Pat.HSTRP, "horizontal");
|
---|
834 | PatSTR.put(Pat.VSTRP, "vertical");
|
---|
835 | PatSTR.put(Pat.DIAG, "diagonal");
|
---|
836 | PatSTR.put(Pat.SQUARED, "squared");
|
---|
837 | PatSTR.put(Pat.BORDER, "border");
|
---|
838 | PatSTR.put(Pat.CROSS, "cross");
|
---|
839 | PatSTR.put(Pat.SALTIRE, "saltire");
|
---|
840 | }
|
---|
841 |
|
---|
842 | public Pat getPattern(Ent ent) {
|
---|
843 | if (ent == Ent.BODY)
|
---|
844 | return getObjPattern();
|
---|
845 | else
|
---|
846 | return getTopPattern();
|
---|
847 | }
|
---|
848 |
|
---|
849 | public void setPattern(Ent ent, Pat pat) {
|
---|
850 | if (ent == Ent.BODY) {
|
---|
851 | setObjPattern(pat);
|
---|
852 | } else {
|
---|
853 | setTopPattern(pat);
|
---|
854 | }
|
---|
855 | }
|
---|
856 |
|
---|
857 | private Pat bodyPattern = Pat.NOPAT;
|
---|
858 |
|
---|
859 | public Pat getObjPattern() {
|
---|
860 | return bodyPattern;
|
---|
861 | }
|
---|
862 |
|
---|
863 | public void setObjPattern(Pat pat) {
|
---|
864 | bodyPattern = pat;
|
---|
865 | }
|
---|
866 |
|
---|
867 | private Pat topPattern = Pat.NOPAT;
|
---|
868 |
|
---|
869 | public Pat getTopPattern() {
|
---|
870 | return topPattern;
|
---|
871 | }
|
---|
872 |
|
---|
873 | public void setTopPattern(Pat pat) {
|
---|
874 | topPattern = pat;
|
---|
875 | }
|
---|
876 |
|
---|
877 | public enum Top {
|
---|
878 | NOTOP, CYL, CONE, SPHERE, X_SHAPE, NORTH, SOUTH, EAST, WEST, SPHERES2, BOARD, RHOMBUS, CIRCLE, TRIANGLE, TRIANGLE_INV, SQUARE
|
---|
879 | }
|
---|
880 |
|
---|
881 | public static final EnumMap<Top, String> TopSTR = new EnumMap<>(Top.class);
|
---|
882 | static {
|
---|
883 | TopSTR.put(Top.CYL, "cylinder");
|
---|
884 | TopSTR.put(Top.CONE, "cone, point up");
|
---|
885 | TopSTR.put(Top.SPHERE, "sphere");
|
---|
886 | TopSTR.put(Top.X_SHAPE, "x-shape");
|
---|
887 | TopSTR.put(Top.NORTH, "2 cones up");
|
---|
888 | TopSTR.put(Top.SOUTH, "2 cones down");
|
---|
889 | TopSTR.put(Top.EAST, "2 cones base together");
|
---|
890 | TopSTR.put(Top.WEST, "2 cones point together");
|
---|
891 | TopSTR.put(Top.SPHERES2, "2 spheres");
|
---|
892 | TopSTR.put(Top.BOARD, "board");
|
---|
893 | TopSTR.put(Top.RHOMBUS, "rhombus");
|
---|
894 | TopSTR.put(Top.CIRCLE, "circle");
|
---|
895 | TopSTR.put(Top.TRIANGLE, "triangle, point up");
|
---|
896 | TopSTR.put(Top.TRIANGLE_INV, "triangle, point down");
|
---|
897 | TopSTR.put(Top.SQUARE, "square");
|
---|
898 | }
|
---|
899 |
|
---|
900 | private Top topShape = Top.NOTOP;
|
---|
901 |
|
---|
902 | public Top getTopmark() {
|
---|
903 | return topShape;
|
---|
904 | }
|
---|
905 |
|
---|
906 | public void setTopmark(Top top) {
|
---|
907 | topShape = top;
|
---|
908 | repaint();
|
---|
909 | }
|
---|
910 |
|
---|
911 | private Cat RoType = Cat.NOROS;
|
---|
912 |
|
---|
913 | public Cat getRadio() {
|
---|
914 | return RoType;
|
---|
915 | }
|
---|
916 |
|
---|
917 | public void setRadio(Cat type) {
|
---|
918 | RoType = type;
|
---|
919 | repaint();
|
---|
920 | }
|
---|
921 |
|
---|
922 | public enum Rtb {
|
---|
923 | NORTB, REFLECTOR, RACON, RAMARK, LEADING
|
---|
924 | }
|
---|
925 |
|
---|
926 | public static final EnumMap<Rtb, String> RtbSTR = new EnumMap<>(Rtb.class);
|
---|
927 | static {
|
---|
928 | RtbSTR.put(Rtb.RACON, "racon");
|
---|
929 | RtbSTR.put(Rtb.RAMARK, "ramark");
|
---|
930 | RtbSTR.put(Rtb.LEADING, "leading");
|
---|
931 | }
|
---|
932 |
|
---|
933 | private Rtb RaType = Rtb.NORTB;
|
---|
934 |
|
---|
935 | public Rtb getRadar() {
|
---|
936 | return RaType;
|
---|
937 | }
|
---|
938 |
|
---|
939 | public void setRadar(Rtb type) {
|
---|
940 | RaType = type;
|
---|
941 | if (type == Rtb.NORTB) {
|
---|
942 | setRaconGroup("");
|
---|
943 | setRaconSequence("");
|
---|
944 | setRaconPeriod("");
|
---|
945 | setRaconRange("");
|
---|
946 | setRaconSector1("");
|
---|
947 | setRaconSector2("");
|
---|
948 | }
|
---|
949 | repaint();
|
---|
950 | }
|
---|
951 |
|
---|
952 | private String raconGroup = "";
|
---|
953 |
|
---|
954 | public String getRaconGroup() {
|
---|
955 | return raconGroup;
|
---|
956 | }
|
---|
957 |
|
---|
958 | public void setRaconGroup(String grp) {
|
---|
959 | raconGroup = grp;
|
---|
960 | repaint();
|
---|
961 | }
|
---|
962 |
|
---|
963 | private String raconSequence = "";
|
---|
964 |
|
---|
965 | public String getRaconSequence() {
|
---|
966 | return raconSequence;
|
---|
967 | }
|
---|
968 |
|
---|
969 | public void setRaconSequence(String seq) {
|
---|
970 | raconSequence = seq;
|
---|
971 | repaint();
|
---|
972 | }
|
---|
973 |
|
---|
974 | private String raconPeriod = "";
|
---|
975 |
|
---|
976 | public String getRaconPeriod() {
|
---|
977 | return raconPeriod;
|
---|
978 | }
|
---|
979 |
|
---|
980 | public void setRaconPeriod(String per) {
|
---|
981 | raconPeriod = validDecimal(per);
|
---|
982 | repaint();
|
---|
983 | }
|
---|
984 |
|
---|
985 | private String raconRange = "";
|
---|
986 |
|
---|
987 | public String getRaconRange() {
|
---|
988 | return raconRange;
|
---|
989 | }
|
---|
990 |
|
---|
991 | public void setRaconRange(String rng) {
|
---|
992 | raconRange = validDecimal(rng);
|
---|
993 | repaint();
|
---|
994 | }
|
---|
995 |
|
---|
996 | private String raconSector1 = "";
|
---|
997 |
|
---|
998 | public String getRaconSector1() {
|
---|
999 | return raconSector1;
|
---|
1000 | }
|
---|
1001 |
|
---|
1002 | public void setRaconSector1(String sec) {
|
---|
1003 | raconSector1 = validDecimal(sec);
|
---|
1004 | repaint();
|
---|
1005 | }
|
---|
1006 |
|
---|
1007 | private String raconSector2 = "";
|
---|
1008 |
|
---|
1009 | public String getRaconSector2() {
|
---|
1010 | return raconSector2;
|
---|
1011 | }
|
---|
1012 |
|
---|
1013 | public void setRaconSector2(String sec) {
|
---|
1014 | raconSector2 = validDecimal(sec);
|
---|
1015 | repaint();
|
---|
1016 | }
|
---|
1017 |
|
---|
1018 | public enum Fog {
|
---|
1019 | NOFOG, FOGSIG, HORN, SIREN, DIA, BELL, WHIS, GONG, EXPLOS
|
---|
1020 | }
|
---|
1021 |
|
---|
1022 | public static final EnumMap<Fog, String> FogSTR = new EnumMap<>(Fog.class);
|
---|
1023 | static {
|
---|
1024 | FogSTR.put(Fog.FOGSIG, "yes");
|
---|
1025 | FogSTR.put(Fog.HORN, "horn");
|
---|
1026 | FogSTR.put(Fog.SIREN, "siren");
|
---|
1027 | FogSTR.put(Fog.DIA, "diaphone");
|
---|
1028 | FogSTR.put(Fog.BELL, "bell");
|
---|
1029 | FogSTR.put(Fog.WHIS, "whistle");
|
---|
1030 | FogSTR.put(Fog.GONG, "gong");
|
---|
1031 | FogSTR.put(Fog.EXPLOS, "explosion");
|
---|
1032 | }
|
---|
1033 |
|
---|
1034 | private Fog fogSound = Fog.NOFOG;
|
---|
1035 |
|
---|
1036 | public Fog getFogSound() {
|
---|
1037 | return fogSound;
|
---|
1038 | }
|
---|
1039 |
|
---|
1040 | public void setFogSound(Fog sound) {
|
---|
1041 | fogSound = sound;
|
---|
1042 | if (sound == Fog.NOFOG) {
|
---|
1043 | setFogGroup("");
|
---|
1044 | setFogSequence("");
|
---|
1045 | setFogPeriod("");
|
---|
1046 | setFogRange("");
|
---|
1047 | }
|
---|
1048 | repaint();
|
---|
1049 | }
|
---|
1050 |
|
---|
1051 | private String fogGroup = "";
|
---|
1052 |
|
---|
1053 | public String getFogGroup() {
|
---|
1054 | return fogGroup;
|
---|
1055 | }
|
---|
1056 |
|
---|
1057 | public void setFogGroup(String grp) {
|
---|
1058 | fogGroup = grp;
|
---|
1059 | repaint();
|
---|
1060 | }
|
---|
1061 |
|
---|
1062 | private String fogSequence = "";
|
---|
1063 |
|
---|
1064 | public String getFogSequence() {
|
---|
1065 | return fogSequence;
|
---|
1066 | }
|
---|
1067 |
|
---|
1068 | public void setFogSequence(String seq) {
|
---|
1069 | fogSequence = seq;
|
---|
1070 | repaint();
|
---|
1071 | }
|
---|
1072 |
|
---|
1073 | private String fogRange = "";
|
---|
1074 |
|
---|
1075 | public String getFogRange() {
|
---|
1076 | return fogRange;
|
---|
1077 | }
|
---|
1078 |
|
---|
1079 | public void setFogRange(String rng) {
|
---|
1080 | fogRange = validDecimal(rng);
|
---|
1081 | repaint();
|
---|
1082 | }
|
---|
1083 |
|
---|
1084 | private String fogPeriod = "";
|
---|
1085 |
|
---|
1086 | public String getFogPeriod() {
|
---|
1087 | return fogPeriod;
|
---|
1088 | }
|
---|
1089 |
|
---|
1090 | public void setFogPeriod(String per) {
|
---|
1091 | fogPeriod = validDecimal(per);
|
---|
1092 | repaint();
|
---|
1093 | }
|
---|
1094 |
|
---|
1095 | public enum Sts {
|
---|
1096 | UNKSTS, PERM, OCC, REC, NIU, INT, RESV, TEMP, PRIV, MAND, DEST, EXT, ILLUM, HIST, PUB, SYNC, WATCH, UNWAT, DOUBT
|
---|
1097 | }
|
---|
1098 |
|
---|
1099 | public static final EnumMap<Sts, String> StsSTR = new EnumMap<>(Sts.class);
|
---|
1100 | static {
|
---|
1101 | StsSTR.put(Sts.PERM, "permanent");
|
---|
1102 | StsSTR.put(Sts.OCC, "occasional");
|
---|
1103 | StsSTR.put(Sts.REC, "recommended");
|
---|
1104 | StsSTR.put(Sts.NIU, "not_in_use");
|
---|
1105 | StsSTR.put(Sts.INT, "intermittent");
|
---|
1106 | StsSTR.put(Sts.RESV, "reserved");
|
---|
1107 | StsSTR.put(Sts.TEMP, "tempory");
|
---|
1108 | StsSTR.put(Sts.PRIV, "private");
|
---|
1109 | StsSTR.put(Sts.MAND, "mandatory");
|
---|
1110 | StsSTR.put(Sts.DEST, "destroyed");
|
---|
1111 | StsSTR.put(Sts.EXT, "extinguished");
|
---|
1112 | StsSTR.put(Sts.ILLUM, "illuminated");
|
---|
1113 | StsSTR.put(Sts.HIST, "historic");
|
---|
1114 | StsSTR.put(Sts.PUB, "public");
|
---|
1115 | StsSTR.put(Sts.SYNC, "synchronized");
|
---|
1116 | StsSTR.put(Sts.WATCH, "watched");
|
---|
1117 | StsSTR.put(Sts.UNWAT, "unwatched");
|
---|
1118 | StsSTR.put(Sts.DOUBT, "existence_doubtful");
|
---|
1119 | }
|
---|
1120 |
|
---|
1121 | private Sts status = Sts.UNKSTS;
|
---|
1122 |
|
---|
1123 | public Sts getStatus() {
|
---|
1124 | return status;
|
---|
1125 | }
|
---|
1126 |
|
---|
1127 | public void setStatus(Sts sts) {
|
---|
1128 | status = sts;
|
---|
1129 | }
|
---|
1130 |
|
---|
1131 | public enum Cns {
|
---|
1132 | UNKCNS, BRICK, CONC, BOULD, HSURF, USURF, WOOD, METAL, GLAS, PAINT
|
---|
1133 | }
|
---|
1134 |
|
---|
1135 | public static final EnumMap<Cns, String> CnsSTR = new EnumMap<>(Cns.class);
|
---|
1136 | static {
|
---|
1137 | CnsSTR.put(Cns.BRICK, "masonry");
|
---|
1138 | CnsSTR.put(Cns.CONC, "concreted");
|
---|
1139 | CnsSTR.put(Cns.BOULD, "boulders");
|
---|
1140 | CnsSTR.put(Cns.HSURF, "hard_surfaced");
|
---|
1141 | CnsSTR.put(Cns.USURF, "unsurfaced");
|
---|
1142 | CnsSTR.put(Cns.WOOD, "wooden");
|
---|
1143 | CnsSTR.put(Cns.METAL, "metal");
|
---|
1144 | CnsSTR.put(Cns.GLAS, "grp");
|
---|
1145 | CnsSTR.put(Cns.PAINT, "painted");
|
---|
1146 | }
|
---|
1147 |
|
---|
1148 | private Cns construction = Cns.UNKCNS;
|
---|
1149 |
|
---|
1150 | public Cns getConstr() {
|
---|
1151 | return construction;
|
---|
1152 | }
|
---|
1153 |
|
---|
1154 | public void setConstr(Cns cns) {
|
---|
1155 | construction = cns;
|
---|
1156 | }
|
---|
1157 |
|
---|
1158 | public enum Con {
|
---|
1159 | UNKCON, CONSP, NCONS, REFL
|
---|
1160 | }
|
---|
1161 |
|
---|
1162 | public static final EnumMap<Con, String> ConSTR = new EnumMap<>(Con.class);
|
---|
1163 | static {
|
---|
1164 | ConSTR.put(Con.CONSP, "conspicuous");
|
---|
1165 | ConSTR.put(Con.NCONS, "not_conspicuous");
|
---|
1166 | ConSTR.put(Con.REFL, "reflector");
|
---|
1167 | }
|
---|
1168 |
|
---|
1169 | private Con conspicuity = Con.UNKCON;
|
---|
1170 |
|
---|
1171 | public Con getConsp() {
|
---|
1172 | return conspicuity;
|
---|
1173 | }
|
---|
1174 |
|
---|
1175 | public void setConsp(Con con) {
|
---|
1176 | conspicuity = con;
|
---|
1177 | }
|
---|
1178 |
|
---|
1179 | private Con reflectivity = Con.UNKCON;
|
---|
1180 |
|
---|
1181 | public Con getRefl() {
|
---|
1182 | return reflectivity;
|
---|
1183 | }
|
---|
1184 |
|
---|
1185 | public void setRefl(Con con) {
|
---|
1186 | reflectivity = con;
|
---|
1187 | }
|
---|
1188 |
|
---|
1189 | public enum Fnc {
|
---|
1190 | UNKFNC, HMO, CSTM, HLTH, HOSP, POFF, HOTEL, RWSTA, POLICE, WPOL, PILO, PILL, BANK, DCHQ, TRNS, FACT, PWRS, ADMIN, EDUC, CHCH, CHPL,
|
---|
1191 | TMPL, PGDA, SHSH, BTMP, MOSQ, MRBT, LOOK, COMS, TV, RADO, RADR, LSUP, MWAV, COOL, OBSV, TIMB, CLK, CTRL, AMOR, STAD, BUSS,
|
---|
1192 | PRHB, RGLN, RSTN, RCMD, INFO
|
---|
1193 | }
|
---|
1194 |
|
---|
1195 | public static final EnumMap<Fnc, String> FncSTR = new EnumMap<>(Fnc.class);
|
---|
1196 | static {
|
---|
1197 | FncSTR.put(Fnc.UNKFNC, "");
|
---|
1198 | FncSTR.put(Fnc.HMO, "harbour-master");
|
---|
1199 | FncSTR.put(Fnc.CSTM, "customs");
|
---|
1200 | FncSTR.put(Fnc.HLTH, "health");
|
---|
1201 | FncSTR.put(Fnc.HOSP, "hospital");
|
---|
1202 | FncSTR.put(Fnc.POFF, "post_office");
|
---|
1203 | FncSTR.put(Fnc.HOTEL, "hotel");
|
---|
1204 | FncSTR.put(Fnc.RWSTA, "railway_station");
|
---|
1205 | FncSTR.put(Fnc.POLICE, "police_station");
|
---|
1206 | FncSTR.put(Fnc.WPOL, "water-police_station");
|
---|
1207 | FncSTR.put(Fnc.PILO, "pilot_office");
|
---|
1208 | FncSTR.put(Fnc.PILL, "pilot_lookout");
|
---|
1209 | FncSTR.put(Fnc.BANK, "bank");
|
---|
1210 | FncSTR.put(Fnc.DCHQ, "district_control");
|
---|
1211 | FncSTR.put(Fnc.TRNS, "transit_shed");
|
---|
1212 | FncSTR.put(Fnc.FACT, "factory");
|
---|
1213 | FncSTR.put(Fnc.PWRS, "power_station");
|
---|
1214 | FncSTR.put(Fnc.ADMIN, "administrative");
|
---|
1215 | FncSTR.put(Fnc.EDUC, "educational");
|
---|
1216 | FncSTR.put(Fnc.CHCH, "church");
|
---|
1217 | FncSTR.put(Fnc.CHPL, "chapel");
|
---|
1218 | FncSTR.put(Fnc.TMPL, "temple");
|
---|
1219 | FncSTR.put(Fnc.PGDA, "pagoda");
|
---|
1220 | FncSTR.put(Fnc.SHSH, "shinto_shrine");
|
---|
1221 | FncSTR.put(Fnc.BTMP, "buddhist_temple");
|
---|
1222 | FncSTR.put(Fnc.MOSQ, "mosque");
|
---|
1223 | FncSTR.put(Fnc.MRBT, "marabout");
|
---|
1224 | FncSTR.put(Fnc.LOOK, "lookout");
|
---|
1225 | FncSTR.put(Fnc.COMS, "communication");
|
---|
1226 | FncSTR.put(Fnc.TV, "television");
|
---|
1227 | FncSTR.put(Fnc.RADO, "radio");
|
---|
1228 | FncSTR.put(Fnc.RADR, "radar");
|
---|
1229 | FncSTR.put(Fnc.LSUP, "light_support");
|
---|
1230 | FncSTR.put(Fnc.MWAV, "microwave");
|
---|
1231 | FncSTR.put(Fnc.COOL, "cooling");
|
---|
1232 | FncSTR.put(Fnc.OBSV, "observation");
|
---|
1233 | FncSTR.put(Fnc.TIMB, "time_ball");
|
---|
1234 | FncSTR.put(Fnc.CLK, "clock");
|
---|
1235 | FncSTR.put(Fnc.CTRL, "control");
|
---|
1236 | FncSTR.put(Fnc.AMOR, "airship_mooring");
|
---|
1237 | FncSTR.put(Fnc.STAD, "stadium");
|
---|
1238 | FncSTR.put(Fnc.BUSS, "bus_station");
|
---|
1239 | FncSTR.put(Fnc.PRHB, "prohibition");
|
---|
1240 | FncSTR.put(Fnc.RGLN, "regulation");
|
---|
1241 | FncSTR.put(Fnc.RSTN, "restriction");
|
---|
1242 | FncSTR.put(Fnc.RCMD, "recommendation");
|
---|
1243 | FncSTR.put(Fnc.INFO, "information");
|
---|
1244 | }
|
---|
1245 |
|
---|
1246 | private Fnc function = Fnc.UNKFNC;
|
---|
1247 |
|
---|
1248 | public Fnc getFunc() {
|
---|
1249 | return function;
|
---|
1250 | }
|
---|
1251 |
|
---|
1252 | public void setFunc(Fnc fnc) {
|
---|
1253 | function = fnc;
|
---|
1254 | repaint();
|
---|
1255 | }
|
---|
1256 |
|
---|
1257 | public String information = "";
|
---|
1258 |
|
---|
1259 | public String getInfo() {
|
---|
1260 | return information;
|
---|
1261 | }
|
---|
1262 |
|
---|
1263 | public void setInfo(String str) {
|
---|
1264 | information = str.trim();
|
---|
1265 | }
|
---|
1266 |
|
---|
1267 | public String source = "";
|
---|
1268 |
|
---|
1269 | public String getSource() {
|
---|
1270 | return source;
|
---|
1271 | }
|
---|
1272 |
|
---|
1273 | public void setSource(String str) {
|
---|
1274 | source = str.trim();
|
---|
1275 | }
|
---|
1276 |
|
---|
1277 | public String elevation = "";
|
---|
1278 |
|
---|
1279 | public String getElevation() {
|
---|
1280 | return elevation;
|
---|
1281 | }
|
---|
1282 |
|
---|
1283 | public void setElevation(String str) {
|
---|
1284 | elevation = validDecimal(str);
|
---|
1285 | }
|
---|
1286 |
|
---|
1287 | public String height = "";
|
---|
1288 |
|
---|
1289 | public String getObjectHeight() {
|
---|
1290 | return height;
|
---|
1291 | }
|
---|
1292 |
|
---|
1293 | public void setObjectHeight(String str) {
|
---|
1294 | height = validDecimal(str);
|
---|
1295 | }
|
---|
1296 |
|
---|
1297 | private String channel = "";
|
---|
1298 |
|
---|
1299 | public String getChannel() {
|
---|
1300 | return channel;
|
---|
1301 | }
|
---|
1302 |
|
---|
1303 | public void setChannel(String per) {
|
---|
1304 | channel = validDecimal(per);
|
---|
1305 | repaint();
|
---|
1306 | }
|
---|
1307 |
|
---|
1308 | public String ref = "";
|
---|
1309 |
|
---|
1310 | public String getRef() {
|
---|
1311 | return ref;
|
---|
1312 | }
|
---|
1313 |
|
---|
1314 | public void setRef(String str) {
|
---|
1315 | ref = str;
|
---|
1316 | }
|
---|
1317 |
|
---|
1318 | public String lightRef = "";
|
---|
1319 |
|
---|
1320 | public String getLightRef() {
|
---|
1321 | return lightRef;
|
---|
1322 | }
|
---|
1323 |
|
---|
1324 | public void setLightRef(String str) {
|
---|
1325 | lightRef = str;
|
---|
1326 | }
|
---|
1327 |
|
---|
1328 | public String fixme = "";
|
---|
1329 |
|
---|
1330 | public String getFixme() {
|
---|
1331 | return fixme;
|
---|
1332 | }
|
---|
1333 |
|
---|
1334 | public void setFixme(String str) {
|
---|
1335 | fixme = str;
|
---|
1336 | }
|
---|
1337 |
|
---|
1338 | public boolean testValid() {
|
---|
1339 | if (dlg.node == null) return false;
|
---|
1340 | boolean tmp = false;
|
---|
1341 | PanelMain.messageBar.setText("");
|
---|
1342 | switch (getObject()) {
|
---|
1343 | case BCNCAR:
|
---|
1344 | case BCNLAT:
|
---|
1345 | case BOYCAR:
|
---|
1346 | case BOYLAT:
|
---|
1347 | if ((getCategory() != Cat.NOCAT) && (getShape() != Shp.UNKSHP)) {
|
---|
1348 | tmp = true;
|
---|
1349 | }
|
---|
1350 | break;
|
---|
1351 | case BCNISD:
|
---|
1352 | case BCNSAW:
|
---|
1353 | case BCNSPP:
|
---|
1354 | case BOYISD:
|
---|
1355 | case BOYSAW:
|
---|
1356 | case BOYSPP:
|
---|
1357 | if (getShape() != Shp.UNKSHP) {
|
---|
1358 | tmp = true;
|
---|
1359 | }
|
---|
1360 | break;
|
---|
1361 | case FLTCAR:
|
---|
1362 | case FLTISD:
|
---|
1363 | case FLTLAT:
|
---|
1364 | case FLTSAW:
|
---|
1365 | case FLTSPP:
|
---|
1366 | if (getObjColour(0) != Col.UNKCOL) {
|
---|
1367 | tmp = true;
|
---|
1368 | }
|
---|
1369 | break;
|
---|
1370 | case LITMAJ:
|
---|
1371 | case LITMIN:
|
---|
1372 | case LITFLT:
|
---|
1373 | case LITVES:
|
---|
1374 | case LITHSE:
|
---|
1375 | case SISTAW:
|
---|
1376 | case SISTAT:
|
---|
1377 | case OFSPLF:
|
---|
1378 | case MORFAC:
|
---|
1379 | case BOYINB:
|
---|
1380 | case PILBOP:
|
---|
1381 | case RSCSTA:
|
---|
1382 | case RDOSTA:
|
---|
1383 | case RADSTA:
|
---|
1384 | tmp = true;
|
---|
1385 | break;
|
---|
1386 | case NOTMRK:
|
---|
1387 | if (getCategory() != Cat.NOCAT) {
|
---|
1388 | tmp = true;
|
---|
1389 | }
|
---|
1390 | case LNDMRK:
|
---|
1391 | if ((getCategory() != Cat.NOCAT) || (getFunc() != Fnc.UNKFNC)) {
|
---|
1392 | tmp = true;
|
---|
1393 | }
|
---|
1394 | break;
|
---|
1395 | }
|
---|
1396 | if (tmp) {
|
---|
1397 | SmedAction.panelMain.moreButton.setVisible(true);
|
---|
1398 | SmedAction.panelMain.saveButton.setEnabled(true);
|
---|
1399 | SmedAction.panelMain.topButton.setEnabled(true);
|
---|
1400 | SmedAction.panelMain.fogButton.setEnabled(true);
|
---|
1401 | SmedAction.panelMain.radButton.setEnabled(true);
|
---|
1402 | SmedAction.panelMain.litButton.setEnabled(true);
|
---|
1403 | return true;
|
---|
1404 | } else {
|
---|
1405 | SmedAction.panelMain.moreButton.setVisible(false);
|
---|
1406 | SmedAction.panelMain.moreButton.setText(">>");
|
---|
1407 | SmedAction.panelMain.topButton.setEnabled(false);
|
---|
1408 | SmedAction.panelMain.fogButton.setEnabled(false);
|
---|
1409 | SmedAction.panelMain.radButton.setEnabled(false);
|
---|
1410 | SmedAction.panelMain.litButton.setEnabled(false);
|
---|
1411 | PanelMain.messageBar.setText("Seamark not recognised");
|
---|
1412 | return false;
|
---|
1413 | }
|
---|
1414 | }
|
---|
1415 |
|
---|
1416 | public void clrMark() {
|
---|
1417 | setName("");
|
---|
1418 | setObject(Obj.UNKOBJ);
|
---|
1419 | clrLight();
|
---|
1420 | setFogSound(Fog.NOFOG);
|
---|
1421 | setRadar(Rtb.NORTB);
|
---|
1422 | setRadio(Cat.NOROS);
|
---|
1423 | setStatus(Sts.UNKSTS);
|
---|
1424 | setConstr(Cns.UNKCNS);
|
---|
1425 | setConsp(Con.UNKCON);
|
---|
1426 | setRefl(Con.UNKCON);
|
---|
1427 | setRef("");
|
---|
1428 | setObjectHeight("");
|
---|
1429 | setElevation("");
|
---|
1430 | setChannel("");
|
---|
1431 | setInfo("");
|
---|
1432 | setSource("");
|
---|
1433 | setFixme("");
|
---|
1434 | SmedAction.panelMain.syncPanel();
|
---|
1435 | repaint();
|
---|
1436 | }
|
---|
1437 |
|
---|
1438 | public String validDecimal(String str) {
|
---|
1439 | str = str.trim().replace(',', '.');
|
---|
1440 | if (!(str.isEmpty()) && !(str.matches("^[+-]??\\d+(\\.\\d+)??$"))) {
|
---|
1441 | PanelMain.messageBar.setText(Messages.getString("NotDecimal"));
|
---|
1442 | return "";
|
---|
1443 | } else {
|
---|
1444 | PanelMain.messageBar.setText("");
|
---|
1445 | return str;
|
---|
1446 | }
|
---|
1447 | }
|
---|
1448 |
|
---|
1449 | public String validDecimal(String str, float max) {
|
---|
1450 | str = validDecimal(str);
|
---|
1451 | if (!(str.isEmpty()) && (Float.valueOf(str) > max)) {
|
---|
1452 | PanelMain.messageBar.setText(Messages.getString("TooBig") + " (" + max + ")");
|
---|
1453 | return "";
|
---|
1454 | } else {
|
---|
1455 | PanelMain.messageBar.setText("");
|
---|
1456 | return str;
|
---|
1457 | }
|
---|
1458 | }
|
---|
1459 |
|
---|
1460 | public void parseMark(OsmPrimitive node) {
|
---|
1461 | PanelMain.messageBar.setText("");
|
---|
1462 | String str = Main.pref.get("smedplugin.IALA");
|
---|
1463 | if (str.equals("C")) {
|
---|
1464 | setRegion(Reg.C);
|
---|
1465 | } else if (str.equals("B")) {
|
---|
1466 | setRegion(Reg.B);
|
---|
1467 | } else {
|
---|
1468 | setRegion(Reg.A);
|
---|
1469 | }
|
---|
1470 |
|
---|
1471 | Map<String, String> keys = node.getKeys();
|
---|
1472 |
|
---|
1473 | str = "";
|
---|
1474 | if (keys.containsKey("seamark:type")) {
|
---|
1475 | str = keys.get("seamark:type");
|
---|
1476 | }
|
---|
1477 |
|
---|
1478 | clrMark();
|
---|
1479 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1480 | if (ObjSTR.get(obj).equals(str)) {
|
---|
1481 | setObject(obj);
|
---|
1482 | }
|
---|
1483 | }
|
---|
1484 |
|
---|
1485 | if (str.equals("")) {
|
---|
1486 | PanelMain.messageBar.setText("No seamark");
|
---|
1487 | }
|
---|
1488 | if (getObject() == Obj.UNKOBJ) {
|
---|
1489 | PanelMain.messageBar.setText("Seamark not recognised");
|
---|
1490 | }
|
---|
1491 |
|
---|
1492 | setName("");
|
---|
1493 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1494 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":name")) {
|
---|
1495 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":name");
|
---|
1496 | setName(str);
|
---|
1497 | }
|
---|
1498 | }
|
---|
1499 | if (keys.containsKey("seamark:name")) {
|
---|
1500 | str = keys.get("seamark:name");
|
---|
1501 | setName(str);
|
---|
1502 | }
|
---|
1503 |
|
---|
1504 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1505 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":category")) {
|
---|
1506 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":category");
|
---|
1507 | if (obj == getObject()) {
|
---|
1508 | setCategory(Cat.NOCAT);
|
---|
1509 | for (Cat cat : CatSTR.keySet()) {
|
---|
1510 | if (CatSTR.get(cat).equals(str)) {
|
---|
1511 | setCategory(cat);
|
---|
1512 | }
|
---|
1513 | }
|
---|
1514 | }
|
---|
1515 | }
|
---|
1516 | }
|
---|
1517 |
|
---|
1518 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1519 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":shape")) {
|
---|
1520 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":shape");
|
---|
1521 | setShape(Shp.UNKSHP);
|
---|
1522 | for (Shp shp : ShpSTR.keySet()) {
|
---|
1523 | if (ShpSTR.get(shp).equals(str)) {
|
---|
1524 | setShape(shp);
|
---|
1525 | }
|
---|
1526 | }
|
---|
1527 | }
|
---|
1528 | }
|
---|
1529 | if (getShape() == Shp.UNKSHP) {
|
---|
1530 | if (EntMAP.get(getObject()) == Ent.BUOY) {
|
---|
1531 | setShape(Shp.BUOY);
|
---|
1532 | }
|
---|
1533 | if (EntMAP.get(getObject()) == Ent.BEACON) {
|
---|
1534 | setShape(Shp.BEACON);
|
---|
1535 | }
|
---|
1536 | if (EntMAP.get(getObject()) == Ent.LFLOAT)
|
---|
1537 | if (getObject() == Obj.LITVES) {
|
---|
1538 | setShape(Shp.SUPER);
|
---|
1539 | } else {
|
---|
1540 | setShape(Shp.FLOAT);
|
---|
1541 | }
|
---|
1542 | }
|
---|
1543 |
|
---|
1544 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1545 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":colour")) {
|
---|
1546 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":colour");
|
---|
1547 | bodyColour.clear();
|
---|
1548 | for (String item : str.split(";")) {
|
---|
1549 | for (Col col : ColSTR.keySet()) {
|
---|
1550 | if (ColSTR.get(col).equals(item)) {
|
---|
1551 | bodyColour.add(col);
|
---|
1552 | }
|
---|
1553 | }
|
---|
1554 | }
|
---|
1555 | }
|
---|
1556 | }
|
---|
1557 |
|
---|
1558 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1559 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":colour_pattern")) {
|
---|
1560 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":colour_pattern");
|
---|
1561 | setObjPattern(Pat.NOPAT);
|
---|
1562 | for (Pat pat : PatSTR.keySet()) {
|
---|
1563 | if (PatSTR.get(pat).equals(str)) {
|
---|
1564 | setObjPattern(pat);
|
---|
1565 | }
|
---|
1566 | }
|
---|
1567 | }
|
---|
1568 |
|
---|
1569 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":height")) {
|
---|
1570 | setObjectHeight(keys.get("seamark:" + ObjSTR.get(obj) + ":height"));
|
---|
1571 | }
|
---|
1572 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":elevation")) {
|
---|
1573 | setElevation(keys.get("seamark:" + ObjSTR.get(obj) + ":elevation"));
|
---|
1574 | }
|
---|
1575 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":channel")) {
|
---|
1576 | setChannel(keys.get("seamark:" + ObjSTR.get(obj) + ":channel"));
|
---|
1577 | }
|
---|
1578 | }
|
---|
1579 |
|
---|
1580 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1581 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":function")) {
|
---|
1582 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":function");
|
---|
1583 | setFunc(Fnc.UNKFNC);
|
---|
1584 | for (Fnc fnc : FncSTR.keySet()) {
|
---|
1585 | if (FncSTR.get(fnc).equals(str)) {
|
---|
1586 | setFunc(fnc);
|
---|
1587 | }
|
---|
1588 | }
|
---|
1589 | }
|
---|
1590 | }
|
---|
1591 |
|
---|
1592 | if ((getObject() == Obj.LNDMRK) && (getCategory() == Cat.NOCAT) && (getFunc() == Fnc.UNKFNC)) {
|
---|
1593 | setObject(Obj.LITHSE);
|
---|
1594 | }
|
---|
1595 |
|
---|
1596 | if (getObject() == Obj.LITFLT) {
|
---|
1597 | switch (getObjColour(0)) {
|
---|
1598 | case RED:
|
---|
1599 | if ((getObjColour(1) == Col.WHITE) && (getObjColour(2) == Col.UNKCOL)) {
|
---|
1600 | setObject(Obj.FLTSAW);
|
---|
1601 | setCategory(Cat.NOCAT);
|
---|
1602 | } else if (getObjColour(1) == Col.UNKCOL) {
|
---|
1603 | setObject(Obj.FLTLAT);
|
---|
1604 | if (getRegion() == Reg.B) {
|
---|
1605 | setCategory(Cat.LAM_STBD);
|
---|
1606 | } else {
|
---|
1607 | setCategory(Cat.LAM_PORT);
|
---|
1608 | }
|
---|
1609 | } else if ((getObjColour(1) == Col.GREEN)
|
---|
1610 | && (getObjColour(2) == Col.RED)) {
|
---|
1611 | setObject(Obj.FLTLAT);
|
---|
1612 | if (getRegion() == Reg.B) {
|
---|
1613 | setCategory(Cat.LAM_PSTBD);
|
---|
1614 | } else {
|
---|
1615 | setCategory(Cat.LAM_PPORT);
|
---|
1616 | }
|
---|
1617 | } else if ((getObjColour(1) == Col.WHITE)
|
---|
1618 | && (getObjColour(2) == Col.RED)) {
|
---|
1619 | setObject(Obj.FLTLAT);
|
---|
1620 | setCategory(Cat.LAM_PORT);
|
---|
1621 | } else {
|
---|
1622 | setObject(Obj.FLTSPP);
|
---|
1623 | setCategory(Cat.NOCAT);
|
---|
1624 | }
|
---|
1625 | break;
|
---|
1626 | case GREEN:
|
---|
1627 | if (getObjColour(1) == Col.UNKCOL) {
|
---|
1628 | setObject(Obj.FLTLAT);
|
---|
1629 | if (getRegion() == Reg.B) {
|
---|
1630 | setCategory(Cat.LAM_PORT);
|
---|
1631 | } else {
|
---|
1632 | setCategory(Cat.LAM_STBD);
|
---|
1633 | }
|
---|
1634 | } else if ((getObjColour(1) == Col.RED)
|
---|
1635 | && (getObjColour(2) == Col.GREEN)) {
|
---|
1636 | setObject(Obj.FLTLAT);
|
---|
1637 | if (getRegion() == Reg.B) {
|
---|
1638 | setCategory(Cat.LAM_PPORT);
|
---|
1639 | } else {
|
---|
1640 | setCategory(Cat.LAM_PSTBD);
|
---|
1641 | }
|
---|
1642 | } else if ((getObjColour(1) == Col.WHITE)
|
---|
1643 | && (getObjColour(2) == Col.GREEN)) {
|
---|
1644 | setObject(Obj.FLTLAT);
|
---|
1645 | setCategory(Cat.LAM_STBD);
|
---|
1646 | } else {
|
---|
1647 | setObject(Obj.FLTSPP);
|
---|
1648 | setCategory(Cat.NOCAT);
|
---|
1649 | }
|
---|
1650 | break;
|
---|
1651 | case YELLOW:
|
---|
1652 | if (getObjColour(1) == Col.BLACK) {
|
---|
1653 | setObject(Obj.FLTCAR);
|
---|
1654 | if (getObjColour(2) == Col.YELLOW) {
|
---|
1655 | setCategory(Cat.CAM_WEST);
|
---|
1656 | } else {
|
---|
1657 | setCategory(Cat.CAM_SOUTH);
|
---|
1658 | }
|
---|
1659 | } else {
|
---|
1660 | setObject(Obj.FLTSPP);
|
---|
1661 | setCategory(Cat.NOCAT);
|
---|
1662 | }
|
---|
1663 | break;
|
---|
1664 | case BLACK:
|
---|
1665 | if (getObjColour(1) == Col.RED) {
|
---|
1666 | setObject(Obj.FLTISD);
|
---|
1667 | setCategory(Cat.NOCAT);
|
---|
1668 | } else if (getObjColour(1) == Col.YELLOW) {
|
---|
1669 | setObject(Obj.FLTCAR);
|
---|
1670 | if (getObjColour(2) == Col.BLACK) {
|
---|
1671 | setCategory(Cat.CAM_EAST);
|
---|
1672 | } else {
|
---|
1673 | setCategory(Cat.CAM_NORTH);
|
---|
1674 | }
|
---|
1675 | } else {
|
---|
1676 | setObject(Obj.FLTSPP);
|
---|
1677 | setCategory(Cat.NOCAT);
|
---|
1678 | }
|
---|
1679 | break;
|
---|
1680 | default:
|
---|
1681 | setCategory(Cat.NOCAT);
|
---|
1682 | }
|
---|
1683 | }
|
---|
1684 |
|
---|
1685 | for (Obj obj : ObjSTR.keySet()) {
|
---|
1686 | if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":system")) {
|
---|
1687 | str = keys.get("seamark:" + ObjSTR.get(obj) + ":system");
|
---|
1688 | if (str.equals("iala-a")) {
|
---|
1689 | setRegion(Reg.A);
|
---|
1690 | } else if (str.equals("iala-b")) {
|
---|
1691 | setRegion(Reg.B);
|
---|
1692 | } else {
|
---|
1693 | setRegion(Reg.C);
|
---|
1694 | }
|
---|
1695 | } else if (GrpMAP.get(object) == Grp.LAT) {
|
---|
1696 | switch (getCategory()) {
|
---|
1697 | case LAM_PORT:
|
---|
1698 | if (getObjColour(0) == Col.RED) {
|
---|
1699 | if (getObjColour(1) == Col.WHITE) {
|
---|
1700 | setRegion(Reg.C);
|
---|
1701 | } else {
|
---|
1702 | setRegion(Reg.A);
|
---|
1703 | }
|
---|
1704 | }
|
---|
1705 | if (getObjColour(0) == Col.GREEN) {
|
---|
1706 | setRegion(Reg.B);
|
---|
1707 | }
|
---|
1708 | break;
|
---|
1709 | case LAM_PPORT:
|
---|
1710 | if (getObjColour(0) == Col.RED) {
|
---|
1711 | if (getObjColour(3) == Col.GREEN) {
|
---|
1712 | setRegion(Reg.C);
|
---|
1713 | } else {
|
---|
1714 | setRegion(Reg.B);
|
---|
1715 | }
|
---|
1716 | }
|
---|
1717 | if (getObjColour(0) == Col.GREEN) {
|
---|
1718 | setRegion(Reg.A);
|
---|
1719 | }
|
---|
1720 | break;
|
---|
1721 | case LAM_STBD:
|
---|
1722 | if (getObjColour(0) == Col.GREEN) {
|
---|
1723 | if (getObjColour(1) == Col.WHITE) {
|
---|
1724 | setRegion(Reg.C);
|
---|
1725 | } else {
|
---|
1726 | setRegion(Reg.A);
|
---|
1727 | }
|
---|
1728 | }
|
---|
1729 | if (getObjColour(0) == Col.RED) {
|
---|
1730 | setRegion(Reg.B);
|
---|
1731 | }
|
---|
1732 | break;
|
---|
1733 | case LAM_PSTBD:
|
---|
1734 | if (getObjColour(0) == Col.GREEN) {
|
---|
1735 | setRegion(Reg.B);
|
---|
1736 | }
|
---|
1737 | if (getObjColour(0) == Col.RED) {
|
---|
1738 | if (getObjColour(3) == Col.GREEN) {
|
---|
1739 | setRegion(Reg.C);
|
---|
1740 | } else {
|
---|
1741 | setRegion(Reg.A);
|
---|
1742 | }
|
---|
1743 | }
|
---|
1744 | break;
|
---|
1745 | }
|
---|
1746 | }
|
---|
1747 | }
|
---|
1748 |
|
---|
1749 | if (keys.containsKey("seamark:topmark:shape")) {
|
---|
1750 | str = keys.get("seamark:topmark:shape");
|
---|
1751 | setTopmark(Top.NOTOP);
|
---|
1752 | for (Top top : TopSTR.keySet()) {
|
---|
1753 | if (TopSTR.get(top).equals(str)) {
|
---|
1754 | setTopmark(top);
|
---|
1755 | }
|
---|
1756 | }
|
---|
1757 | }
|
---|
1758 | if (keys.containsKey("seamark:topmark:colour")) {
|
---|
1759 | str = keys.get("seamark:topmark:colour");
|
---|
1760 | setTopColour(Col.UNKCOL);
|
---|
1761 | for (Col col : ColSTR.keySet()) {
|
---|
1762 | if (ColSTR.get(col).equals(str)) {
|
---|
1763 | setTopColour(col);
|
---|
1764 | }
|
---|
1765 | }
|
---|
1766 | }
|
---|
1767 | if (keys.containsKey("seamark:topmark:colour_pattern")) {
|
---|
1768 | str = keys.get("seamark:topmark:colour_pattern");
|
---|
1769 | setTopPattern(Pat.NOPAT);
|
---|
1770 | for (Pat pat : PatSTR.keySet()) {
|
---|
1771 | if (PatSTR.get(pat).equals(str)) {
|
---|
1772 | setTopPattern(pat);
|
---|
1773 | }
|
---|
1774 | }
|
---|
1775 | }
|
---|
1776 |
|
---|
1777 | clrLight();
|
---|
1778 | for (int i = 0; i < 30; i++) {
|
---|
1779 | String secStr = (i == 0) ? "" : (":" + Integer.toString(i));
|
---|
1780 | if (keys.containsKey("seamark:light" + secStr + ":colour")) {
|
---|
1781 | nulLight(i);
|
---|
1782 | str = keys.get("seamark:light" + secStr + ":colour");
|
---|
1783 | if (str.contains(";")) {
|
---|
1784 | String[] strs = str.split(";");
|
---|
1785 | for (Col col : ColSTR.keySet()) {
|
---|
1786 | if ((strs.length > 1) && ColSTR.get(col).equals(strs[1])) {
|
---|
1787 | setLightAtt(Att.ALT, i, col);
|
---|
1788 | }
|
---|
1789 | }
|
---|
1790 | str = strs[0];
|
---|
1791 | }
|
---|
1792 | for (Col col : ColSTR.keySet()) {
|
---|
1793 | if (ColSTR.get(col).equals(str)) {
|
---|
1794 | setLightAtt(Att.COL, i, col);
|
---|
1795 | }
|
---|
1796 | }
|
---|
1797 | }
|
---|
1798 | if (keys.containsKey("seamark:light" + secStr + ":character")) {
|
---|
1799 | str = keys.get("seamark:light" + secStr + ":character");
|
---|
1800 | if (str.contains("(") && str.contains(")")) {
|
---|
1801 | int i1 = str.indexOf("(");
|
---|
1802 | int i2 = str.indexOf(")");
|
---|
1803 | setLightAtt(Att.GRP, i, str.substring((i1+1), i2));
|
---|
1804 | str = str.substring(0, i1) + str.substring((i2+1), str.length());
|
---|
1805 | }
|
---|
1806 | setLightAtt(Att.CHR, i, str);
|
---|
1807 | }
|
---|
1808 | if (keys.containsKey("seamark:light" + secStr + ":group")) {
|
---|
1809 | setLightAtt(Att.GRP, i, keys.get("seamark:light" + secStr + ":group"));
|
---|
1810 | }
|
---|
1811 | if (keys.containsKey("seamark:light" + secStr + ":sequence")) {
|
---|
1812 | setLightAtt(Att.SEQ, i, keys.get("seamark:light" + secStr + ":sequence"));
|
---|
1813 | }
|
---|
1814 | if (keys.containsKey("seamark:light" + secStr + ":period")) {
|
---|
1815 | setLightAtt(Att.PER, i, keys.get("seamark:light" + secStr + ":period"));
|
---|
1816 | }
|
---|
1817 | if (keys.containsKey("seamark:light" + secStr + ":category")) {
|
---|
1818 | str = keys.get("seamark:light" + secStr + ":category");
|
---|
1819 | if (str.equals("vert")) {
|
---|
1820 | str = "vertical";
|
---|
1821 | }
|
---|
1822 | if (str.equals("horiz")) {
|
---|
1823 | str = "horizontal";
|
---|
1824 | }
|
---|
1825 | for (Lit lit : LitSTR.keySet()) {
|
---|
1826 | if (LitSTR.get(lit).equals(str)) {
|
---|
1827 | setLightAtt(Att.LIT, i, lit);
|
---|
1828 | }
|
---|
1829 | }
|
---|
1830 | }
|
---|
1831 | if (keys.containsKey("seamark:light" + secStr + ":sector_start")) {
|
---|
1832 | setLightAtt(Att.BEG, i, keys.get("seamark:light" + secStr + ":sector_start"));
|
---|
1833 | }
|
---|
1834 | if (keys.containsKey("seamark:light" + secStr + ":sector_end")) {
|
---|
1835 | setLightAtt(Att.END, i, keys.get("seamark:light" + secStr + ":sector_end"));
|
---|
1836 | }
|
---|
1837 | if (keys.containsKey("seamark:light" + secStr + ":radius")) {
|
---|
1838 | setLightAtt(Att.RAD, i, keys.get("seamark:light" + secStr + ":radius"));
|
---|
1839 | }
|
---|
1840 | if (keys.containsKey("seamark:light" + secStr + ":height")) {
|
---|
1841 | setLightAtt(Att.HGT, i, keys.get("seamark:light" + secStr + ":height"));
|
---|
1842 | }
|
---|
1843 | if (keys.containsKey("seamark:light" + secStr + ":range")) {
|
---|
1844 | setLightAtt(Att.RNG, i, keys.get("seamark:light" + secStr + ":range"));
|
---|
1845 | }
|
---|
1846 | if (keys.containsKey("seamark:light" + secStr + ":visibility")) {
|
---|
1847 | str = keys.get("seamark:light" + secStr + ":visibility");
|
---|
1848 | for (Vis vis : VisSTR.keySet()) {
|
---|
1849 | if (VisSTR.get(vis).equals(str)) {
|
---|
1850 | setLightAtt(Att.VIS, i, vis);
|
---|
1851 | }
|
---|
1852 | }
|
---|
1853 | }
|
---|
1854 | if (keys.containsKey("seamark:light" + secStr + ":exhibition")) {
|
---|
1855 | str = keys.get("seamark:light" + secStr + ":exhibition");
|
---|
1856 | for (Exh exh : ExhSTR.keySet()) {
|
---|
1857 | if (ExhSTR.get(exh).equals(str)) {
|
---|
1858 | setLightAtt(Att.EXH, i, exh);
|
---|
1859 | }
|
---|
1860 | }
|
---|
1861 | }
|
---|
1862 | if (keys.containsKey("seamark:light" + secStr + ":orientation")) {
|
---|
1863 | setLightAtt(Att.ORT, i, keys.get("seamark:light" + secStr + ":orientation"));
|
---|
1864 | }
|
---|
1865 | if (keys.containsKey("seamark:light" + secStr + ":multiple")) {
|
---|
1866 | setLightAtt(Att.MLT, i, keys.get("seamark:light" + secStr + ":multiple"));
|
---|
1867 | }
|
---|
1868 |
|
---|
1869 | if (sectors.size() == i) {
|
---|
1870 | break;
|
---|
1871 | }
|
---|
1872 | }
|
---|
1873 |
|
---|
1874 | if (keys.containsKey("seamark:fog_signal")) {
|
---|
1875 | setFogSound(Fog.FOGSIG);
|
---|
1876 | }
|
---|
1877 | if (keys.containsKey("seamark:fog_signal:category")) {
|
---|
1878 | str = keys.get("seamark:fog_signal:category");
|
---|
1879 | setFogSound(Fog.NOFOG);
|
---|
1880 | for (Fog fog : FogSTR.keySet()) {
|
---|
1881 | if (FogSTR.get(fog).equals(str)) {
|
---|
1882 | setFogSound(fog);
|
---|
1883 | }
|
---|
1884 | }
|
---|
1885 | }
|
---|
1886 | if (keys.containsKey("seamark:fog_signal:group")) {
|
---|
1887 | setFogGroup(keys.get("seamark:fog_signal:group"));
|
---|
1888 | }
|
---|
1889 | if (keys.containsKey("seamark:fog_signal:period")) {
|
---|
1890 | setFogPeriod(keys.get("seamark:fog_signal:period"));
|
---|
1891 | }
|
---|
1892 | if (keys.containsKey("seamark:fog_signal:sequence")) {
|
---|
1893 | setFogSequence(keys.get("seamark:fog_signal:sequence"));
|
---|
1894 | }
|
---|
1895 | if (keys.containsKey("seamark:fog_signal:range")) {
|
---|
1896 | setFogRange(keys.get("seamark:fog_signal:range"));
|
---|
1897 | }
|
---|
1898 |
|
---|
1899 | if (keys.containsKey("seamark:radio_station:category")) {
|
---|
1900 | str = keys.get("seamark:radio_station:category");
|
---|
1901 | setRadio(Cat.NOROS);
|
---|
1902 | for (Cat rdo : CatSTR.keySet()) {
|
---|
1903 | if (CatSTR.get(rdo).equals(str)) {
|
---|
1904 | setRadio(rdo);
|
---|
1905 | }
|
---|
1906 | }
|
---|
1907 | }
|
---|
1908 |
|
---|
1909 | if (keys.containsKey("seamark:radar_reflector")) {
|
---|
1910 | setRadar(Rtb.REFLECTOR);
|
---|
1911 | }
|
---|
1912 | if (keys.containsKey("seamark:radar_transponder:category")) {
|
---|
1913 | str = keys.get("seamark:radar_transponder:category");
|
---|
1914 | setRadar(Rtb.NORTB);
|
---|
1915 | for (Rtb rtb : RtbSTR.keySet()) {
|
---|
1916 | if (RtbSTR.get(rtb).equals(str)) {
|
---|
1917 | setRadar(rtb);
|
---|
1918 | }
|
---|
1919 | }
|
---|
1920 | }
|
---|
1921 | if (keys.containsKey("seamark:radar_transponder:group")) {
|
---|
1922 | setRaconGroup(keys.get("seamark:radar_transponder:group"));
|
---|
1923 | }
|
---|
1924 | if (keys.containsKey("seamark:radar_transponder:period")) {
|
---|
1925 | setRaconPeriod(keys.get("seamark:radar_transponder:period"));
|
---|
1926 | }
|
---|
1927 | if (keys.containsKey("seamark:radar_transponder:sequence")) {
|
---|
1928 | setRaconSequence(keys.get("seamark:radar_transponder:sequence"));
|
---|
1929 | }
|
---|
1930 | if (keys.containsKey("seamark:radar_transponder:range")) {
|
---|
1931 | setRaconRange(keys.get("seamark:radar_transponder:range"));
|
---|
1932 | }
|
---|
1933 | if (keys.containsKey("seamark:radar_transponder:sector_start")) {
|
---|
1934 | setRaconSector1(keys.get("seamark:radar_transponder:sector_start"));
|
---|
1935 | }
|
---|
1936 | if (keys.containsKey("seamark:radar_transponder:sector_end")) {
|
---|
1937 | setRaconSector2(keys.get("seamark:radar_transponder:sector_end"));
|
---|
1938 | }
|
---|
1939 |
|
---|
1940 | if (keys.containsKey("seamark:information")) {
|
---|
1941 | setInfo(keys.get("seamark:information"));
|
---|
1942 | }
|
---|
1943 | if (keys.containsKey("seamark:light:information")) {
|
---|
1944 | setInfo(getInfo() + keys.get("seamark:light:information"));
|
---|
1945 | }
|
---|
1946 | if (keys.containsKey("seamark:" + ObjSTR.get(getObject()) + "information")) {
|
---|
1947 | setInfo(getInfo() + keys.get("seamark:" + ObjSTR.get(getObject()) + "information"));
|
---|
1948 | }
|
---|
1949 | if (keys.containsKey("seamark:source")) {
|
---|
1950 | setSource(keys.get("seamark:source"));
|
---|
1951 | }
|
---|
1952 | if (keys.containsKey("seamark:light:source")) {
|
---|
1953 | setSource(getSource() + keys.get("seamark:light:source"));
|
---|
1954 | }
|
---|
1955 | if (keys.containsKey("seamark:" + ObjSTR.get(getObject()) + "source")) {
|
---|
1956 | setSource(getSource() + keys.get("seamark:" + ObjSTR.get(getObject()) + "source"));
|
---|
1957 | }
|
---|
1958 | if (keys.containsKey("seamark:height")) {
|
---|
1959 | setObjectHeight(keys.get("seamark:height"));
|
---|
1960 | }
|
---|
1961 | if (keys.containsKey("seamark:elevation")) {
|
---|
1962 | setElevation(keys.get("seamark:elevation"));
|
---|
1963 | }
|
---|
1964 | if (keys.containsKey("seamark:status")) {
|
---|
1965 | str = keys.get("seamark:status");
|
---|
1966 | setStatus(Sts.UNKSTS);
|
---|
1967 | for (Sts sts : StsSTR.keySet()) {
|
---|
1968 | if (StsSTR.get(sts).equals(str)) {
|
---|
1969 | setStatus(sts);
|
---|
1970 | }
|
---|
1971 | }
|
---|
1972 | }
|
---|
1973 | if (keys.containsKey("seamark:construction")) {
|
---|
1974 | str = keys.get("seamark:construction");
|
---|
1975 | setConstr(Cns.UNKCNS);
|
---|
1976 | for (Cns cns : CnsSTR.keySet()) {
|
---|
1977 | if (CnsSTR.get(cns).equals(str)) {
|
---|
1978 | setConstr(cns);
|
---|
1979 | }
|
---|
1980 | }
|
---|
1981 | }
|
---|
1982 | if (keys.containsKey("seamark:conspicuity")) {
|
---|
1983 | str = keys.get("seamark:conspicuity");
|
---|
1984 | setConsp(Con.UNKCON);
|
---|
1985 | for (Con con : ConSTR.keySet()) {
|
---|
1986 | if (ConSTR.get(con).equals(str)) {
|
---|
1987 | setConsp(con);
|
---|
1988 | }
|
---|
1989 | }
|
---|
1990 | }
|
---|
1991 | if (keys.containsKey("seamark:reflectivity")) {
|
---|
1992 | str = keys.get("seamark:reflectivity");
|
---|
1993 | setRefl(Con.UNKCON);
|
---|
1994 | for (Con con : ConSTR.keySet()) {
|
---|
1995 | if (ConSTR.get(con).equals(str)) {
|
---|
1996 | setRefl(con);
|
---|
1997 | }
|
---|
1998 | }
|
---|
1999 | }
|
---|
2000 |
|
---|
2001 | if (keys.containsKey("seamark:ref")) {
|
---|
2002 | setRef(keys.get("seamark:ref"));
|
---|
2003 | }
|
---|
2004 | if (keys.containsKey("seamark:reference")) {
|
---|
2005 | setRef(keys.get("seamark:reference"));
|
---|
2006 | }
|
---|
2007 | if (keys.containsKey("seamark:light:ref")) {
|
---|
2008 | setLightRef(keys.get("seamark:light:ref"));
|
---|
2009 | }
|
---|
2010 | if (keys.containsKey("seamark:light:reference")) {
|
---|
2011 | setLightRef(keys.get("seamark:light:reference"));
|
---|
2012 | }
|
---|
2013 | if (keys.containsKey("seamark:fixme")) {
|
---|
2014 | setFixme(keys.get("seamark:fixme"));
|
---|
2015 | }
|
---|
2016 |
|
---|
2017 | dlg.panelMain.syncPanel();
|
---|
2018 | }
|
---|
2019 |
|
---|
2020 | @Override
|
---|
2021 | public void paintComponent(Graphics g) {
|
---|
2022 | super.paintComponent(g);
|
---|
2023 |
|
---|
2024 | if (dlg.node == null) return;
|
---|
2025 |
|
---|
2026 | Graphics2D g2 = (Graphics2D) g;
|
---|
2027 |
|
---|
2028 | String colStr;
|
---|
2029 | String lblStr;
|
---|
2030 | String imgStr = "/images/";
|
---|
2031 | if (getShape() != Shp.UNKSHP) {
|
---|
2032 | switch (getShape()) {
|
---|
2033 | case TOWER:
|
---|
2034 | imgStr += "Tower";
|
---|
2035 | break;
|
---|
2036 | case BUOY:
|
---|
2037 | case PILLAR:
|
---|
2038 | imgStr += "Pillar";
|
---|
2039 | break;
|
---|
2040 | case SPAR:
|
---|
2041 | imgStr += "Spar";
|
---|
2042 | break;
|
---|
2043 | case CAN:
|
---|
2044 | imgStr += "Can";
|
---|
2045 | break;
|
---|
2046 | case CONI:
|
---|
2047 | imgStr += "Cone";
|
---|
2048 | break;
|
---|
2049 | case SPHERI:
|
---|
2050 | imgStr += "Sphere";
|
---|
2051 | break;
|
---|
2052 | case BARREL:
|
---|
2053 | imgStr += "Barrel";
|
---|
2054 | break;
|
---|
2055 | case CAIRN:
|
---|
2056 | imgStr += "Cairn";
|
---|
2057 | break;
|
---|
2058 | case FLOAT:
|
---|
2059 | imgStr += "Float";
|
---|
2060 | break;
|
---|
2061 | case BEACON:
|
---|
2062 | case PILE:
|
---|
2063 | case LATTICE:
|
---|
2064 | case BUOYANT:
|
---|
2065 | imgStr += "Beacon";
|
---|
2066 | break;
|
---|
2067 | case SUPER:
|
---|
2068 | imgStr += "Super";
|
---|
2069 | break;
|
---|
2070 | case STAKE:
|
---|
2071 | case POLE:
|
---|
2072 | case POST:
|
---|
2073 | imgStr += "Stake";
|
---|
2074 | break;
|
---|
2075 | case PERCH:
|
---|
2076 | if (getCategory() == Cat.LAM_PORT) {
|
---|
2077 | imgStr += "Perch_Port";
|
---|
2078 | } else {
|
---|
2079 | imgStr += "Perch_Starboard";
|
---|
2080 | }
|
---|
2081 | break;
|
---|
2082 | }
|
---|
2083 | colStr = imgStr;
|
---|
2084 | lblStr = "";
|
---|
2085 | for (Col col : bodyColour) {
|
---|
2086 | switch (col) {
|
---|
2087 | case WHITE:
|
---|
2088 | colStr += "_White";
|
---|
2089 | lblStr += "W";
|
---|
2090 | break;
|
---|
2091 | case RED:
|
---|
2092 | colStr += "_Red";
|
---|
2093 | lblStr += "R";
|
---|
2094 | break;
|
---|
2095 | case ORANGE:
|
---|
2096 | colStr += "_Orange";
|
---|
2097 | lblStr += "Or";
|
---|
2098 | break;
|
---|
2099 | case AMBER:
|
---|
2100 | colStr += "_Amber";
|
---|
2101 | lblStr += "Am";
|
---|
2102 | break;
|
---|
2103 | case YELLOW:
|
---|
2104 | colStr += "_Yellow";
|
---|
2105 | lblStr += "Y";
|
---|
2106 | break;
|
---|
2107 | case GREEN:
|
---|
2108 | colStr += "_Green";
|
---|
2109 | lblStr += "G";
|
---|
2110 | break;
|
---|
2111 | case BLUE:
|
---|
2112 | colStr += "_Blue";
|
---|
2113 | lblStr += "Bu";
|
---|
2114 | break;
|
---|
2115 | case VIOLET:
|
---|
2116 | colStr += "_Violet";
|
---|
2117 | lblStr += "Vi";
|
---|
2118 | break;
|
---|
2119 | case BLACK:
|
---|
2120 | colStr += "_Black";
|
---|
2121 | lblStr += "B";
|
---|
2122 | break;
|
---|
2123 | case GREY:
|
---|
2124 | colStr += "_Grey";
|
---|
2125 | lblStr += "Gr";
|
---|
2126 | break;
|
---|
2127 | case BROWN:
|
---|
2128 | colStr += "_Brown";
|
---|
2129 | lblStr += "Br";
|
---|
2130 | break;
|
---|
2131 | case MAGENTA:
|
---|
2132 | colStr += "_Magenta";
|
---|
2133 | lblStr += "Mg";
|
---|
2134 | break;
|
---|
2135 | case PINK:
|
---|
2136 | colStr += "_Pink";
|
---|
2137 | lblStr += "Pk";
|
---|
2138 | break;
|
---|
2139 | }
|
---|
2140 | }
|
---|
2141 | if (!imgStr.equals("/images/")) {
|
---|
2142 | colStr += ".png";
|
---|
2143 | if (getClass().getResource(colStr) == null) {
|
---|
2144 | System.out.println("Missing image1: " + colStr);
|
---|
2145 | imgStr += ".png";
|
---|
2146 | if (getClass().getResource(imgStr) == null) {
|
---|
2147 | System.out.println("Missing image2: " + imgStr);
|
---|
2148 | } else {
|
---|
2149 | g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
|
---|
2150 | g2.drawString(lblStr, 75, 110);
|
---|
2151 | }
|
---|
2152 | } else {
|
---|
2153 | g2.drawImage(new ImageIcon(getClass().getResource(colStr)).getImage(), 7, -15, null);
|
---|
2154 | }
|
---|
2155 | }
|
---|
2156 | } else if (getObject() != Obj.UNKOBJ) {
|
---|
2157 | switch (getObject()) {
|
---|
2158 | case LNDMRK:
|
---|
2159 | switch (getCategory()) {
|
---|
2160 | case LMK_CHMY:
|
---|
2161 | imgStr += "Chimney";
|
---|
2162 | break;
|
---|
2163 | case LMK_CARN:
|
---|
2164 | imgStr += "Cairn";
|
---|
2165 | break;
|
---|
2166 | case LMK_DSHA:
|
---|
2167 | imgStr += "DishAerial";
|
---|
2168 | break;
|
---|
2169 | case LMK_FLGS:
|
---|
2170 | imgStr += "Flagstaff";
|
---|
2171 | break;
|
---|
2172 | case LMK_FLRS:
|
---|
2173 | imgStr += "FlareStack";
|
---|
2174 | break;
|
---|
2175 | case LMK_MNMT:
|
---|
2176 | case LMK_CLMN:
|
---|
2177 | case LMK_OBLK:
|
---|
2178 | case LMK_STAT:
|
---|
2179 | imgStr += "Monument";
|
---|
2180 | break;
|
---|
2181 | case LMK_MAST:
|
---|
2182 | imgStr += "RadioMast";
|
---|
2183 | break;
|
---|
2184 | case LMK_TOWR:
|
---|
2185 | if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL)) {
|
---|
2186 | imgStr += "ChurchTower";
|
---|
2187 | } else {
|
---|
2188 | imgStr += "LandTower";
|
---|
2189 | }
|
---|
2190 | break;
|
---|
2191 | case LMK_WNDM:
|
---|
2192 | imgStr += "Wind_Motor";
|
---|
2193 | break;
|
---|
2194 | case LMK_WTRT:
|
---|
2195 | imgStr += "WaterTower";
|
---|
2196 | break;
|
---|
2197 | case LMK_DOME:
|
---|
2198 | if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL)) {
|
---|
2199 | imgStr += "ChurchDome";
|
---|
2200 | } else {
|
---|
2201 | imgStr += "Dome";
|
---|
2202 | }
|
---|
2203 | break;
|
---|
2204 | case LMK_SPIR:
|
---|
2205 | if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL)) {
|
---|
2206 | imgStr += "ChurchSpire";
|
---|
2207 | } else {
|
---|
2208 | imgStr += "Spire";
|
---|
2209 | }
|
---|
2210 | break;
|
---|
2211 | case LMK_MNRT:
|
---|
2212 | imgStr += "Minaret";
|
---|
2213 | break;
|
---|
2214 | case LMK_WNDS:
|
---|
2215 | imgStr += "Windsock";
|
---|
2216 | break;
|
---|
2217 | case LMK_CROS:
|
---|
2218 | imgStr += "Cross";
|
---|
2219 | break;
|
---|
2220 | case LMK_SCNR:
|
---|
2221 | imgStr += "Signal_Station";
|
---|
2222 | break;
|
---|
2223 | case LMK_WNDL:
|
---|
2224 | imgStr += "Windmill";
|
---|
2225 | break;
|
---|
2226 | case NOCAT:
|
---|
2227 | switch (getFunc()) {
|
---|
2228 | case CHCH:
|
---|
2229 | case CHPL:
|
---|
2230 | imgStr += "Church";
|
---|
2231 | break;
|
---|
2232 | case TMPL:
|
---|
2233 | case PGDA:
|
---|
2234 | case SHSH:
|
---|
2235 | case BTMP:
|
---|
2236 | imgStr += "Temple";
|
---|
2237 | break;
|
---|
2238 | case MOSQ:
|
---|
2239 | imgStr += "Minaret";
|
---|
2240 | break;
|
---|
2241 | case MRBT:
|
---|
2242 | imgStr += "Spire";
|
---|
2243 | break;
|
---|
2244 | }
|
---|
2245 | }
|
---|
2246 | break;
|
---|
2247 | case LITHSE:
|
---|
2248 | imgStr += "Light_House";
|
---|
2249 | break;
|
---|
2250 | case LITMAJ:
|
---|
2251 | imgStr += "Light_Major";
|
---|
2252 | break;
|
---|
2253 | case LITMIN:
|
---|
2254 | imgStr += "Light_Minor";
|
---|
2255 | break;
|
---|
2256 | case LITFLT:
|
---|
2257 | imgStr += "Float";
|
---|
2258 | break;
|
---|
2259 | case LITVES:
|
---|
2260 | imgStr += "Super";
|
---|
2261 | break;
|
---|
2262 | case SISTAW:
|
---|
2263 | imgStr += "Signal_Station";
|
---|
2264 | break;
|
---|
2265 | case SISTAT:
|
---|
2266 | imgStr += "Signal_Station";
|
---|
2267 | break;
|
---|
2268 | case OFSPLF:
|
---|
2269 | if (getCategory() == Cat.OFP_FPSO) {
|
---|
2270 | imgStr += "Storage";
|
---|
2271 | } else {
|
---|
2272 | imgStr += "Platform";
|
---|
2273 | }
|
---|
2274 | break;
|
---|
2275 | case MORFAC:
|
---|
2276 | switch (getCategory()) {
|
---|
2277 | case MOR_DLPN:
|
---|
2278 | imgStr += "Dolphin";
|
---|
2279 | break;
|
---|
2280 | case MOR_DDPN:
|
---|
2281 | imgStr += "DeviationDolphin";
|
---|
2282 | break;
|
---|
2283 | case MOR_POST:
|
---|
2284 | imgStr += "Post";
|
---|
2285 | break;
|
---|
2286 | case MOR_BUOY:
|
---|
2287 | imgStr += "Sphere";
|
---|
2288 | break;
|
---|
2289 | }
|
---|
2290 | break;
|
---|
2291 | case BOYINB:
|
---|
2292 | imgStr += "Super";
|
---|
2293 | break;
|
---|
2294 | case CGUSTA:
|
---|
2295 | imgStr += "Signal_Station";
|
---|
2296 | break;
|
---|
2297 | case PILBOP:
|
---|
2298 | imgStr += "Pilot";
|
---|
2299 | break;
|
---|
2300 | case RSCSTA:
|
---|
2301 | imgStr += "Rescue";
|
---|
2302 | break;
|
---|
2303 | case RDOSTA:
|
---|
2304 | case RADSTA:
|
---|
2305 | imgStr += "Signal_Station";
|
---|
2306 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Station.png")).getImage(), 7, -15, null);
|
---|
2307 | break;
|
---|
2308 | }
|
---|
2309 | if (!imgStr.equals("/images/")) {
|
---|
2310 | imgStr += ".png";
|
---|
2311 | if (getClass().getResource(imgStr) == null) {
|
---|
2312 | System.out.println("Missing image3: " + imgStr);
|
---|
2313 | } else {
|
---|
2314 | g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
|
---|
2315 | }
|
---|
2316 | }
|
---|
2317 | }
|
---|
2318 |
|
---|
2319 | if (getTopmark() != Top.NOTOP) {
|
---|
2320 | imgStr = "/images/Top_";
|
---|
2321 | switch (getTopmark()) {
|
---|
2322 | case CYL:
|
---|
2323 | imgStr += "Can";
|
---|
2324 | break;
|
---|
2325 | case CONE:
|
---|
2326 | imgStr += "Cone";
|
---|
2327 | break;
|
---|
2328 | case SPHERE:
|
---|
2329 | imgStr += "Sphere";
|
---|
2330 | break;
|
---|
2331 | case X_SHAPE:
|
---|
2332 | imgStr += "X";
|
---|
2333 | break;
|
---|
2334 | case NORTH:
|
---|
2335 | imgStr += "North";
|
---|
2336 | break;
|
---|
2337 | case SOUTH:
|
---|
2338 | imgStr += "South";
|
---|
2339 | break;
|
---|
2340 | case EAST:
|
---|
2341 | imgStr += "East";
|
---|
2342 | break;
|
---|
2343 | case WEST:
|
---|
2344 | imgStr += "West";
|
---|
2345 | break;
|
---|
2346 | case SPHERES2:
|
---|
2347 | imgStr += "Isol";
|
---|
2348 | break;
|
---|
2349 | }
|
---|
2350 | colStr = imgStr;
|
---|
2351 | for (Col col : topmarkColour) {
|
---|
2352 | switch (col) {
|
---|
2353 | case WHITE:
|
---|
2354 | colStr += "_White";
|
---|
2355 | break;
|
---|
2356 | case RED:
|
---|
2357 | colStr += "_Red";
|
---|
2358 | break;
|
---|
2359 | case ORANGE:
|
---|
2360 | colStr += "_Orange";
|
---|
2361 | break;
|
---|
2362 | case AMBER:
|
---|
2363 | colStr += "_Amber";
|
---|
2364 | break;
|
---|
2365 | case YELLOW:
|
---|
2366 | colStr += "_Yellow";
|
---|
2367 | break;
|
---|
2368 | case GREEN:
|
---|
2369 | colStr += "_Green";
|
---|
2370 | break;
|
---|
2371 | case BLUE:
|
---|
2372 | colStr += "_Blue";
|
---|
2373 | break;
|
---|
2374 | case VIOLET:
|
---|
2375 | colStr += "_Violet";
|
---|
2376 | break;
|
---|
2377 | case BLACK:
|
---|
2378 | colStr += "_Black";
|
---|
2379 | break;
|
---|
2380 | }
|
---|
2381 | }
|
---|
2382 | switch (getShape()) {
|
---|
2383 | case CAN:
|
---|
2384 | case CONI:
|
---|
2385 | case SPHERI:
|
---|
2386 | case BARREL:
|
---|
2387 | imgStr += "_Buoy_Small";
|
---|
2388 | colStr += "_Buoy_Small";
|
---|
2389 | break;
|
---|
2390 | case PILLAR:
|
---|
2391 | case SPAR:
|
---|
2392 | imgStr += "_Buoy";
|
---|
2393 | colStr += "_Buoy";
|
---|
2394 | break;
|
---|
2395 | case FLOAT:
|
---|
2396 | case SUPER:
|
---|
2397 | imgStr += "_Float";
|
---|
2398 | colStr += "_Float";
|
---|
2399 | break;
|
---|
2400 | case BUOYANT:
|
---|
2401 | case CAIRN:
|
---|
2402 | case PILE:
|
---|
2403 | case LATTICE:
|
---|
2404 | case TOWER:
|
---|
2405 | case STAKE:
|
---|
2406 | case POLE:
|
---|
2407 | case POST:
|
---|
2408 | case BEACON:
|
---|
2409 | imgStr += "_Beacon";
|
---|
2410 | colStr += "_Beacon";
|
---|
2411 | break;
|
---|
2412 | }
|
---|
2413 | colStr += ".png";
|
---|
2414 | if (getClass().getResource(colStr) == null) {
|
---|
2415 | System.out.println("Missing image4: " + colStr);
|
---|
2416 | imgStr += ".png";
|
---|
2417 | if (getClass().getResource(imgStr) == null) {
|
---|
2418 | System.out.println("Missing image5: " + imgStr);
|
---|
2419 | return;
|
---|
2420 | } else {
|
---|
2421 | g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
|
---|
2422 | }
|
---|
2423 | } else {
|
---|
2424 | g2.drawImage(new ImageIcon(getClass().getResource(colStr)).getImage(), 7, -15, null);
|
---|
2425 | }
|
---|
2426 | } else {
|
---|
2427 | if ((getObject() == Obj.BOYINB) || ((getObject() == Obj.MORFAC) && (getCategory() == Cat.MOR_BUOY))) {
|
---|
2428 | imgStr = "/images/Top_Mooring";
|
---|
2429 | switch (getShape()) {
|
---|
2430 | case CAN:
|
---|
2431 | case CONI:
|
---|
2432 | case SPHERI:
|
---|
2433 | case BARREL:
|
---|
2434 | imgStr += "_Buoy_Small";
|
---|
2435 | break;
|
---|
2436 | case FLOAT:
|
---|
2437 | case SUPER:
|
---|
2438 | imgStr += "_Float";
|
---|
2439 | break;
|
---|
2440 | default:
|
---|
2441 | if (getObject() == Obj.MORFAC) {
|
---|
2442 | imgStr += "_Buoy_Small";
|
---|
2443 | } else {
|
---|
2444 | imgStr += "_Float";
|
---|
2445 | }
|
---|
2446 | break;
|
---|
2447 | }
|
---|
2448 | imgStr += ".png";
|
---|
2449 | if (getClass().getResource(imgStr) == null) {
|
---|
2450 | System.out.println("Missing image6: " + imgStr);
|
---|
2451 | return;
|
---|
2452 | } else {
|
---|
2453 | g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
|
---|
2454 | }
|
---|
2455 | }
|
---|
2456 | }
|
---|
2457 |
|
---|
2458 | for (int i = 1; i < sectors.size(); i++) {
|
---|
2459 | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
---|
2460 | g2.setStroke(new BasicStroke(6.0f));
|
---|
2461 | if (!((String) getLightAtt(Att.BEG, i)).isEmpty() && !((String) getLightAtt(Att.END, i)).isEmpty()) {
|
---|
2462 | if (getLightAtt(Att.COL, i) != Col.UNKCOL) {
|
---|
2463 | g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i)));
|
---|
2464 | Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.BEG, i));
|
---|
2465 | Double da = 270 - Double.parseDouble((String) getLightAtt(Att.END, i)) - a0;
|
---|
2466 | da -= da > 0 ? 360 : 0;
|
---|
2467 | g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN));
|
---|
2468 | }
|
---|
2469 | if (getLightAtt(Att.ALT, i) != Col.UNKCOL) {
|
---|
2470 | g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i)));
|
---|
2471 | Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.BEG, i));
|
---|
2472 | Double da = 270 - Double.parseDouble((String) getLightAtt(Att.END, i)) - a0;
|
---|
2473 | da -= da > 0 ? 360 : 0;
|
---|
2474 | g2.draw(new Arc2D.Double(17, 20, 130, 130, a0, da, Arc2D.OPEN));
|
---|
2475 | }
|
---|
2476 | } else if ((getLightAtt(Att.LIT, i) == Lit.DIR) && !((String) getLightAtt(Att.ORT, i)).isEmpty()) {
|
---|
2477 | if (getLightAtt(Att.COL, i) != Col.UNKCOL) {
|
---|
2478 | g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i)));
|
---|
2479 | Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.ORT, i)) + 2.0;
|
---|
2480 | Double da = -4.0;
|
---|
2481 | g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN));
|
---|
2482 | }
|
---|
2483 | if (getLightAtt(Att.ALT, i) != Col.UNKCOL) {
|
---|
2484 | g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i)));
|
---|
2485 | Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.ORT, i)) + 2.0;
|
---|
2486 | Double da = -4.0;
|
---|
2487 | g2.draw(new Arc2D.Double(17, 20, 130, 130, a0, da, Arc2D.OPEN));
|
---|
2488 | }
|
---|
2489 | }
|
---|
2490 | }
|
---|
2491 | g2.setPaint(Color.BLACK);
|
---|
2492 | if ((getLightAtt(Att.COL, 0) != Col.UNKCOL) || !(((String) getLightAtt(Att.CHR, 0)).isEmpty())) {
|
---|
2493 | if (sectors.size() == 1) {
|
---|
2494 | if (((String) getLightAtt(Att.CHR, 0)).contains("Al")) {
|
---|
2495 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png")).getImage(), 7, -15, null);
|
---|
2496 | } else {
|
---|
2497 | switch ((Col) getLightAtt(Att.COL, 0)) {
|
---|
2498 | case RED:
|
---|
2499 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Red_120.png")).getImage(), 7, -15, null);
|
---|
2500 | break;
|
---|
2501 | case GREEN:
|
---|
2502 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Green_120.png")).getImage(), 7, -15, null);
|
---|
2503 | break;
|
---|
2504 | case WHITE:
|
---|
2505 | case YELLOW:
|
---|
2506 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_White_120.png")).getImage(), 7, -15, null);
|
---|
2507 | break;
|
---|
2508 | default:
|
---|
2509 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png")).getImage(), 7, -15, null);
|
---|
2510 | }
|
---|
2511 | }
|
---|
2512 | }
|
---|
2513 | String c = (String) getLightAtt(Att.CHR, 0);
|
---|
2514 | String tmp = "";
|
---|
2515 | if (c.contains("+")) {
|
---|
2516 | int i1 = c.indexOf("+");
|
---|
2517 | tmp = c.substring(i1, c.length());
|
---|
2518 | c = c.substring(0, i1);
|
---|
2519 | if (!((String) getLightAtt(Att.GRP, 0)).isEmpty()) {
|
---|
2520 | c += "(" + (String) getLightAtt(Att.GRP, 0) + ")";
|
---|
2521 | }
|
---|
2522 | if (tmp != null) {
|
---|
2523 | c += tmp;
|
---|
2524 | }
|
---|
2525 | } else if (!((String) getLightAtt(Att.GRP, 0)).isEmpty()) {
|
---|
2526 | c += "(" + (String) getLightAtt(Att.GRP, 0) + ")";
|
---|
2527 | }
|
---|
2528 | switch ((Col) getLightAtt(Att.COL, 0)) {
|
---|
2529 | case WHITE:
|
---|
2530 | c += ".W";
|
---|
2531 | break;
|
---|
2532 | case YELLOW:
|
---|
2533 | c += ".Y";
|
---|
2534 | break;
|
---|
2535 | case RED:
|
---|
2536 | c += ".R";
|
---|
2537 | break;
|
---|
2538 | case GREEN:
|
---|
2539 | c += ".G";
|
---|
2540 | break;
|
---|
2541 | case AMBER:
|
---|
2542 | c += ".Am";
|
---|
2543 | break;
|
---|
2544 | case ORANGE:
|
---|
2545 | c += ".Or";
|
---|
2546 | break;
|
---|
2547 | case BLUE:
|
---|
2548 | c += ".Bu";
|
---|
2549 | break;
|
---|
2550 | case VIOLET:
|
---|
2551 | c += ".Vi";
|
---|
2552 | break;
|
---|
2553 | }
|
---|
2554 | switch ((Col) getLightAtt(Att.ALT, 0)) {
|
---|
2555 | case WHITE:
|
---|
2556 | c += "W";
|
---|
2557 | break;
|
---|
2558 | case YELLOW:
|
---|
2559 | c += "Y";
|
---|
2560 | break;
|
---|
2561 | case RED:
|
---|
2562 | c += "R";
|
---|
2563 | break;
|
---|
2564 | case GREEN:
|
---|
2565 | c += "G";
|
---|
2566 | break;
|
---|
2567 | case AMBER:
|
---|
2568 | c += "Am";
|
---|
2569 | break;
|
---|
2570 | case ORANGE:
|
---|
2571 | c += "Or";
|
---|
2572 | break;
|
---|
2573 | case BLUE:
|
---|
2574 | c += "Bu";
|
---|
2575 | break;
|
---|
2576 | case VIOLET:
|
---|
2577 | c += "Vi";
|
---|
2578 | break;
|
---|
2579 | }
|
---|
2580 | tmp = (String) getLightAtt(Att.MLT, 0);
|
---|
2581 | if (!tmp.isEmpty()) {
|
---|
2582 | c = tmp + c;
|
---|
2583 | }
|
---|
2584 | if (getLightAtt(Att.LIT, 0) != Lit.UNKLIT) {
|
---|
2585 | switch ((Lit) getLightAtt(Att.LIT, 0)) {
|
---|
2586 | case VERT:
|
---|
2587 | c += "(Vert)";
|
---|
2588 | break;
|
---|
2589 | case HORIZ:
|
---|
2590 | c += "(Horiz)";
|
---|
2591 | break;
|
---|
2592 | }
|
---|
2593 | }
|
---|
2594 | tmp = (String) getLightAtt(Att.PER, 0);
|
---|
2595 | if (!tmp.isEmpty()) {
|
---|
2596 | c += " " + tmp + "s";
|
---|
2597 | }
|
---|
2598 | g2.drawString(c, 100, 70);
|
---|
2599 | }
|
---|
2600 |
|
---|
2601 | if (getFogSound() != Fog.NOFOG) {
|
---|
2602 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Fog_Signal.png")).getImage(), 7, -15, null);
|
---|
2603 | String str = "";
|
---|
2604 | if (getFogSound() != Fog.FOGSIG) {
|
---|
2605 | switch (getFogSound()) {
|
---|
2606 | case HORN:
|
---|
2607 | str = "Horn";
|
---|
2608 | break;
|
---|
2609 | case SIREN:
|
---|
2610 | str = "Siren";
|
---|
2611 | break;
|
---|
2612 | case DIA:
|
---|
2613 | str = "Dia";
|
---|
2614 | break;
|
---|
2615 | case BELL:
|
---|
2616 | str = "Bell";
|
---|
2617 | break;
|
---|
2618 | case WHIS:
|
---|
2619 | str = "Whis";
|
---|
2620 | break;
|
---|
2621 | case GONG:
|
---|
2622 | str = "Gong";
|
---|
2623 | break;
|
---|
2624 | case EXPLOS:
|
---|
2625 | str = "Explos";
|
---|
2626 | break;
|
---|
2627 | }
|
---|
2628 | }
|
---|
2629 | if (!getFogGroup().isEmpty()) {
|
---|
2630 | str += ("(" + getFogGroup() + ")");
|
---|
2631 | } else {
|
---|
2632 | str += " ";
|
---|
2633 | }
|
---|
2634 | if (!getFogPeriod().isEmpty()) {
|
---|
2635 | str += getFogPeriod() + "s";
|
---|
2636 | }
|
---|
2637 | g2.drawString(str, 0, 70);
|
---|
2638 | }
|
---|
2639 |
|
---|
2640 | if (RaType != Rtb.NORTB) {
|
---|
2641 | if (getRadar() == Rtb.REFLECTOR) {
|
---|
2642 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png")).getImage(), 7, -15, null);
|
---|
2643 | } else {
|
---|
2644 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Station.png")).getImage(), 7, -15, null);
|
---|
2645 | String str = "";
|
---|
2646 | if (getRadar() == Rtb.RAMARK) {
|
---|
2647 | str += "Ramark";
|
---|
2648 | } else {
|
---|
2649 | str += "Racon";
|
---|
2650 | }
|
---|
2651 | if (!getRaconGroup().isEmpty()) {
|
---|
2652 | str += ("(" + getRaconGroup() + ")");
|
---|
2653 | } else {
|
---|
2654 | str += " ";
|
---|
2655 | }
|
---|
2656 | if (!getRaconPeriod().isEmpty()) {
|
---|
2657 | str += getRaconPeriod() + "s";
|
---|
2658 | }
|
---|
2659 | g2.drawString(str, 0, 50);
|
---|
2660 | }
|
---|
2661 | }
|
---|
2662 |
|
---|
2663 | if (RoType != Cat.NOROS) {
|
---|
2664 | g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Station.png")).getImage(), 7, -15, null);
|
---|
2665 | g2.drawString("AIS", 0, 30);
|
---|
2666 | }
|
---|
2667 | }
|
---|
2668 |
|
---|
2669 | public void saveSign(OsmPrimitive node) {
|
---|
2670 |
|
---|
2671 | if (getObject() != Obj.UNKOBJ) {
|
---|
2672 |
|
---|
2673 | Main.pref.put("smedplugin.IALA", getRegion() == Reg.C ? "C" : (getRegion() == Reg.B ? "B" : "A"));
|
---|
2674 |
|
---|
2675 | for (String str : node.getKeys().keySet()) {
|
---|
2676 | if (str.trim().matches("^seamark:\\S+")) {
|
---|
2677 | Main.main.undoRedo.add(new ChangePropertyCommand(node, str, null));
|
---|
2678 | }
|
---|
2679 | }
|
---|
2680 |
|
---|
2681 | if (!getName().isEmpty()) {
|
---|
2682 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:name", getName()));
|
---|
2683 | }
|
---|
2684 |
|
---|
2685 | String objStr = ObjSTR.get(object);
|
---|
2686 | if (objStr != null) {
|
---|
2687 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:type", objStr));
|
---|
2688 |
|
---|
2689 | if (getShape() != Shp.FLOAT) {
|
---|
2690 | String str = CatSTR.get(getCategory());
|
---|
2691 | if (str != null) {
|
---|
2692 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":category", str));
|
---|
2693 | }
|
---|
2694 | if ((getShape() != Shp.BUOY) && (getShape() != Shp.BEACON)) {
|
---|
2695 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":shape", ShpSTR.get(getShape())));
|
---|
2696 | }
|
---|
2697 | }
|
---|
2698 |
|
---|
2699 | if ((getObjColour(0) != Col.UNKCOL) && getShape() != Shp.PERCH) {
|
---|
2700 | String str = ColSTR.get(getObjColour(0));
|
---|
2701 | for (int i = 1; bodyColour.size() > i; i++) {
|
---|
2702 | str += (";" + ColSTR.get(getObjColour(i)));
|
---|
2703 | }
|
---|
2704 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour", str));
|
---|
2705 | }
|
---|
2706 |
|
---|
2707 | if (getObjPattern() != Pat.NOPAT) {
|
---|
2708 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern",
|
---|
2709 | PatSTR.get(getObjPattern())));
|
---|
2710 | }
|
---|
2711 |
|
---|
2712 | if (getFunc() != Fnc.UNKFNC) {
|
---|
2713 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":function", FncSTR.get(getFunc())));
|
---|
2714 | }
|
---|
2715 |
|
---|
2716 | if ((GrpMAP.get(object) == Grp.LAT) && (getShape() != Shp.PERCH)
|
---|
2717 | || (getObject() == Obj.FLTLAT)) {
|
---|
2718 | switch (region) {
|
---|
2719 | case A:
|
---|
2720 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-a"));
|
---|
2721 | break;
|
---|
2722 | case B:
|
---|
2723 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-b"));
|
---|
2724 | break;
|
---|
2725 | case C:
|
---|
2726 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "other"));
|
---|
2727 | break;
|
---|
2728 | }
|
---|
2729 | }
|
---|
2730 | if (!getObjectHeight().isEmpty()) {
|
---|
2731 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":height", getObjectHeight()));
|
---|
2732 | }
|
---|
2733 | if (!getElevation().isEmpty()) {
|
---|
2734 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":elevation", getElevation()));
|
---|
2735 | }
|
---|
2736 | if (!getChannel().isEmpty()) {
|
---|
2737 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":channel", getChannel()));
|
---|
2738 | }
|
---|
2739 | }
|
---|
2740 | if (getTopmark() != Top.NOTOP) {
|
---|
2741 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:shape", TopSTR.get(getTopmark())));
|
---|
2742 | if (getTopPattern() != Pat.NOPAT) {
|
---|
2743 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour_pattern", PatSTR.get(getTopPattern())));
|
---|
2744 | }
|
---|
2745 | if (getTopColour(0) != Col.UNKCOL) {
|
---|
2746 | String str = ColSTR.get(getTopColour(0));
|
---|
2747 | for (int i = 1; topmarkColour.size() > i; i++) {
|
---|
2748 | str += (";" + ColSTR.get(getTopColour(i)));
|
---|
2749 | }
|
---|
2750 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour", str));
|
---|
2751 | }
|
---|
2752 | }
|
---|
2753 |
|
---|
2754 | for (int i = (sectors.size() > 1 ? 1 : 0); i < sectors.size(); i++) {
|
---|
2755 | String secStr = (i == 0) ? "" : (":" + Integer.toString(i));
|
---|
2756 | if (sectors.get(i)[0] != Col.UNKCOL)
|
---|
2757 | if ((sectors.get(i)[15] != Col.UNKCOL) && ((String) sectors.get(i)[1]).contains("Al")) {
|
---|
2758 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour",
|
---|
2759 | (ColSTR.get(sectors.get(i)[0])) + ";" + ColSTR.get(sectors.get(i)[15])));
|
---|
2760 | } else {
|
---|
2761 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour",
|
---|
2762 | ColSTR.get(sectors.get(i)[0])));
|
---|
2763 | }
|
---|
2764 | if (!((String) sectors.get(i)[1]).isEmpty()) {
|
---|
2765 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":character", (String) sectors.get(i)[1]));
|
---|
2766 | } else if (!((String) sectors.get(0)[1]).isEmpty()) {
|
---|
2767 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":character", (String) sectors.get(0)[1]));
|
---|
2768 | }
|
---|
2769 | if (!((String) sectors.get(i)[2]).isEmpty()) {
|
---|
2770 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":group", (String) sectors.get(i)[2]));
|
---|
2771 | } else if (!((String) sectors.get(0)[2]).isEmpty()) {
|
---|
2772 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":group", (String) sectors.get(0)[2]));
|
---|
2773 | }
|
---|
2774 | if (!((String) sectors.get(i)[3]).isEmpty()) {
|
---|
2775 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sequence", (String) sectors.get(i)[3]));
|
---|
2776 | } else if (!((String) sectors.get(0)[3]).isEmpty()) {
|
---|
2777 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sequence", (String) sectors.get(0)[3]));
|
---|
2778 | }
|
---|
2779 | if (!((String) sectors.get(i)[4]).isEmpty()) {
|
---|
2780 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(i)[4]));
|
---|
2781 | } else if (!((String) sectors.get(0)[4]).isEmpty()) {
|
---|
2782 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(0)[4]));
|
---|
2783 | }
|
---|
2784 | if (sectors.get(i)[5] != Lit.UNKLIT) {
|
---|
2785 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category",
|
---|
2786 | LitSTR.get(sectors.get(i)[5])));
|
---|
2787 | } else if (sectors.get(0)[5] != Lit.UNKLIT) {
|
---|
2788 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category",
|
---|
2789 | LitSTR.get(sectors.get(0)[5])));
|
---|
2790 | }
|
---|
2791 | if (!((String) sectors.get(i)[6]).isEmpty()) {
|
---|
2792 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_start",
|
---|
2793 | (String) sectors.get(i)[6]));
|
---|
2794 | }
|
---|
2795 | if (!((String) sectors.get(i)[7]).isEmpty()) {
|
---|
2796 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_end",
|
---|
2797 | (String) sectors.get(i)[7]));
|
---|
2798 | }
|
---|
2799 | if (!((String) sectors.get(i)[8]).isEmpty()) {
|
---|
2800 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":radius", (String) sectors.get(i)[8]));
|
---|
2801 | } else if (!((String) sectors.get(0)[8]).isEmpty()) {
|
---|
2802 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":radius", (String) sectors.get(0)[8]));
|
---|
2803 | }
|
---|
2804 | if (!((String) sectors.get(i)[9]).isEmpty()) {
|
---|
2805 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":height", (String) sectors.get(i)[9]));
|
---|
2806 | } else if (!((String) sectors.get(0)[9]).isEmpty()) {
|
---|
2807 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":height", (String) sectors.get(0)[9]));
|
---|
2808 | }
|
---|
2809 | if (!((String) sectors.get(i)[10]).isEmpty()) {
|
---|
2810 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(i)[10]));
|
---|
2811 | } else if (!((String) sectors.get(0)[10]).isEmpty()) {
|
---|
2812 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(0)[10]));
|
---|
2813 | }
|
---|
2814 | if (sectors.get(i)[11] != Vis.UNKVIS) {
|
---|
2815 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility",
|
---|
2816 | VisSTR.get(sectors.get(i)[11])));
|
---|
2817 | } else if (sectors.get(0)[11] != Vis.UNKVIS) {
|
---|
2818 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility",
|
---|
2819 | VisSTR.get(sectors.get(0)[11])));
|
---|
2820 | }
|
---|
2821 | if (sectors.get(i)[12] != Exh.UNKEXH) {
|
---|
2822 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition",
|
---|
2823 | ExhSTR.get(sectors.get(i)[12])));
|
---|
2824 | } else if (sectors.get(0)[12] != Exh.UNKEXH) {
|
---|
2825 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition",
|
---|
2826 | ExhSTR.get(sectors.get(0)[12])));
|
---|
2827 | }
|
---|
2828 | if (!((String) sectors.get(i)[13]).isEmpty()) {
|
---|
2829 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":orientation",
|
---|
2830 | (String) sectors.get(i)[13]));
|
---|
2831 | }
|
---|
2832 | if (!((String) sectors.get(i)[14]).isEmpty()) {
|
---|
2833 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String) sectors.get(i)[14]));
|
---|
2834 | } else if (!((String) sectors.get(0)[14]).isEmpty()) {
|
---|
2835 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String) sectors.get(0)[14]));
|
---|
2836 | }
|
---|
2837 | }
|
---|
2838 |
|
---|
2839 | if (getFogSound() != Fog.NOFOG) {
|
---|
2840 | if (getFogSound() == Fog.FOGSIG) {
|
---|
2841 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal", "yes"));
|
---|
2842 | } else {
|
---|
2843 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:category", FogSTR.get(getFogSound())));
|
---|
2844 | }
|
---|
2845 | if (!getFogGroup().isEmpty()) {
|
---|
2846 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:group", getFogGroup()));
|
---|
2847 | }
|
---|
2848 | if (!getFogPeriod().isEmpty()) {
|
---|
2849 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:period", getFogPeriod()));
|
---|
2850 | }
|
---|
2851 | if (!getFogSequence().isEmpty()) {
|
---|
2852 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:sequence", getFogSequence()));
|
---|
2853 | }
|
---|
2854 | if (!getFogRange().isEmpty()) {
|
---|
2855 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:range", getFogRange()));
|
---|
2856 | }
|
---|
2857 | }
|
---|
2858 |
|
---|
2859 | if (RoType != Cat.NOROS) {
|
---|
2860 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radio_station:category", CatSTR.get(getRadio())));
|
---|
2861 | }
|
---|
2862 |
|
---|
2863 | if (RaType != Rtb.NORTB) {
|
---|
2864 | if (getRadar() == Rtb.REFLECTOR) {
|
---|
2865 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_reflector", "yes"));
|
---|
2866 | } else {
|
---|
2867 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:category", RtbSTR.get(getRadar())));
|
---|
2868 | if (!getRaconGroup().isEmpty()) {
|
---|
2869 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:group", getRaconGroup()));
|
---|
2870 | }
|
---|
2871 | if (!getRaconPeriod().isEmpty()) {
|
---|
2872 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:period", getRaconPeriod()));
|
---|
2873 | }
|
---|
2874 | if (!getRaconSequence().isEmpty()) {
|
---|
2875 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sequence", getRaconSequence()));
|
---|
2876 | }
|
---|
2877 | if (!getRaconRange().isEmpty()) {
|
---|
2878 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:range", getRaconRange()));
|
---|
2879 | }
|
---|
2880 | if ((!getRaconSector1().isEmpty()) && (!getRaconSector2().isEmpty())) {
|
---|
2881 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_start", getRaconSector1()));
|
---|
2882 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_end", getRaconSector2()));
|
---|
2883 | }
|
---|
2884 | }
|
---|
2885 | }
|
---|
2886 |
|
---|
2887 | if (!getInfo().isEmpty()) {
|
---|
2888 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:information", getInfo()));
|
---|
2889 | }
|
---|
2890 | if (!getSource().isEmpty()) {
|
---|
2891 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:source", getSource()));
|
---|
2892 | }
|
---|
2893 | if (getStatus() != Sts.UNKSTS) {
|
---|
2894 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:status", StsSTR.get(getStatus())));
|
---|
2895 | }
|
---|
2896 | if (getConstr() != Cns.UNKCNS) {
|
---|
2897 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:construction", CnsSTR.get(getConstr())));
|
---|
2898 | }
|
---|
2899 | if (getConsp() != Con.UNKCON) {
|
---|
2900 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:conspicuity", ConSTR.get(getConsp())));
|
---|
2901 | }
|
---|
2902 | if (getRefl() != Con.UNKCON) {
|
---|
2903 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reflectivity", ConSTR.get(getRefl())));
|
---|
2904 | }
|
---|
2905 | if (!getRef().isEmpty()) {
|
---|
2906 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reference", getRef()));
|
---|
2907 | }
|
---|
2908 | if (!getLightRef().isEmpty()) {
|
---|
2909 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:reference", getLightRef()));
|
---|
2910 | }
|
---|
2911 | if (!getFixme().isEmpty()) {
|
---|
2912 | Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fixme", getFixme()));
|
---|
2913 | }
|
---|
2914 | }
|
---|
2915 | }
|
---|
2916 |
|
---|
2917 | }
|
---|