Changeset 23005 in osm for applications/editors/josm/plugins/toms
- Timestamp:
- 2010-09-06T04:09:24+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r23001 r23005 48 48 import org.openstreetmap.josm.tools.Shortcut; 49 49 50 import toms.Messages; 50 51 import toms.seamarks.SeaMark; 51 52 import toms.seamarks.buoys.Buoy; … … 72 73 private Buoy obuoy = null; // gemerkte Tonne // @jve:decl-index=0: 73 74 private JMenuItem SmpItem = null; // Info über item in der Werkzeugleiste 74 private String smt = ""; // value vom key "seamark:type" // @jve:decl-index=0: 75 private String smb = ""; // value vom key "seamark" // @jve:decl-index=0: 75 private String smt = ""; // value vom key "seamark:type" // @jve:decl-index=0: //$NON-NLS-1$ 76 private String smb = ""; // value vom key "seamark" // @jve:decl-index=0: //$NON-NLS-1$ 76 77 private Collection<? extends OsmPrimitive> Selection = null; // @jve:decl-index=0: 77 78 private OsmPrimitive SelNode = null; 78 private String Os = ""; // @jve:decl-index=0: 79 private String UserHome = ""; // @jve:decl-index=0: 79 private String Os = ""; // @jve:decl-index=0: //$NON-NLS-1$ 80 private String UserHome = ""; // @jve:decl-index=0: //$NON-NLS-1$ 80 81 81 82 // SelectionChangedListner der in die Eventqueue von josm eingehängt wird … … 200 201 201 202 public SmpDialogAction() { 202 super( tr("Edit OpenSeaMap"), "Smp", tr("Seamark Editor"), Shortcut203 .registerShortcut("tools:Semarks", 204 tr("Tool: {0}", tr("Seamark Editor")), KeyEvent.VK_S,203 super(Messages.getString("SmpDialogAction.4"), "Smp",Messages.getString("SmpDialogAction.0"), Shortcut //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 204 .registerShortcut("tools:Semarks", //$NON-NLS-1$ 205 tr("Tool: {0}", Messages.getString("SmpDialogAction.9")), KeyEvent.VK_S, //$NON-NLS-1$ //$NON-NLS-2$ 205 206 Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true); 206 207 207 208 dia = this; 208 String str = Main.pref.get("mappaint.style.sources"); 209 if (!str.contains("dev.openseamap.org")) { 210 if (!str.equals("")) 209 String str = Main.pref.get("mappaint.style.sources"); //$NON-NLS-1$ 210 if (!str.contains("dev.openseamap.org")) { //$NON-NLS-1$ 211 if (!str.equals("")) //$NON-NLS-1$ 211 212 str += new String(new char[] { 0x1e }); 212 Main.pref.put("mappaint.style.sources", str 213 + "http://dev.openseamap.org/josm/seamark_styles.xml"); 214 } 215 str = Main.pref.get("color.background"); 216 if (str.equals("#000000") || str.equals("")) 217 Main.pref.put("color.background", "#606060"); 213 Main.pref.put("mappaint.style.sources", str //$NON-NLS-1$ 214 + "http://dev.openseamap.org/josm/seamark_styles.xml"); //$NON-NLS-1$ 215 } 216 str = Main.pref.get("color.background"); //$NON-NLS-1$ 217 if (str.equals("#000000") || str.equals("")) //$NON-NLS-1$ //$NON-NLS-2$ 218 Main.pref.put("color.background", "#606060"); //$NON-NLS-1$ //$NON-NLS-2$ 218 219 } 219 220 … … 284 285 Command c; 285 286 286 if (smb != "") { 287 288 c = new ChangePropertyCommand(n, "seamark", smb); 287 if (smb != "") { //$NON-NLS-1$ 288 289 c = new ChangePropertyCommand(n, "seamark", smb); //$NON-NLS-1$ 289 290 c.executeCommand(); 290 291 ds.fireSelectionChanged(); 291 292 292 smb = ""; 293 smb = ""; //$NON-NLS-1$ 293 294 } 294 295 295 if (smt != "") { 296 297 c = new ChangePropertyCommand(n, "seamark:type", smt); 296 if (smt != "") { //$NON-NLS-1$ 297 298 c = new ChangePropertyCommand(n, "seamark:type", smt); //$NON-NLS-1$ 298 299 c.executeCommand(); 299 300 ds.fireSelectionChanged(); 300 301 301 smt = ""; 302 smt = ""; //$NON-NLS-1$ 302 303 } 303 304 } … … 318 319 319 320 if (ds == null) { 320 buoy = new BuoyUkn(this, "active layer contains no OSM data");321 buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.26")); //$NON-NLS-1$ 321 322 buoy.setNode(null); 322 323 return; … … 327 328 328 329 if (nodes == 0) { 329 buoy = new BuoyUkn(this, "Please select a node");330 buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.27")); //$NON-NLS-1$ 330 331 buoy.setNode(null); 331 332 return; … … 333 334 334 335 if (nodes > 1) { 335 buoy = new BuoyUkn(this, "Please select only one node");336 buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.28")); //$NON-NLS-1$ 336 337 buoy.setNode(null); 337 338 return; … … 354 355 cM01IconVisible.setEnabled(true); 355 356 cM01IconVisible.setIcon(new ImageIcon(getClass().getResource( 356 "/images/Auge.png"))); 357 "/images/Auge.png"))); //$NON-NLS-1$ 357 358 358 359 cbM01TypeOfMark.setEnabled(true); 359 360 360 361 // Soweit das Vorspiel. Ab hier beginnt das Parsen 361 String type = ""; 362 String str = ""; 362 String type = ""; //$NON-NLS-1$ 363 String str = ""; //$NON-NLS-1$ 363 364 364 365 keys = node.getKeys(); … … 368 369 // schrieben werden 369 370 370 if (keys.containsKey("seamark:type")) 371 type = keys.get("seamark:type"); 372 373 if (type.equals("buoy_lateral") || type.equals("beacon_lateral") 374 || keys.containsKey("seamark:buoy_lateral:category") 375 || keys.containsKey("seamark:buoy_lateral:shape") 376 || keys.containsKey("seamark:buoy_lateral:colour") 377 || keys.containsKey("seamark:beacon_lateral:category") 378 || keys.containsKey("seamark:beacon_lateral:shape") 379 || keys.containsKey("seamark:beacon_lateral:colour")) { 371 if (keys.containsKey("seamark:type")) //$NON-NLS-1$ 372 type = keys.get("seamark:type"); //$NON-NLS-1$ 373 374 if (type.equals("buoy_lateral") || type.equals("beacon_lateral") //$NON-NLS-1$ //$NON-NLS-2$ 375 || keys.containsKey("seamark:buoy_lateral:category") //$NON-NLS-1$ 376 || keys.containsKey("seamark:buoy_lateral:shape") //$NON-NLS-1$ 377 || keys.containsKey("seamark:buoy_lateral:colour") //$NON-NLS-1$ 378 || keys.containsKey("seamark:beacon_lateral:category") //$NON-NLS-1$ 379 || keys.containsKey("seamark:beacon_lateral:shape") //$NON-NLS-1$ 380 || keys.containsKey("seamark:beacon_lateral:colour")) { //$NON-NLS-1$ 380 381 buoy = new BuoyLat(this, node); 381 382 return; 382 383 383 } else if (type.equals("buoy_cardinal") || type.equals("beacon_cardinal") 384 || keys.containsKey("seamark:buoy_cardinal:category") 385 || keys.containsKey("seamark:buoy_cardinal:shape") 386 || keys.containsKey("seamark:buoy_cardinal:colour") 387 || keys.containsKey("seamark:beacon_cardinal:category") 388 || keys.containsKey("seamark:beacon_cardinal:shape") 389 || keys.containsKey("seamark:beacon_cardinal:colour")) { 384 } else if (type.equals("buoy_cardinal") || type.equals("beacon_cardinal") //$NON-NLS-1$ //$NON-NLS-2$ 385 || keys.containsKey("seamark:buoy_cardinal:category") //$NON-NLS-1$ 386 || keys.containsKey("seamark:buoy_cardinal:shape") //$NON-NLS-1$ 387 || keys.containsKey("seamark:buoy_cardinal:colour") //$NON-NLS-1$ 388 || keys.containsKey("seamark:beacon_cardinal:category") //$NON-NLS-1$ 389 || keys.containsKey("seamark:beacon_cardinal:shape") //$NON-NLS-1$ 390 || keys.containsKey("seamark:beacon_cardinal:colour")) { //$NON-NLS-1$ 390 391 buoy = new BuoyCard(this, node); 391 392 return; 392 393 393 } else if (type.equals("buoy_safe_water") 394 || type.equals("beacon_safe_water") 395 || keys.containsKey("seamark:buoy_safe_water:shape") 396 || keys.containsKey("seamark:buoy_safe_water:colour") 397 || keys.containsKey("seamark:beacon_safe_water:shape") 398 || keys.containsKey("seamark:beacon_safe_water:colour")) { 394 } else if (type.equals("buoy_safe_water") //$NON-NLS-1$ 395 || type.equals("beacon_safe_water") //$NON-NLS-1$ 396 || keys.containsKey("seamark:buoy_safe_water:shape") //$NON-NLS-1$ 397 || keys.containsKey("seamark:buoy_safe_water:colour") //$NON-NLS-1$ 398 || keys.containsKey("seamark:beacon_safe_water:shape") //$NON-NLS-1$ 399 || keys.containsKey("seamark:beacon_safe_water:colour")) { //$NON-NLS-1$ 399 400 buoy = new BuoySaw(this, node); 400 401 return; 401 402 402 } else if (type.equals("buoy_special_purpose") 403 || type.equals("beacon_special_purpose") 404 || keys.containsKey("seamark:buoy_special_purpose:shape") 405 || keys.containsKey("seamark:buoy_special_purpose:colour") 406 || keys.containsKey("seamark:beacon_special_purpose:shape") 407 || keys.containsKey("seamark:beacon_special_purpose:colour")) { 403 } else if (type.equals("buoy_special_purpose") //$NON-NLS-1$ 404 || type.equals("beacon_special_purpose") //$NON-NLS-1$ 405 || keys.containsKey("seamark:buoy_special_purpose:shape") //$NON-NLS-1$ 406 || keys.containsKey("seamark:buoy_special_purpose:colour") //$NON-NLS-1$ 407 || keys.containsKey("seamark:beacon_special_purpose:shape") //$NON-NLS-1$ 408 || keys.containsKey("seamark:beacon_special_purpose:colour")) { //$NON-NLS-1$ 408 409 buoy = new BuoySpec(this, node); 409 410 return; 410 411 411 } else if (type.equals("buoy_isolated_danger") 412 || type.equals("beacon_isolated_danger") 413 || keys.containsKey("seamark:buoy_isolated_danger:shape") 414 || keys.containsKey("seamark:buoy_isolated_danger:colour") 415 || keys.containsKey("seamark:beacon_isolated_danger:shape") 416 || keys.containsKey("seamark:beacon_isolated_danger:colour")) { 412 } else if (type.equals("buoy_isolated_danger") //$NON-NLS-1$ 413 || type.equals("beacon_isolated_danger") //$NON-NLS-1$ 414 || keys.containsKey("seamark:buoy_isolated_danger:shape") //$NON-NLS-1$ 415 || keys.containsKey("seamark:buoy_isolated_danger:colour") //$NON-NLS-1$ 416 || keys.containsKey("seamark:beacon_isolated_danger:shape") //$NON-NLS-1$ 417 || keys.containsKey("seamark:beacon_isolated_danger:colour")) { //$NON-NLS-1$ 417 418 buoy = new BuoyIsol(this, node); 418 419 return; 419 420 420 } else if (type.equals("light_float")) { 421 if (keys.containsKey("seamark:light_float:colour")) { 422 str = keys.get("seamark:light_float:colour"); 423 if (str.equals("red") || str.equals("green") 424 || str.equals("red;green;red") || str.equals("green;red;green")) { 421 } else if (type.equals("light_float")) { //$NON-NLS-1$ 422 if (keys.containsKey("seamark:light_float:colour")) { //$NON-NLS-1$ 423 str = keys.get("seamark:light_float:colour"); //$NON-NLS-1$ 424 if (str.equals("red") || str.equals("green") //$NON-NLS-1$ //$NON-NLS-2$ 425 || str.equals("red;green;red") || str.equals("green;red;green")) { //$NON-NLS-1$ //$NON-NLS-2$ 425 426 buoy = new BuoyLat(this, node); 426 427 return; 427 } else if (str.equals("black;yellow") 428 || str.equals("black;yellow;black") || str.equals("yellow;black") 429 || str.equals("yellow;black;yellow")) { 428 } else if (str.equals("black;yellow") //$NON-NLS-1$ 429 || str.equals("black;yellow;black") || str.equals("yellow;black") //$NON-NLS-1$ //$NON-NLS-2$ 430 || str.equals("yellow;black;yellow")) { //$NON-NLS-1$ 430 431 buoy = new BuoyCard(this, node); 431 432 return; 432 } else if (str.equals("black;red;black")) { 433 } else if (str.equals("black;red;black")) { //$NON-NLS-1$ 433 434 buoy = new BuoyIsol(this, node); 434 435 return; 435 } else if (str.equals("red;white")) { 436 } else if (str.equals("red;white")) { //$NON-NLS-1$ 436 437 buoy = new BuoySaw(this, node); 437 438 return; 438 } else if (str.equals("yellow")) { 439 } else if (str.equals("yellow")) { //$NON-NLS-1$ 439 440 buoy = new BuoySaw(this, node); 440 441 return; 441 442 } else { 442 buoy = new BuoyUkn(this, "Parse-Error: Invalid colour");443 buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.82")); //$NON-NLS-1$ 443 444 buoy.setNode(node); 444 445 return; 445 446 } 446 } else if (keys.containsKey("seamark:light_float:topmark:shape")) { 447 str = keys.get("seamark:light_float:topmark:shape"); 448 if (str.equals("cylinder") || str.equals("cone, point up")) { 447 } else if (keys.containsKey("seamark:light_float:topmark:shape")) { //$NON-NLS-1$ 448 str = keys.get("seamark:light_float:topmark:shape"); //$NON-NLS-1$ 449 if (str.equals("cylinder") || str.equals("cone, point up")) { //$NON-NLS-1$ //$NON-NLS-2$ 449 450 buoy = new BuoyLat(this, node); 450 451 return; 451 452 } 452 } else if (keys.containsKey("seamark:light_float:topmark:colour")) { 453 str = keys.get("seamark:light_float:topmark:colour"); 454 if (str.equals("red") || str.equals("green")) { 453 } else if (keys.containsKey("seamark:light_float:topmark:colour")) { //$NON-NLS-1$ 454 str = keys.get("seamark:light_float:topmark:colour"); //$NON-NLS-1$ 455 if (str.equals("red") || str.equals("green")) { //$NON-NLS-1$ //$NON-NLS-2$ 455 456 buoy = new BuoyLat(this, node); 456 457 return; … … 459 460 } 460 461 461 buoy = new BuoyUkn(this, "Seamark not set");462 buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.91")); //$NON-NLS-1$ 462 463 buoy.setNode(node); 463 464 return; … … 473 474 dM01SeaMap.setResizable(false); 474 475 dM01SeaMap.setContentPane(getPM01SeaMap()); 475 dM01SeaMap.setTitle( "Seamark Editor");476 dM01SeaMap.setTitle(Messages.getString("SmpDialogAction.92")); //$NON-NLS-1$ 476 477 dM01SeaMap.setVisible(false); 477 478 dM01SeaMap.setAlwaysOnTop(true); … … 505 506 lM01Icon01.setBounds(new Rectangle(210, 30, 160, 200)); 506 507 lM01Icon01.setIcon(null); 507 lM01Icon01.setText(""); 508 lM01Icon01.setText(""); //$NON-NLS-1$ 508 509 509 510 lM01Icon02 = new JLabel(); 510 511 lM01Icon02.setBounds(new Rectangle(210, 30, 160, 200)); 511 512 lM01Icon02.setIcon(null); 512 lM01Icon02.setText(""); 513 lM01Icon02.setText(""); //$NON-NLS-1$ 513 514 514 515 lM01FireMark = new JLabel(); 515 516 lM01FireMark.setBounds(new Rectangle(305, 90, 90, 20)); 516 lM01FireMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 517 lM01FireMark.setText(""); 517 lM01FireMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 518 lM01FireMark.setText(""); //$NON-NLS-1$ 518 519 519 520 lM01Head = new JLabel(); 520 521 lM01Head.setBounds(new Rectangle(5, 3, 316, 16)); 521 lM01Head.setText( "Seamark Properties");522 lM01Head.setText(Messages.getString("SmpDialogAction.97")); //$NON-NLS-1$ 522 523 523 524 lM01Region = new JLabel(); 524 525 lM01Region.setBounds(new Rectangle(220, 7, 120, 16)); 525 lM01Region.setFont(new Font("Dialog", Font.PLAIN, 12)); 526 lM01Region.setText( "Region:");526 lM01Region.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 527 lM01Region.setText(Messages.getString("SmpDialogAction.99")); //$NON-NLS-1$ 527 528 528 529 lM02Region = new JLabel(); 529 530 lM02Region.setBounds(new Rectangle(270, 7, 120, 16)); 530 lM02Region.setFont(new Font("Dialog", Font.BOLD, 12)); 531 lM02Region.setText( "IALA");531 lM02Region.setFont(new Font("Dialog", Font.BOLD, 12)); //$NON-NLS-1$ 532 lM02Region.setText(Messages.getString("SmpDialogAction.101")); //$NON-NLS-1$ 532 533 533 534 lM01TypeOfMark = new JLabel(); 534 535 lM01TypeOfMark.setBounds(new Rectangle(5, 28, 120, 16)); 535 lM01TypeOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 536 lM01TypeOfMark.setText( "Type:");536 lM01TypeOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 537 lM01TypeOfMark.setText(Messages.getString("SmpDialogAction.103")); //$NON-NLS-1$ 537 538 538 539 lM01CatOfMark = new JLabel(); 539 540 lM01CatOfMark.setBounds(new Rectangle(5, 58, 120, 16)); 540 lM01CatOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 541 lM01CatOfMark.setText( "Category:");541 lM01CatOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 542 lM01CatOfMark.setText(Messages.getString("SmpDialogAction.1")); //$NON-NLS-1$ 542 543 543 544 lM01StyleOfMark = new JLabel(); 544 545 lM01StyleOfMark.setBounds(new Rectangle(5, 88, 148, 16)); 545 lM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 546 lM01StyleOfMark.setText( "Shape:");546 lM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 547 lM01StyleOfMark.setText(Messages.getString("SmpDialogAction.107")); //$NON-NLS-1$ 547 548 548 549 lM01Name = new JLabel(); 549 550 lM01Name.setBounds(new Rectangle(5, 120, 82, 16)); 550 lM01Name.setFont(new Font("Dialog", Font.PLAIN, 12)); 551 lM01Name.setText( "Name:");551 lM01Name.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 552 lM01Name.setText(Messages.getString("SmpDialogAction.109")); //$NON-NLS-1$ 552 553 553 554 lM01Props02 = new JLabel(); 554 lM01Props02.setBounds(new Rectangle(5, 150, 90, 16));555 lM01Props02.setFont(new Font("Dialog", Font.PLAIN, 12)); 556 lM01Props02.setText( "Other Features:");555 lM01Props02.setBounds(new Rectangle(5, 150, 172, 16)); 556 lM01Props02.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 557 lM01Props02.setText(Messages.getString("SmpDialogAction.111")); //$NON-NLS-1$ 557 558 558 559 lM01Racon = new JLabel(); 559 560 lM01Racon.setBounds(new Rectangle(335, 195, 65, 20)); 560 lM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); 561 lM01Racon.setText( "( )");561 lM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 562 lM01Racon.setText(Messages.getString("SmpDialogAction.113")); //$NON-NLS-1$ 562 563 563 564 lM01FogGroup = new JLabel(); 564 565 lM01FogGroup.setBounds(new Rectangle(190, 220, 100, 20)); 565 lM01FogGroup.setFont(new Font("Dialog", Font.PLAIN, 12)); 566 lM01FogGroup.setText( "Group: ( )");566 lM01FogGroup.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 567 lM01FogGroup.setText(Messages.getString("SmpDialogAction.115")); //$NON-NLS-1$ 567 568 568 569 lM01FogPeriod = new JLabel(); 569 570 lM01FogPeriod.setBounds(new Rectangle(300, 220, 100, 20)); 570 lM01FogPeriod.setFont(new Font("Dialog", Font.PLAIN, 12)); 571 lM01FogPeriod.setText( "Period: s");571 lM01FogPeriod.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 572 lM01FogPeriod.setText(Messages.getString("SmpDialogAction.117")); //$NON-NLS-1$ 572 573 573 574 lM01Kennung = new JLabel(); 574 575 lM01Kennung.setBounds(new Rectangle(240, 245, 60, 20)); 575 lM01Kennung.setFont(new Font("Dialog", Font.PLAIN, 12)); 576 lM01Kennung.setText( "Character:");576 lM01Kennung.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 577 lM01Kennung.setText(Messages.getString("SmpDialogAction.119")); //$NON-NLS-1$ 577 578 578 579 lM01Height = new JLabel(); 579 580 lM01Height.setBounds(new Rectangle(10, 270, 100, 20)); 580 lM01Height.setFont(new Font("Dialog", Font.PLAIN, 12)); 581 lM01Height.setText( "Height: m");581 lM01Height.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 582 lM01Height.setText(Messages.getString("SmpDialogAction.121")); //$NON-NLS-1$ 582 583 583 584 lM01Range = new JLabel(); 584 585 lM01Range.setBounds(new Rectangle(108, 270, 100, 20)); 585 lM01Range.setFont(new Font("Dialog", Font.PLAIN, 12)); 586 lM01Range.setText( "Range: M");586 lM01Range.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 587 lM01Range.setText(Messages.getString("SmpDialogAction.123")); //$NON-NLS-1$ 587 588 588 589 lM01Group = new JLabel(); 589 590 lM01Group.setBounds(new Rectangle(204, 270, 100, 20)); 590 lM01Group.setFont(new Font("Dialog", Font.PLAIN, 12)); 591 lM01Group.setText( "Group: ( )");591 lM01Group.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 592 lM01Group.setText(Messages.getString("SmpDialogAction.125")); //$NON-NLS-1$ 592 593 593 594 lM01RepeatTime = new JLabel(); 594 595 lM01RepeatTime.setBounds(new Rectangle(300, 270, 100, 20)); 595 lM01RepeatTime.setFont(new Font("Dialog", Font.PLAIN, 12)); 596 lM01RepeatTime.setText( "Period: s");596 lM01RepeatTime.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 597 lM01RepeatTime.setText(Messages.getString("SmpDialogAction.127")); //$NON-NLS-1$ 597 598 598 599 lM01Sector = new JLabel(); 599 600 lM01Sector.setBounds(new Rectangle(10, 295, 180, 20)); 600 lM01Sector.setFont(new Font("Dialog", Font.PLAIN, 12)); 601 lM01Sector.setText( "Sector:");601 lM01Sector.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 602 lM01Sector.setText(Messages.getString("SmpDialogAction.129")); //$NON-NLS-1$ 602 603 603 604 lM01Colour = new JLabel(); 604 605 lM01Colour.setBounds(new Rectangle(120, 295, 180, 20)); 605 lM01Colour.setFont(new Font("Dialog", Font.PLAIN, 12)); 606 lM01Colour.setText( "Colour:");606 lM01Colour.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 607 lM01Colour.setText(Messages.getString("SmpDialogAction.131")); //$NON-NLS-1$ 607 608 608 609 lM01Bearing = new JLabel(); 609 610 lM01Bearing.setBounds(new Rectangle(228, 295, 180, 20)); 610 lM01Bearing.setFont(new Font("Dialog", Font.PLAIN, 12)); 611 lM01Bearing.setText( "Brg: �- �, r:");612 613 rbM01RegionA = new JRadioButton( "-A", Main.pref.get("tomsplugin.IALA")614 .equals("A")); 611 lM01Bearing.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 612 lM01Bearing.setText(Messages.getString("SmpDialogAction.133")); //$NON-NLS-1$ 613 614 rbM01RegionA = new JRadioButton(Messages.getString("SmpDialogAction.134"), Main.pref.get("tomsplugin.IALA") //$NON-NLS-1$ //$NON-NLS-2$ 615 .equals("A")); //$NON-NLS-1$ 615 616 rbM01RegionA.setBounds(new Rectangle(305, 0, 50, 30)); 616 rbM01RegionB = new JRadioButton("-B", Main.pref.get("tomsplugin.IALA") 617 .equals("B")); 617 rbM01RegionB = new JRadioButton("-B", Main.pref.get("tomsplugin.IALA") //$NON-NLS-1$ //$NON-NLS-2$ 618 .equals("B")); //$NON-NLS-1$ 618 619 rbM01RegionB.setBounds(new Rectangle(352, 0, 50, 30)); 619 620 bgM01Region = new ButtonGroup(); … … 633 634 rbM01RegionB.addActionListener(alM01Region); 634 635 635 rbM01Fired1 = new JRadioButton( "Single", true);636 rbM01Fired1 = new JRadioButton(Messages.getString("SmpDialogAction.140"), true); //$NON-NLS-1$ 636 637 rbM01Fired1.setBounds(new Rectangle(80, 240, 65, 30)); 637 rbM01FiredN = new JRadioButton( "Sectored", false);638 rbM01FiredN = new JRadioButton(Messages.getString("SmpDialogAction.141"), false); //$NON-NLS-1$ 638 639 rbM01FiredN.setBounds(new Rectangle(145, 240, 80, 30)); 639 640 bgM01Fired = new ButtonGroup(); … … 717 718 718 719 // Inhalt der ComboBox 719 cbM01TypeOfMark.addItem( "* Select Seamark *");720 cbM01TypeOfMark.addItem( "Lateral Mark");721 cbM01TypeOfMark.addItem( "Cardinal Mark");722 cbM01TypeOfMark.addItem( "Safe Water Mark");723 cbM01TypeOfMark.addItem( "Isolated Danger");724 cbM01TypeOfMark.addItem( "Special Purpose");725 cbM01TypeOfMark.addItem( "Light");720 cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.142")); //$NON-NLS-1$ 721 cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.143")); //$NON-NLS-1$ 722 cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.144")); //$NON-NLS-1$ 723 cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.145")); //$NON-NLS-1$ 724 cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.146")); //$NON-NLS-1$ 725 cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.147")); //$NON-NLS-1$ 726 cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.148")); //$NON-NLS-1$ 726 727 727 728 cbM01TypeOfMark.setBounds(new Rectangle(50, 25, 150, 25)); 728 729 cbM01TypeOfMark.setEditable(false); 729 cbM01TypeOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 730 cbM01TypeOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 730 731 cbM01TypeOfMark.setEnabled(true); 731 732 … … 735 736 736 737 if (buoy == null) { 737 buoy = new BuoyUkn(dia, "Seamark not set");738 buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$ 738 739 return; 739 740 } … … 747 748 case SeaMark.UNKNOWN_TYPE: 748 749 if (!(buoy instanceof BuoyUkn)) 749 buoy = new BuoyUkn(dia, "Seamark not set");750 buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$ 750 751 buoy.setBuoyIndex(type); 751 752 break; … … 755 756 buoy.setBuoyIndex(0); 756 757 cbM01CatOfMark.removeAllItems(); 757 cbM01CatOfMark.addItem( "*Select Category*");758 cbM01CatOfMark.addItem( "Port");759 cbM01CatOfMark.addItem( "Starboard");760 cbM01CatOfMark.addItem( "Preferred Port");761 cbM01CatOfMark.addItem( "Preferred Starboard");758 cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.152")); //$NON-NLS-1$ 759 cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.153")); //$NON-NLS-1$ 760 cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.154")); //$NON-NLS-1$ 761 cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.155")); //$NON-NLS-1$ 762 cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.156")); //$NON-NLS-1$ 762 763 cbM01CatOfMark.setEnabled(true); 763 764 } … … 768 769 buoy.setBuoyIndex(0); 769 770 cbM01CatOfMark.removeAllItems(); 770 cbM01CatOfMark.addItem( "*Select Category*");771 cbM01CatOfMark.addItem( "North");772 cbM01CatOfMark.addItem( "East");773 cbM01CatOfMark.addItem( "South");774 cbM01CatOfMark.addItem( "West");771 cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.157")); //$NON-NLS-1$ 772 cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.158")); //$NON-NLS-1$ 773 cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.159")); //$NON-NLS-1$ 774 cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.160")); //$NON-NLS-1$ 775 cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.161")); //$NON-NLS-1$ 775 776 cbM01CatOfMark.setEnabled(true); 776 777 } … … 810 811 cbM01CatOfMark = new JComboBox(); 811 812 cbM01CatOfMark.setBounds(new Rectangle(75, 55, 125, 25)); 812 cbM01CatOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 813 cbM01CatOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 813 814 cbM01CatOfMark.addActionListener(new ActionListener() { 814 815 public void actionPerformed(ActionEvent e) { … … 816 817 817 818 if (buoy == null) { 818 buoy = new BuoyUkn(dia, "Seamark not set");819 buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$ 819 820 return; 820 821 } … … 851 852 cbM01StyleOfMark = new JComboBox(); 852 853 cbM01StyleOfMark.setBounds(new Rectangle(50, 85, 150, 25)); 853 cbM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 854 cbM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 854 855 cbM01StyleOfMark.addActionListener(new ActionListener() { 855 856 public void actionPerformed(ActionEvent e) { … … 883 884 cM01TopMark = new JCheckBox(); 884 885 cM01TopMark.setBounds(new Rectangle(10, 170, 90, 20)); 885 cM01TopMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 886 cM01TopMark.setText( "Topmark");886 cM01TopMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 887 cM01TopMark.setText(Messages.getString("SmpDialogAction.166")); //$NON-NLS-1$ 887 888 cM01TopMark.addItemListener(new ItemListener() { 888 889 public void itemStateChanged(ItemEvent e) { … … 902 903 cbM01TopMark = new JComboBox(); 903 904 cbM01TopMark.setBounds(new Rectangle(100, 170, 70, 20)); 904 cbM01TopMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 905 cbM01TopMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 905 906 cbM01TopMark.addActionListener(new ActionListener() { 906 907 public void actionPerformed(ActionEvent e) { … … 916 917 cM01Radar = new JCheckBox(); 917 918 cM01Radar.setBounds(new Rectangle(10, 195, 120, 20)); 918 cM01Radar.setFont(new Font("Dialog", Font.PLAIN, 12)); 919 cM01Radar.setText( "Radar Reflector");919 cM01Radar.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 920 cM01Radar.setText(Messages.getString("SmpDialogAction.169")); //$NON-NLS-1$ 920 921 } 921 922 return cM01Radar; … … 926 927 cM01Racon = new JCheckBox(); 927 928 cM01Racon.setBounds(new Rectangle(130, 195, 110, 20)); 928 cM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); 929 cM01Racon.setText( "Radar Beacon");929 cM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 930 cM01Racon.setText(Messages.getString("SmpDialogAction.171")); //$NON-NLS-1$ 930 931 } 931 932 return cM01Racon; … … 936 937 cbM01Racon = new JComboBox(); 937 938 cbM01Racon.setBounds(new Rectangle(240, 195, 80, 20)); 938 cbM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); 939 cbM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 939 940 cbM01Racon.addActionListener(new ActionListener() { 940 941 public void actionPerformed(ActionEvent e) { … … 963 964 cM01Fog = new JCheckBox(); 964 965 cM01Fog.setBounds(new Rectangle(10, 220, 90, 20)); 965 cM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); 966 cM01Fog.setText( "Fog Signal");966 cM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 967 cM01Fog.setText(Messages.getString("SmpDialogAction.174")); //$NON-NLS-1$ 967 968 } 968 969 return cM01Fog; … … 973 974 cbM01Fog = new JComboBox(); 974 975 cbM01Fog.setBounds(new Rectangle(100, 220, 70, 20)); 975 cbM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); 976 cbM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 976 977 cbM01Fog.addActionListener(new ActionListener() { 977 978 public void actionPerformed(ActionEvent e) { … … 1013 1014 cM01Fired = new JCheckBox(); 1014 1015 cM01Fired.setBounds(new Rectangle(10, 245, 70, 20)); 1015 cM01Fired.setFont(new Font("Dialog", Font.PLAIN, 12)); 1016 cM01Fired.setText( "Lighted");1016 cM01Fired.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 1017 cM01Fired.setText(Messages.getString("SmpDialogAction.177")); //$NON-NLS-1$ 1017 1018 cM01Fired.addItemListener(new ItemListener() { 1018 1019 public void itemStateChanged(ItemEvent e) { … … 1037 1038 public void actionPerformed(ActionEvent e) { 1038 1039 int i1, i2; 1039 String g = "", c = ""; 1040 String g = "", c = ""; //$NON-NLS-1$ //$NON-NLS-2$ 1040 1041 String it = (String) cbM01Kennung.getSelectedItem(); 1041 1042 1042 1043 if (it == null) 1043 1044 return; 1044 if (it.compareTo("Not set") == 0) 1045 if (it.compareTo("Not set") == 0) //$NON-NLS-1$ 1045 1046 return; 1046 1047 if (buoy == null) 1047 1048 return; 1048 1049 1049 i1 = it.indexOf("("); 1050 i2 = it.indexOf(")", i1); 1051 tfM01Group.setText(""); 1050 i1 = it.indexOf("("); //$NON-NLS-1$ 1051 i2 = it.indexOf(")", i1); //$NON-NLS-1$ 1052 tfM01Group.setText(""); //$NON-NLS-1$ 1052 1053 tfM01Group.setEnabled(false); 1053 1054 if (i1 >= 0) { … … 1055 1056 if (i1 >= 0) { 1056 1057 g = it.substring(i1 + 1, i2); 1057 if (g.equals("")) 1058 if (g.equals("")) //$NON-NLS-1$ 1058 1059 tfM01Group.setEnabled(true); 1059 1060 } 1060 1061 } 1061 if (it.contains("+")) { 1062 i1 = it.indexOf("+"); 1062 if (it.contains("+")) { //$NON-NLS-1$ 1063 i1 = it.indexOf("+"); //$NON-NLS-1$ 1063 1064 i2 = it.length(); 1064 if (c.equals("")) 1065 if (c.equals("")) //$NON-NLS-1$ 1065 1066 c = it; 1066 1067 else 1067 1068 c = c + it.substring(i1, i2); 1068 1069 } 1069 if (c.equals("")) 1070 if (c.equals("")) //$NON-NLS-1$ 1070 1071 c = it; 1071 1072 buoy.setLightChar(c); … … 1147 1148 cbM01Colour = new JComboBox(); 1148 1149 cbM01Colour.setBounds(new Rectangle(165, 295, 40, 20)); 1149 cbM01Colour.setFont(new Font("Dialog", Font.PLAIN, 12)); 1150 cbM01Colour.addItem( "W");1151 cbM01Colour.addItem( "R");1152 cbM01Colour.addItem( "G");1150 cbM01Colour.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 1151 cbM01Colour.addItem(Messages.getString("SmpDialogAction.190")); //$NON-NLS-1$ 1152 cbM01Colour.addItem(Messages.getString("SmpDialogAction.191")); //$NON-NLS-1$ 1153 cbM01Colour.addItem(Messages.getString("SmpDialogAction.192")); //$NON-NLS-1$ 1153 1154 cbM01Colour.addActionListener(new ActionListener() { 1154 1155 public void actionPerformed(ActionEvent e) { … … 1164 1165 cbM01Sector = new JComboBox(); 1165 1166 cbM01Sector.setBounds(new Rectangle(55, 295, 50, 20)); 1166 cbM01Sector.setFont(new Font("Dialog", Font.PLAIN, 12)); 1167 cbM01Sector.addItem( "Com");1168 cbM01Sector.addItem( "1");1169 cbM01Sector.addItem( "2");1170 cbM01Sector.addItem( "3");1171 cbM01Sector.addItem( "4");1172 cbM01Sector.addItem( "5");1173 cbM01Sector.addItem( "6");1174 cbM01Sector.addItem( "7");1175 cbM01Sector.addItem( "8");1176 cbM01Sector.addItem( "9");1167 cbM01Sector.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 1168 cbM01Sector.addItem(Messages.getString("SmpDialogAction.194")); //$NON-NLS-1$ 1169 cbM01Sector.addItem(Messages.getString("SmpDialogAction.195")); //$NON-NLS-1$ 1170 cbM01Sector.addItem(Messages.getString("SmpDialogAction.196")); //$NON-NLS-1$ 1171 cbM01Sector.addItem(Messages.getString("SmpDialogAction.197")); //$NON-NLS-1$ 1172 cbM01Sector.addItem(Messages.getString("SmpDialogAction.198")); //$NON-NLS-1$ 1173 cbM01Sector.addItem(Messages.getString("SmpDialogAction.199")); //$NON-NLS-1$ 1174 cbM01Sector.addItem(Messages.getString("SmpDialogAction.200")); //$NON-NLS-1$ 1175 cbM01Sector.addItem(Messages.getString("SmpDialogAction.201")); //$NON-NLS-1$ 1176 cbM01Sector.addItem(Messages.getString("SmpDialogAction.202")); //$NON-NLS-1$ 1177 cbM01Sector.addItem(Messages.getString("SmpDialogAction.203")); //$NON-NLS-1$ 1177 1178 cbM01Sector.addActionListener(new ActionListener() { 1178 1179 public void actionPerformed(ActionEvent e) { … … 1226 1227 if (bM01Close == null) { 1227 1228 bM01Close = new JButton(); 1228 bM01Close.setBounds(new Rectangle(20, 325, 80, 20));1229 bM01Close.setText( "Close");1229 bM01Close.setBounds(new Rectangle(20, 325, 110, 20)); 1230 bM01Close.setText(Messages.getString("SmpDialogAction.204")); //$NON-NLS-1$ 1230 1231 bM01Close.addActionListener(new ActionListener() { 1231 1232 public void actionPerformed(ActionEvent e) { … … 1251 1252 if (bM01Save == null) { 1252 1253 bM01Save = new JButton(); 1253 bM01Save.setBounds(new Rectangle(1 20, 325, 80, 20));1254 bM01Save.setText( "Save");1254 bM01Save.setBounds(new Rectangle(150, 325, 110, 20)); 1255 bM01Save.setText(Messages.getString("SmpDialogAction.205")); //$NON-NLS-1$ 1255 1256 bM01Save.setEnabled(false); 1256 1257 … … 1258 1259 public void actionPerformed(ActionEvent e) { 1259 1260 cM01IconVisible.setIcon(new ImageIcon(getClass().getResource( 1260 "/images/Auge.png"))); 1261 "/images/Auge.png"))); //$NON-NLS-1$ 1261 1262 cM01IconVisible.setSelected(true); 1262 1263 … … 1274 1275 cM01IconVisible.setBounds(new Rectangle(310, 325, 30, 21)); 1275 1276 cM01IconVisible.setIcon(new ImageIcon(getClass().getResource( 1276 "/images/AugeN.png"))); 1277 "/images/AugeN.png"))); //$NON-NLS-1$ 1277 1278 cM01IconVisible.setSelected(false); 1278 1279 cM01IconVisible.addActionListener(new ActionListener() { … … 1287 1288 if (cM01IconVisible.isSelected()) { 1288 1289 cM01IconVisible.setIcon(new ImageIcon(getClass().getResource( 1289 "/images/AugeN.png"))); 1290 "/images/AugeN.png"))); //$NON-NLS-1$ 1290 1291 if (n != null) { 1291 1292 // seamark loeschen, wenn notwendig 1292 if (n.getKeys().containsKey("seamark")) { 1293 smb = n.getKeys().get("seamark"); // smb merken 1294 1295 c = new ChangePropertyCommand(n, "seamark", null); 1293 if (n.getKeys().containsKey("seamark")) { //$NON-NLS-1$ 1294 smb = n.getKeys().get("seamark"); // smb merken //$NON-NLS-1$ 1295 1296 c = new ChangePropertyCommand(n, "seamark", null); //$NON-NLS-1$ 1296 1297 c.executeCommand(); 1297 1298 ds.fireSelectionChanged(); … … 1300 1301 1301 1302 // seamark:type loeschen, wenn notwendig 1302 if (n.getKeys().containsKey("seamark:type")) { 1303 smt = n.getKeys().get("seamark:type"); // smt merken 1304 1305 c = new ChangePropertyCommand(n, "seamark:type", null); 1303 if (n.getKeys().containsKey("seamark:type")) { //$NON-NLS-1$ 1304 smt = n.getKeys().get("seamark:type"); // smt merken //$NON-NLS-1$ 1305 1306 c = new ChangePropertyCommand(n, "seamark:type", null); //$NON-NLS-1$ 1306 1307 c.executeCommand(); 1307 1308 ds.fireSelectionChanged(); … … 1311 1312 } 1312 1313 } else { 1313 cM01IconVisible.setIcon(new ImageIcon(getClass().getResource( 1314 "/images/Auge.png"))); 1314 cM01IconVisible.setIcon(new ImageIcon(getClass().getResource("/images/Auge.png"))); //$NON-NLS-1$ 1315 1315 PicRebuild(); 1316 1316 obuoy = null;
Note:
See TracChangeset
for help on using the changeset viewer.