Changeset 26581 in osm


Ignore:
Timestamp:
2011-08-27T21:05:19+02:00 (14 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/msg/messages.properties

    r26579 r26581  
    118118Pink=Pink
    119119
     120UKPurpose=Unknown Purpose
     121Warning=Warning
     122Yachting=Yachting
     123Outfall=Outfall
     124ODAS=ODAS
     125RecreationZone=Recreation Zone
     126Mooring=Mooring
     127LANBY=LANBY
     128Leading=Leading
     129Notice=Notice
     130TSS=TSS
     131FoulGround=Foul Ground
     132FerryCross=Ferry Crossing
     133Anchorage=Anchorage
     134ChanSeparation=Channel Separation
     135
    120136UKCategory=Unknown Category
    121137Traffic=Traffic Control
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java

    r26579 r26581  
    167167                                }
    168168                        }
     169                        checkValidity();
    169170                }
    170171        }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java

    r26579 r26581  
    1717        public JLabel categoryLabel;
    1818        public JComboBox categoryBox;
     19        public EnumMap<Cat, Integer> categories = new EnumMap<Cat, Integer>(Cat.class);
    1920        private ActionListener alCategoryBox = new ActionListener() {
    2021                public void actionPerformed(java.awt.event.ActionEvent e) {
     22                        for (Cat cat : categories.keySet()) {
     23                                int idx = categories.get(cat);
     24                                if (dlg.mark != null && (idx == categoryBox.getSelectedIndex()))
     25                                        dlg.mark.setCategory(cat);
     26                        }
     27                        checkValidity();
    2128                }
    2229        };
     
    5158                                        button.setBorderPainted(false);
    5259                        }
    53                         if (dlg.mark != null) {
    54                                 if ((dlg.mark.getObject() != Obj.UNKNOWN) && (dlg.mark.getShape() != Shp.UNKNOWN))
    55                                         dlg.panelMain.moreButton.setVisible(true);
    56                                 else
    57                                         dlg.panelMain.moreButton.setVisible(false);
    58                                 dlg.mark.paintSign();
    59                         }
     60                        checkValidity();
    6061                }
    6162        };
     
    8889                this.add(categoryBox, null);
    8990                categoryBox.addActionListener(alCategoryBox);
    90                 categoryBox.addItem(Messages.getString("NoneSpecified"));
    91                 categoryBox.addItem(Messages.getString("General"));
    92                 categoryBox.addItem(Messages.getString("ChannelSeparation"));
    93                 categoryBox.addItem(Messages.getString("EntryProhibited"));
    94                 categoryBox.addItem(Messages.getString("Yachting"));
    95                 categoryBox.addItem(Messages.getString("Diving"));
    96                 categoryBox.addItem(Messages.getString("Anchorage"));
    97                 categoryBox.addItem(Messages.getString("Pipeline"));
    98                 categoryBox.addItem(Messages.getString("SpeedLimit"));
    99                 categoryBox.addItem(Messages.getString("FerryCrossing"));
    100                 categoryBox.addItem(Messages.getString("FoulGround"));
    101                 categoryBox.addItem(Messages.getString("UnknownPurpose"));
     91                addCatItem(Messages.getString("UKPurpose"), Cat.SPM_UNKN);
     92                addCatItem(Messages.getString("Warning"), Cat.SPM_WARN);
     93                addCatItem(Messages.getString("ChanSeparation"), Cat.SPM_CHBF);
     94                addCatItem(Messages.getString("Yachting"), Cat.SPM_YCHT);
     95                addCatItem(Messages.getString("Cable"), Cat.SPM_CABL);
     96                addCatItem(Messages.getString("Outfall"), Cat.SPM_OFAL);
     97                addCatItem(Messages.getString("ODAS"), Cat.SPM_ODAS);
     98                addCatItem(Messages.getString("RecreationZone"), Cat.SPM_RECN);
     99                addCatItem(Messages.getString("Mooring"), Cat.SPM_MOOR);
     100                addCatItem(Messages.getString("LANBY"), Cat.SPM_LNBY);
     101                addCatItem(Messages.getString("Leading"), Cat.SPM_LDNG);
     102                addCatItem(Messages.getString("Notice"), Cat.SPM_NOTC);
     103                addCatItem(Messages.getString("TSS"), Cat.SPM_TSS);
     104                addCatItem(Messages.getString("FoulGround"), Cat.SPM_FOUL);
     105                addCatItem(Messages.getString("Diving"), Cat.SPM_DIVE);
     106                addCatItem(Messages.getString("FerryCross"), Cat.SPM_FRRY);
     107                addCatItem(Messages.getString("Anchorage"), Cat.SPM_ANCH);
    102108        }
    103109
     110        private void checkValidity() {
     111                if (dlg.mark != null) {
     112                        if ((dlg.mark.getObject() != Obj.UNKNOWN) && (dlg.mark.getShape() != Shp.UNKNOWN)) {
     113                                dlg.panelMain.fogButton.setEnabled(true);
     114                                dlg.panelMain.radButton.setEnabled(true);
     115                                dlg.panelMain.litButton.setEnabled(true);
     116                                dlg.panelMain.moreButton.setVisible(true);
     117                        } else {
     118                                dlg.panelMain.fogButton.setEnabled(false);
     119                                dlg.panelMain.radButton.setEnabled(false);
     120                                dlg.panelMain.litButton.setEnabled(false);
     121                                dlg.panelMain.moreButton.setVisible(false);
     122                        }
     123                        dlg.mark.paintSign();
     124                }
     125        }
     126       
    104127        public void updateSelections() {
    105128                if (dlg.mark != null) {
     
    118141                } else
    119142                        clearSelections();
     143        }
     144
     145        private void addCatItem(String str, Cat cat) {
     146                categories.put(cat, categoryBox.getItemCount());
     147                categoryBox.addItem(str);
    120148        }
    121149
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r26579 r26581  
    143143                CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST,
    144144                ACH_URST, ACH_DEEP, ACH_TANK, ACH_EXPL, ACH_QUAR, ACH_SPLN, ACH_SCAN, ACH_SCMO, ACH_T24H, ACH_TLIM,
    145                 SPM_CHBF, SPM_YCHT,
     145                SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN,
     146                SPM_MOOR, SPM_LNBY, SPM_LDNG, SPM_NOTC, SPM_TSS, SPM_FOUL, SPM_DIVE, SPM_FRRY, SPM_ANCH,
    146147                MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_BUOY,
    147148                SIS_PTCL, SIS_PTED, SIS_IPT, SIS_BRTH, SIS_DOCK, SIS_LOCK, SIS_FBAR, SIS_BRDG, SIS_DRDG, SIS_TRFC,
     
    160161                CatSTR.put(Cat.CAM_SOUTH, "south");
    161162                CatSTR.put(Cat.CAM_WEST, "west");
     163                CatSTR.put(Cat.SPM_UNKN, "unknown");
     164                CatSTR.put(Cat.SPM_WARN, "warning");
     165                CatSTR.put(Cat.SPM_CHBF, "channel_separation");
     166                CatSTR.put(Cat.SPM_YCHT, "yachting");
     167                CatSTR.put(Cat.SPM_CABL, "cable");
     168                CatSTR.put(Cat.SPM_OFAL, "outfall");
     169                CatSTR.put(Cat.SPM_ODAS, "ODAS");
     170                CatSTR.put(Cat.SPM_RECN, "recreational");
     171                CatSTR.put(Cat.SPM_MOOR, "mooring");
     172                CatSTR.put(Cat.SPM_LNBY, "LANBY");
     173                CatSTR.put(Cat.SPM_LDNG, "leading");
     174                CatSTR.put(Cat.SPM_NOTC, "notice");
     175                CatSTR.put(Cat.SPM_TSS, "TSS");
     176                CatSTR.put(Cat.SPM_FOUL, "foul");
     177                CatSTR.put(Cat.SPM_DIVE, "diving");
     178                CatSTR.put(Cat.SPM_FRRY, "ferry");
     179                CatSTR.put(Cat.SPM_ANCH, "anchorage");
    162180                CatSTR.put(Cat.MOR_DLPN, "dolphin");
    163181                CatSTR.put(Cat.MOR_DDPN, "deviation_dolphon");
Note: See TracChangeset for help on using the changeset viewer.