Ignore:
Timestamp:
2011-11-04T13:13:48+01:00 (13 years ago)
Author:
malcolmh
Message:

save

Location:
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChr.java

    r26999 r27005  
    102102                this.add(getChrButton(fixedButton, 0, 16, 44, 16, Messages.getString("FChar"), Chr.FIXED), null);
    103103                this.add(getChrButton(flashButton, 0, 32, 44, 16, Messages.getString("FlChar"), Chr.FLASH), null);
    104                 this.add(getChrButton(longFlashButton, 0, 48, 44, 16, Messages.getString("LFlChar"), Chr.LONGFLASH), null);
     104                this.add(getChrButton(longFlashButton, 0, 48, 44, 16, Messages.getString("LFlChar"), Chr.LFLASH), null);
    105105                this.add(getChrButton(quickButton, 0, 64, 44, 16, Messages.getString("QChar"), Chr.QUICK), null);
    106                 this.add(getChrButton(veryQuickButton, 0, 80, 44, 16, Messages.getString("VQChar"), Chr.VERYQUICK), null);
    107                 this.add(getChrButton(ultraQuickButton, 0, 96, 44, 16, Messages.getString("UQChar"), Chr.ULTRAQUICK), null);
     106                this.add(getChrButton(veryQuickButton, 0, 80, 44, 16, Messages.getString("VQChar"), Chr.VQUICK), null);
     107                this.add(getChrButton(ultraQuickButton, 0, 96, 44, 16, Messages.getString("UQChar"), Chr.UQUICK), null);
    108108                this.add(getChrButton(alternatingButton, 44, 0, 44, 16, Messages.getString("AlChar"), Chr.ALTERNATING), null);
    109109                this.add(getChrButton(isophasedButton, 44, 16, 44, 16, Messages.getString("IsoChar"), Chr.ISOPHASED), null);
    110110                this.add(getChrButton(occultingButton, 44, 32, 44, 16, Messages.getString("OcChar"), Chr.OCCULTING), null);
    111111                this.add(getChrButton(morseButton, 44, 48, 44, 16, Messages.getString("MoChar"), Chr.MORSE), null);
    112                 this.add(getChrButton(interruptedQuickButton, 44, 64, 44, 16, Messages.getString("IQChar"), Chr.INTERRUPTEDQUICK), null);
    113                 this.add(getChrButton(interruptedVeryQuickButton, 44, 80, 44, 16, Messages.getString("IVQChar"), Chr.INTERRUPTEDVERYQUICK),
    114                                 null);
    115                 this.add(getChrButton(interruptedUltraQuickButton, 44, 96, 44, 16, Messages.getString("IUQChar"), Chr.INTERRUPTEDULTRAQUICK),
     112                this.add(getChrButton(interruptedQuickButton, 44, 64, 44, 16, Messages.getString("IQChar"), Chr.IQUICK), null);
     113                this.add(getChrButton(interruptedVeryQuickButton, 44, 80, 44, 16, Messages.getString("IVQChar"), Chr.IVQUICK),null);
     114                this.add(getChrButton(interruptedUltraQuickButton, 44, 96, 44, 16, Messages.getString("IUQChar"), Chr.IUQUICK),
    116115                                null);
    117116                charLabel.setBounds(new Rectangle(0, 113, 88, 20));
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java

    r27000 r27005  
    55import java.awt.*;
    66import java.awt.event.*;
     7import java.util.EnumMap;
    78
    89import oseam.Messages;
     
    3940        public JLabel visibilityLabel;
    4041        public JComboBox visibilityBox;
     42        public EnumMap<Vis, Integer> visibilities = new EnumMap<Vis, Integer>(Vis.class);
    4143        private ActionListener alVisibility = new ActionListener() {
    4244                public void actionPerformed(java.awt.event.ActionEvent e) {
     
    7274        public JLabel exhibitionLabel;
    7375        public JComboBox exhibitionBox;
     76        public EnumMap<Exh, Integer> exhibitions = new EnumMap<Exh, Integer>(Exh.class);
    7477        private ActionListener alExhibition = new ActionListener() {
    7578                public void actionPerformed(java.awt.event.ActionEvent e) {
     
    179182                this.add(visibilityBox, null);
    180183                visibilityBox.addActionListener(alVisibility);
    181                 visibilityBox.addItem(Messages.getString("NoneSpecified"));
    182                 visibilityBox.addItem(Messages.getString("Intensified"));
    183                 visibilityBox.addItem(Messages.getString("Unintensified"));
    184                 visibilityBox.addItem(Messages.getString("PartiallyObscured"));
     184                addVisibItem(Messages.getString("NoneSpecified"), Vis.UNKNOWN);
     185                addVisibItem(Messages.getString("Intensified"), Vis.INTEN);
     186                addVisibItem(Messages.getString("Unintensified"), Vis.UNINTEN);
     187                addVisibItem(Messages.getString("PartiallyObscured"), Vis.PARTOBS);
    185188
    186189                exhibitionLabel = new JLabel(Messages.getString("Exhibition"), SwingConstants.CENTER);
     
    191194                this.add(exhibitionBox, null);
    192195                exhibitionBox.addActionListener(alExhibition);
    193                 exhibitionBox.addItem("-");
    194                 exhibitionBox.addItem(Messages.getString("24h"));
    195                 exhibitionBox.addItem(Messages.getString("Day"));
    196                 exhibitionBox.addItem(Messages.getString("Night"));
    197                 exhibitionBox.addItem(Messages.getString("Fog"));
     196                addExhibItem(Messages.getString("NotSet"), Exh.UNKNOWN);
     197                addExhibItem(Messages.getString("24h"), Exh.H24);
     198                addExhibItem(Messages.getString("Day"), Exh.DAY);
     199                addExhibItem(Messages.getString("Night"), Exh.NIGHT);
     200                addExhibItem(Messages.getString("Fog"), Exh.FOG);
    198201
    199202                orientationLabel = new JLabel(Messages.getString("Orientation"), SwingConstants.CENTER);
     
    210213        }
    211214
     215        private void addVisibItem(String str, Vis vis) {
     216                visibilities.put(vis, visibilityBox.getItemCount());
     217                visibilityBox.addItem(str);
     218        }
     219
     220        private void addExhibItem(String str, Exh exh) {
     221                exhibitions.put(exh, exhibitionBox.getItemCount());
     222                exhibitionBox.addItem(str);
     223        }
     224
    212225        private JRadioButton getTypeButton(JRadioButton button, int x, int y, int w, int h, String tip) {
    213226                button.setBounds(new Rectangle(x, y, w, h));
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java

    r26998 r27005  
    6767                }
    6868        };
    69         public JLabel visLabel;
    70         public JComboBox visBox;
    71         public EnumMap<Vis, Integer> visibilities = new EnumMap<Vis, Integer>(Vis.class);
    72         private ActionListener alVis = new ActionListener() {
    73                 public void actionPerformed(java.awt.event.ActionEvent e) {
    74                         for (Vis vis : visibilities.keySet()) {
    75                                 int idx = visibilities.get(vis);
    76                                 if (dlg.mark != null && (idx == visBox.getSelectedIndex()))
    77                                         dlg.mark.setVis(vis);
     69        public JLabel conLabel;
     70        public JComboBox conBox;
     71        public EnumMap<Con, Integer> conspicuities = new EnumMap<Con, Integer>(Con.class);
     72        private ActionListener alCon = new ActionListener() {
     73                public void actionPerformed(java.awt.event.ActionEvent e) {
     74                        for (Con con : conspicuities.keySet()) {
     75                                int idx = conspicuities.get(con);
     76                                if (dlg.mark != null && (idx == conBox.getSelectedIndex()))
     77                                        dlg.mark.setCon(con);
    7878                        }
    7979                }
     
    8181        public JLabel reflLabel;
    8282        public JComboBox reflBox;
    83         public EnumMap<Vis, Integer> reflectivities = new EnumMap<Vis, Integer>(Vis.class);
     83        public EnumMap<Con, Integer> reflectivities = new EnumMap<Con, Integer>(Con.class);
    8484        private ActionListener alRefl = new ActionListener() {
    8585                public void actionPerformed(java.awt.event.ActionEvent e) {
    86                         for (Vis vis : reflectivities.keySet()) {
    87                                 int idx = reflectivities.get(vis);
     86                        for (Con con : reflectivities.keySet()) {
     87                                int idx = reflectivities.get(con);
    8888                                if (dlg.mark != null && (idx == reflBox.getSelectedIndex()))
    89                                         dlg.mark.setRvis(vis);
     89                                        dlg.mark.setRefl(con);
    9090                        }
    9191                }
     
    272272                constrBox.addActionListener(alConstr);
    273273
    274                 visLabel = new JLabel(Messages.getString("Visibility"), SwingConstants.CENTER);
    275                 visLabel.setBounds(new Rectangle(250, 80, 100, 20));
    276                 this.add(visLabel, null);
    277                 visBox = new JComboBox();
    278                 visBox.setBounds(new Rectangle(250, 100, 100, 20));
    279                 addVisItem(Messages.getString("NotSet"), Vis.UNKNOWN);
    280                 addVisItem(Messages.getString("Conspicuous"), Vis.CONSP);
    281                 addVisItem(Messages.getString("NotConspicuous"), Vis.NCONS);
    282                 this.add(visBox, null);
    283                 visBox.addActionListener(alVis);
     274                conLabel = new JLabel(Messages.getString("Visibility"), SwingConstants.CENTER);
     275                conLabel.setBounds(new Rectangle(250, 80, 100, 20));
     276                this.add(conLabel, null);
     277                conBox = new JComboBox();
     278                conBox.setBounds(new Rectangle(250, 100, 100, 20));
     279                addConItem(Messages.getString("NotSet"), Con.UNKNOWN);
     280                addConItem(Messages.getString("Conspicuous"), Con.CONSP);
     281                addConItem(Messages.getString("NotConspicuous"), Con.NCONS);
     282                this.add(conBox, null);
     283                conBox.addActionListener(alCon);
    284284
    285285                reflLabel = new JLabel(Messages.getString("Reflectivity"), SwingConstants.CENTER);
     
    288288                reflBox = new JComboBox();
    289289                reflBox.setBounds(new Rectangle(250, 140, 100, 20));
    290                 addRvsItem(Messages.getString("NotSet"), Vis.UNKNOWN);
    291                 addRvsItem(Messages.getString("Conspicuous"), Vis.CONSP);
    292                 addRvsItem(Messages.getString("NotConspicuous"), Vis.NCONS);
    293                 addRvsItem(Messages.getString("Reflector"), Vis.REFL);
     290                addReflItem(Messages.getString("NotSet"), Con.UNKNOWN);
     291                addReflItem(Messages.getString("Conspicuous"), Con.CONSP);
     292                addReflItem(Messages.getString("NotConspicuous"), Con.NCONS);
     293                addReflItem(Messages.getString("Reflector"), Con.REFL);
    294294                this.add(reflBox, null);
    295295                reflBox.addActionListener(alRefl);
     
    318318                                constrBox.setSelectedIndex(item);
    319319                }
    320                 visBox.setSelectedIndex(0);
    321                 for (Vis vis : visibilities.keySet()) {
    322                         int item = visibilities.get(vis);
    323                         if (dlg.mark.getVis() == vis)
    324                                 visBox.setSelectedIndex(item);
     320                conBox.setSelectedIndex(0);
     321                for (Con con : conspicuities.keySet()) {
     322                        int item = conspicuities.get(con);
     323                        if (dlg.mark.getCon() == con)
     324                                conBox.setSelectedIndex(item);
    325325                }
    326326                reflBox.setSelectedIndex(0);
    327                 for (Vis vis : reflectivities.keySet()) {
    328                         int item = reflectivities.get(vis);
    329                         if (dlg.mark.getRvis() == vis)
     327                for (Con con : reflectivities.keySet()) {
     328                        int item = reflectivities.get(con);
     329                        if (dlg.mark.getRefl() == con)
    330330                                reflBox.setSelectedIndex(item);
    331331                }
     
    342342        }
    343343
    344         private void addVisItem(String str, Vis vis) {
    345                 visibilities.put(vis, visBox.getItemCount());
    346                 visBox.addItem(str);
    347         }
    348 
    349         private void addRvsItem(String str, Vis vis) {
    350                 reflectivities.put(vis, reflBox.getItemCount());
     344        private void addConItem(String str, Con con) {
     345                conspicuities.put(con, conBox.getItemCount());
     346                conBox.addItem(str);
     347        }
     348
     349        private void addReflItem(String str, Con con) {
     350                reflectivities.put(con, reflBox.getItemCount());
    351351                reflBox.addItem(str);
    352352        }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r27000 r27005  
    5555
    5656        public enum Obj {
    57                 UNKNOWN, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP, BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, FLTCAR, FLTISD, FLTLAT, FLTSAW, FLTSPP, LITMAJ, LITMIN, LITFLT, LITVES, LNDMRK, MORFAC, SISTAW, SISTAT
     57                UNKNOWN, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP, BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP,
     58                FLTCAR, FLTISD, FLTLAT, FLTSAW, FLTSPP, LITMAJ, LITMIN, LITFLT, LITVES,
     59                LNDMRK, MORFAC, SISTAW, SISTAT
    5860        }
    5961
     
    159161
    160162        public enum Cat {
    161                 NONE, LAM_PORT, LAM_STBD, LAM_PPORT, LAM_PSTBD, CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST, ACH_URST, ACH_DEEP, ACH_TANK, ACH_EXPL, ACH_QUAR, ACH_SPLN, ACH_SCAN, ACH_SCMO, ACH_T24H, ACH_TLIM, SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN, SPM_MOOR, SPM_LNBY, SPM_LDNG, SPM_NOTC, SPM_TSS, SPM_FOUL, SPM_DIVE, SPM_FRRY, SPM_ANCH, MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_BUOY, SIS_PTCL, SIS_PTED, SIS_IPT, SIS_BRTH, SIS_DOCK, SIS_LOCK, SIS_FBAR, SIS_BRDG, SIS_DRDG, SIS_TRFC, SIS_DNGR, SIS_OBST, SIS_CABL, SIS_MILY, SIS_DSTR, SIS_WTHR, SIS_STRM, SIS_ICE, SIS_TIME, SIS_TIDE, SIS_TSTM, SIS_TGAG, SIS_TSCL, SIS_DIVE, SIS_LGAG, LIT_DIRF, LIT_LEDG
     163                NONE, LAM_PORT, LAM_STBD, LAM_PPORT, LAM_PSTBD, CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST,
     164                ACH_URST, ACH_DEEP, ACH_TANK, ACH_EXPL, ACH_QUAR, ACH_SPLN, ACH_SCAN, ACH_SCMO, ACH_T24H, ACH_TLIM,
     165                SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN, SPM_MOOR, SPM_LNBY,
     166                SPM_LDNG, SPM_NOTC, SPM_TSS, SPM_FOUL, SPM_DIVE, SPM_FRRY,
     167                SPM_ANCH, MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_BUOY,
     168                SIS_PTCL, SIS_PTED, SIS_IPT, SIS_BRTH, SIS_DOCK, SIS_LOCK, SIS_FBAR, SIS_BRDG, SIS_DRDG, SIS_TRFC,
     169                SIS_DNGR, SIS_OBST, SIS_CABL, SIS_MILY, SIS_DSTR, SIS_WTHR, SIS_STRM, SIS_ICE, SIS_TIME, SIS_TIDE,
     170                SIS_TSTM, SIS_TGAG, SIS_TSCL, SIS_DIVE, SIS_LGAG, LIT_DIRF, LIT_LEDG
    162171        }
    163172
     
    234243
    235244        public enum Shp {
    236                 UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER, BUOYANT, CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON
     245                UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER,
     246                BUOYANT, CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON
    237247        }
    238248
     
    447457
    448458        public enum Chr {
    449                 UNKNOWN, FIXED, FLASH, LONGFLASH, QUICK, VERYQUICK, ULTRAQUICK, ISOPHASED, OCCULTING, MORSE, ALTERNATING, INTERRUPTEDQUICK, INTERRUPTEDVERYQUICK, INTERRUPTEDULTRAQUICK
     459                UNKNOWN, FIXED, FLASH, LFLASH, QUICK, VQUICK, UQUICK, ISOPHASED, OCCULTING,
     460                MORSE, ALTERNATING, IQUICK, IVQUICK, IUQUICK
    450461        }
    451462
     
    455466                ChrMAP.put(EnumSet.of(Chr.FIXED), "F");
    456467                ChrMAP.put(EnumSet.of(Chr.FLASH), "Fl");
    457                 ChrMAP.put(EnumSet.of(Chr.LONGFLASH), "LFl");
     468                ChrMAP.put(EnumSet.of(Chr.LFLASH), "LFl");
    458469                ChrMAP.put(EnumSet.of(Chr.QUICK), "Q");
    459                 ChrMAP.put(EnumSet.of(Chr.VERYQUICK), "VQ");
    460                 ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK), "UQ");
    461                 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDQUICK), "IQ");
    462                 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDVERYQUICK), "IVQ");
    463                 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDULTRAQUICK), "IUQ");
     470                ChrMAP.put(EnumSet.of(Chr.VQUICK), "VQ");
     471                ChrMAP.put(EnumSet.of(Chr.UQUICK), "UQ");
     472                ChrMAP.put(EnumSet.of(Chr.IQUICK), "IQ");
     473                ChrMAP.put(EnumSet.of(Chr.IVQUICK), "IVQ");
     474                ChrMAP.put(EnumSet.of(Chr.IUQUICK), "IUQ");
    464475                ChrMAP.put(EnumSet.of(Chr.ISOPHASED), "Iso");
    465476                ChrMAP.put(EnumSet.of(Chr.OCCULTING), "Oc");
     
    469480                ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl");
    470481                ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED, Chr.FLASH), "F.Al.Fl");
    471                 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LONGFLASH), "Al.LFl");
     482                ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LFLASH), "Al.LFl");
    472483                ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.ISOPHASED), "Al.Iso");
    473484                ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc");
    474485                ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.FLASH), "FFl");
    475                 ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LONGFLASH), "FLFl");
     486                ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LFLASH), "FLFl");
    476487                ChrMAP.put(EnumSet.of(Chr.OCCULTING, Chr.FLASH), "OcFl");
    477                 ChrMAP.put(EnumSet.of(Chr.FLASH, Chr.LONGFLASH), "FlLFl");
    478                 ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LONGFLASH), "Q+LFl");
    479                 ChrMAP.put(EnumSet.of(Chr.VERYQUICK, Chr.LONGFLASH), "VQ+LFl");
    480                 ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK, Chr.LONGFLASH), "UQ+LFl");
     488                ChrMAP.put(EnumSet.of(Chr.FLASH, Chr.LFLASH), "FlLFl");
     489                ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LFLASH), "Q+LFl");
     490                ChrMAP.put(EnumSet.of(Chr.VQUICK, Chr.LFLASH), "VQ+LFl");
     491                ChrMAP.put(EnumSet.of(Chr.UQUICK, Chr.LFLASH), "UQ+LFl");
    481492        }
    482493
     
    745756        }
    746757
     758        public enum Vis {
     759                UNKNOWN, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS
     760        }
     761
     762        public static final Map<EnumSet<Vis>, String> VisMAP = new HashMap<EnumSet<Vis>, String>();
     763        static {
     764                VisMAP.put(EnumSet.of(Vis.UNKNOWN), "");
     765                VisMAP.put(EnumSet.of(Vis.HIGH), "high");
     766                VisMAP.put(EnumSet.of(Vis.LOW), "low");
     767                VisMAP.put(EnumSet.of(Vis.FAINT), "faint");
     768                VisMAP.put(EnumSet.of(Vis.INTEN), "intensified");
     769                VisMAP.put(EnumSet.of(Vis.UNINTEN), "unintensified");
     770                VisMAP.put(EnumSet.of(Vis.REST), "restricted");
     771                VisMAP.put(EnumSet.of(Vis.OBS), "obscured");
     772                VisMAP.put(EnumSet.of(Vis.PARTOBS), "part_obscured");
     773        }
     774
     775        public enum Lit {
     776                UNKNOWN, VERT, VERT2, VERT3, VERT4, HORIZ, HORIZ2, HORIZ3, HORIZ4, UPPER, LOWER, REAR, FRONT, AERO, AIROBS, FOGDET, FLOOD, STRIP, SUBS, SPOT, MOIRE, EMERG, BEAR
     777        }
     778
     779        public static final Map<EnumSet<Lit>, String> LitMAP = new HashMap<EnumSet<Lit>, String>();
     780        static {
     781                LitMAP.put(EnumSet.of(Lit.UNKNOWN), "");
     782        }
     783
     784        public enum Exh { UNKNOWN, H24, DAY, NIGHT, FOG }
     785        public static final Map<EnumSet<Exh>, String> ExhMAP = new HashMap<EnumSet<Exh>, String>();
     786        static {
     787                ExhMAP.put(EnumSet.of(Exh.UNKNOWN), "");
     788                ExhMAP.put(EnumSet.of(Exh.H24), "24h");
     789                ExhMAP.put(EnumSet.of(Exh.DAY), "day");
     790                ExhMAP.put(EnumSet.of(Exh.NIGHT), "night");
     791                ExhMAP.put(EnumSet.of(Exh.FOG), "fog");
     792        }
     793       
    747794        public enum Pat {
    748795                NONE, HORIZ, VERT, DIAG, SQUARE, BORDER
     
    10581105        }
    10591106
    1060         public enum Vis {
     1107        public enum Con {
    10611108                UNKNOWN, CONSP, NCONS, REFL
    10621109        }
    10631110
    1064         public static final EnumMap<Vis, String> VisSTR = new EnumMap<Vis, String>(Vis.class);
     1111        public static final EnumMap<Con, String> ConSTR = new EnumMap<Con, String>(Con.class);
    10651112        static {
    1066                 VisSTR.put(Vis.CONSP, "conspicuous");
    1067                 VisSTR.put(Vis.NCONS, "not_conspicuous");
    1068                 VisSTR.put(Vis.REFL, "reflector");
    1069         }
    1070 
    1071         private Vis visibility = Vis.UNKNOWN;
    1072 
    1073         public Vis getVis() {
    1074                 return visibility;
    1075         }
    1076 
    1077         public void setVis(Vis vis) {
    1078                 visibility = vis;
    1079         }
    1080 
    1081         private Vis reflectivity = Vis.UNKNOWN;
    1082 
    1083         public Vis getRvis() {
     1113                ConSTR.put(Con.CONSP, "conspicuous");
     1114                ConSTR.put(Con.NCONS, "not_conspicuous");
     1115                ConSTR.put(Con.REFL, "reflector");
     1116        }
     1117
     1118        private Con conspicuity = Con.UNKNOWN;
     1119
     1120        public Con getCon() {
     1121                return conspicuity;
     1122        }
     1123
     1124        public void setCon(Con con) {
     1125                conspicuity = con;
     1126        }
     1127
     1128        private Con reflectivity = Con.UNKNOWN;
     1129
     1130        public Con getRefl() {
    10841131                return reflectivity;
    10851132        }
    10861133
    1087         public void setRvis(Vis vis) {
    1088                 reflectivity = vis;
     1134        public void setRefl(Con con) {
     1135                reflectivity = con;
    10891136        }
    10901137
     
    14991546                        }
    15001547                }
    1501                 if (keys.containsKey("seamark:visibility")) {
    1502                         str = keys.get("seamark:visibility");
    1503                         setVis(Vis.UNKNOWN);
    1504                         for (Vis vis : VisSTR.keySet()) {
    1505                                 if (VisSTR.get(vis).equals(str)) {
    1506                                         setVis(vis);
     1548                if (keys.containsKey("seamark:conspicuity")) {
     1549                        str = keys.get("seamark:conspicuity");
     1550                        setCon(Con.UNKNOWN);
     1551                        for (Con con : ConSTR.keySet()) {
     1552                                if (ConSTR.get(con).equals(str)) {
     1553                                        setCon(con);
    15071554                                }
    15081555                        }
     
    15101557                if (keys.containsKey("seamark:reflectivity")) {
    15111558                        str = keys.get("seamark:reflectivity");
    1512                         setRvis(Vis.UNKNOWN);
    1513                         for (Vis vis : VisSTR.keySet()) {
    1514                                 if (VisSTR.get(vis).equals(str)) {
    1515                                         setRvis(vis);
     1559                        setRefl(Con.UNKNOWN);
     1560                        for (Con con : ConSTR.keySet()) {
     1561                                if (ConSTR.get(con).equals(str)) {
     1562                                        setRefl(con);
    15161563                                }
    15171564                        }
     
    19171964                                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:construction", CnsSTR.get(getConstr())));
    19181965                        }
    1919                         if (getVis() != Vis.UNKNOWN) {
    1920                                 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:visibility", VisSTR.get(getVis())));
    1921                         }
    1922                         if (getRvis() != Vis.UNKNOWN) {
    1923                                 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reflectivity", VisSTR.get(getRvis())));
     1966                        if (getCon() != Con.UNKNOWN) {
     1967                                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:conspicuity", ConSTR.get(getCon())));
     1968                        }
     1969                        if (getRefl() != Con.UNKNOWN) {
     1970                                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reflectivity", ConSTR.get(getRefl())));
    19241971                        }
    19251972                }
Note: See TracChangeset for help on using the changeset viewer.