Changeset 23109 in osm
- Timestamp:
- 2010-09-11T09:49:36+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r23093 r23109 216 216 String str = Main.pref.get("mappaint.style.sources"); //$NON-NLS-1$ 217 217 if (!str.contains("dev.openseamap.org")) { //$NON-NLS-1$ 218 if (!str. equals("")) //$NON-NLS-1$218 if (!str.isEmpty()) //$NON-NLS-1$ 219 219 str += new String(new char[] { 0x1e }); 220 220 Main.pref.put("mappaint.style.sources", str //$NON-NLS-1$ … … 222 222 } 223 223 str = Main.pref.get("color.background"); //$NON-NLS-1$ 224 if (str.equals("#000000") || str. equals("")) //$NON-NLS-1$ //$NON-NLS-2$224 if (str.equals("#000000") || str.isEmpty()) //$NON-NLS-1$ //$NON-NLS-2$ 225 225 Main.pref.put("color.background", "#606060"); //$NON-NLS-1$ //$NON-NLS-2$ 226 226 } … … 1157 1157 if (i1 >= 0) { 1158 1158 g = it.substring(i1 + 1, i2); 1159 if (g. equals("")) //$NON-NLS-1$1159 if (g.isEmpty()) //$NON-NLS-1$ 1160 1160 tfM01Group.setEnabled(true); 1161 1161 } … … 1164 1164 i1 = it.indexOf("+"); //$NON-NLS-1$ 1165 1165 i2 = it.length(); 1166 if (c. equals("")) //$NON-NLS-1$1166 if (c.isEmpty()) //$NON-NLS-1$ 1167 1167 c = it; 1168 1168 else 1169 1169 c = c + it.substring(i1, i2); 1170 1170 } 1171 if (c. equals("")) //$NON-NLS-1$1171 if (c.isEmpty()) //$NON-NLS-1$ 1172 1172 c = it; 1173 1173 buoy.setLightChar(c); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r23093 r23109 236 236 String regex = "^[\\d\\s.]+$"; 237 237 238 if (lightPeriod.length() == 0) 239 lightPeriod = " "; 240 241 Pattern pat = Pattern.compile(regex); 242 Matcher matcher = pat.matcher(lightPeriod); 243 244 if (matcher.find()) { 245 LightPeriod[getSectorIndex()] = lightPeriod; 246 setErrMsg(null); 247 } else { 248 setErrMsg("Must be a number"); 249 dlg.tfM01RepeatTime.requestFocus(); 250 } 238 if (!lightPeriod.isEmpty()) { 239 240 Pattern pat = Pattern.compile(regex); 241 Matcher matcher = pat.matcher(lightPeriod); 242 243 if (matcher.find()) { 244 setErrMsg(null); 245 } else { 246 setErrMsg("Must be a number"); 247 lightPeriod = ""; 248 dlg.tfM01RepeatTime.requestFocus(); 249 } 250 } 251 LightPeriod[getSectorIndex()] = lightPeriod; 251 252 } 252 253 … … 262 263 263 264 public void parseLights(Map<String, String> k) { 264 265 266 String key = (String)((Map.Entry)it.next()).getKey();267 268 String value = ((String)((Map.Entry)it.next()).getValue()).trim();269 270 271 272 }273 265 Iterator it = k.entrySet().iterator(); 266 while (it.hasNext()) { 267 String key = (String) ((Map.Entry) it.next()).getKey(); 268 if (key.contains("seamark:light:")) { 269 String value = ((String) ((Map.Entry) it.next()).getValue()).trim(); 270 271 } 272 } 273 } 274 274 275 private Node Node = null; 275 276 … … 419 420 } 420 421 421 if (!getLightGroup(). equals(""))422 if (!getLightGroup().isEmpty()) 422 423 c = c + "(" + getLightGroup() + ")"; 423 424 if (tmp != null) … … 426 427 c = c + " " + getLightColour(); 427 428 lp = getLightPeriod(); 428 if (!lp. equals(""))429 if (!lp.isEmpty()) 429 430 c = c + " " + lp + "s"; 430 431 dlg.lM01FireMark.setText(c); 432 433 dlg.cM01Fired.setVisible(true); 434 dlg.cM01Fired.setEnabled(false); 435 dlg.cM01Fired.setSelected(true); 436 dlg.lM01Kennung.setVisible(true); 437 dlg.cbM01Kennung.setVisible(true); 438 dlg.lM01Group.setVisible(true); 439 dlg.tfM01Group.setVisible(true); 440 dlg.lM01RepeatTime.setVisible(true); 441 dlg.tfM01RepeatTime.setVisible(true); 442 if (isSectored()) { 443 dlg.lM01Sector.setVisible(true); 444 dlg.cbM01Sector.setVisible(true); 445 dlg.lM01Bearing.setVisible(true); 446 dlg.tfM01Bearing.setVisible(true); 447 dlg.tfM02Bearing.setVisible(true); 448 dlg.tfM01Radius.setVisible(true); 449 } else { 450 dlg.lM01Sector.setVisible(false); 451 dlg.cbM01Sector.setVisible(false); 452 dlg.lM01Bearing.setVisible(false); 453 dlg.tfM01Bearing.setVisible(false); 454 dlg.tfM02Bearing.setVisible(false); 455 dlg.tfM01Radius.setVisible(false); 456 } 431 457 } else { 432 dlg.tfM01RepeatTime.setEnabled(false);433 dlg.cbM01Kennung.setEnabled(false);434 458 dlg.lM01FireMark.setText(""); 435 459 } … … 477 501 478 502 String str = dlg.tfM01Name.getText(); 479 if ( str.compareTo("") != 0)503 if (!str.isEmpty()) 480 504 Main.main.undoRedo.add(new ChangePropertyCommand(Node, "seamark:name", 481 505 str)); … … 485 509 486 510 protected void saveLightData(String colour) { 487 if (colour. equals("")) {511 if (colour.isEmpty()) { 488 512 return; 489 513 } … … 537 561 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 538 562 "seamark:radar_transponder:category", "racon")); 539 if (!getRaconGroup(). equals(""))563 if (!getRaconGroup().isEmpty()) 540 564 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 541 565 "seamark:radar_transponder:group", getRaconGroup())); … … 589 613 break; 590 614 } 591 if (!getFogGroup(). equals(""))615 if (!getFogGroup().isEmpty()) 592 616 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 593 617 "seamark:fog_group:group", getFogGroup())); 594 if (!getFogPeriod(). equals(""))618 if (!getFogPeriod().isEmpty()) 595 619 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 596 620 "seamark:fog_period:group", getFogPeriod())); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
r23086 r23109 70 70 col = keys.get("seamark:light_float:colour"); //$NON-NLS-1$ 71 71 72 if (cat. equals("")) { //$NON-NLS-1$72 if (cat.isEmpty()) { //$NON-NLS-1$ 73 73 if (col.equals("black;yellow")) { //$NON-NLS-1$ 74 74 setBuoyIndex(CARD_NORTH); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r23093 r23109 82 82 cat = keys.get("seamark:beacon_lateral:category"); //$NON-NLS-1$ 83 83 84 if (cat. equals("")) { //$NON-NLS-1$84 if (cat.isEmpty()) { //$NON-NLS-1$ 85 85 if (col.equals("red")) { //$NON-NLS-1$ 86 86 setColour(RED); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyNota.java
r23096 r23109 54 54 dlg.cM01Fog.setVisible(true); 55 55 56 dlg.cM01Fired.setVisible(true);57 dlg.cM01Fired.setEnabled(false);58 dlg.cM01Fired.setSelected(true);59 56 dlg.rbM01Fired1.setVisible(true); 60 57 dlg.rbM01FiredN.setVisible(true); 61 dlg.lM01Kennung.setVisible(true);62 dlg.cbM01Kennung.setVisible(true);63 58 dlg.lM01Height.setVisible(true); 64 59 dlg.tfM01Height.setVisible(true); 65 60 dlg.lM01Range.setVisible(true); 66 61 dlg.tfM01Range.setVisible(true); 67 dlg.lM01Group.setVisible(true);68 dlg.tfM01Group.setVisible(true);69 dlg.lM01RepeatTime.setVisible(true);70 dlg.tfM01RepeatTime.setVisible(true);71 62 dlg.lM01Colour.setVisible(true); 72 63 dlg.cbM01Colour.setVisible(true); 73 if (isSectored()) {74 dlg.lM01Sector.setVisible(true);75 dlg.cbM01Sector.setVisible(true);76 dlg.lM01Bearing.setVisible(true);77 dlg.tfM01Bearing.setVisible(true);78 dlg.tfM02Bearing.setVisible(true);79 dlg.tfM01Radius.setVisible(true);80 } else {81 dlg.lM01Sector.setVisible(false);82 dlg.cbM01Sector.setVisible(false);83 dlg.lM01Bearing.setVisible(false);84 dlg.tfM01Bearing.setVisible(false);85 dlg.tfM02Bearing.setVisible(false);86 dlg.tfM01Radius.setVisible(false);87 }88 64 89 65 switch (getBuoyIndex()) {
Note:
See TracChangeset
for help on using the changeset viewer.