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