Changeset 22946 in osm for applications/editors/josm/plugins/toms
- Timestamp:
- 2010-09-02T17:01:24+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r22923 r22946 11 11 import java.awt.SystemColor; 12 12 import java.awt.event.ActionEvent; 13 import java.awt.event.ActionListener; 14 import java.awt.event.ItemListener; 15 import java.awt.event.ItemEvent; 16 import java.awt.event.FocusAdapter; 17 import java.awt.event.FocusEvent; 13 18 import java.awt.event.KeyEvent; 14 19 import java.awt.event.WindowEvent; … … 102 107 private JDialog dM01SeaMap = null; 103 108 private JPanel pM01SeaMap = null; 104 private JLabel lM01TimeUnit = null; 105 private JLabel lM01RepeatTime = null; 106 private JLabel lM01Kennung = null; 107 private JLabel lM01Name = null; 108 private JLabel lM01Props02 = null; 109 private JLabel lM01StyleOfMark = null; 110 private JLabel lM01TypeOfMark = null; 109 private JLabel lM01Head = null; 111 110 private JLabel lM01Region = null; 112 private JLabel lM01Head = null; 113 public JLabel lM01Icon01 = null; 114 public JLabel lM01Icon02 = null; 111 private JLabel lM02Region = null; 115 112 public ButtonGroup bgM01Region = null; 116 113 public JRadioButton rbM01RegionA = null; 117 114 public JRadioButton rbM01RegionB = null; 115 public JLabel lM01Icon01 = null; 116 public JLabel lM01Icon02 = null; 117 public JLabel lM01FireMark = null; 118 private JLabel lM01Name = null; 119 public JTextField tfM01Name = null; 120 private JLabel lM01StyleOfMark = null; 121 private JLabel lM01CatOfMark = null; 122 private JLabel lM01TypeOfMark = null; 123 private JLabel lM01Props02 = null; 118 124 public JComboBox cbM01TypeOfMark = null; 125 public JComboBox cbM01CatOfMark = null; 119 126 public JComboBox cbM01StyleOfMark = null; 127 public JCheckBox cM01TopMark = null; 128 public JComboBox cbM01TopMark = null; 129 private JCheckBox cM01Radar = null; 130 private JCheckBox cM01Racon = null; 131 private JComboBox cbM01Racon = null; 132 private JTextField tfM01Racon = null; 133 private JLabel lM01Racon = null; 134 private JCheckBox cM01Fog = null; 135 private JComboBox cbM01Fog = null; 136 private JLabel lM01FogGroup = null; 137 private JTextField tfM01FogGroup = null; 138 private JLabel lM01FogPeriod = null; 139 private JTextField tfM01FogPeriod = null; 140 public JCheckBox cM01Fired = null; 141 public ButtonGroup bgM01Fired = null; 142 public JRadioButton rbM01Fired1 = null; 143 public JRadioButton rbM01FiredN = null; 144 public JComboBox cbM01Sector = null; 145 private JLabel lM01Group = null; 146 public JTextField tfM01Group = null; 147 private JLabel lM01RepeatTime = null; 148 public JTextField tfM01RepeatTime = null; 149 private JLabel lM01Kennung = null; 150 public JComboBox cbM01Kennung = null; 151 private JLabel lM01Height = null; 152 public JTextField tfM01Height = null; 153 private JLabel lM01Range = null; 154 public JTextField tfM01Range = null; 120 155 public JButton bM01Save = null; 121 public JCheckBox cM01TopMark = null; 122 private JCheckBox cM01Radar = null; 123 public JCheckBox cM01Fired = null; 124 private JCheckBox cM01Fog = null; 156 private JButton bM01Close = null; 157 private JCheckBox cM01IconVisible = null; 125 158 public JTextField sM01StatusBar = null; 126 public JTextField tfM01Name = null;127 private JButton bM01Close = null;128 public JTextField tfM01RepeatTime = null;129 public JComboBox cbM01Kennung = null;130 public JTextField tfM01FireMark = null;131 private JCheckBox cM01IconVisible = null;132 159 133 160 public JMenuItem getSmpItem() { … … 433 460 if (dM01SeaMap == null) { 434 461 dM01SeaMap = new JDialog(); 435 dM01SeaMap.setSize(new Dimension(353, 373)); 436 // dM01SeaMap.setSize(new Dimension(400, 400)); 462 dM01SeaMap.setSize(new Dimension(400, 400)); 437 463 dM01SeaMap.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); 438 464 dM01SeaMap.setModal(false); … … 455 481 SmpItem.setEnabled(true); 456 482 } 457 458 483 public void windowActivated(WindowEvent arg0) { 459 460 484 parseSeaMark(); 461 485 buoy.paintSign(); 462 486 } 463 464 }); 465 466 } 467 487 }); 488 } 468 489 return dM01SeaMap; 469 490 } … … 471 492 private JPanel getPM01SeaMap() { 472 493 if (pM01SeaMap == null) { 473 lM01TimeUnit = new JLabel(); 474 lM01TimeUnit.setBounds(new Rectangle(325, 230, 26, 20)); 475 lM01TimeUnit.setFont(new Font("Dialog", Font.PLAIN, 12)); 476 lM01TimeUnit.setText("s"); 477 478 lM01RepeatTime = new JLabel(); 479 lM01RepeatTime.setBounds(new Rectangle(245, 230, 70, 20)); 480 lM01RepeatTime.setFont(new Font("Dialog", Font.PLAIN, 12)); 481 lM01RepeatTime.setText("Period:"); 482 483 lM01Kennung = new JLabel(); 484 lM01Kennung.setBounds(new Rectangle(95, 230, 60, 20)); 485 lM01Kennung.setFont(new Font("Dialog", Font.PLAIN, 12)); 486 lM01Kennung.setText("Character:"); 494 495 lM01Icon01 = new JLabel(); 496 lM01Icon01.setBounds(new Rectangle(200, 20, 160, 200)); 497 lM01Icon01.setIcon(null); 498 lM01Icon01.setText(""); 499 500 lM01Icon02 = new JLabel(); 501 lM01Icon02.setBounds(new Rectangle(200, 20, 160, 200)); 502 lM01Icon02.setIcon(null); 503 lM01Icon02.setText(""); 504 505 lM01FireMark = new JLabel(); 506 lM01FireMark.setBounds(new Rectangle(310, 70, 80, 20)); 507 lM01FireMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 508 lM01FireMark.setText(""); 509 510 lM01Head = new JLabel(); 511 lM01Head.setBounds(new Rectangle(5, 3, 316, 16)); 512 lM01Head.setText("Seamark Properties"); 513 514 lM01Region = new JLabel(); 515 lM01Region.setBounds(new Rectangle(220, 7, 120, 16)); 516 lM01Region.setFont(new Font("Dialog", Font.PLAIN, 12)); 517 lM01Region.setText("Region:"); 518 519 lM02Region = new JLabel(); 520 lM02Region.setBounds(new Rectangle(270, 7, 120, 16)); 521 lM02Region.setFont(new Font("Dialog", Font.BOLD, 12)); 522 lM02Region.setText("IALA"); 523 524 lM01TypeOfMark = new JLabel(); 525 lM01TypeOfMark.setBounds(new Rectangle(5, 28, 120, 16)); 526 lM01TypeOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 527 lM01TypeOfMark.setText("Type:"); 528 529 lM01CatOfMark = new JLabel(); 530 lM01CatOfMark.setBounds(new Rectangle(5, 58, 120, 16)); 531 lM01CatOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 532 lM01CatOfMark.setText("Category:"); 533 534 lM01StyleOfMark = new JLabel(); 535 lM01StyleOfMark.setBounds(new Rectangle(5, 88, 148, 16)); 536 lM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 537 lM01StyleOfMark.setText("Shape:"); 487 538 488 539 lM01Name = new JLabel(); … … 492 543 493 544 lM01Props02 = new JLabel(); 494 lM01Props02.setBounds(new Rectangle(5, 1 70, 90, 16));545 lM01Props02.setBounds(new Rectangle(5, 150, 90, 16)); 495 546 lM01Props02.setFont(new Font("Dialog", Font.PLAIN, 12)); 496 547 lM01Props02.setText("Other Features:"); 497 548 498 lM01StyleOfMark = new JLabel(); 499 lM01StyleOfMark.setBounds(new Rectangle(5, 90, 148, 16)); 500 lM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 501 lM01StyleOfMark.setText("Shape:"); 502 503 lM01TypeOfMark = new JLabel(); 504 lM01TypeOfMark.setBounds(new Rectangle(5, 30, 120, 16)); 505 lM01TypeOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 506 lM01TypeOfMark.setText("Type:"); 507 508 lM01Region = new JLabel(); 509 lM01Region.setBounds(new Rectangle(5, 60, 120, 16)); 510 lM01Region.setFont(new Font("Dialog", Font.PLAIN, 12)); 511 lM01Region.setText("Region:"); 512 513 lM01Head = new JLabel(); 514 lM01Head.setBounds(new Rectangle(5, 3, 316, 16)); 515 lM01Head.setText("Seamark Properties"); 516 517 lM01Icon01 = new JLabel(); 518 lM01Icon01.setBounds(new Rectangle(225, 0, 160, 200)); 519 lM01Icon01.setIcon(null); 520 lM01Icon01.setText(""); 521 522 lM01Icon02 = new JLabel(); 523 lM01Icon02.setBounds(new Rectangle(225, 0, 160, 200)); 524 lM01Icon02.setIcon(null); 525 lM01Icon02.setText(""); 526 527 rbM01RegionA = new JRadioButton("A", Main.pref.get("tomsplugin.IALA") 549 lM01Racon = new JLabel(); 550 lM01Racon.setBounds(new Rectangle(335, 195, 65, 20)); 551 lM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); 552 lM01Racon.setText("( )"); 553 554 lM01FogGroup = new JLabel(); 555 lM01FogGroup.setBounds(new Rectangle(190, 220, 100, 20)); 556 lM01FogGroup.setFont(new Font("Dialog", Font.PLAIN, 12)); 557 lM01FogGroup.setText("Group: ( )"); 558 559 lM01FogPeriod = new JLabel(); 560 lM01FogPeriod.setBounds(new Rectangle(300, 220, 100, 20)); 561 lM01FogPeriod.setFont(new Font("Dialog", Font.PLAIN, 12)); 562 lM01FogPeriod.setText("Period: s"); 563 564 lM01Kennung = new JLabel(); 565 lM01Kennung.setBounds(new Rectangle(35, 270, 60, 20)); 566 lM01Kennung.setFont(new Font("Dialog", Font.PLAIN, 12)); 567 lM01Kennung.setText("Character:"); 568 569 lM01Group = new JLabel(); 570 lM01Group.setBounds(new Rectangle(190, 270, 100, 20)); 571 lM01Group.setFont(new Font("Dialog", Font.PLAIN, 12)); 572 lM01Group.setText("Group: ( )"); 573 574 lM01RepeatTime = new JLabel(); 575 lM01RepeatTime.setBounds(new Rectangle(300, 270, 100, 20)); 576 lM01RepeatTime.setFont(new Font("Dialog", Font.PLAIN, 12)); 577 lM01RepeatTime.setText("Period: s"); 578 579 lM01Height = new JLabel(); 580 lM01Height.setBounds(new Rectangle(190, 295, 100, 20)); 581 lM01Height.setFont(new Font("Dialog", Font.PLAIN, 12)); 582 lM01Height.setText("Height: m"); 583 584 lM01Range = new JLabel(); 585 lM01Range.setBounds(new Rectangle(300, 295, 100, 20)); 586 lM01Range.setFont(new Font("Dialog", Font.PLAIN, 12)); 587 lM01Range.setText("Range: M"); 588 589 rbM01RegionA = new JRadioButton("-A", Main.pref.get("tomsplugin.IALA") 528 590 .equals("A")); 529 rbM01RegionA.setBounds(new Rectangle( 60, 55, 40, 30));530 rbM01RegionB = new JRadioButton(" B", Main.pref.get("tomsplugin.IALA")591 rbM01RegionA.setBounds(new Rectangle(305, 0, 50, 30)); 592 rbM01RegionB = new JRadioButton("-B", Main.pref.get("tomsplugin.IALA") 531 593 .equals("B")); 532 rbM01RegionB.setBounds(new Rectangle( 100, 55, 40, 30));594 rbM01RegionB.setBounds(new Rectangle(352, 0, 50, 30)); 533 595 bgM01Region = new ButtonGroup(); 534 596 bgM01Region.add(rbM01RegionA); 535 597 bgM01Region.add(rbM01RegionB); 536 598 537 java.awt.event.ActionListener alM01Region = new java.awt.event.ActionListener() {599 ActionListener alM01Region = new ActionListener() { 538 600 public void actionPerformed(java.awt.event.ActionEvent e) { 539 601 if (buoy instanceof BuoyLat) { … … 547 609 rbM01RegionB.addActionListener(alM01Region); 548 610 611 rbM01Fired1 = new JRadioButton("Single", true); 612 rbM01Fired1.setBounds(new Rectangle(100, 240, 80, 30)); 613 rbM01FiredN = new JRadioButton("Sectored", false); 614 rbM01FiredN.setBounds(new Rectangle(190, 240, 100, 30)); 615 bgM01Fired = new ButtonGroup(); 616 bgM01Fired.add(rbM01Fired1); 617 bgM01Fired.add(rbM01FiredN); 618 619 ActionListener alM01Fired = new ActionListener() { 620 public void actionPerformed(java.awt.event.ActionEvent e) { 621 buoy.paintSign(); 622 } 623 }; 624 rbM01Fired1.addActionListener(alM01Fired); 625 rbM01FiredN.addActionListener(alM01Fired); 626 549 627 pM01SeaMap = new JPanel(); 550 628 pM01SeaMap.setLayout(null); 551 pM01SeaMap.add(lM01TimeUnit, null); 552 pM01SeaMap.add(lM01RepeatTime, null); 553 pM01SeaMap.add(lM01Kennung, null); 554 pM01SeaMap.add(lM01Name, null); 555 pM01SeaMap.add(lM01Props02, null); 556 pM01SeaMap.add(lM01StyleOfMark, null); 557 pM01SeaMap.add(lM01TypeOfMark, null); 629 pM01SeaMap.add(lM01Head, null); 630 pM01SeaMap.add(rbM01RegionA, null); 631 pM01SeaMap.add(rbM01RegionB, null); 558 632 pM01SeaMap.add(lM01Region, null); 559 pM01SeaMap.add(lM0 1Head, null);633 pM01SeaMap.add(lM02Region, null); 560 634 pM01SeaMap.add(lM01Icon01, null); 561 635 pM01SeaMap.add(lM01Icon02, null); 562 pM01SeaMap.add(rbM01RegionA, null);563 pM01SeaMap.add(rbM01RegionB, null);564 // pM01SeaMap.add(getTbM01Region(), null);565 636 pM01SeaMap.add(getCbM01TypeOfMark(), null); 637 pM01SeaMap.add(lM01TypeOfMark, null); 638 pM01SeaMap.add(getCbM01CatOfMark(), null); 639 pM01SeaMap.add(lM01CatOfMark, null); 566 640 pM01SeaMap.add(getCbM01StyleOfMark(), null); 641 pM01SeaMap.add(lM01StyleOfMark, null); 642 pM01SeaMap.add(lM01Name, null); 643 pM01SeaMap.add(getTfM01Name(), null); 644 pM01SeaMap.add(lM01Props02, null); 645 pM01SeaMap.add(getCM01TopMark(), null); 646 pM01SeaMap.add(getCbM01TopMark(), null); 647 pM01SeaMap.add(getCM01Radar(), null); 648 pM01SeaMap.add(getCM01Racon(), null); 649 pM01SeaMap.add(getCbM01Racon(), null); 650 pM01SeaMap.add(getTfM01Racon(), null); 651 pM01SeaMap.add(lM01Racon, null); 652 pM01SeaMap.add(getCM01Fog(), null); 653 pM01SeaMap.add(getCbM01Fog(), null); 654 pM01SeaMap.add(getTfM01FogGroup(), null); 655 pM01SeaMap.add(lM01FogGroup, null); 656 pM01SeaMap.add(getTfM01FogPeriod(), null); 657 pM01SeaMap.add(lM01FogPeriod, null); 658 pM01SeaMap.add(getCM01Fired(), null); 659 pM01SeaMap.add(rbM01Fired1, null); 660 pM01SeaMap.add(rbM01FiredN, null); 661 pM01SeaMap.add(getCbM01Sector(), null); 662 pM01SeaMap.add(getTfM01RepeatTime(), null); 663 pM01SeaMap.add(lM01RepeatTime, null); 664 pM01SeaMap.add(getCbM01Kennung(), null); 665 pM01SeaMap.add(lM01Kennung, null); 666 pM01SeaMap.add(lM01Group, null); 667 pM01SeaMap.add(getTfM01Group(), null); 668 pM01SeaMap.add(lM01Height, null); 669 pM01SeaMap.add(getTfM01Height(), null); 670 pM01SeaMap.add(lM01Range, null); 671 pM01SeaMap.add(getTfM01Range(), null); 672 pM01SeaMap.add(lM01FireMark, null); 567 673 pM01SeaMap.add(getBM01Save(), null); 568 pM01SeaMap.add(getCM01TopMark(), null);569 pM01SeaMap.add(getCM01Radar(), null);570 pM01SeaMap.add(getCM01Fired(), null);571 pM01SeaMap.add(getCM01Fog(), null);572 674 pM01SeaMap.add(getSM01StatusBar(), null); 573 pM01SeaMap.add(getTfM01Name(), null);574 675 pM01SeaMap.add(getBM01Close(), null); 575 pM01SeaMap.add(getTfM01RepeatTime(), null);576 pM01SeaMap.add(getCbM01Kennung(), null);577 pM01SeaMap.add(getTfM01FireMark(), null);578 676 pM01SeaMap.add(getCM01IconVisible(), null); 579 677 } 580 581 678 return pM01SeaMap; 582 679 } … … 608 705 cbM01TypeOfMark.setEnabled(true); 609 706 610 cbM01TypeOfMark.addActionListener(new java.awt.event.ActionListener() {707 cbM01TypeOfMark.addActionListener(new ActionListener() { 611 708 public void actionPerformed(java.awt.event.ActionEvent e) { 612 709 Node n; … … 678 775 } 679 776 680 /* 681 * private JToggleButton getTbM01Region() { if (tbM01Region == null) { 682 * tbM01Region = new JToggleButton(); 683 * 684 * tbM01Region.setBounds(new Rectangle(60, 55, 80, 25)); 685 * tbM01Region.setFont(new Font("Dialog", Font.PLAIN, 12)); 686 * tbM01Region.setEnabled(false); if 687 * (Main.pref.get("tomsplugin.IALA").equals("B")) { 688 * tbM01Region.setSelected(true); tbM01Region.setText("IALA-B"); } else { 689 * tbM01Region.setSelected(false); tbM01Region.setText("IALA-A"); } 690 * 691 * tbM01Region.addActionListener(new java.awt.event.ActionListener() { public 692 * void actionPerformed(java.awt.event.ActionEvent e) { if 693 * (tbM01Region.isSelected()) { buoy.setRegion(true); 694 * tbM01Region.setText("IALA-B"); } else { buoy.setRegion(false); 695 * tbM01Region.setText("IALA-A"); } buoy.paintSign(); } }); } 696 * 697 * return tbM01Region; } 698 */ 699 777 private JComboBox getCbM01CatOfMark() { 778 if (cbM01CatOfMark == null) { 779 cbM01CatOfMark = new JComboBox(); 780 cbM01CatOfMark.setBounds(new Rectangle(80, 55, 120, 25)); 781 cbM01CatOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 782 cbM01CatOfMark.setEnabled(true); 783 cbM01CatOfMark.addActionListener(new ActionListener() { 784 public void actionPerformed(ActionEvent e) { 785 int cat = cbM01CatOfMark.getSelectedIndex(); 786 } 787 }); 788 } 789 return cbM01CatOfMark; 790 } 791 700 792 private JComboBox getCbM01StyleOfMark() { 701 793 if (cbM01StyleOfMark == null) { … … 704 796 cbM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 705 797 cbM01StyleOfMark.setEnabled(true); 706 cbM01StyleOfMark.addActionListener(new java.awt.event.ActionListener() {707 public void actionPerformed( java.awt.event.ActionEvent e) {798 cbM01StyleOfMark.addActionListener(new ActionListener() { 799 public void actionPerformed(ActionEvent e) { 708 800 int style = cbM01StyleOfMark.getSelectedIndex(); 709 801 if (buoy != null && style != buoy.getStyleIndex()) { … … 714 806 }); 715 807 } 716 717 808 return cbM01StyleOfMark; 718 809 } 719 810 720 private JButton getBM01Save() { 721 if (bM01Save == null) { 722 bM01Save = new JButton(); 723 bM01Save.setBounds(new Rectangle(120, 290, 80, 20)); 724 bM01Save.setText("Save"); 725 726 bM01Save.addActionListener(new java.awt.event.ActionListener() { 727 public void actionPerformed(java.awt.event.ActionEvent e) { 728 cM01IconVisible.setIcon(new ImageIcon(getClass().getResource( 729 "/images/Auge.png"))); 730 cM01IconVisible.setSelected(true); 731 732 buoy.saveSign(); 733 } 734 }); 735 } 736 737 return bM01Save; 811 private JTextField getTfM01Name() { 812 if (tfM01Name == null) { 813 tfM01Name = new JTextField(); 814 tfM01Name.setBounds(new Rectangle(50, 120, 150, 20)); 815 tfM01Name.addFocusListener(new FocusAdapter() { 816 public void focusLost(FocusEvent e) { 817 buoy.setName(tfM01Name.getText()); 818 } 819 }); 820 } 821 822 return tfM01Name; 738 823 } 739 824 … … 741 826 if (cM01TopMark == null) { 742 827 cM01TopMark = new JCheckBox(); 743 cM01TopMark.setBounds(new Rectangle( 20, 190, 90, 20));828 cM01TopMark.setBounds(new Rectangle(10, 170, 90, 20)); 744 829 cM01TopMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 745 830 cM01TopMark.setText("Topmark"); 746 cM01TopMark.addItemListener(new java.awt.event.ItemListener() {747 public void itemStateChanged( java.awt.event.ItemEvent e) {831 cM01TopMark.addItemListener(new ItemListener() { 832 public void itemStateChanged(ItemEvent e) { 748 833 if (buoy == null) { 749 834 return; 750 835 } 751 752 836 buoy.setTopMark(cM01TopMark.isSelected()); 753 837 buoy.paintSign(); … … 755 839 }); 756 840 } 757 758 841 return cM01TopMark; 842 } 843 844 private JComboBox getCbM01TopMark() { 845 if (cbM01TopMark == null) { 846 cbM01TopMark = new JComboBox(); 847 cbM01TopMark.setBounds(new Rectangle(100, 170, 70, 20)); 848 cbM01TopMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 849 cbM01TopMark.setEnabled(true); 850 cbM01TopMark.addActionListener(new ActionListener() { 851 public void actionPerformed(ActionEvent e) { 852 int top = cbM01TopMark.getSelectedIndex(); 853 } 854 }); 855 } 856 return cbM01TopMark; 759 857 } 760 858 … … 762 860 if (cM01Radar == null) { 763 861 cM01Radar = new JCheckBox(); 764 cM01Radar.setBounds(new Rectangle(1 40, 190, 70, 20));862 cM01Radar.setBounds(new Rectangle(10, 195, 120, 20)); 765 863 cM01Radar.setFont(new Font("Dialog", Font.PLAIN, 12)); 766 864 cM01Radar.setEnabled(false); 767 cM01Radar.setText("Radar"); 768 } 769 865 cM01Radar.setText("Radar Reflector"); 866 } 770 867 return cM01Radar; 868 } 869 870 private JCheckBox getCM01Racon() { 871 if (cM01Racon == null) { 872 cM01Racon = new JCheckBox(); 873 cM01Racon.setBounds(new Rectangle(130, 195, 110, 20)); 874 cM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); 875 cM01Racon.setEnabled(false); 876 cM01Racon.setText("Radar Beacon"); 877 } 878 return cM01Racon; 879 } 880 881 private JComboBox getCbM01Racon() { 882 if (cbM01Racon == null) { 883 cbM01Racon = new JComboBox(); 884 cbM01Racon.setBounds(new Rectangle(240, 195, 80, 20)); 885 cbM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); 886 cbM01Racon.setEnabled(true); 887 cbM01Racon.addActionListener(new ActionListener() { 888 public void actionPerformed(ActionEvent e) { 889 int rac = cbM01Racon.getSelectedIndex(); 890 } 891 }); 892 } 893 return cbM01Racon; 894 } 895 896 private JTextField getTfM01Racon() { 897 if (tfM01Racon == null) { 898 tfM01Racon = new JTextField(); 899 tfM01Racon.setBounds(new Rectangle(345, 195, 30, 20)); 900 tfM01Racon.addFocusListener(new FocusAdapter() { 901 public void focusLost(FocusEvent e) { 902 buoy.setName(tfM01Racon.getText()); 903 } 904 }); 905 } 906 return tfM01Racon; 907 } 908 909 private JCheckBox getCM01Fog() { 910 if (cM01Fog == null) { 911 cM01Fog = new JCheckBox(); 912 cM01Fog.setBounds(new Rectangle(10, 220, 90, 20)); 913 cM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); 914 cM01Fog.setEnabled(false); 915 cM01Fog.setText("Fog Signal"); 916 } 917 return cM01Fog; 918 } 919 920 private JComboBox getCbM01Fog() { 921 if (cbM01Fog == null) { 922 cbM01Fog = new JComboBox(); 923 cbM01Fog.setBounds(new Rectangle(100, 220, 70, 20)); 924 cbM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); 925 cbM01Fog.setEnabled(true); 926 cbM01Fog.addActionListener(new ActionListener() { 927 public void actionPerformed(ActionEvent e) { 928 int fog = cbM01Fog.getSelectedIndex(); 929 } 930 }); 931 } 932 return cbM01Fog; 933 } 934 935 private JTextField getTfM01FogGroup() { 936 if (tfM01FogGroup == null) { 937 tfM01FogGroup = new JTextField(); 938 tfM01FogGroup.setBounds(new Rectangle(243, 220, 30, 20)); 939 tfM01FogGroup.addFocusListener(new FocusAdapter() { 940 public void focusLost(FocusEvent e) { 941 buoy.setName(tfM01FogGroup.getText()); 942 } 943 }); 944 } 945 return tfM01FogGroup; 946 } 947 948 private JTextField getTfM01FogPeriod() { 949 if (tfM01FogPeriod == null) { 950 tfM01FogPeriod = new JTextField(); 951 tfM01FogPeriod.setBounds(new Rectangle(345, 220, 30, 20)); 952 tfM01FogPeriod.addFocusListener(new FocusAdapter() { 953 public void focusLost(FocusEvent e) { 954 buoy.setName(tfM01FogPeriod.getText()); 955 } 956 }); 957 } 958 return tfM01FogPeriod; 771 959 } 772 960 … … 774 962 if (cM01Fired == null) { 775 963 cM01Fired = new JCheckBox(); 776 cM01Fired.setBounds(new Rectangle( 20, 230, 70, 20));964 cM01Fired.setBounds(new Rectangle(10, 245, 70, 20)); 777 965 cM01Fired.setFont(new Font("Dialog", Font.PLAIN, 12)); 778 966 cM01Fired.setText("Lighted"); 779 967 cM01Fired.setEnabled(false); 780 cM01Fired.addItemListener(new java.awt.event.ItemListener() {781 public void itemStateChanged( java.awt.event.ItemEvent e) {968 cM01Fired.addItemListener(new ItemListener() { 969 public void itemStateChanged(ItemEvent e) { 782 970 if (buoy == null) { 783 971 return; … … 794 982 } 795 983 796 private JCheckBox getCM01Fog() { 797 if (cM01Fog == null) { 798 cM01Fog = new JCheckBox(); 799 cM01Fog.setBounds(new Rectangle(20, 210, 90, 20)); 800 cM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); 801 cM01Fog.setEnabled(false); 802 cM01Fog.setText("Foghorn"); 803 } 804 805 return cM01Fog; 806 } 807 808 private JTextField getSM01StatusBar() { 809 if (sM01StatusBar == null) { 810 sM01StatusBar = new JTextField(); 811 sM01StatusBar.setBounds(new Rectangle(7, 319, 340, 20)); 812 sM01StatusBar.setBackground(SystemColor.activeCaptionBorder); 813 } 814 815 return sM01StatusBar; 816 } 817 818 private JTextField getTfM01Name() { 819 if (tfM01Name == null) { 820 tfM01Name = new JTextField(); 821 tfM01Name.setBounds(new Rectangle(50, 120, 175, 20)); 822 tfM01Name.addFocusListener(new java.awt.event.FocusAdapter() { 823 public void focusLost(java.awt.event.FocusEvent e) { 824 buoy.setName(tfM01Name.getText()); 825 } 826 }); 827 } 828 829 return tfM01Name; 984 private JComboBox getCbM01Kennung() { 985 if (cbM01Kennung == null) { 986 cbM01Kennung = new JComboBox(); 987 cbM01Kennung.setBounds(new Rectangle(100, 270, 70, 20)); 988 cbM01Kennung.addActionListener(new ActionListener() { 989 public void actionPerformed(ActionEvent e) { 990 int i1, i2; 991 String g = "", c = ""; 992 String it = (String) cbM01Kennung.getSelectedItem(); 993 994 if (it == null) 995 return; 996 if (it.compareTo("Not set") == 0) 997 return; 998 if (buoy == null) 999 return; 1000 1001 i1 = it.indexOf("("); 1002 i2 = it.indexOf(")", i1); 1003 if (i1 >= 0) { 1004 c = it.substring(0, i1); 1005 if (i1 >= 0) 1006 g = it.substring(i1 + 1, i2); 1007 } 1008 if (it.contains("+")) { 1009 i1 = it.indexOf("+"); 1010 i2 = it.length(); 1011 if (c.equals("")) 1012 c = it; 1013 else 1014 c = c + it.substring(i1, i2); 1015 } 1016 if (c.equals("")) 1017 c = it; 1018 buoy.setLightChar(c); 1019 buoy.setLightGroup(g); 1020 // buoy.setLightColour(); 1021 buoy.paintSign(); 1022 } 1023 }); 1024 } 1025 return cbM01Kennung; 1026 } 1027 1028 private JComboBox getCbM01Sector() { 1029 if (cbM01Sector == null) { 1030 cbM01Sector = new JComboBox(); 1031 cbM01Sector.setBounds(new Rectangle(300, 245, 50, 20)); 1032 cbM01Sector.setFont(new Font("Dialog", Font.PLAIN, 12)); 1033 cbM01Sector.setEnabled(true); 1034 cbM01Sector.addActionListener(new ActionListener() { 1035 public void actionPerformed(ActionEvent e) { 1036 int sec = cbM01Sector.getSelectedIndex(); 1037 } 1038 }); 1039 } 1040 return cbM01Sector; 1041 } 1042 1043 private JTextField getTfM01RepeatTime() { 1044 if (tfM01RepeatTime == null) { 1045 tfM01RepeatTime = new JTextField(); 1046 tfM01RepeatTime.setBounds(new Rectangle(345, 270, 30, 20)); 1047 tfM01RepeatTime.addActionListener(new ActionListener() { 1048 public void actionPerformed(ActionEvent e) { 1049 String s = tfM01RepeatTime.getText(); 1050 1051 buoy.setLightPeriod(s); 1052 buoy.paintSign(); 1053 } 1054 }); 1055 1056 tfM01RepeatTime.addFocusListener(new FocusAdapter() { 1057 public void focusLost(FocusEvent e) { 1058 String s = tfM01RepeatTime.getText(); 1059 1060 buoy.setLightPeriod(s); 1061 buoy.paintSign(); 1062 } 1063 }); 1064 } 1065 1066 return tfM01RepeatTime; 1067 } 1068 1069 private JTextField getTfM01Group() { 1070 if (tfM01Group == null) { 1071 tfM01Group = new JTextField(); 1072 tfM01Group.setBounds(new Rectangle(243, 270, 30, 20)); 1073 tfM01Group.addFocusListener(new FocusAdapter() { 1074 public void focusLost(FocusEvent e) { 1075 buoy.setName(tfM01Group.getText()); 1076 } 1077 }); 1078 } 1079 return tfM01Group; 1080 } 1081 1082 private JTextField getTfM01Height() { 1083 if (tfM01Height == null) { 1084 tfM01Height = new JTextField(); 1085 tfM01Height.setBounds(new Rectangle(243, 295, 30, 20)); 1086 tfM01Height.addFocusListener(new FocusAdapter() { 1087 public void focusLost(FocusEvent e) { 1088 buoy.setName(tfM01Height.getText()); 1089 } 1090 }); 1091 } 1092 return tfM01Height; 1093 } 1094 1095 private JTextField getTfM01Range() { 1096 if (tfM01Range == null) { 1097 tfM01Range = new JTextField(); 1098 tfM01Range.setBounds(new Rectangle(345, 295, 30, 20)); 1099 tfM01Range.addFocusListener(new FocusAdapter() { 1100 public void focusLost(FocusEvent e) { 1101 buoy.setName(tfM01Range.getText()); 1102 } 1103 }); 1104 } 1105 return tfM01Range; 830 1106 } 831 1107 … … 833 1109 if (bM01Close == null) { 834 1110 bM01Close = new JButton(); 835 bM01Close.setBounds(new Rectangle(20, 290, 80, 20));1111 bM01Close.setBounds(new Rectangle(20, 325, 80, 20)); 836 1112 bM01Close.setText("Close"); 837 bM01Close.addActionListener(new java.awt.event.ActionListener() {838 public void actionPerformed( java.awt.event.ActionEvent e) {1113 bM01Close.addActionListener(new ActionListener() { 1114 public void actionPerformed(ActionEvent e) { 839 1115 // aufraeumen 840 1116 if (obuoy != null) … … 855 1131 } 856 1132 857 private JTextField getTfM01RepeatTime() { 858 if (tfM01RepeatTime == null) { 859 tfM01RepeatTime = new JTextField(); 860 tfM01RepeatTime.setBounds(new Rectangle(290, 230, 30, 20)); 861 tfM01RepeatTime.addActionListener(new java.awt.event.ActionListener() { 862 public void actionPerformed(java.awt.event.ActionEvent e) { 863 String s = tfM01RepeatTime.getText(); 864 865 buoy.setLightPeriod(s); 866 buoy.paintSign(); 867 } 868 }); 869 870 tfM01RepeatTime.addFocusListener(new java.awt.event.FocusAdapter() { 871 public void focusLost(java.awt.event.FocusEvent e) { 872 String s = tfM01RepeatTime.getText(); 873 874 buoy.setLightPeriod(s); 875 buoy.paintSign(); 876 } 877 }); 878 } 879 880 return tfM01RepeatTime; 881 } 882 883 private JComboBox getCbM01Kennung() { 884 if (cbM01Kennung == null) { 885 cbM01Kennung = new JComboBox(); 886 cbM01Kennung.setBounds(new Rectangle(160, 230, 70, 20)); 887 cbM01Kennung.addActionListener(new java.awt.event.ActionListener() { 888 public void actionPerformed(java.awt.event.ActionEvent e) { 889 int i1, i2; 890 String g = "", c = ""; 891 String it = (String) cbM01Kennung.getSelectedItem(); 892 893 if (it == null) 894 return; 895 896 if (it.compareTo("Not set") == 0) 897 return; 898 899 if (buoy == null) { 900 return; 901 } 902 903 i1 = it.indexOf("("); 904 i2 = it.indexOf(")", i1); 905 906 if (i1 >= 0) { 907 c = it.substring(0, i1); 908 if (i1 >= 0) 909 g = it.substring(i1 + 1, i2); 910 } 911 912 if (it.contains("+")) { 913 i1 = it.indexOf("+"); 914 i2 = it.length(); 915 if (c.equals("")) 916 c = it; 917 else 918 c = c + it.substring(i1, i2); 919 } 920 921 if (c.equals("")) 922 c = it; 923 buoy.setLightChar(c); 924 buoy.setLightGroup(g); 925 // buoy.setLightColour(); 926 927 buoy.paintSign(); 928 } 929 }); 930 } 931 932 return cbM01Kennung; 933 } 934 935 private JTextField getTfM01FireMark() { 936 if (tfM01FireMark == null) { 937 tfM01FireMark = new JTextField(); 938 tfM01FireMark.setBounds(new Rectangle(240, 160, 100, 20)); 939 tfM01FireMark.setEditable(false); 940 } 941 942 return tfM01FireMark; 1133 private JButton getBM01Save() { 1134 if (bM01Save == null) { 1135 bM01Save = new JButton(); 1136 bM01Save.setBounds(new Rectangle(120, 325, 80, 20)); 1137 bM01Save.setText("Save"); 1138 1139 bM01Save.addActionListener(new ActionListener() { 1140 public void actionPerformed(ActionEvent e) { 1141 cM01IconVisible.setIcon(new ImageIcon(getClass().getResource( 1142 "/images/Auge.png"))); 1143 cM01IconVisible.setSelected(true); 1144 1145 buoy.saveSign(); 1146 } 1147 }); 1148 } 1149 1150 return bM01Save; 943 1151 } 944 1152 … … 946 1154 if (cM01IconVisible == null) { 947 1155 cM01IconVisible = new JCheckBox(); 948 cM01IconVisible.setBounds(new Rectangle(310, 290, 30, 21));1156 cM01IconVisible.setBounds(new Rectangle(310, 325, 30, 21)); 949 1157 cM01IconVisible.setIcon(new ImageIcon(getClass().getResource( 950 1158 "/images/AugeN.png"))); 951 1159 cM01IconVisible.setSelected(false); 952 cM01IconVisible.addActionListener(new java.awt.event.ActionListener() {953 public void actionPerformed( java.awt.event.ActionEvent e) {1160 cM01IconVisible.addActionListener(new ActionListener() { 1161 public void actionPerformed(ActionEvent e) { 954 1162 Command c; 955 1163 Node n = null; … … 994 1202 }); 995 1203 } 996 997 1204 return cM01IconVisible; 998 1205 } 1206 1207 private JTextField getSM01StatusBar() { 1208 if (sM01StatusBar == null) { 1209 sM01StatusBar = new JTextField(); 1210 sM01StatusBar.setBounds(new Rectangle(7, 355, 385, 20)); 1211 sM01StatusBar.setBackground(SystemColor.activeCaptionBorder); 1212 } 1213 return sM01StatusBar; 1214 } 1215 999 1216 } -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r22923 r22946 257 257 if (lp != "" && lp != " ") 258 258 c = c + " " + lp + "s"; 259 dlg. tfM01FireMark.setText(c);259 dlg.lM01FireMark.setText(c); 260 260 } else { 261 261 dlg.tfM01RepeatTime.setEnabled(false); 262 262 dlg.cbM01Kennung.setEnabled(false); 263 dlg. tfM01FireMark.setText("");263 dlg.lM01FireMark.setText(""); 264 264 } 265 265
Note:
See TracChangeset
for help on using the changeset viewer.