Ignore:
Timestamp:
2011-12-14T02:56:38+01:00 (13 years ago)
Author:
malcolmh
Message:

save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r27223 r27230  
    6161
    6262        public enum Obj {
    63                 UNKNOWN, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP,
     63                UNKOBJ, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP,
    6464                BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP,
    6565                FLTCAR, FLTISD, FLTLAT, FLTSAW, FLTSPP,
     
    9696        }
    9797
    98         private Obj object = Obj.UNKNOWN;
     98        private Obj object = Obj.UNKOBJ;
    9999
    100100        public Obj getObject() {
     
    104104        public void setObject(Obj obj) {
    105105                object = obj;
    106                 if (obj == Obj.UNKNOWN) {
    107                         setCategory(Cat.NONE);
    108                         setShape(Shp.UNKNOWN);
    109                         setColour(Ent.BODY, Col.UNKNOWN);
    110                         setPattern(Ent.BODY, Pat.NONE);
    111                         setTopmark(Top.NONE);
    112                         setColour(Ent.TOPMARK, Col.UNKNOWN);
    113                         setPattern(Ent.TOPMARK, Pat.NONE);
    114                         setFogSound(Fog.NONE);
    115                         setRadar(Rtb.NONE);
    116                         setStatus(Sts.UNKNOWN);
    117                         setConstr(Cns.UNKNOWN);
    118                         setConsp(Con.UNKNOWN);
    119                         setRefl(Con.UNKNOWN);
     106                if (obj == Obj.UNKOBJ) {
     107                        setCategory(Cat.NOCAT);
     108                        setShape(Shp.UNKSHP);
     109                        setColour(Ent.BODY, Col.UNKCOL);
     110                        setPattern(Ent.BODY, Pat.NOPAT);
     111                        setTopmark(Top.NOTOP);
     112                        setColour(Ent.TOPMARK, Col.UNKCOL);
     113                        setPattern(Ent.TOPMARK, Pat.NOPAT);
     114                        setFogSound(Fog.NOFOG);
     115                        setRadar(Rtb.NORTB);
     116                        setStatus(Sts.UNKSTS);
     117                        setConstr(Cns.UNKCNS);
     118                        setConsp(Con.UNKCON);
     119                        setRefl(Con.UNKCON);
    120120                        setRef("");
    121121                        setObjectHeight("");
     
    129129
    130130        public enum Ent {
    131                 BODY, BUOY, BEACON, FLOAT, TOPMARK, LIGHT, MOORING, STATION
     131                BODY, BUOY, BEACON, LFLOAT, TOPMARK, LIGHT, MOORING, STATION
    132132        }
    133133
     
    146146                EntMAP.put(Obj.LITMAJ, Ent.LIGHT);
    147147                EntMAP.put(Obj.LITMIN, Ent.LIGHT);
    148                 EntMAP.put(Obj.LITFLT, Ent.FLOAT);
    149                 EntMAP.put(Obj.FLTCAR, Ent.FLOAT);
    150                 EntMAP.put(Obj.FLTLAT, Ent.FLOAT);
    151                 EntMAP.put(Obj.FLTSAW, Ent.FLOAT);
    152                 EntMAP.put(Obj.FLTISD, Ent.FLOAT);
    153                 EntMAP.put(Obj.FLTSPP, Ent.FLOAT);
    154                 EntMAP.put(Obj.LITVES, Ent.FLOAT);
     148                EntMAP.put(Obj.LITFLT, Ent.LFLOAT);
     149                EntMAP.put(Obj.FLTCAR, Ent.LFLOAT);
     150                EntMAP.put(Obj.FLTLAT, Ent.LFLOAT);
     151                EntMAP.put(Obj.FLTSAW, Ent.LFLOAT);
     152                EntMAP.put(Obj.FLTISD, Ent.LFLOAT);
     153                EntMAP.put(Obj.FLTSPP, Ent.LFLOAT);
     154                EntMAP.put(Obj.LITVES, Ent.LFLOAT);
    155155                EntMAP.put(Obj.LITHSE, Ent.LIGHT);
    156156                EntMAP.put(Obj.LNDMRK, Ent.LIGHT);
     
    161161
    162162        public enum Grp {
    163                 NUL, LAT, CAR, SAW, ISD, SPP, LIT, SIS
     163                NUL, LAT, CAR, SAW, ISD, SPP, LGT, SIS
    164164        }
    165165
    166166        public static final EnumMap<Obj, Grp> GrpMAP = new EnumMap<Obj, Grp>(Obj.class);
    167167        static {
    168                 GrpMAP.put(Obj.UNKNOWN, Grp.NUL);
     168                GrpMAP.put(Obj.UNKOBJ, Grp.NUL);
    169169                GrpMAP.put(Obj.BCNCAR, Grp.CAR);
    170170                GrpMAP.put(Obj.BCNISD, Grp.ISD);
     
    182182                GrpMAP.put(Obj.FLTISD, Grp.ISD);
    183183                GrpMAP.put(Obj.FLTSPP, Grp.SPP);
    184                 GrpMAP.put(Obj.LITFLT, Grp.LIT);
    185                 GrpMAP.put(Obj.LITMAJ, Grp.LIT);
    186                 GrpMAP.put(Obj.LITMIN, Grp.LIT);
    187                 GrpMAP.put(Obj.LITVES, Grp.LIT);
    188                 GrpMAP.put(Obj.LITHSE, Grp.LIT);
    189                 GrpMAP.put(Obj.LNDMRK, Grp.LIT);
     184                GrpMAP.put(Obj.LITFLT, Grp.LGT);
     185                GrpMAP.put(Obj.LITMAJ, Grp.LGT);
     186                GrpMAP.put(Obj.LITMIN, Grp.LGT);
     187                GrpMAP.put(Obj.LITVES, Grp.LGT);
     188                GrpMAP.put(Obj.LITHSE, Grp.LGT);
     189                GrpMAP.put(Obj.LNDMRK, Grp.LGT);
    190190                GrpMAP.put(Obj.MORFAC, Grp.SPP);
    191191                GrpMAP.put(Obj.SISTAW, Grp.SIS);
     
    194194
    195195        public enum Cat {
    196                 NONE, LAM_PORT, LAM_STBD, LAM_PPORT, LAM_PSTBD, CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST,
     196                NOCAT, LAM_PORT, LAM_STBD, LAM_PPORT, LAM_PSTBD, CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST,
    197197                ACH_URST, ACH_DEEP, ACH_TANK, ACH_EXPL, ACH_QUAR, ACH_SPLN, ACH_SCAN, ACH_SCMO, ACH_T24H, ACH_TLIM,
    198198                SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN, SPM_MOOR, SPM_LNBY,
     
    287287        }
    288288
    289         private Cat category = Cat.NONE;
     289        private Cat category = Cat.NOCAT;
    290290
    291291        public Cat getCategory() {
     
    299299
    300300        public enum Shp {
    301                 UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER, BUOYANT, CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON
     301                UNKSHP, PILLAR, SPAR, CAN, CONI, SPHERI, BARREL, FLOAT, SUPER, BUOYANT, CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON
    302302        }
    303303
     
    307307                ShpSTR.put(Shp.SPAR, "spar");
    308308                ShpSTR.put(Shp.CAN, "can");
    309                 ShpSTR.put(Shp.CONE, "conical");
    310                 ShpSTR.put(Shp.SPHERE, "spherical");
     309                ShpSTR.put(Shp.CONI, "conical");
     310                ShpSTR.put(Shp.SPHERI, "spherical");
    311311                ShpSTR.put(Shp.BARREL, "barrel");
    312312                ShpSTR.put(Shp.FLOAT, "float");
     
    321321        }
    322322
    323         private Shp shape = Shp.UNKNOWN;
     323        private Shp shape = Shp.UNKSHP;
    324324
    325325        public Shp getShape() {
     
    333333
    334334        public enum Col {
    335                 UNKNOWN, BLANK, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, GREY, BROWN, MAGENTA, PINK
     335                UNKCOL, BLANK, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, GREY, BROWN, MAGENTA, PINK
    336336        }
    337337
    338338        public static final EnumMap<Col, Color> ColMAP = new EnumMap<Col, Color>(Col.class);
    339339        static {
    340                 ColMAP.put(Col.UNKNOWN, new Color(0xc0c0c0));
     340                ColMAP.put(Col.UNKCOL, new Color(0xc0c0c0));
    341341                ColMAP.put(Col.WHITE, Color.WHITE);
    342342                ColMAP.put(Col.RED, Color.RED);
     
    412412                        return bodyColour.get(i);
    413413                else
    414                         return Col.UNKNOWN;
     414                        return Col.UNKCOL;
    415415        }
    416416
     
    430430                if (bodyColour.size() >= i)
    431431                        bodyColour.add(i, col);
     432                repaint();
    432433        }
    433434
    434435        public void addObjColour(Col col) {
    435436                bodyColour.add(col);
     437                repaint();
    436438        }
    437439
     
    439441                if (bodyColour.size() > i)
    440442                        bodyColour.remove(i);
     443                repaint();
    441444        }
    442445
     
    447450                        return topmarkColour.get(i);
    448451                else
    449                         return Col.UNKNOWN;
     452                        return Col.UNKCOL;
    450453        }
    451454
     
    465468                if (topmarkColour.size() >= i)
    466469                        topmarkColour.add(i, col);
     470                repaint();
    467471        }
    468472
    469473        public void addTopColour(Col col) {
    470474                topmarkColour.add(col);
     475                repaint();
    471476        }
    472477
     
    474479                if (topmarkColour.size() > i)
    475480                        topmarkColour.remove(i);
     481                repaint();
    476482        }
    477483
    478484        public enum Chr {
    479                 UNKNOWN, FIXED, FLASH, LFLASH, QUICK, VQUICK, UQUICK, ISOPHASED, OCCULTING, MORSE, ALTERNATING, IQUICK, IVQUICK, IUQUICK
     485                UNKCHR, FIXED, FLASH, LFLASH, QUICK, VQUICK, UQUICK, ISOPHASED, OCCULTING, MORSE, ALTERNATING, IQUICK, IVQUICK, IUQUICK
    480486        }
    481487
    482488        public static final Map<EnumSet<Chr>, String> ChrMAP = new HashMap<EnumSet<Chr>, String>();
    483489        static {
    484                 ChrMAP.put(EnumSet.of(Chr.UNKNOWN), "");
    485490                ChrMAP.put(EnumSet.of(Chr.FIXED), "F");
    486491                ChrMAP.put(EnumSet.of(Chr.FLASH), "Fl");
     
    512517
    513518        public enum Vis {
    514                 UNKNOWN, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS
     519                UNKVIS, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS
    515520        }
    516521
    517522        public static final EnumMap<Vis, String> VisSTR = new EnumMap<Vis, String>(Vis.class);
    518523        static {
    519                 VisSTR.put(Vis.UNKNOWN, "");
    520524                VisSTR.put(Vis.HIGH, "high");
    521525                VisSTR.put(Vis.LOW, "low");
     
    529533
    530534        public enum Lit {
    531                 UNKNOWN, VERT, HORIZ, DIR, UPPER, LOWER, LEAD, REAR, FRONT, AERO, AIROBS, FOGDET, FLOOD, STRIP, SUBS, SPOT, MOIRE, EMERG, BEAR
     535                UNKLIT, VERT, HORIZ, DIR, UPPER, LOWER, LEAD, REAR, FRONT, AERO, AIROBS, FOGDET, FLOOD, STRIP, SUBS, SPOT, MOIRE, EMERG, BEAR
    532536        }
    533537
    534538        public static final EnumMap<Lit, String> LitSTR = new EnumMap<Lit, String>(Lit.class);
    535539        static {
    536                 LitSTR.put(Lit.UNKNOWN, "");
    537540                LitSTR.put(Lit.VERT, "vertical");
    538541                LitSTR.put(Lit.HORIZ, "horizontal");
     
    556559
    557560        public enum Exh {
    558                 UNKNOWN, H24, DAY, NIGHT, FOG, WARN, STORM
     561                UNKEXH, H24, DAY, NIGHT, FOG, WARN, STORM
    559562        }
    560563
    561564        public static final EnumMap<Exh, String> ExhSTR = new EnumMap<Exh, String>(Exh.class);
    562565        static {
    563                 ExhSTR.put(Exh.UNKNOWN, "");
    564566                ExhSTR.put(Exh.H24, "24h");
    565567                ExhSTR.put(Exh.DAY, "day");
     
    574576        }
    575577
    576         public Object[] sector = { Col.UNKNOWN, "", "", "", "", Lit.UNKNOWN, "", "",
    577                         "", "", "", Vis.UNKNOWN, Exh.UNKNOWN, "", "", Col.UNKNOWN };
     578        public Object[] sector = { Col.UNKCOL, "", "", "", "", Lit.UNKLIT, "", "",
     579                        "", "", "", Vis.UNKVIS, Exh.UNKEXH, "", "", Col.UNKCOL };
    578580
    579581        private ArrayList<Object[]> sectors = new ArrayList<Object[]>();
     
    608610                        switch (att) {
    609611                        case 4:
    610                         case 8:
    611612                        case 9:
    612613                        case 10:
     
    653654
    654655        public enum Pat {
    655                 NONE, HORIZ, VERT, DIAG, SQUARE, BORDER
     656                NOPAT, HORIZ, VERT, DIAG, SQUARE, BORDER, CROSS
    656657        }
    657658
     
    663664                PatSTR.put(Pat.SQUARE, "squared");
    664665                PatSTR.put(Pat.BORDER, "border");
     666                PatSTR.put(Pat.CROSS, "cross");
    665667        }
    666668
     
    679681        }
    680682
    681         private Pat bodyPattern = Pat.NONE;
     683        private Pat bodyPattern = Pat.NOPAT;
    682684
    683685        public Pat getObjPattern() {
     
    689691        }
    690692
    691         private Pat topPattern = Pat.NONE;
     693        private Pat topPattern = Pat.NOPAT;
    692694
    693695        public Pat getTopPattern() {
     
    700702
    701703        public enum Top {
    702                 NONE, CAN, CONE, SPHERE, X_SHAPE, NORTH, SOUTH, EAST, WEST, SPHERES2, BOARD, DIAMOND, CIRCLE, TRIANGLE, TRIANGLE_INV, SQUARE
     704                NOTOP, CAN, CONE, SPHERE, X_SHAPE, NORTH, SOUTH, EAST, WEST, SPHERES2, BOARD, DIAMOND, CIRCLE, TRIANGLE, TRIANGLE_INV, SQUARE
    703705        }
    704706
     
    722724        }
    723725
    724         private Top topShape = Top.NONE;
     726        private Top topShape = Top.NOTOP;
    725727
    726728        public Top getTopmark() {
     
    734736
    735737        public enum Rtb {
    736                 NONE, REFLECTOR, RACON, RAMARK, LEADING
     738                NORTB, REFLECTOR, RACON, RAMARK, LEADING
    737739        }
    738740
     
    744746        }
    745747
    746         private Rtb RaType = Rtb.NONE;
     748        private Rtb RaType = Rtb.NORTB;
    747749
    748750        public Rtb getRadar() {
     
    752754        public void setRadar(Rtb type) {
    753755                RaType = type;
    754                 if (type == Rtb.NONE) {
     756                if (type == Rtb.NORTB) {
    755757                        setRaconGroup("");
    756758                        setRaconSequence("");
     
    830832
    831833        public enum Fog {
    832                 NONE, UNKNOWN, HORN, SIREN, DIA, BELL, WHIS, GONG, EXPLOS
     834                NOFOG, FOGSIG, HORN, SIREN, DIA, BELL, WHIS, GONG, EXPLOS
    833835        }
    834836
    835837        public static final EnumMap<Fog, String> FogSTR = new EnumMap<Fog, String>(Fog.class);
    836838        static {
    837                 FogSTR.put(Fog.UNKNOWN, "yes");
     839                FogSTR.put(Fog.FOGSIG, "yes");
    838840                FogSTR.put(Fog.HORN, "horn");
    839841                FogSTR.put(Fog.SIREN, "siren");
     
    845847        }
    846848
    847         private Fog fogSound = Fog.NONE;
     849        private Fog fogSound = Fog.NOFOG;
    848850
    849851        public Fog getFogSound() {
     
    853855        public void setFogSound(Fog sound) {
    854856                fogSound = sound;
    855                 if (sound == Fog.NONE) {
     857                if (sound == Fog.NOFOG) {
    856858                        setFogGroup("");
    857859                        setFogSequence("");
     
    907909
    908910        public enum Sts {
    909                 UNKNOWN, PERM, OCC, REC, NIU, INT, RESV, TEMP, PRIV, MAND, DEST, EXT, ILLUM, HIST, PUB, SYNC, WATCH, UNWAT, DOUBT
     911                UNKSTS, PERM, OCC, REC, NIU, INT, RESV, TEMP, PRIV, MAND, DEST, EXT, ILLUM, HIST, PUB, SYNC, WATCH, UNWAT, DOUBT
    910912        }
    911913
     
    932934        }
    933935
    934         private Sts status = Sts.UNKNOWN;
     936        private Sts status = Sts.UNKSTS;
    935937
    936938        public Sts getStatus() {
     
    943945
    944946        public enum Cns {
    945                 UNKNOWN, BRICK, CONC, BOULD, HSURF, USURF, WOOD, METAL, GRP, PAINT
     947                UNKCNS, BRICK, CONC, BOULD, HSURF, USURF, WOOD, METAL, GRP, PAINT
    946948        }
    947949
     
    959961        }
    960962
    961         private Cns construction = Cns.UNKNOWN;
     963        private Cns construction = Cns.UNKCNS;
    962964
    963965        public Cns getConstr() {
     
    970972
    971973        public enum Con {
    972                 UNKNOWN, CONSP, NCONS, REFL
     974                UNKCON, CONSP, NCONS, REFL
    973975        }
    974976
     
    980982        }
    981983
    982         private Con conspicuity = Con.UNKNOWN;
     984        private Con conspicuity = Con.UNKCON;
    983985
    984986        public Con getConsp() {
     
    990992        }
    991993
    992         private Con reflectivity = Con.UNKNOWN;
     994        private Con reflectivity = Con.UNKCON;
    993995
    994996        public Con getRefl() {
     
    10781080                case BOYCAR:
    10791081                case BOYLAT:
    1080                         if ((getCategory() != Cat.NONE) && (getShape() != Shp.UNKNOWN))
     1082                        if ((getCategory() != Cat.NOCAT) && (getShape() != Shp.UNKSHP))
    10811083                                tmp = true;
    10821084                        break;
     
    10871089                case BOYSAW:
    10881090                case BOYSPP:
    1089                         if (getShape() != Shp.UNKNOWN)
     1091                        if (getShape() != Shp.UNKSHP)
    10901092                                tmp = true;
    10911093                        break;
     
    10951097                case FLTSAW:
    10961098                case FLTSPP:
    1097                         if (getObjColour(0) != Col.UNKNOWN)
     1099                        if (getObjColour(0) != Col.UNKCOL)
    10981100                                tmp = true;
    10991101                        break;
     
    11091111                        break;
    11101112                case LNDMRK:
    1111                         if (getCategory() != Cat.NONE)
     1113                        if (getCategory() != Cat.NOCAT)
    11121114                                tmp = true;
    11131115                        break;
     
    11181120                        Ent ent = EntMAP.get(getObject());
    11191121                        dlg.panelMain.topButton.setEnabled((ent == Ent.BUOY)
    1120                                         || (ent == Ent.BEACON) || (ent == Ent.FLOAT));
     1122                                        || (ent == Ent.BEACON) || (ent == Ent.LFLOAT));
    11211123                        dlg.panelMain.fogButton.setEnabled(true);
    11221124                        dlg.panelMain.radButton.setEnabled(true);
     
    11361138
    11371139        public void clearSign() {
    1138                 setObject(Obj.UNKNOWN);
     1140                setObject(Obj.UNKOBJ);
    11391141                setName("");
    11401142                clrLight();
     
    11811183                        str = keys.get("seamark:type");
    11821184
    1183                 setObject(Obj.UNKNOWN);
     1185                setObject(Obj.UNKOBJ);
    11841186                for (Obj obj : ObjSTR.keySet()) {
    11851187                        if (ObjSTR.get(obj).equals(str)) {
     
    11911193                        dlg.manager.showVisualMessage("No seamark");
    11921194                }
    1193                 if (getObject() == Obj.UNKNOWN) {
     1195                if (getObject() == Obj.UNKOBJ) {
    11941196                        dlg.manager.showVisualMessage("Seamark not recognised");
    11951197                }
     
    12131215                }
    12141216               
    1215                
    12161217                if (keys.containsKey("seamark:longname"))
    12171218                        longName = keys.get("seamark:longname");
     
    12221223                        if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":category")) {
    12231224                                str = keys.get("seamark:" + ObjSTR.get(obj) + ":category");
    1224                                 setCategory(Cat.NONE);
     1225                                setCategory(Cat.NOCAT);
    12251226                                for (Cat cat : CatSTR.keySet()) {
    12261227                                        if (CatSTR.get(cat).equals(str)) {
     
    12341235                        if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":shape")) {
    12351236                                str = keys.get("seamark:" + ObjSTR.get(obj) + ":shape");
    1236                                 setShape(Shp.UNKNOWN);
     1237                                setShape(Shp.UNKSHP);
    12371238                                for (Shp shp : ShpSTR.keySet()) {
    12381239                                        if (ShpSTR.get(shp).equals(str)) {
     
    12421243                        }
    12431244                }
    1244                 if (getShape() == Shp.UNKNOWN) {
     1245                if (getShape() == Shp.UNKSHP) {
    12451246                        if (EntMAP.get(getObject()) == Ent.BUOY)
    12461247                                setShape(Shp.BUOY);
    12471248                        if (EntMAP.get(getObject()) == Ent.BEACON)
    12481249                                setShape(Shp.BEACON);
    1249                         if (EntMAP.get(getObject()) == Ent.FLOAT)
     1250                        if (EntMAP.get(getObject()) == Ent.LFLOAT)
    12501251                                if (getObject() == Obj.LITVES)
    12511252                                        setShape(Shp.SUPER);
     
    12711272                        if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":colour_pattern")) {
    12721273                                str = keys.get("seamark:" + ObjSTR.get(obj) + ":colour_pattern");
    1273                                 setObjPattern(Pat.NONE);
     1274                                setObjPattern(Pat.NOPAT);
    12741275                                for (Pat pat : PatSTR.keySet()) {
    12751276                                        if (PatSTR.get(pat).equals(str)) {
     
    12871288                }
    12881289
    1289                 if ((getObject() == Obj.LNDMRK) && (getCategory() == Cat.NONE)) {
     1290                if ((getObject() == Obj.LNDMRK) && (getCategory() == Cat.NOCAT)) {
    12901291                        setObject(Obj.LITHSE);
    12911292                }
     
    12941295                        switch (getObjColour(0)) {
    12951296                        case RED:
    1296                                 if ((getObjColour(1) == Col.WHITE) && (getObjColour(2) == Col.UNKNOWN)) {
     1297                                if ((getObjColour(1) == Col.WHITE) && (getObjColour(2) == Col.UNKCOL)) {
    12971298                                        setObject(Obj.FLTSAW);
    1298                                         setCategory(Cat.NONE);
    1299                                 } else if (getObjColour(1) == Col.UNKNOWN) {
     1299                                        setCategory(Cat.NOCAT);
     1300                                } else if (getObjColour(1) == Col.UNKCOL) {
    13001301                                        setObject(Obj.FLTLAT);
    13011302                                        if (getRegion() == Reg.B) {
     
    13181319                                } else {
    13191320                                        setObject(Obj.FLTSPP);
    1320                                         setCategory(Cat.NONE);
     1321                                        setCategory(Cat.NOCAT);
    13211322                                }
    13221323                                break;
    13231324                        case GREEN:
    1324                                 if (getObjColour(1) == Col.UNKNOWN) {
     1325                                if (getObjColour(1) == Col.UNKCOL) {
    13251326                                        setObject(Obj.FLTLAT);
    13261327                                        if (getRegion() == Reg.B) {
     
    13431344                                } else {
    13441345                                        setObject(Obj.FLTSPP);
    1345                                         setCategory(Cat.NONE);
     1346                                        setCategory(Cat.NOCAT);
    13461347                                }
    13471348                                break;
     
    13561357                                } else {
    13571358                                        setObject(Obj.FLTSPP);
    1358                                         setCategory(Cat.NONE);
     1359                                        setCategory(Cat.NOCAT);
    13591360                                }
    13601361                                break;
     
    13621363                                if (getObjColour(1) == Col.RED) {
    13631364                                        setObject(Obj.FLTISD);
    1364                                         setCategory(Cat.NONE);
     1365                                        setCategory(Cat.NOCAT);
    13651366                                } else if (getObjColour(1) == Col.YELLOW) {
    13661367                                        setObject(Obj.FLTCAR);
     
    13721373                                } else {
    13731374                                        setObject(Obj.FLTSPP);
    1374                                         setCategory(Cat.NONE);
     1375                                        setCategory(Cat.NOCAT);
    13751376                                }
    13761377                                break;
    13771378                        default:
    1378                                 setCategory(Cat.NONE);
     1379                                setCategory(Cat.NOCAT);
    13791380                        }
    13801381                }
     
    14371438                if (keys.containsKey("seamark:topmark:shape")) {
    14381439                        str = keys.get("seamark:topmark:shape");
    1439                         setTopmark(Top.NONE);
     1440                        setTopmark(Top.NOTOP);
    14401441                        for (Top top : TopSTR.keySet()) {
    14411442                                if (TopSTR.get(top).equals(str)) {
     
    14461447                if (keys.containsKey("seamark:topmark:colour")) {
    14471448                        str = keys.get("seamark:topmark:colour");
    1448                         setTopColour(Col.UNKNOWN);
     1449                        setTopColour(Col.UNKCOL);
    14491450                        for (Col col : ColSTR.keySet()) {
    14501451                                if (ColSTR.get(col).equals(str)) {
     
    14551456                if (keys.containsKey("seamark:topmark:colour_pattern")) {
    14561457                        str = keys.get("seamark:topmark:colour_pattern");
    1457                         setTopPattern(Pat.NONE);
     1458                        setTopPattern(Pat.NOPAT);
    14581459                        for (Pat pat : PatSTR.keySet()) {
    14591460                                if (PatSTR.get(pat).equals(str)) {
     
    15331534
    15341535                if (keys.containsKey("seamark:fog_signal")) {
    1535                         setFogSound(Fog.UNKNOWN);
     1536                        setFogSound(Fog.FOGSIG);
    15361537                }
    15371538                if (keys.containsKey("seamark:fog_signal:category")) {
    15381539                        str = keys.get("seamark:fog_signal:category");
    1539                         setFogSound(Fog.NONE);
     1540                        setFogSound(Fog.NOFOG);
    15401541                        for (Fog fog : FogSTR.keySet()) {
    15411542                                if (FogSTR.get(fog).equals(str)) {
     
    15621563                if (keys.containsKey("seamark:radar_transponder:category")) {
    15631564                        str = keys.get("seamark:radar_transponder:category");
    1564                         setRadar(Rtb.NONE);
     1565                        setRadar(Rtb.NORTB);
    15651566                        for (Rtb rtb : RtbSTR.keySet()) {
    15661567                                if (RtbSTR.get(rtb).equals(str)) {
     
    16021603                if (keys.containsKey("seamark:status")) {
    16031604                        str = keys.get("seamark:status");
    1604                         setStatus(Sts.UNKNOWN);
     1605                        setStatus(Sts.UNKSTS);
    16051606                        for (Sts sts : StsSTR.keySet()) {
    16061607                                if (StsSTR.get(sts).equals(str)) {
     
    16111612                if (keys.containsKey("seamark:construction")) {
    16121613                        str = keys.get("seamark:construction");
    1613                         setConstr(Cns.UNKNOWN);
     1614                        setConstr(Cns.UNKCNS);
    16141615                        for (Cns cns : CnsSTR.keySet()) {
    16151616                                if (CnsSTR.get(cns).equals(str)) {
     
    16201621                if (keys.containsKey("seamark:conspicuity")) {
    16211622                        str = keys.get("seamark:conspicuity");
    1622                         setConsp(Con.UNKNOWN);
     1623                        setConsp(Con.UNKCON);
    16231624                        for (Con con : ConSTR.keySet()) {
    16241625                                if (ConSTR.get(con).equals(str)) {
     
    16291630                if (keys.containsKey("seamark:reflectivity")) {
    16301631                        str = keys.get("seamark:reflectivity");
    1631                         setRefl(Con.UNKNOWN);
     1632                        setRefl(Con.UNKCON);
    16321633                        for (Con con : ConSTR.keySet()) {
    16331634                                if (ConSTR.get(con).equals(str)) {
     
    16661667                String lblStr;
    16671668                String imgStr = "/images/";
    1668                 if (getShape() != Shp.UNKNOWN) {
     1669                if (getShape() != Shp.UNKSHP) {
    16691670                        switch (getShape()) {
    16701671                        case TOWER:
     
    16811682                                imgStr += "Can";
    16821683                                break;
    1683                         case CONE:
     1684                        case CONI:
    16841685                                imgStr += "Cone";
    16851686                                break;
    1686                         case SPHERE:
     1687                        case SPHERI:
    16871688                                imgStr += "Sphere";
    16881689                                break;
     
    17911792                                }
    17921793                        }
    1793                 } else if (getObject() != Obj.UNKNOWN) {
     1794                } else if (getObject() != Obj.UNKOBJ) {
    17941795                        switch (getObject()) {
    17951796                        case LNDMRK:
     
    18591860                }
    18601861
    1861                 if (getTopmark() != Top.NONE) {
     1862                if (getTopmark() != Top.NOTOP) {
    18621863                        imgStr = "/images/Top_";
    18631864                        switch (getTopmark()) {
     
    19241925                        switch (getShape()) {
    19251926                        case CAN:
    1926                         case CONE:
    1927                         case SPHERE:
     1927                        case CONI:
     1928                        case SPHERI:
    19281929                        case BARREL:
    19291930                                imgStr += "_Buoy_Small";
     
    19721973            g2.setStroke(new BasicStroke(6.0f));
    19731974            if (!((String)getLightAtt(Att.BEG, i)).isEmpty() && !((String)getLightAtt(Att.END, i)).isEmpty()) {
    1974                                 if (getLightAtt(Att.COL, i) != Col.UNKNOWN) {
     1975                                if (getLightAtt(Att.COL, i) != Col.UNKCOL) {
    19751976                                        g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i)));
    19761977                                        Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.BEG, i));
     
    19791980                                        g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN));
    19801981                                }
    1981                                 if (getLightAtt(Att.ALT, i) != Col.UNKNOWN) {
     1982                                if (getLightAtt(Att.ALT, i) != Col.UNKCOL) {
    19821983                                        g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i)));
    19831984                                        Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.BEG, i));
     
    19891990                }
    19901991    g2.setPaint(Color.BLACK);
    1991                 if ((getLightAtt(Att.COL, 0) != Col.UNKNOWN) || !(((String)getLightAtt(Att.CHR, 0)).isEmpty())) {
     1992                if ((getLightAtt(Att.COL, 0) != Col.UNKCOL) || !(((String)getLightAtt(Att.CHR, 0)).isEmpty())) {
    19921993                        if (sectors.size() == 1) {
    19931994                                if (((String) getLightAtt(Att.CHR, 0)).contains("Al")) {
     
    20782079                        if (!tmp.isEmpty())
    20792080                                c = tmp + c;
    2080                         if (getLightAtt(Att.LIT, 0) != Lit.UNKNOWN) {
     2081                        if (getLightAtt(Att.LIT, 0) != Lit.UNKLIT) {
    20812082                                switch ((Lit)getLightAtt(Att.LIT, 0)) {
    20822083                                case VERT:
     
    20942095                }
    20952096
    2096                 if (getFogSound() != Fog.NONE) {
     2097                if (getFogSound() != Fog.NOFOG) {
    20972098                        g2.drawImage(new ImageIcon(getClass().getResource("/images/Fog_Signal.png")).getImage(), 7, -15, null);
    20982099                        String str = "";
    2099                         if (getFogSound() != Fog.UNKNOWN)
     2100                        if (getFogSound() != Fog.FOGSIG)
    21002101                                switch (getFogSound()) {
    21012102                                case HORN:
     
    21302131                }
    21312132
    2132                 if (RaType != Rtb.NONE) {
     2133                if (RaType != Rtb.NORTB) {
    21332134                        if (getRadar() == Rtb.REFLECTOR) {
    21342135                                g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png")).getImage(), 7, -15, null);
     
    21532154        public void saveSign(Node node) {
    21542155               
    2155                 if (getObject() != Obj.UNKNOWN) {
     2156                if (getObject() != Obj.UNKOBJ) {
    21562157
    21572158                        Main.pref.put("smedplugin.IALA", getRegion() == Reg.C ? "C" : (getRegion() == Reg.B ? "B" : "A"));
     
    21802181                                }
    21812182
    2182                                 if ((getObjColour(0) != Col.UNKNOWN) && getShape() != Shp.PERCH) {
     2183                                if ((getObjColour(0) != Col.UNKCOL) && getShape() != Shp.PERCH) {
    21832184                                        String str = ColSTR.get(getObjColour(0));
    21842185                                        for (int i = 1; bodyColour.size() > i; i++) {
     
    21882189                                }
    21892190
    2190                                 if (getObjPattern() != Pat.NONE) {
     2191                                if (getObjPattern() != Pat.NOPAT) {
    21912192                                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatSTR.get(getObjPattern())));
    21922193                                }
     
    22132214                                }
    22142215                        }
    2215                         if (getTopmark() != Top.NONE) {
     2216                        if (getTopmark() != Top.NOTOP) {
    22162217                                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:shape", TopSTR.get(getTopmark())));
    2217                                 if (getTopPattern() != Pat.NONE)
     2218                                if (getTopPattern() != Pat.NOPAT)
    22182219                                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour_pattern", PatSTR.get(getTopPattern())));
    2219                                 if (getTopColour(0) != Col.UNKNOWN) {
     2220                                if (getTopColour(0) != Col.UNKCOL) {
    22202221                                        String str = ColSTR.get(getTopColour(0));
    22212222                                        for (int i = 1; topmarkColour.size() > i; i++) {
     
    22282229                        for (int i = 0; i < sectors.size(); i++) {
    22292230                                String secStr = (i == 0) ? "" : (":" + Integer.toString(i));
    2230                                 if (sectors.get(i)[0] != Col.UNKNOWN)
    2231                                         if ((sectors.get(i)[15] != Col.UNKNOWN) && ((String)sectors.get(i)[1]).contains("Al"))
     2231                                if (sectors.get(i)[0] != Col.UNKCOL)
     2232                                        if ((sectors.get(i)[15] != Col.UNKCOL) && ((String)sectors.get(i)[1]).contains("Al"))
    22322233                                                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", (ColSTR.get(sectors.get(i)[0]))
    22332234                                                                + ";" + ColSTR.get(sectors.get(i)[15])));
     
    22422243                                if (!((String) sectors.get(i)[4]).isEmpty())
    22432244                                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(i)[4]));
    2244                                 if (sectors.get(i)[5] != Lit.UNKNOWN)
     2245                                if (sectors.get(i)[5] != Lit.UNKLIT)
    22452246                                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", LitSTR.get(sectors.get(i)[5])));
    22462247                                if (!((String) sectors.get(i)[6]).isEmpty())
     
    22542255                                if (!((String) sectors.get(i)[10]).isEmpty())
    22552256                                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(i)[10]));
    2256                                 if (sectors.get(i)[11] != Vis.UNKNOWN)
     2257                                if (sectors.get(i)[11] != Vis.UNKVIS)
    22572258                                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", VisSTR.get(sectors.get(i)[11])));
    2258                                 if (sectors.get(i)[12] != Exh.UNKNOWN)
     2259                                if (sectors.get(i)[12] != Exh.UNKEXH)
    22592260                                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", ExhSTR.get(sectors.get(i)[12])));
    22602261                                if (!((String) sectors.get(i)[13]).isEmpty())
     
    22642265                        }
    22652266
    2266                         if (getFogSound() != Fog.NONE) {
    2267                                 if (getFogSound() == Fog.UNKNOWN)
     2267                        if (getFogSound() != Fog.NOFOG) {
     2268                                if (getFogSound() == Fog.FOGSIG)
    22682269                                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal", "yes"));
    22692270                                else
     
    22832284                        }
    22842285
    2285                         if (RaType != Rtb.NONE) {
     2286                        if (RaType != Rtb.NORTB) {
    22862287                                if (getRadar() == Rtb.REFLECTOR) {
    22872288                                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_reflector", "yes"));
     
    23132314                                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:source", getSource()));
    23142315                        }
    2315                         if (getStatus() != Sts.UNKNOWN) {
     2316                        if (getStatus() != Sts.UNKSTS) {
    23162317                                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:status", StsSTR.get(getStatus())));
    23172318                        }
    2318                         if (getConstr() != Cns.UNKNOWN) {
     2319                        if (getConstr() != Cns.UNKCNS) {
    23192320                                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:construction", CnsSTR.get(getConstr())));
    23202321                        }
    2321                         if (getConsp() != Con.UNKNOWN) {
     2322                        if (getConsp() != Con.UNKCON) {
    23222323                                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:conspicuity", ConSTR.get(getConsp())));
    23232324                        }
    2324                         if (getRefl() != Con.UNKNOWN) {
     2325                        if (getRefl() != Con.UNKCON) {
    23252326                                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reflectivity", ConSTR.get(getRefl())));
    23262327                        }
Note: See TracChangeset for help on using the changeset viewer.