Ignore:
Timestamp:
2012-03-24T11:55:00+01:00 (12 years ago)
Author:
malcolmh
Message:

save

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

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages.properties

    r27445 r28144  
    275275RadarScanner=Radar Scanner
    276276Windmill=Windmill
    277 SpireMinaret=Spire/Minaret
     277Spire=Spire
     278Minaret=Minaret
     279
     280Function=Function
     281Church=Church
     282Chapel=Chapel
     283Temple=Temple
     284Pagoda=Pagoda
     285ShintoShrine=Shinto Shrine
     286BuddhistTemple=Buddhist Temple
     287Mosque=Mosque
     288Marabout=Marabout
    278289
    279290Platform=Platform
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_de.properties

    r27445 r28144  
    275275RadarScanner=Radar Anlage
    276276Windmill=Windmühle
    277 SpireMinaret=Spitzer Turm/Minarett
     277Spire=Spitzer Turm
     278Minaret=Minarett
     279
     280Function=Function
     281Church=Church
     282Chapel=Chapel
     283Temple=Temple
     284Pagoda=Pagoda
     285ShintoShrine=Shinto Shrine
     286BuddhistTemple=Buddhist Temple
     287Mosque=Mosque
     288Marabout=Marabout
    278289
    279290Platform=Platform
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_en.properties

    r27445 r28144  
    275275RadarScanner=Radar Scanner
    276276Windmill=Windmill
    277 SpireMinaret=Spire/Minaret
     277Spire=Spire
     278Minaret=Minaret
     279
     280Function=Function
     281Church=Church
     282Chapel=Chapel
     283Temple=Temple
     284Pagoda=Pagoda
     285ShintoShrine=Shinto Shrine
     286BuddhistTemple=Buddhist Temple
     287Mosque=Mosque
     288Marabout=Marabout
    278289
    279290Platform=Platform
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java

    r28140 r28144  
    124124        public JLabel functionLabel;
    125125        public JComboBox functionBox;
    126         public EnumMap<Cat, Integer> functionss = new EnumMap<Cat, Integer>(Cat.class);
     126        public EnumMap<Fnc, Integer> functions = new EnumMap<Fnc, Integer>(Fnc.class);
    127127        private ActionListener alfunctionBox = new ActionListener() {
    128128                public void actionPerformed(java.awt.event.ActionEvent e) {
    129                         for (Cat cat : landCats.keySet()) {
    130                                 int idx = landCats.get(cat);
    131                                 if (dlg.node != null && (idx == landCatBox.getSelectedIndex())) {
    132                                         dlg.panelMain.mark.setCategory(cat);
     129                        for (Fnc fnc : functions.keySet()) {
     130                                int idx = functions.get(fnc);
     131                                if (dlg.node != null && (idx == functionBox.getSelectedIndex())) {
     132                                        dlg.panelMain.mark.setFunc(fnc);
    133133                                        dlg.panelMain.mark.testValid();
    134134                                }
     
    167167                                dlg.panelMain.mark.setShape(Shp.FLOAT);
    168168                        else dlg.panelMain.mark.setShape(Shp.UNKSHP);
     169                        functionLabel.setVisible(false);
    169170                        categoryLabel.setVisible(false);
     171                        functionLabel.setVisible(false);
     172                        functionBox.setVisible(false);
    170173                        landCatBox.setVisible(false);
    171174                        trafficCatBox.setVisible(false);
     
    180183                        dlg.panelMain.mark.setCategory(Cat.NOCAT);
    181184                        if (landButton.isSelected()) {
    182                                 categoryLabel.setVisible(true);
     185                                functionLabel.setVisible(true);
     186                                categoryLabel.setVisible(true);
     187                                functionBox.setVisible(true);
    183188                                landCatBox.setVisible(true);
    184189                                alLandCatBox.actionPerformed(null);
     
    254259                functionLabel.setBounds(new Rectangle(5, 94, 160, 18));
    255260                add(functionLabel);
    256                 functionLabel.setVisible(true);
     261                functionLabel.setVisible(false);
    257262
    258263                functionBox = new JComboBox();
     
    260265                add(functionBox);
    261266                functionBox.addActionListener(alfunctionBox);
    262                 functionBox.setVisible(true);
     267                addLFItem("", Fnc.UNKFNC);
     268                addLFItem(Messages.getString("Church"), Fnc.CHCH);
     269                addLFItem(Messages.getString("Chapel"), Fnc.CHPL);
     270                addLFItem(Messages.getString("Temple"), Fnc.TMPL);
     271                addLFItem(Messages.getString("Pagoda"), Fnc.PGDA);
     272                addLFItem(Messages.getString("ShintoShrine"), Fnc.SHSH);
     273                addLFItem(Messages.getString("BuddhistTemple"), Fnc.BTMP);
     274                addLFItem(Messages.getString("Mosque"), Fnc.MOSQ);
     275                addLFItem(Messages.getString("Marabout"), Fnc.MRBT);
     276                functionBox.setVisible(false);
    263277
    264278                categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER);
     
    289303                addLCItem(Messages.getString("RadarScanner"), Cat.LMK_SCNR);
    290304                addLCItem(Messages.getString("Windmill"), Cat.LMK_WNDL);
    291                 addLCItem(Messages.getString("SpireMinaret"), Cat.LMK_SPIR);
     305                addLCItem(Messages.getString("Spire"), Cat.LMK_SPIR);
     306                addLCItem(Messages.getString("Minaret"), Cat.LMK_MNRT);
    292307                addLCItem(Messages.getString("Cairn"), Cat.LMK_CARN);
    293308                landCatBox.setVisible(false);
     
    421436
    422437        public void syncPanel() {
     438                functionLabel.setVisible(false);
     439                functionBox.setVisible(false);
    423440                categoryLabel.setVisible(false);
    424441                landCatBox.setVisible(false);
     
    433450                chBox.setVisible(false);
    434451                chBox.setText(dlg.panelMain.mark.getChannel());
    435                 if ((dlg.panelMain.mark.getObject() == Obj.LNDMRK) && (dlg.panelMain.mark.getCategory() != Cat.NOCAT)) {
    436                         categoryLabel.setVisible(true);
     452                if ((dlg.panelMain.mark.getObject() == Obj.LNDMRK) && ((dlg.panelMain.mark.getCategory() != Cat.NOCAT) || (dlg.panelMain.mark.getFunc() != Fnc.UNKFNC))) {
     453                        functionLabel.setVisible(true);
     454                        categoryLabel.setVisible(true);
     455                        functionBox.setVisible(true);
    437456                        landCatBox.setVisible(true);
     457                        for (Fnc fnc : functions.keySet()) {
     458                                int item = functions.get(fnc);
     459                                if (dlg.panelMain.mark.getFunc() == fnc)
     460                                        functionBox.setSelectedIndex(item);
     461                        }
    438462                        for (Cat cat : landCats.keySet()) {
    439463                                int item = landCats.get(cat);
     
    553577                radarCats.put(cat, radarCatBox.getItemCount());
    554578                radarCatBox.addItem(str);
     579        }
     580
     581        private void addLFItem(String str, Fnc fnc) {
     582                functions.put(fnc, functionBox.getItemCount());
     583                functionBox.addItem(str);
    555584        }
    556585
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r28140 r28144  
    114114                if (obj == Obj.UNKOBJ) {
    115115                        setCategory(Cat.NOCAT);
     116                        setFunc(Fnc.UNKFNC);
    116117                        setShape(Shp.UNKSHP);
    117118                        setColour(Ent.BODY, Col.UNKCOL);
     
    299300                CatSTR.put(Cat.LMK_CROS, "cross");
    300301                CatSTR.put(Cat.LMK_DOME, "dome");
    301                 CatSTR.put(Cat.LMK_SCNR, "radar");
     302                CatSTR.put(Cat.LMK_SCNR, "radar_scanner");
    302303                CatSTR.put(Cat.LMK_WNDL, "windmill");
    303304                CatSTR.put(Cat.LMK_SPIR, "spire");
     
    11341135        public void setFunc(Fnc fnc) {
    11351136                function = fnc;
     1137                repaint();
    11361138        }
    11371139
     
    12621264                        break;
    12631265                case LNDMRK:
    1264                         if (getCategory() != Cat.NOCAT)
     1266                        if ((getCategory() != Cat.NOCAT) || (getFunc() != Fnc.UNKFNC))
    12651267                                tmp = true;
    12661268                        break;
     
    14531455                }
    14541456
    1455                 if ((getObject() == Obj.LNDMRK) && (getCategory() == Cat.NOCAT)) {
     1457                for (Obj obj : ObjSTR.keySet()) {
     1458                        if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":function")) {
     1459                                str = keys.get("seamark:" + ObjSTR.get(obj) + ":function");
     1460                                setFunc(Fnc.UNKFNC);
     1461                                for (Fnc fnc : FncSTR.keySet()) {
     1462                                        if (FncSTR.get(fnc).equals(str)) {
     1463                                                setFunc(fnc);
     1464                                        }
     1465                                }
     1466                        }
     1467                }
     1468
     1469                if ((getObject() == Obj.LNDMRK) && (getCategory() == Cat.NOCAT) && (getFunc() == Fnc.UNKFNC)) {
    14561470                        setObject(Obj.LITHSE);
    14571471                }
     
    19942008                                        break;
    19952009                                case LMK_MNMT:
     2010                                case LMK_CLMN:
     2011                                case LMK_OBLK:
     2012                                case LMK_STAT:
    19962013                                        imgStr += "Monument";
    19972014                                        break;
     
    20002017                                        break;
    20012018                                case LMK_TOWR:
    2002                                         imgStr += "LandTower";
     2019                                        if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL))
     2020                                                imgStr += "ChurchTower";
     2021                                        else
     2022                                                imgStr += "LandTower";
    20032023                                        break;
    20042024                                case LMK_WNDM:
     
    20082028                                        imgStr += "WaterTower";
    20092029                                        break;
     2030                                case LMK_DOME:
     2031                                        if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL))
     2032                                                imgStr += "ChurchDome";
     2033                                        else
     2034                                                imgStr += "Dome";
     2035                                        break;
     2036                                case LMK_SPIR:
     2037                                        if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL))
     2038                                                imgStr += "ChurchSpire";
     2039                                        else
     2040                                                imgStr += "Spire";
     2041                                        break;
     2042                                case LMK_MNRT:
     2043                                        imgStr += "Minaret";
     2044                                        break;
     2045                                case LMK_WNDS:
     2046                                        imgStr += "Windsock";
     2047                                        break;
     2048                                case LMK_CROS:
     2049                                        imgStr += "Cross";
     2050                                        break;
     2051                                case LMK_SCNR:
     2052                                        imgStr += "Signal_Station";
     2053                                        break;
     2054                                case LMK_WNDL:
     2055                                        imgStr += "Windmill";
     2056                                        break;
     2057                                case NOCAT:
     2058                                        switch (getFunc()) {
     2059                                        case CHCH:
     2060                                        case CHPL:
     2061                                                imgStr += "Church";
     2062                                                break;
     2063                                        case TMPL:
     2064                                        case PGDA:
     2065                                        case SHSH:
     2066                                        case BTMP:
     2067                                                imgStr += "Temple";
     2068                                                break;
     2069                                        case MOSQ:
     2070                                                imgStr += "Minaret";
     2071                                                break;
     2072                                        case MRBT:
     2073                                                imgStr += "Spire";
     2074                                                break;
     2075                                        }
    20102076                                }
    20112077                                break;
     
    24552521                                if (getObjPattern() != Pat.NOPAT) {
    24562522                                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatSTR.get(getObjPattern())));
     2523                                }
     2524
     2525                                if (getFunc() != Fnc.UNKFNC) {
     2526                                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":function", FncSTR.get(getFunc())));
    24572527                                }
    24582528
Note: See TracChangeset for help on using the changeset viewer.