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