Changeset 28144 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2012-03-24T11:55:00+01:00 (13 years ago)
- 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 275 275 RadarScanner=Radar Scanner 276 276 Windmill=Windmill 277 SpireMinaret=Spire/Minaret 277 Spire=Spire 278 Minaret=Minaret 279 280 Function=Function 281 Church=Church 282 Chapel=Chapel 283 Temple=Temple 284 Pagoda=Pagoda 285 ShintoShrine=Shinto Shrine 286 BuddhistTemple=Buddhist Temple 287 Mosque=Mosque 288 Marabout=Marabout 278 289 279 290 Platform=Platform -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_de.properties
r27445 r28144 275 275 RadarScanner=Radar Anlage 276 276 Windmill=Windmühle 277 SpireMinaret=Spitzer Turm/Minarett 277 Spire=Spitzer Turm 278 Minaret=Minarett 279 280 Function=Function 281 Church=Church 282 Chapel=Chapel 283 Temple=Temple 284 Pagoda=Pagoda 285 ShintoShrine=Shinto Shrine 286 BuddhistTemple=Buddhist Temple 287 Mosque=Mosque 288 Marabout=Marabout 278 289 279 290 Platform=Platform -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_en.properties
r27445 r28144 275 275 RadarScanner=Radar Scanner 276 276 Windmill=Windmill 277 SpireMinaret=Spire/Minaret 277 Spire=Spire 278 Minaret=Minaret 279 280 Function=Function 281 Church=Church 282 Chapel=Chapel 283 Temple=Temple 284 Pagoda=Pagoda 285 ShintoShrine=Shinto Shrine 286 BuddhistTemple=Buddhist Temple 287 Mosque=Mosque 288 Marabout=Marabout 278 289 279 290 Platform=Platform -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r28140 r28144 124 124 public JLabel functionLabel; 125 125 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); 127 127 private ActionListener alfunctionBox = new ActionListener() { 128 128 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.set Category(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); 133 133 dlg.panelMain.mark.testValid(); 134 134 } … … 167 167 dlg.panelMain.mark.setShape(Shp.FLOAT); 168 168 else dlg.panelMain.mark.setShape(Shp.UNKSHP); 169 functionLabel.setVisible(false); 169 170 categoryLabel.setVisible(false); 171 functionLabel.setVisible(false); 172 functionBox.setVisible(false); 170 173 landCatBox.setVisible(false); 171 174 trafficCatBox.setVisible(false); … … 180 183 dlg.panelMain.mark.setCategory(Cat.NOCAT); 181 184 if (landButton.isSelected()) { 182 categoryLabel.setVisible(true); 185 functionLabel.setVisible(true); 186 categoryLabel.setVisible(true); 187 functionBox.setVisible(true); 183 188 landCatBox.setVisible(true); 184 189 alLandCatBox.actionPerformed(null); … … 254 259 functionLabel.setBounds(new Rectangle(5, 94, 160, 18)); 255 260 add(functionLabel); 256 functionLabel.setVisible( true);261 functionLabel.setVisible(false); 257 262 258 263 functionBox = new JComboBox(); … … 260 265 add(functionBox); 261 266 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); 263 277 264 278 categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER); … … 289 303 addLCItem(Messages.getString("RadarScanner"), Cat.LMK_SCNR); 290 304 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); 292 307 addLCItem(Messages.getString("Cairn"), Cat.LMK_CARN); 293 308 landCatBox.setVisible(false); … … 421 436 422 437 public void syncPanel() { 438 functionLabel.setVisible(false); 439 functionBox.setVisible(false); 423 440 categoryLabel.setVisible(false); 424 441 landCatBox.setVisible(false); … … 433 450 chBox.setVisible(false); 434 451 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); 437 456 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 } 438 462 for (Cat cat : landCats.keySet()) { 439 463 int item = landCats.get(cat); … … 553 577 radarCats.put(cat, radarCatBox.getItemCount()); 554 578 radarCatBox.addItem(str); 579 } 580 581 private void addLFItem(String str, Fnc fnc) { 582 functions.put(fnc, functionBox.getItemCount()); 583 functionBox.addItem(str); 555 584 } 556 585 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r28140 r28144 114 114 if (obj == Obj.UNKOBJ) { 115 115 setCategory(Cat.NOCAT); 116 setFunc(Fnc.UNKFNC); 116 117 setShape(Shp.UNKSHP); 117 118 setColour(Ent.BODY, Col.UNKCOL); … … 299 300 CatSTR.put(Cat.LMK_CROS, "cross"); 300 301 CatSTR.put(Cat.LMK_DOME, "dome"); 301 CatSTR.put(Cat.LMK_SCNR, "radar ");302 CatSTR.put(Cat.LMK_SCNR, "radar_scanner"); 302 303 CatSTR.put(Cat.LMK_WNDL, "windmill"); 303 304 CatSTR.put(Cat.LMK_SPIR, "spire"); … … 1134 1135 public void setFunc(Fnc fnc) { 1135 1136 function = fnc; 1137 repaint(); 1136 1138 } 1137 1139 … … 1262 1264 break; 1263 1265 case LNDMRK: 1264 if ( getCategory() != Cat.NOCAT)1266 if ((getCategory() != Cat.NOCAT) || (getFunc() != Fnc.UNKFNC)) 1265 1267 tmp = true; 1266 1268 break; … … 1453 1455 } 1454 1456 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)) { 1456 1470 setObject(Obj.LITHSE); 1457 1471 } … … 1994 2008 break; 1995 2009 case LMK_MNMT: 2010 case LMK_CLMN: 2011 case LMK_OBLK: 2012 case LMK_STAT: 1996 2013 imgStr += "Monument"; 1997 2014 break; … … 2000 2017 break; 2001 2018 case LMK_TOWR: 2002 imgStr += "LandTower"; 2019 if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL)) 2020 imgStr += "ChurchTower"; 2021 else 2022 imgStr += "LandTower"; 2003 2023 break; 2004 2024 case LMK_WNDM: … … 2008 2028 imgStr += "WaterTower"; 2009 2029 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 } 2010 2076 } 2011 2077 break; … … 2455 2521 if (getObjPattern() != Pat.NOPAT) { 2456 2522 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()))); 2457 2527 } 2458 2528
Note:
See TracChangeset
for help on using the changeset viewer.