Changeset 23295 in osm for applications/editors/josm
- Timestamp:
- 2010-09-21T13:35:12+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r23287 r23295 383 383 type = keys.get("seamark:type"); //$NON-NLS-1$ 384 384 385 if (type.equals("buoy_lateral") || type.equals("beacon_lateral") //$NON-NLS-1$ //$NON-NLS-2$ 386 || keys.containsKey("seamark:buoy_lateral:category") //$NON-NLS-1$ 387 || keys.containsKey("seamark:buoy_lateral:shape") //$NON-NLS-1$ 388 || keys.containsKey("seamark:buoy_lateral:colour") //$NON-NLS-1$ 389 || keys.containsKey("seamark:beacon_lateral:category") //$NON-NLS-1$ 390 || keys.containsKey("seamark:beacon_lateral:shape") //$NON-NLS-1$ 391 || keys.containsKey("seamark:beacon_lateral:colour")) { //$NON-NLS-1$ 385 if (type.equals("buoy_lateral") || type.equals("beacon_lateral")) { //$NON-NLS-1$ //$NON-NLS-2$ 392 386 buoy = new BuoyLat(this, node); 393 387 return; 394 388 395 } else if (type.equals("buoy_cardinal") || type.equals("beacon_cardinal") //$NON-NLS-1$ //$NON-NLS-2$ 396 || keys.containsKey("seamark:buoy_cardinal:category") //$NON-NLS-1$ 397 || keys.containsKey("seamark:buoy_cardinal:shape") //$NON-NLS-1$ 398 || keys.containsKey("seamark:buoy_cardinal:colour") //$NON-NLS-1$ 399 || keys.containsKey("seamark:beacon_cardinal:category") //$NON-NLS-1$ 400 || keys.containsKey("seamark:beacon_cardinal:shape") //$NON-NLS-1$ 401 || keys.containsKey("seamark:beacon_cardinal:colour")) { //$NON-NLS-1$ 389 } else if (type.equals("buoy_cardinal") || type.equals("beacon_cardinal")) { //$NON-NLS-1$ //$NON-NLS-2$ 402 390 buoy = new BuoyCard(this, node); 403 391 return; 404 392 405 } else if (type.equals("buoy_safe_water") //$NON-NLS-1$ 406 || type.equals("beacon_safe_water") //$NON-NLS-1$ 407 || keys.containsKey("seamark:buoy_safe_water:shape") //$NON-NLS-1$ 408 || keys.containsKey("seamark:buoy_safe_water:colour") //$NON-NLS-1$ 409 || keys.containsKey("seamark:beacon_safe_water:shape") //$NON-NLS-1$ 410 || keys.containsKey("seamark:beacon_safe_water:colour")) { //$NON-NLS-1$ 393 } else if (type.equals("buoy_safe_water") || type.equals("beacon_safe_water")) { //$NON-NLS-1$ 411 394 buoy = new BuoySaw(this, node); 412 395 return; 413 396 414 } else if (type.equals("buoy_special_purpose") //$NON-NLS-1$ 415 || type.equals("beacon_special_purpose") //$NON-NLS-1$ 416 || keys.containsKey("seamark:buoy_special_purpose:shape") //$NON-NLS-1$ 417 || keys.containsKey("seamark:buoy_special_purpose:colour") //$NON-NLS-1$ 418 || keys.containsKey("seamark:beacon_special_purpose:shape") //$NON-NLS-1$ 419 || keys.containsKey("seamark:beacon_special_purpose:colour")) { //$NON-NLS-1$ 397 } else if (type.equals("buoy_special_purpose") || type.equals("beacon_special_purpose")) { //$NON-NLS-1$ 420 398 buoy = new BuoySpec(this, node); 421 399 return; 422 400 423 } else if (type.equals("buoy_isolated_danger") //$NON-NLS-1$ 424 || type.equals("beacon_isolated_danger") //$NON-NLS-1$ 425 || keys.containsKey("seamark:buoy_isolated_danger:shape") //$NON-NLS-1$ 426 || keys.containsKey("seamark:buoy_isolated_danger:colour") //$NON-NLS-1$ 427 || keys.containsKey("seamark:beacon_isolated_danger:shape") //$NON-NLS-1$ 428 || keys.containsKey("seamark:beacon_isolated_danger:colour")) { //$NON-NLS-1$ 401 } else if (type.equals("buoy_isolated_danger") || type.equals("beacon_isolated_danger")) { //$NON-NLS-1$ 429 402 buoy = new BuoyIsol(this, node); 430 403 return; … … 470 443 } 471 444 } 445 } 446 447 if (keys.containsKey("buoy_lateral:category") || keys.containsKey("beacon_lateral:category")) { //$NON-NLS-1$ //$NON-NLS-2$ 448 buoy = new BuoyLat(this, node); 449 return; 450 } else if (keys.containsKey("buoy_cardinal:category") || keys.containsKey("beacon_cardinal:category")) { //$NON-NLS-1$ //$NON-NLS-2$ 451 buoy = new BuoyCard(this, node); 452 return; 453 } else if (keys.containsKey("buoy_isolated_danger:category") || keys.containsKey("beacon_isolated_danger:category")) { //$NON-NLS-1$ //$NON-NLS-2$ 454 buoy = new BuoyIsol(this, node); 455 return; 456 } else if (keys.containsKey("buoy_safe_water:category") || keys.containsKey("beacon_safe_water:category")) { //$NON-NLS-1$ //$NON-NLS-2$ 457 buoy = new BuoySaw(this, node); 458 return; 459 } else if (keys.containsKey("buoy_special_purpose:category") || keys.containsKey("beacon_special_purpose:category")) { //$NON-NLS-1$ //$NON-NLS-2$ 460 buoy = new BuoySpec(this, node); 461 return; 462 } 463 464 if (keys.containsKey("buoy_lateral:shape") || keys.containsKey("beacon_lateral:shape")) { //$NON-NLS-1$ //$NON-NLS-2$ 465 buoy = new BuoyLat(this, node); 466 return; 467 } else if (keys.containsKey("buoy_cardinal:shape") || keys.containsKey("beacon_cardinal:shape")) { //$NON-NLS-1$ //$NON-NLS-2$ 468 buoy = new BuoyCard(this, node); 469 return; 470 } else if (keys.containsKey("buoy_isolated_danger:shape") || keys.containsKey("beacon_isolated_danger:shape")) { //$NON-NLS-1$ //$NON-NLS-2$ 471 buoy = new BuoyIsol(this, node); 472 return; 473 } else if (keys.containsKey("buoy_safe_water:shape") || keys.containsKey("beacon_safe_water:shape")) { //$NON-NLS-1$ //$NON-NLS-2$ 474 buoy = new BuoySaw(this, node); 475 return; 476 } else if (keys.containsKey("buoy_special_purpose:shape") || keys.containsKey("beacon_special_purpose:shape")) { //$NON-NLS-1$ //$NON-NLS-2$ 477 buoy = new BuoySpec(this, node); 478 return; 479 } 480 481 if (keys.containsKey("buoy_lateral:colour") || keys.containsKey("beacon_lateral:colour")) { //$NON-NLS-1$ //$NON-NLS-2$ 482 buoy = new BuoyLat(this, node); 483 return; 484 } else if (keys.containsKey("buoy_cardinal:colour") || keys.containsKey("beacon_cardinal:colour")) { //$NON-NLS-1$ //$NON-NLS-2$ 485 buoy = new BuoyCard(this, node); 486 return; 487 } else if (keys.containsKey("buoy_isolated_danger:colour") || keys.containsKey("beacon_isolated_danger:colour")) { //$NON-NLS-1$ //$NON-NLS-2$ 488 buoy = new BuoyIsol(this, node); 489 return; 490 } else if (keys.containsKey("buoy_safe_water:colour") || keys.containsKey("beacon_safe_water:colour")) { //$NON-NLS-1$ //$NON-NLS-2$ 491 buoy = new BuoySaw(this, node); 492 return; 493 } else if (keys.containsKey("buoy_special_purpose:colour") || keys.containsKey("beacon_special_purpose:colour")) { //$NON-NLS-1$ //$NON-NLS-2$ 494 buoy = new BuoySpec(this, node); 495 return; 472 496 } 473 497 … … 877 901 cbM01CatOfMark.addActionListener(new ActionListener() { 878 902 public void actionPerformed(ActionEvent e) { 879 int cat = cbM01CatOfMark.getSelectedIndex(); 880 881 if (buoy == null) { 882 buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$ 883 buoy.paintSign(); 884 return; 885 } 886 887 Node n = buoy.getNode(); 888 if (n == null) 889 return; 890 891 buoy.setBuoyIndex(cat); 903 if (buoy == null) 904 return; 905 buoy.setBuoyIndex(cbM01CatOfMark.getSelectedIndex()); 892 906 buoy.refreshStyles(); 893 907 buoy.refreshLights(); … … 907 921 cbM01StyleOfMark.addActionListener(new ActionListener() { 908 922 public void actionPerformed(ActionEvent e) { 909 int style = cbM01StyleOfMark.getSelectedIndex(); 910 if (buoy != null && style != buoy.getStyleIndex()) { 911 buoy.setStyleIndex(style); 912 buoy.refreshLights(); 913 buoy.setLightColour(); 914 buoy.paintSign(); 915 } 923 if (buoy == null) 924 return; 925 buoy.setStyleIndex(cbM01StyleOfMark.getSelectedIndex()); 926 buoy.refreshLights(); 927 buoy.setLightColour(); 928 buoy.paintSign(); 916 929 } 917 930 }); … … 926 939 tfM01Name.addFocusListener(new FocusAdapter() { 927 940 public void focusLost(FocusEvent e) { 941 if (buoy == null) 942 return; 928 943 buoy.setName(tfM01Name.getText()); 929 944 buoy.paintSign(); … … 942 957 cM01TopMark.addItemListener(new ItemListener() { 943 958 public void itemStateChanged(ItemEvent e) { 944 if (buoy == null) { 945 return; 946 } 959 if (buoy == null) 960 return; 947 961 buoy.setTopMark(cM01TopMark.isSelected()); 948 962 buoy.paintSign(); … … 960 974 cbM01TopMark.addActionListener(new ActionListener() { 961 975 public void actionPerformed(ActionEvent e) { 976 if (buoy == null) 977 return; 962 978 buoy.setTopMarkIndex(cbM01TopMark.getSelectedIndex()); 963 979 buoy.paintSign(); … … 976 992 cM01Radar.addActionListener(new ActionListener() { 977 993 public void actionPerformed(ActionEvent e) { 994 if (buoy == null) 995 return; 978 996 if (cM01Radar.isSelected()) { 979 997 buoy.setRadar(true); … … 998 1016 cM01Racon.addActionListener(new ActionListener() { 999 1017 public void actionPerformed(ActionEvent e) { 1018 if (buoy == null) 1019 return; 1000 1020 if (cM01Racon.isSelected()) { 1001 1021 buoy.setRacon(true); … … 1024 1044 cbM01Racon.addActionListener(new ActionListener() { 1025 1045 public void actionPerformed(ActionEvent e) { 1046 if (buoy == null) 1047 return; 1026 1048 int rac = cbM01Racon.getSelectedIndex(); 1027 1049 buoy.setRaType(rac); … … 1039 1061 tfM01Racon.addFocusListener(new FocusAdapter() { 1040 1062 public void focusLost(FocusEvent e) { 1063 if (buoy == null) 1064 return; 1041 1065 buoy.setRaconGroup(tfM01Racon.getText().trim()); 1042 1066 buoy.paintSign(); … … 1055 1079 cM01Fog.addActionListener(new ActionListener() { 1056 1080 public void actionPerformed(ActionEvent e) { 1081 if (buoy == null) 1082 return; 1057 1083 buoy.setFog(cM01Fog.isSelected()); 1058 1084 buoy.paintSign(); … … 1079 1105 cbM01Fog.addActionListener(new ActionListener() { 1080 1106 public void actionPerformed(ActionEvent e) { 1107 if (buoy == null) 1108 return; 1081 1109 if (cbM01Fog.getSelectedIndex() > 0) 1082 1110 buoy.setFogSound(cbM01Fog.getSelectedIndex()); … … 1096 1124 tfM01FogGroup.addFocusListener(new FocusAdapter() { 1097 1125 public void focusLost(FocusEvent e) { 1126 if (buoy == null) 1127 return; 1098 1128 buoy.setFogGroup(tfM01FogGroup.getText().trim()); 1099 1129 buoy.paintSign(); … … 1110 1140 tfM01FogPeriod.addFocusListener(new FocusAdapter() { 1111 1141 public void focusLost(FocusEvent e) { 1142 if (buoy == null) 1143 return; 1112 1144 buoy.setFogPeriod(tfM01FogPeriod.getText().trim()); 1113 1145 buoy.paintSign(); … … 1179 1211 tfM01Height.addFocusListener(new FocusAdapter() { 1180 1212 public void focusLost(FocusEvent e) { 1213 if (buoy == null) 1214 return; 1181 1215 buoy.setHeight(tfM01Height.getText().trim()); 1182 1216 buoy.paintSign(); … … 1193 1227 tfM01Range.addFocusListener(new FocusAdapter() { 1194 1228 public void focusLost(FocusEvent e) { 1229 if (buoy == null) 1230 return; 1195 1231 buoy.setRange(tfM01Range.getText().trim()); 1196 1232 buoy.paintSign(); … … 1207 1243 tfM01Group.addFocusListener(new FocusAdapter() { 1208 1244 public void focusLost(FocusEvent e) { 1245 if (buoy == null) 1246 return; 1209 1247 buoy.setLightGroup(tfM01Group.getText().trim()); 1210 1248 buoy.paintSign(); … … 1221 1259 tfM01RepeatTime.addActionListener(new ActionListener() { 1222 1260 public void actionPerformed(ActionEvent e) { 1261 if (buoy == null) 1262 return; 1223 1263 buoy.setLightPeriod(tfM01RepeatTime.getText().trim()); 1224 1264 buoy.paintSign(); … … 1228 1268 tfM01RepeatTime.addFocusListener(new FocusAdapter() { 1229 1269 public void focusLost(FocusEvent e) { 1270 if (buoy == null) 1271 return; 1230 1272 buoy.setLightPeriod(tfM01RepeatTime.getText().trim()); 1231 1273 buoy.paintSign(); … … 1247 1289 cbM01Colour.addActionListener(new ActionListener() { 1248 1290 public void actionPerformed(ActionEvent e) { 1291 if (buoy == null) 1292 return; 1249 1293 buoy.setLightColour((String) cbM01Colour.getSelectedItem()); 1250 1294 buoy.paintSign(); … … 1272 1316 cbM01Sector.addActionListener(new ActionListener() { 1273 1317 public void actionPerformed(ActionEvent e) { 1318 if (buoy == null) 1319 return; 1274 1320 buoy.setSectorIndex(cbM01Sector.getSelectedIndex()); 1275 1321 buoy.paintSign(); … … 1286 1332 tfM01Bearing.addFocusListener(new FocusAdapter() { 1287 1333 public void focusLost(FocusEvent e) { 1334 if (buoy == null) 1335 return; 1288 1336 buoy.setBearing1(tfM01Bearing.getText().trim()); 1289 1337 } … … 1312 1360 tfM01Radius.addFocusListener(new FocusAdapter() { 1313 1361 public void focusLost(FocusEvent e) { 1362 if (buoy == null) 1363 return; 1314 1364 buoy.setRadius(tfM01Radius.getText().trim()); 1315 1365 } -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
r23269 r23295 21 21 super(dia); 22 22 23 System.out.println("new"); 23 24 String str; 24 25 Map<String, String> keys; … … 27 28 28 29 resetMask(); 30 dlg.cbM01TypeOfMark.setSelectedIndex(CARDINAL); 31 29 32 dlg.cbM01CatOfMark.removeAllItems(); 30 33 dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.157")); //$NON-NLS-1$ … … 47 50 dlg.cbM01StyleOfMark.setVisible(true); 48 51 dlg.lM01StyleOfMark.setVisible(true); 49 50 dlg.cbM01TypeOfMark.setSelectedIndex(CARDINAL);51 52 52 53 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$ -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
r23269 r23295 26 26 27 27 resetMask(); 28 29 28 dlg.cbM01TypeOfMark.setSelectedIndex(ISOLATED_DANGER); 30 29 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r23269 r23295 25 25 26 26 resetMask(); 27 dlg.cbM01TypeOfMark.setSelectedIndex(LATERAL); 27 28 28 29 dlg.cbM01CatOfMark.removeAllItems(); … … 47 48 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$ 48 49 dlg.cbM01StyleOfMark.setEnabled(true); 49 50 dlg.cbM01TypeOfMark.setSelectedIndex(LATERAL);51 50 52 51 if (keys.containsKey("name")) //$NON-NLS-1$ -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
r23270 r23295 26 26 27 27 resetMask(); 28 29 28 dlg.cbM01TypeOfMark.setSelectedIndex(SAFE_WATER); 30 29 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
r23287 r23295 26 26 27 27 resetMask(); 28 29 28 dlg.cbM01TypeOfMark.setSelectedIndex(SPECIAL_PURPOSE); 30 29
Note:
See TracChangeset
for help on using the changeset viewer.