Changeset 23174 in osm for applications/editors/josm/plugins/toms/src
- Timestamp:
- 2010-09-15T13:58:06+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms/seamarks
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/seamarks/SeaMark.java
r23138 r23174 111 111 */ 112 112 113 public final static int UNKNOWN_RATYP = 0;114 public final static int RATYP _RACON = 1;115 public final static int RATYP _RAMARK = 2;116 public final static int RATYP _LEADING = 3;113 public final static int UNKNOWN_RATYPE = 0; 114 public final static int RATYPE_RACON = 1; 115 public final static int RATYPE_RAMARK = 2; 116 public final static int RATYPE_LEADING = 3; 117 117 118 118 /** -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r23166 r23174 115 115 } 116 116 117 public void setFogSound(int fogSound) {118 FogSound = fogSound;117 public void setFogSound(int sound) { 118 FogSound = sound; 119 119 } 120 120 … … 125 125 } 126 126 127 public void setFogGroup(String fogGroup) {128 FogGroup = fogGroup;127 public void setFogGroup(String group) { 128 FogGroup = group; 129 129 } 130 130 … … 135 135 } 136 136 137 public void setFogPeriod(String fogPeriod) {138 FogPeriod = fogPeriod;137 public void setFogPeriod(String period) { 138 FogPeriod = period; 139 139 } 140 140 … … 172 172 173 173 public String getLightChar() { 174 if (LightChar[ getSectorIndex()] == null)174 if (LightChar[SectorIndex] == null) 175 175 return (LightChar[0]); 176 return LightChar[ getSectorIndex()];176 return LightChar[SectorIndex]; 177 177 } 178 178 179 179 public void setLightChar(String lightChar) { 180 if ( getSectorIndex()== 0)180 if (SectorIndex == 0) 181 181 LightChar = new String[10]; 182 LightChar[ getSectorIndex()] = lightChar;182 LightChar[SectorIndex] = lightChar; 183 183 } 184 184 … … 186 186 187 187 public String getLightColour() { 188 if (LightColour[ getSectorIndex()] == null)188 if (LightColour[SectorIndex] == null) 189 189 return (LightColour[0]); 190 return LightColour[ getSectorIndex()];190 return LightColour[SectorIndex]; 191 191 } 192 192 193 193 public void setLightColour(String lightColour) { 194 if ( getSectorIndex()== 0)194 if (SectorIndex == 0) 195 195 LightColour = new String[10]; 196 LightColour[ getSectorIndex()] = lightColour;196 LightColour[SectorIndex] = lightColour; 197 197 } 198 198 … … 200 200 201 201 public String getLightGroup() { 202 if (LightGroup[ getSectorIndex()] == null)202 if (LightGroup[SectorIndex] == null) 203 203 return (LightGroup[0]); 204 return LightGroup[ getSectorIndex()];204 return LightGroup[SectorIndex]; 205 205 } 206 206 207 207 public void setLightGroup(String lightGroup) { 208 if ( getSectorIndex()== 0)208 if (SectorIndex == 0) 209 209 LightGroup = new String[10]; 210 LightGroup[ getSectorIndex()] = lightGroup;210 LightGroup[SectorIndex] = lightGroup; 211 211 } 212 212 … … 222 222 223 223 public String getHeight() { 224 if (Height[ getSectorIndex()] == null)224 if (Height[SectorIndex] == null) 225 225 return (Height[0]); 226 return Height[ getSectorIndex()];226 return Height[SectorIndex]; 227 227 } 228 228 229 229 public void setHeight(String height) { 230 if ( getSectorIndex()== 0)230 if (SectorIndex == 0) 231 231 Height = new String[10]; 232 Height[ getSectorIndex()] = height;232 Height[SectorIndex] = height; 233 233 } 234 234 … … 236 236 237 237 public String getRange() { 238 if (Range[ getSectorIndex()] == null)238 if (Range[SectorIndex] == null) 239 239 return (Range[0]); 240 return Range[ getSectorIndex()];240 return Range[SectorIndex]; 241 241 } 242 242 243 243 public void setRange(String range) { 244 if ( getSectorIndex()== 0)244 if (SectorIndex == 0) 245 245 Range = new String[10]; 246 Range[ getSectorIndex()] = range;246 Range[SectorIndex] = range; 247 247 } 248 248 … … 250 250 251 251 public String getBearing1() { 252 if (Bearing1[ getSectorIndex()] == null)252 if (Bearing1[SectorIndex] == null) 253 253 return (Bearing1[0]); 254 return Bearing1[ getSectorIndex()];254 return Bearing1[SectorIndex]; 255 255 } 256 256 257 257 public void setBearing1(String bearing) { 258 if ( getSectorIndex()== 0)258 if (SectorIndex == 0) 259 259 Bearing1 = new String[10]; 260 Bearing1[ getSectorIndex()] = bearing;260 Bearing1[SectorIndex] = bearing; 261 261 } 262 262 … … 264 264 265 265 public String getBearing2() { 266 if (Bearing2[ getSectorIndex()] == null)266 if (Bearing2[SectorIndex] == null) 267 267 return (Bearing2[0]); 268 return Bearing2[ getSectorIndex()];268 return Bearing2[SectorIndex]; 269 269 } 270 270 271 271 public void setBearing2(String bearing) { 272 if ( getSectorIndex()== 0)272 if (SectorIndex == 0) 273 273 Bearing2 = new String[10]; 274 Bearing2[ getSectorIndex()] = bearing;274 Bearing2[SectorIndex] = bearing; 275 275 } 276 276 … … 278 278 279 279 public String getRadius() { 280 if (Radius[ getSectorIndex()] == null)280 if (Radius[SectorIndex] == null) 281 281 return (Radius[0]); 282 return Radius[ getSectorIndex()];282 return Radius[SectorIndex]; 283 283 } 284 284 285 285 public void setRadius(String radius) { 286 if ( getSectorIndex()== 0)286 if (SectorIndex == 0) 287 287 Radius = new String[10]; 288 Radius[ getSectorIndex()] = radius;288 Radius[SectorIndex] = radius; 289 289 } 290 290 … … 292 292 293 293 public String getLightPeriod() { 294 if (LightPeriod[ getSectorIndex()] == null)294 if (LightPeriod[SectorIndex] == null) 295 295 return (LightPeriod[0]); 296 return LightPeriod[ getSectorIndex()];296 return LightPeriod[SectorIndex]; 297 297 } 298 298 … … 313 313 } 314 314 } 315 if ( getSectorIndex()== 0)315 if (SectorIndex == 0) 316 316 LightPeriod = new String[10]; 317 LightPeriod[getSectorIndex()] = lightPeriod; 318 } 319 320 protected void setLightPeriod(Map<String, String> k) { 321 String s = ""; 322 if (k.containsKey("seamark:light:period")) { 323 s = k.get("seamark:light:period"); 324 setSectorIndex(0); 325 setLightPeriod(s); 326 return; 327 } 317 LightPeriod[SectorIndex] = lightPeriod; 328 318 } 329 319 … … 375 365 Iterator it = k.entrySet().iterator(); 376 366 while (it.hasNext()) { 377 Map.Entry entry = (Map.Entry) it.next();367 Map.Entry entry = (Map.Entry) it.next(); 378 368 String key = (String) entry.getKey(); 379 369 String value = ((String) entry.getValue()).trim(); … … 400 390 index = 0; 401 391 } 402 if (index != 0) setSectored(true); 392 if (index != 0) 393 setSectored(true); 403 394 if (key.equals("colour")) { 404 395 if (value.equals("red")) … … 421 412 } 422 413 } 414 setSectorIndex(0); 415 dlg.cM01Fired.setSelected(isFired()); 416 dlg.rbM01Fired1.setSelected(!isSectored()); 417 dlg.rbM01FiredN.setSelected(isSectored()); 418 dlg.cbM01Kennung.setSelectedItem(getLightChar()); 419 dlg.tfM01Height.setText(getHeight()); 420 dlg.tfM01Range.setText(getRange()); 421 dlg.tfM01Group.setText(getLightGroup()); 422 dlg.tfM01RepeatTime.setText(getLightPeriod()); 423 dlg.cbM01Colour.setSelectedItem(getLightColour()); 424 } 425 426 public void parseFogRadar(Map<String, String> k) { 427 String str; 428 setFog(false); 429 setRadar(false); 430 setRacon(false); 431 if (k.containsKey("seamark:fog_signal") 432 || k.containsKey("seamark:fog_signal:category") 433 || k.containsKey("seamark:fog_signal:group") 434 || k.containsKey("seamark:fog_signal:period")) { 435 setFog(true); 436 if (k.containsKey("seamark:fog_signal:category")) { 437 str = k.get("seamark:fog_signal:category"); 438 if (str.equals("horn")) 439 setFogSound(FOG_HORN); 440 else if (str.equals("siren")) 441 setFogSound(FOG_SIREN); 442 else if (str.equals("diaphone")) 443 setFogSound(FOG_DIA); 444 else if (str.equals("bell")) 445 setFogSound(FOG_BELL); 446 else if (str.equals("whis")) 447 setFogSound(FOG_WHIS); 448 else if (str.equals("gong")) 449 setFogSound(FOG_GONG); 450 else if (str.equals("explosive")) 451 setFogSound(FOG_EXPLOS); 452 else 453 setFogSound(UNKNOWN_FOG); 454 } 455 if (k.containsKey("seamark:fog_signal:group")) 456 setFogGroup(k.get("seamark:fog_signal:group")); 457 if (k.containsKey("seamark:fog_signal:period")) 458 setFogPeriod(k.get("seamark:fog_signal:period")); 459 } 460 dlg.cM01Fog.setSelected(hasFog()); 461 dlg.cbM01Fog.setSelectedIndex(getFogSound()); 462 dlg.tfM01FogGroup.setText(getFogGroup()); 463 dlg.tfM01FogPeriod.setText(getFogPeriod()); 464 465 if (k.containsKey("seamark:radar_transponder") 466 || k.containsKey("seamark:radar_transponder:category") 467 || k.containsKey("seamark:radar_transponder:group")) { 468 setRacon(true); 469 if (k.containsKey("seamark:radar_transponder:category")) { 470 str = k.get("seamark:radar_transponder:category"); 471 if (str.equals("racon")) 472 setRaType(RATYPE_RACON); 473 else if (str.equals("ramark")) 474 setRaType(RATYPE_RAMARK); 475 else if (str.equals("leading")) 476 setRaType(RATYPE_LEADING); 477 else 478 setRaType(UNKNOWN_RATYPE); 479 } 480 if (k.containsKey("seamark:radar_transponder:group")) 481 setRaconGroup(k.get("seamark:radar_transponder:group")); 482 } else if (k.containsKey("seamark:radar_reflector")) 483 setRadar(true); 484 dlg.cM01Radar.setSelected(hasRadar()); 485 dlg.cM01Racon.setSelected(hasRacon()); 486 dlg.cbM01Racon.setSelectedIndex(getRaType()); 487 dlg.tfM01Racon.setText(getRaconGroup()); 423 488 } 424 489 … … 459 524 "/images/Radar_Station.png"))); 460 525 dlg.cbM01Racon.setVisible(true); 461 if (getRaType() == RATYP _RACON) {526 if (getRaType() == RATYPE_RACON) { 462 527 dlg.lM01Racon.setVisible(true); 463 528 dlg.tfM01Racon.setVisible(true); … … 532 597 } 533 598 dlg.cbM01Kennung.setSelectedItem(c); 534 if ((dlg.cbM01Kennung.getSelectedIndex() == 0) && !getLightGroup().isEmpty()) { 599 if (((dlg.cbM01Kennung.getSelectedIndex() == 0) && !getLightGroup() 600 .isEmpty()) 601 || (((String) dlg.cbM01Kennung.getSelectedItem()).contains("(")) 602 && !(((String) dlg.cbM01Kennung.getSelectedItem()).contains("+"))) { 535 603 c = c + "(" + getLightGroup() + ")"; 536 604 dlg.cbM01Kennung.setSelectedItem(c); … … 544 612 dlg.lM01Kennung.setVisible(true); 545 613 dlg.cbM01Kennung.setVisible(true); 546 if (((String) dlg.cbM01Kennung.getSelectedItem()).contains("(")) {614 if (((String) dlg.cbM01Kennung.getSelectedItem()).contains("(")) { 547 615 dlg.tfM01Group.setVisible(false); 548 616 dlg.lM01Group.setVisible(false); … … 804 872 if (hasRacon()) { 805 873 switch (RaType) { 806 case RATYP _RACON:874 case RATYPE_RACON: 807 875 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 808 876 "seamark:radar_transponder:category", "racon")); … … 811 879 "seamark:radar_transponder:group", getRaconGroup())); 812 880 break; 813 case RATYP _RAMARK:881 case RATYPE_RAMARK: 814 882 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 815 883 "seamark:radar_transponder:category", "ramark")); 816 884 break; 817 case RATYP _LEADING:885 case RATYPE_LEADING: 818 886 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 819 887 "seamark:radar_transponder:category", "leading")); … … 825 893 } 826 894 if (hasFog()) { 827 if ( FogSound== 0) {895 if (getFogSound() == 0) { 828 896 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 829 897 "seamark:fog_signal", "yes")); 830 898 } else { 831 switch ( FogSound) {899 switch (getFogSound()) { 832 900 case FOG_HORN: 833 901 Main.main.undoRedo.add(new ChangePropertyCommand(Node, … … 861 929 if (!getFogGroup().isEmpty()) 862 930 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 863 "seamark:fog_ group:group", getFogGroup()));931 "seamark:fog_signal:group", getFogGroup())); 864 932 if (!getFogPeriod().isEmpty()) 865 933 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 866 "seamark:fog_ period:group", getFogPeriod()));934 "seamark:fog_signal:period", getFogPeriod())); 867 935 } 868 936 } -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
r23155 r23174 107 107 } 108 108 109 dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());110 111 109 if (keys.containsKey("seamark:buoy_cardinal:shape")) { //$NON-NLS-1$ 112 110 str = keys.get("seamark:buoy_cardinal:shape"); //$NON-NLS-1$ … … 133 131 if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount()) 134 132 setStyleIndex(0); 133 134 refreshLights(); 135 parseLights(keys); 136 parseFogRadar(keys); 137 138 dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex()); 135 139 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex()); 136 137 parseLights(keys); 138 refreshLights(); 140 dlg.tfM01Name.setText(getName()); 141 dlg.cM01TopMark.setSelected(hasTopMark()); 139 142 } 140 143 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
r23155 r23174 89 89 } 90 90 91 refreshLights(); 91 92 parseLights(keys); 92 refreshLights(); 93 parseFogRadar(keys); 94 95 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex()); 96 dlg.tfM01Name.setText(getName()); 97 dlg.cM01TopMark.setSelected(hasTopMark()); 93 98 } 94 99 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r23155 r23174 213 213 } 214 214 } 215 216 dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());217 215 218 216 if (keys.containsKey("seamark:buoy_lateral:shape")) { //$NON-NLS-1$ … … 273 271 274 272 refreshStyles(); 275 parseLights(keys);276 273 refreshLights(); 277 274 setLightColour(); 275 parseLights(keys); 276 parseFogRadar(keys); 277 278 dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex()); 279 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex()); 280 dlg.tfM01Name.setText(getName()); 281 dlg.cM01TopMark.setSelected(hasTopMark()); 278 282 } 279 283 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyNota.java
r23156 r23174 68 68 } 69 69 70 dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex()); 71 70 refreshLights(); 72 71 parseLights(keys); 73 refreshLights();72 parseFogRadar(keys); 74 73 setTopMark(false); 75 74 setFired(true); 75 76 dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex()); 77 dlg.tfM01Name.setText(getName()); 76 78 dlg.cM01Fired.setEnabled(false); 77 79 dlg.cM01Fired.setSelected(true); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
r23155 r23174 76 76 if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount()) 77 77 setStyleIndex(0); 78 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());79 78 80 79 if (keys.containsKey("seamark:topmark:shape") //$NON-NLS-1$ … … 83 82 } 84 83 84 refreshLights(); 85 85 parseLights(keys); 86 refreshLights(); 86 parseFogRadar(keys); 87 88 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex()); 89 dlg.tfM01Name.setText(getName()); 90 dlg.cM01TopMark.setSelected(hasTopMark()); 87 91 } 88 92 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
r23155 r23174 94 94 if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount()) 95 95 setStyleIndex(0); 96 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());97 96 98 97 keys = node.getKeys(); … … 105 104 } 106 105 106 refreshLights(); 107 107 parseLights(keys); 108 refreshLights(); 108 parseFogRadar(keys); 109 110 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex()); 111 dlg.tfM01Name.setText(getName()); 112 dlg.cM01TopMark.setSelected(hasTopMark()); 109 113 } 110 114
Note:
See TracChangeset
for help on using the changeset viewer.