Changeset 22979 in osm for applications/editors/josm/plugins/toms
- Timestamp:
- 2010-09-03T20:24:13+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src
- Files:
-
- 24 added
- 25 deleted
- 143 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r22946 r22979 62 62 * lokale Variable, private 63 63 */ 64 private SmpDialogAction dia = null; // Variable f ür den Handle von64 private SmpDialogAction dia = null; // Variable für den Handle von 65 65 // SmpDialogAction 66 private Buoy buoy = null; // Variable f ür Objekte des Typs "Tonne" //66 private Buoy buoy = null; // Variable für Objekte des Typs "Tonne" // 67 67 // @jve:decl-index=0: 68 68 private boolean isOpen = false; // zeigt den Status des Dialogs an 69 69 private Node onode = null; // gemerkter Knoten 70 70 private Buoy obuoy = null; // gemerkte Tonne // @jve:decl-index=0: 71 private JMenuItem SmpItem = null; // Info über item in der Werkzeugleiste71 private JMenuItem SmpItem = null; // Info über item in der Werkzeugleiste 72 72 private String smt = ""; // value vom key "seamark:type" // @jve:decl-index=0: 73 73 private String smb = ""; // value vom key "seamark" // @jve:decl-index=0: … … 77 77 private String UserHome = ""; // @jve:decl-index=0: 78 78 79 // SelectionChangedListner der in die Eventqueue von josm eingeh ängt wird79 // SelectionChangedListner der in die Eventqueue von josm eingehängt wird 80 80 private SelectionChangedListener SmpListener = new SelectionChangedListener() { 81 81 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { … … 116 116 public JLabel lM01Icon02 = null; 117 117 public JLabel lM01FireMark = null; 118 private JLabel lM01TypeOfMark = null; 119 public JComboBox cbM01TypeOfMark = null; 120 private JLabel lM01CatOfMark = null; 121 public JComboBox cbM01CatOfMark = null; 122 private JLabel lM01StyleOfMark = null; 123 public JComboBox cbM01StyleOfMark = null; 118 124 private JLabel lM01Name = null; 119 125 public JTextField tfM01Name = null; 120 private JLabel lM01StyleOfMark = null;121 private JLabel lM01CatOfMark = null;122 private JLabel lM01TypeOfMark = null;123 126 private JLabel lM01Props02 = null; 124 public JComboBox cbM01TypeOfMark = null;125 public JComboBox cbM01CatOfMark = null;126 public JComboBox cbM01StyleOfMark = null;127 127 public JCheckBox cM01TopMark = null; 128 128 public JComboBox cbM01TopMark = null; 129 p rivateJCheckBox cM01Radar = null;130 p rivateJCheckBox cM01Racon = null;131 p rivateJComboBox cbM01Racon = null;132 p rivateJTextField tfM01Racon = null;129 public JCheckBox cM01Radar = null; 130 public JCheckBox cM01Racon = null; 131 public JComboBox cbM01Racon = null; 132 public JTextField tfM01Racon = null; 133 133 private JLabel lM01Racon = null; 134 p rivateJCheckBox cM01Fog = null;135 p rivateJComboBox cbM01Fog = null;134 public JCheckBox cM01Fog = null; 135 public JComboBox cbM01Fog = null; 136 136 private JLabel lM01FogGroup = null; 137 p rivateJTextField tfM01FogGroup = null;137 public JTextField tfM01FogGroup = null; 138 138 private JLabel lM01FogPeriod = null; 139 p rivateJTextField tfM01FogPeriod = null;139 public JTextField tfM01FogPeriod = null; 140 140 public JCheckBox cM01Fired = null; 141 141 public ButtonGroup bgM01Fired = null; 142 142 public JRadioButton rbM01Fired1 = null; 143 143 public JRadioButton rbM01FiredN = null; 144 private JLabel lM01Kennung = null; 145 public JComboBox cbM01Kennung = null; 146 private JLabel lM01Sector = null; 144 147 public JComboBox cbM01Sector = null; 145 148 private JLabel lM01Group = null; … … 147 150 private JLabel lM01RepeatTime = null; 148 151 public JTextField tfM01RepeatTime = null; 149 private JLabel lM01Kennung = null;150 public JComboBox cbM01Kennung = null;151 152 private JLabel lM01Height = null; 153 private JLabel lM01Bearing = null; 154 public JTextField tfM01Bearing = null; 155 public JTextField tfM02Bearing = null; 156 public JTextField tfM01Radius = null; 152 157 public JTextField tfM01Height = null; 153 158 private JLabel lM01Range = null; 154 159 public JTextField tfM01Range = null; 155 160 public JButton bM01Save = null; 156 p rivateJButton bM01Close = null;157 p rivateJCheckBox cM01IconVisible = null;161 public JButton bM01Close = null; 162 public JCheckBox cM01IconVisible = null; 158 163 public JTextField sM01StatusBar = null; 159 164 … … 253 258 SmpItem.setEnabled(false); 254 259 255 // Ausprobe: M öglichkeit der Benachrichtigung, wenn etwas neu260 // Ausprobe: Möglichkeit der Benachrichtigung, wenn etwas neu 256 261 // selektiert wird (ueber SelectionChangedListener) 257 262 // private Collection<? extends OsmPrimitive> sel; 258 263 // siehe org.openstreetmap.josm.plugins.osb -> OsbLayer.java 259 // Einh ängen des Listeners in die Eventqueue von josm264 // Einhängen des Listeners in die Eventqueue von josm 260 265 DataSet.selListeners.add(SmpListener); 261 266 // DataSet.addSelectionListener(SmpListener); … … 348 353 349 354 cbM01TypeOfMark.setEnabled(true); 350 cbM01StyleOfMark.setEnabled(true);351 355 352 356 // Soweit das Vorspiel. Ab hier beginnt das Parsen … … 481 485 SmpItem.setEnabled(true); 482 486 } 487 483 488 public void windowActivated(WindowEvent arg0) { 484 489 parseSeaMark(); … … 494 499 495 500 lM01Icon01 = new JLabel(); 496 lM01Icon01.setBounds(new Rectangle(2 00, 20, 160, 200));501 lM01Icon01.setBounds(new Rectangle(210, 30, 160, 200)); 497 502 lM01Icon01.setIcon(null); 498 503 lM01Icon01.setText(""); 499 504 500 505 lM01Icon02 = new JLabel(); 501 lM01Icon02.setBounds(new Rectangle(2 00, 20, 160, 200));506 lM01Icon02.setBounds(new Rectangle(210, 30, 160, 200)); 502 507 lM01Icon02.setIcon(null); 503 508 lM01Icon02.setText(""); 504 509 505 510 lM01FireMark = new JLabel(); 506 lM01FireMark.setBounds(new Rectangle(3 10, 70, 80, 20));511 lM01FireMark.setBounds(new Rectangle(305, 90, 90, 20)); 507 512 lM01FireMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 508 513 lM01FireMark.setText(""); … … 563 568 564 569 lM01Kennung = new JLabel(); 565 lM01Kennung.setBounds(new Rectangle( 35, 270, 60, 20));570 lM01Kennung.setBounds(new Rectangle(240, 245, 60, 20)); 566 571 lM01Kennung.setFont(new Font("Dialog", Font.PLAIN, 12)); 567 572 lM01Kennung.setText("Character:"); 573 574 lM01Sector = new JLabel(); 575 lM01Sector.setBounds(new Rectangle(80, 270, 180, 20)); 576 lM01Sector.setFont(new Font("Dialog", Font.PLAIN, 12)); 577 lM01Sector.setText("Sector:"); 568 578 569 579 lM01Group = new JLabel(); … … 576 586 lM01RepeatTime.setFont(new Font("Dialog", Font.PLAIN, 12)); 577 587 lM01RepeatTime.setText("Period: s"); 588 589 lM01Bearing = new JLabel(); 590 lM01Bearing.setBounds(new Rectangle(35, 295, 180, 20)); 591 lM01Bearing.setFont(new Font("Dialog", Font.PLAIN, 12)); 592 lM01Bearing.setText(" ¼- ¼, r:"); 578 593 579 594 lM01Height = new JLabel(); … … 596 611 bgM01Region.add(rbM01RegionA); 597 612 bgM01Region.add(rbM01RegionB); 598 613 599 614 ActionListener alM01Region = new ActionListener() { 600 615 public void actionPerformed(java.awt.event.ActionEvent e) { … … 610 625 611 626 rbM01Fired1 = new JRadioButton("Single", true); 612 rbM01Fired1.setBounds(new Rectangle( 100, 240, 80, 30));627 rbM01Fired1.setBounds(new Rectangle(80, 240, 65, 30)); 613 628 rbM01FiredN = new JRadioButton("Sectored", false); 614 rbM01FiredN.setBounds(new Rectangle(1 90, 240, 100, 30));629 rbM01FiredN.setBounds(new Rectangle(145, 240, 80, 30)); 615 630 bgM01Fired = new ButtonGroup(); 616 631 bgM01Fired.add(rbM01Fired1); 617 632 bgM01Fired.add(rbM01FiredN); 618 633 619 634 ActionListener alM01Fired = new ActionListener() { 620 635 public void actionPerformed(java.awt.event.ActionEvent e) { 621 636 buoy.paintSign(); 622 637 } 623 638 }; … … 659 674 pM01SeaMap.add(rbM01Fired1, null); 660 675 pM01SeaMap.add(rbM01FiredN, null); 661 pM01SeaMap.add(getCbM01Sector(), null);662 676 pM01SeaMap.add(getTfM01RepeatTime(), null); 663 677 pM01SeaMap.add(lM01RepeatTime, null); 664 678 pM01SeaMap.add(getCbM01Kennung(), null); 665 679 pM01SeaMap.add(lM01Kennung, null); 680 pM01SeaMap.add(getCbM01Sector(), null); 666 681 pM01SeaMap.add(lM01Group, null); 667 682 pM01SeaMap.add(getTfM01Group(), null); 683 pM01SeaMap.add(lM01Sector, null); 684 pM01SeaMap.add(lM01Bearing, null); 685 pM01SeaMap.add(getTfM01Bearing(), null); 686 pM01SeaMap.add(getTfM02Bearing(), null); 687 pM01SeaMap.add(getTfM01Radius(), null); 668 688 pM01SeaMap.add(lM01Height, null); 669 689 pM01SeaMap.add(getTfM01Height(), null); … … 686 706 687 707 // Inhalt der ComboBox 688 cbM01TypeOfMark.addItem("Not set"); 689 cbM01TypeOfMark.addItem("Port"); 690 cbM01TypeOfMark.addItem("Starboard"); 691 cbM01TypeOfMark.addItem("Preferred Port"); 692 cbM01TypeOfMark.addItem("Preferred Starboard"); 693 cbM01TypeOfMark.addItem("Safe Water"); 694 cbM01TypeOfMark.addItem("Cardinal North"); 695 cbM01TypeOfMark.addItem("Cardinal East"); 696 cbM01TypeOfMark.addItem("Cardinal South"); 697 cbM01TypeOfMark.addItem("Cardinal West"); 708 cbM01TypeOfMark.addItem("* Select Seamark *"); 709 cbM01TypeOfMark.addItem("Lateral Mark"); 710 cbM01TypeOfMark.addItem("Cardinal Mark"); 711 cbM01TypeOfMark.addItem("Safe Water Mark"); 698 712 cbM01TypeOfMark.addItem("Isolated Danger"); 699 713 cbM01TypeOfMark.addItem("Special Purpose"); 700 //cbM01TypeOfMark.addItem("Light");714 cbM01TypeOfMark.addItem("Light"); 701 715 702 716 cbM01TypeOfMark.setBounds(new Rectangle(50, 25, 150, 25)); … … 707 721 cbM01TypeOfMark.addActionListener(new ActionListener() { 708 722 public void actionPerformed(java.awt.event.ActionEvent e) { 709 Node n;710 723 int type = cbM01TypeOfMark.getSelectedIndex(); 711 724 … … 714 727 return; 715 728 } 716 if ((type == 0) || (type == buoy.getBuoyIndex())) 717 return; 718 719 n = buoy.getNode(); 729 730 Node n = buoy.getNode(); 720 731 if (n == null) 721 732 return; 733 722 734 switch (type) { 723 735 724 case SeaMark.UNKNOWN_ CAT:736 case SeaMark.UNKNOWN_TYPE: 725 737 if (!(buoy instanceof BuoyUkn)) 726 738 buoy = new BuoyUkn(dia, "Seamark not set"); … … 728 740 break; 729 741 730 case SeaMark.PORT_HAND: 731 case SeaMark.STARBOARD_HAND: 732 case SeaMark.PREF_PORT_HAND: 733 case SeaMark.PREF_STARBOARD_HAND: 734 if (!(buoy instanceof BuoyLat)) 735 buoy = new BuoyLat(dia, n); 742 case SeaMark.LATERAL: 743 if (!(buoy instanceof BuoyLat)) { 744 buoy.setBuoyIndex(0); 745 cbM01CatOfMark.removeAllItems(); 746 cbM01CatOfMark.addItem("*Select Category*"); 747 cbM01CatOfMark.addItem("Port"); 748 cbM01CatOfMark.addItem("Starboard"); 749 cbM01CatOfMark.addItem("Preferred Port"); 750 cbM01CatOfMark.addItem("Preferred Starboard"); 751 cbM01CatOfMark.setEnabled(true); 752 } 753 break; 754 755 case SeaMark.CARDINAL: 756 if (!(buoy instanceof BuoyCard)) { 757 buoy.setBuoyIndex(0); 758 cbM01CatOfMark.removeAllItems(); 759 cbM01CatOfMark.addItem("*Select Category*"); 760 cbM01CatOfMark.addItem("North"); 761 cbM01CatOfMark.addItem("East"); 762 cbM01CatOfMark.addItem("South"); 763 cbM01CatOfMark.addItem("West"); 764 cbM01CatOfMark.setEnabled(true); 765 } 736 766 break; 737 767 … … 739 769 if (!(buoy instanceof BuoySaw)) 740 770 buoy = new BuoySaw(dia, n); 741 break; 742 743 case SeaMark.CARD_NORTH: 744 case SeaMark.CARD_EAST: 745 case SeaMark.CARD_SOUTH: 746 case SeaMark.CARD_WEST: 747 if (!(buoy instanceof BuoyCard)) 748 buoy = new BuoyCard(dia, n); 771 buoy.setBuoyIndex(type); 749 772 break; 750 773 … … 752 775 if (!(buoy instanceof BuoyIsol)) 753 776 buoy = new BuoyIsol(dia, n); 777 buoy.setBuoyIndex(type); 754 778 break; 755 779 … … 757 781 if (!(buoy instanceof BuoySpec)) 758 782 buoy = new BuoySpec(dia, n); 783 buoy.setBuoyIndex(type); 759 784 break; 760 default:761 if (!(buoy instanceof BuoyUkn))762 buoy = new BuoyUkn(dia, "Not Implemented");763 785 } 764 786 765 buoy.setBuoyIndex(type);766 787 buoy.refreshStyles(); 767 788 buoy.refreshLights(); 789 buoy.setLightColour(); 768 790 buoy.paintSign(); 769 791 } 770 792 }); 771 772 } 773 793 } 774 794 return cbM01TypeOfMark; 775 795 } … … 778 798 if (cbM01CatOfMark == null) { 779 799 cbM01CatOfMark = new JComboBox(); 780 cbM01CatOfMark.setBounds(new Rectangle( 80, 55, 120, 25));800 cbM01CatOfMark.setBounds(new Rectangle(75, 55, 125, 25)); 781 801 cbM01CatOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 782 cbM01CatOfMark.setEnabled(true);783 802 cbM01CatOfMark.addActionListener(new ActionListener() { 784 803 public void actionPerformed(ActionEvent e) { 785 804 int cat = cbM01CatOfMark.getSelectedIndex(); 805 806 if (buoy == null) { 807 buoy = new BuoyUkn(dia, "Seamark not set"); 808 return; 809 } 810 if (cat == 0) 811 return; 812 813 Node n = buoy.getNode(); 814 if (n == null) 815 return; 816 817 if (cbM01TypeOfMark.getSelectedIndex() == SeaMark.LATERAL) { 818 if (!(buoy instanceof BuoyLat)) 819 buoy = new BuoyLat(dia, n); 820 buoy.setBuoyIndex(cat); 821 } 822 if (cbM01TypeOfMark.getSelectedIndex() == SeaMark.CARDINAL) { 823 if (!(buoy instanceof BuoyCard)) 824 buoy = new BuoyCard(dia, n); 825 buoy.setBuoyIndex(cat); 826 } 827 828 buoy.refreshStyles(); 829 buoy.refreshLights(); 830 buoy.setLightColour(); 831 buoy.paintSign(); 786 832 } 787 833 }); … … 795 841 cbM01StyleOfMark.setBounds(new Rectangle(50, 85, 150, 25)); 796 842 cbM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 797 cbM01StyleOfMark.setEnabled(true);798 843 cbM01StyleOfMark.addActionListener(new ActionListener() { 799 844 public void actionPerformed(ActionEvent e) { … … 847 892 cbM01TopMark.setBounds(new Rectangle(100, 170, 70, 20)); 848 893 cbM01TopMark.setFont(new Font("Dialog", Font.PLAIN, 12)); 849 cbM01TopMark.setEnabled(true);850 894 cbM01TopMark.addActionListener(new ActionListener() { 851 895 public void actionPerformed(ActionEvent e) { … … 862 906 cM01Radar.setBounds(new Rectangle(10, 195, 120, 20)); 863 907 cM01Radar.setFont(new Font("Dialog", Font.PLAIN, 12)); 864 cM01Radar.setEnabled(false);865 908 cM01Radar.setText("Radar Reflector"); 866 909 } … … 873 916 cM01Racon.setBounds(new Rectangle(130, 195, 110, 20)); 874 917 cM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); 875 cM01Racon.setEnabled(false);876 918 cM01Racon.setText("Radar Beacon"); 877 919 } … … 884 926 cbM01Racon.setBounds(new Rectangle(240, 195, 80, 20)); 885 927 cbM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); 886 cbM01Racon.setEnabled(true);887 928 cbM01Racon.addActionListener(new ActionListener() { 888 929 public void actionPerformed(ActionEvent e) { … … 912 953 cM01Fog.setBounds(new Rectangle(10, 220, 90, 20)); 913 954 cM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); 914 cM01Fog.setEnabled(false);915 955 cM01Fog.setText("Fog Signal"); 916 956 } … … 923 963 cbM01Fog.setBounds(new Rectangle(100, 220, 70, 20)); 924 964 cbM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); 925 cbM01Fog.setEnabled(true);926 965 cbM01Fog.addActionListener(new ActionListener() { 927 966 public void actionPerformed(ActionEvent e) { … … 965 1004 cM01Fired.setFont(new Font("Dialog", Font.PLAIN, 12)); 966 1005 cM01Fired.setText("Lighted"); 967 cM01Fired.setEnabled(false);968 1006 cM01Fired.addItemListener(new ItemListener() { 969 1007 public void itemStateChanged(ItemEvent e) { … … 971 1009 return; 972 1010 } 973 974 1011 buoy.setFired(cM01Fired.isSelected()); 975 1012 buoy.setLightColour(); 976 1013 buoy.paintSign(); 977 1014 } … … 985 1022 if (cbM01Kennung == null) { 986 1023 cbM01Kennung = new JComboBox(); 987 cbM01Kennung.setBounds(new Rectangle( 100, 270, 70, 20));1024 cbM01Kennung.setBounds(new Rectangle(305, 245, 70, 20)); 988 1025 cbM01Kennung.addActionListener(new ActionListener() { 989 1026 public void actionPerformed(ActionEvent e) { … … 1001 1038 i1 = it.indexOf("("); 1002 1039 i2 = it.indexOf(")", i1); 1040 tfM01Group.setText(""); 1041 tfM01Group.setEnabled(false); 1003 1042 if (i1 >= 0) { 1004 1043 c = it.substring(0, i1); 1005 if (i1 >= 0) 1044 if (i1 >= 0) { 1006 1045 g = it.substring(i1 + 1, i2); 1046 if (g.equals("")) 1047 tfM01Group.setEnabled(true); 1048 } 1007 1049 } 1008 1050 if (it.contains("+")) { … … 1018 1060 buoy.setLightChar(c); 1019 1061 buoy.setLightGroup(g); 1020 // buoy.setLightColour();1021 1062 buoy.paintSign(); 1022 1063 } … … 1029 1070 if (cbM01Sector == null) { 1030 1071 cbM01Sector = new JComboBox(); 1031 cbM01Sector.setBounds(new Rectangle( 300, 245, 50, 20));1072 cbM01Sector.setBounds(new Rectangle(120, 270, 50, 20)); 1032 1073 cbM01Sector.setFont(new Font("Dialog", Font.PLAIN, 12)); 1033 cbM01Sector.setEnabled(true); 1074 cbM01Sector.addItem("0"); 1075 cbM01Sector.addItem("1"); 1076 cbM01Sector.addItem("2"); 1077 cbM01Sector.addItem("3"); 1078 cbM01Sector.addItem("4"); 1079 cbM01Sector.addItem("5"); 1080 cbM01Sector.addItem("6"); 1081 cbM01Sector.addItem("7"); 1082 cbM01Sector.addItem("8"); 1083 cbM01Sector.addItem("9"); 1034 1084 cbM01Sector.addActionListener(new ActionListener() { 1035 1085 public void actionPerformed(ActionEvent e) { … … 1073 1123 tfM01Group.addFocusListener(new FocusAdapter() { 1074 1124 public void focusLost(FocusEvent e) { 1075 buoy.set Name(tfM01Group.getText());1125 buoy.setLightGroup(tfM01Group.getText()); 1076 1126 } 1077 1127 }); 1078 1128 } 1079 1129 return tfM01Group; 1130 } 1131 1132 private JTextField getTfM01Bearing() { 1133 if (tfM01Bearing == null) { 1134 tfM01Bearing = new JTextField(); 1135 tfM01Bearing.setBounds(new Rectangle(40, 295, 30, 20)); 1136 tfM01Bearing.addFocusListener(new FocusAdapter() { 1137 public void focusLost(FocusEvent e) { 1138 buoy.setName(tfM01Bearing.getText()); 1139 } 1140 }); 1141 } 1142 return tfM01Bearing; 1143 } 1144 1145 private JTextField getTfM02Bearing() { 1146 if (tfM02Bearing == null) { 1147 tfM02Bearing = new JTextField(); 1148 tfM02Bearing.setBounds(new Rectangle(85, 295, 30, 20)); 1149 tfM02Bearing.addFocusListener(new FocusAdapter() { 1150 public void focusLost(FocusEvent e) { 1151 buoy.setName(tfM02Bearing.getText()); 1152 } 1153 }); 1154 } 1155 return tfM02Bearing; 1156 } 1157 1158 private JTextField getTfM01Radius() { 1159 if (tfM01Radius == null) { 1160 tfM01Radius = new JTextField(); 1161 tfM01Radius.setBounds(new Rectangle(140, 295, 30, 20)); 1162 tfM01Radius.addFocusListener(new FocusAdapter() { 1163 public void focusLost(FocusEvent e) { 1164 buoy.setName(tfM01Radius.getText()); 1165 } 1166 }); 1167 } 1168 return tfM01Radius; 1080 1169 } 1081 1170 … … 1136 1225 bM01Save.setBounds(new Rectangle(120, 325, 80, 20)); 1137 1226 bM01Save.setText("Save"); 1227 bM01Save.setEnabled(false); 1138 1228 1139 1229 bM01Save.addActionListener(new ActionListener() { … … 1204 1294 return cM01IconVisible; 1205 1295 } 1206 1296 1207 1297 private JTextField getSM01StatusBar() { 1208 1298 if (sM01StatusBar == null) { -
applications/editors/josm/plugins/toms/src/toms/seamarks/SeaMark.java
r22816 r22979 39 39 * Types - correspond to TypeIndex 40 40 */ 41 public final static int UNKNOWN_TYPE = 0; 42 public final static int LATERAL = 1; 43 public final static int CARDINAL = 2; 44 public final static int SAFE_WATER = 3; 45 public final static int ISOLATED_DANGER = 4; 46 public final static int SPECIAL_PURPOSE = 5; 47 public final static int LIGHT = 6; 48 49 /** 50 * Categories - correspond to CatIndex 51 */ 41 52 public final static int UNKNOWN_CAT = 0; 42 53 public final static int PORT_HAND = 1; … … 44 55 public final static int PREF_PORT_HAND = 3; 45 56 public final static int PREF_STARBOARD_HAND = 4; 46 public final static int SAFE_WATER = 5; 47 public final static int CARD_NORTH = 6; 48 public final static int CARD_EAST = 7; 49 public final static int CARD_SOUTH = 8; 50 public final static int CARD_WEST = 9; 51 public final static int ISOLATED_DANGER = 10; 52 public final static int SPECIAL_PURPOSE = 11; 53 public final static int LIGHT = 12; 57 public final static int CARD_NORTH = 1; 58 public final static int CARD_EAST = 2; 59 public final static int CARD_SOUTH = 3; 60 public final static int CARD_WEST = 4; 54 61 55 62 /** -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r22946 r22979 216 216 public void paintSign() { 217 217 218 dlg.cbM01TypeOfMark.setEnabled(true);219 dlg.cbM01StyleOfMark.setEnabled(true);220 221 dlg.cbM01TypeOfMark.setSelectedIndex(getBuoyIndex());222 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());223 224 218 dlg.cM01TopMark.setSelected(hasTopMark()); 225 219 dlg.cM01Fired.setSelected(isFired()); … … 264 258 } 265 259 266 dlg.bM01Save.setEnabled(true);267 268 260 dlg.lM01Icon01.setIcon(null); 269 261 dlg.lM01Icon02.setIcon(null); … … 331 323 } 332 324 325 public void resetMask() { 326 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); 327 328 dlg.lM01Icon01.setIcon(null); 329 dlg.lM01Icon02.setIcon(null); 330 331 dlg.rbM01RegionA.setEnabled(false); 332 dlg.rbM01RegionB.setEnabled(false); 333 dlg.cbM01StyleOfMark.removeAllItems(); 334 dlg.cbM01StyleOfMark.setEnabled(false); 335 dlg.tfM01Name.setText(""); 336 dlg.tfM01Name.setEnabled(false); 337 setName(""); 338 dlg.cM01TopMark.setSelected(false); 339 dlg.cM01TopMark.setEnabled(false); 340 dlg.cbM01TopMark.removeAllItems(); 341 dlg.cbM01TopMark.setEnabled(false); 342 setTopMark(false); 343 dlg.cM01Radar.setSelected(false); 344 dlg.cM01Radar.setEnabled(false); 345 dlg.cM01Racon.setSelected(false); 346 dlg.cM01Racon.setEnabled(false); 347 dlg.cbM01Racon.removeAllItems(); 348 dlg.cbM01Racon.setEnabled(false); 349 dlg.tfM01Racon.setText(""); 350 dlg.tfM01Racon.setEnabled(false); 351 dlg.cM01Fog.setSelected(false); 352 dlg.cM01Fog.setEnabled(false); 353 dlg.cbM01Fog.removeAllItems(); 354 dlg.cbM01Fog.setEnabled(false); 355 dlg.tfM01FogGroup.setText(""); 356 dlg.tfM01FogGroup.setEnabled(false); 357 dlg.tfM01FogPeriod.setText(""); 358 dlg.tfM01FogPeriod.setEnabled(false); 359 dlg.cM01Fired.setSelected(false); 360 dlg.cM01Fired.setEnabled(false); 361 setFired(false); 362 dlg.rbM01Fired1.setEnabled(false); 363 dlg.rbM01FiredN.setEnabled(false); 364 dlg.cbM01Kennung.removeAllItems(); 365 dlg.cbM01Kennung.setEnabled(false); 366 dlg.cbM01Sector.setEnabled(false); 367 dlg.tfM01Group.setText(""); 368 dlg.tfM01Group.setEnabled(false); 369 dlg.tfM01RepeatTime.setText(""); 370 dlg.tfM01RepeatTime.setEnabled(false); 371 dlg.tfM01Bearing.setText(""); 372 dlg.tfM01Bearing.setEnabled(false); 373 dlg.tfM02Bearing.setText(""); 374 dlg.tfM02Bearing.setEnabled(false); 375 dlg.tfM01Radius.setText(""); 376 dlg.tfM01Radius.setEnabled(false); 377 dlg.tfM01Height.setText(""); 378 dlg.tfM01Height.setEnabled(false); 379 dlg.tfM01Range.setText(""); 380 dlg.tfM01Range.setEnabled(false); 381 382 dlg.bM01Save.setEnabled(false); 383 } 384 333 385 } -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
r22923 r22979 24 24 keys = node.getKeys(); 25 25 setNode(node); 26 27 resetMask(); 26 28 27 29 dlg.cbM01StyleOfMark.removeAllItems(); … … 32 34 dlg.cbM01StyleOfMark.addItem("Tower"); 33 35 dlg.cbM01StyleOfMark.addItem("Float"); 34 35 dlg.cM01Fired.setSelected(false); 36 dlg.cM01TopMark.setSelected(false); 36 dlg.cbM01StyleOfMark.setEnabled(true); 37 37 38 38 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); … … 245 245 246 246 if (isFired()) { 247 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_ 240.png")));247 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_120.png"))); 248 248 249 249 if (getLightChar() != "") { -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
r22923 r22979 23 23 keys = node.getKeys(); 24 24 setNode(node); 25 26 resetMask(); 25 27 26 28 dlg.cbM01StyleOfMark.removeAllItems(); … … 31 33 dlg.cbM01StyleOfMark.addItem("Tower"); 32 34 dlg.cbM01StyleOfMark.addItem("Float"); 35 dlg.cbM01StyleOfMark.setEnabled(true); 33 36 34 37 dlg.cbM01Kennung.removeAllItems(); … … 36 39 dlg.cbM01Kennung.addItem("Fl(2)"); 37 40 38 dlg.cM01Fired.setSelected(false);39 41 dlg.cM01TopMark.setSelected(true); 40 dlg.cM01TopMark.setEnabled(false);41 42 42 43 setColour(SeaMark.BLACK_RED_BLACK); … … 139 140 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource(image))); 140 141 if (isFired()) { 141 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_ 240.png")));142 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_120.png"))); 142 143 if (getLightChar() != "") { 143 144 String c; -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r22923 r22979 13 13 14 14 import toms.dialogs.SmpDialogAction; 15 import toms.seamarks.SeaMark;16 15 17 16 public class BuoyLat extends Buoy { … … 23 22 keys = node.getKeys(); 24 23 setNode(node); 24 25 resetMask(); 26 27 dlg.rbM01RegionA.setEnabled(true); 28 dlg.rbM01RegionB.setEnabled(true); 29 30 dlg.cbM01StyleOfMark.removeAllItems(); 31 dlg.cbM01StyleOfMark.addItem("Not set"); 32 dlg.cbM01StyleOfMark.addItem("Pillar Buoy"); 33 dlg.cbM01StyleOfMark.addItem("Spar Buoy"); 34 dlg.cbM01StyleOfMark.addItem("Beacon"); 35 dlg.cbM01StyleOfMark.addItem("Tower"); 36 dlg.cbM01StyleOfMark.addItem("Float"); 37 dlg.cbM01StyleOfMark.setEnabled(true); 25 38 26 39 dlg.cbM01Kennung.removeAllItems(); 27 40 dlg.cbM01Kennung.addItem("Not set"); 28 41 dlg.cbM01Kennung.addItem("Fl"); 29 dlg.cbM01Kennung.addItem("Fl(2)"); 30 dlg.cbM01Kennung.addItem("Fl(3)"); 31 dlg.cbM01Kennung.addItem("Fl(4)"); 32 dlg.cbM01Kennung.addItem("Fl(5)"); 33 dlg.cbM01Kennung.addItem("Oc(2)"); 34 dlg.cbM01Kennung.addItem("Oc(3)"); 42 dlg.cbM01Kennung.addItem("Fl()"); 43 dlg.cbM01Kennung.addItem("Oc"); 44 dlg.cbM01Kennung.addItem("Oc()"); 35 45 dlg.cbM01Kennung.addItem("Q"); 36 46 dlg.cbM01Kennung.addItem("IQ"); 47 dlg.cbM01Kennung.addItem("Mo()"); 37 48 dlg.cbM01Kennung.setSelectedIndex(0); 38 39 setStyleIndex(0);40 setLightColour();41 setFired(false);42 setTopMark(false);43 setRegion(Main.pref.get("tomsplugin.IALA").equals("B"));44 45 dlg.cM01Fired.setSelected(false);46 dlg.cM01TopMark.setSelected(false);47 49 48 50 if (keys.containsKey("name")) … … 287 289 288 290 dlg.cbM01StyleOfMark.removeAllItems(); 289 dlg.cbM01StyleOfMark.addItem(" Not set");291 dlg.cbM01StyleOfMark.addItem("*Select Shape*"); 290 292 291 293 switch (type) { … … 582 584 if (getLightColour().equals("R")) 583 585 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 584 "/images/Light_Red_ 240.png")));586 "/images/Light_Red_120.png"))); 585 587 else 586 588 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 587 "/images/Light_Green_ 240.png")));589 "/images/Light_Green_120.png"))); 588 590 if (getLightChar() != "") { 589 591 String c; -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyNota.java
r22923 r22979 18 18 public BuoyNota(SmpDialogAction dia, int type) { 19 19 super(dia); 20 21 resetMask(); 20 22 21 23 dlg.cbM01Kennung.removeAllItems(); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
r22923 r22979 23 23 keys = node.getKeys(); 24 24 setNode(node); 25 26 resetMask(); 25 27 26 28 dlg.cbM01StyleOfMark.removeAllItems(); … … 38 40 dlg.cbM01Kennung.addItem("LFl"); 39 41 dlg.cbM01Kennung.addItem("Mo()"); 40 41 dlg.cM01Fired.setSelected(false);42 dlg.cM01TopMark.setSelected(false);43 42 44 43 setColour(SeaMark.RED_WHITE); … … 141 140 142 141 if (isFired()) { 143 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_ 240.png")));142 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_120.png"))); 144 143 if (getLightChar() != "") { 145 144 String c; -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
r22923 r22979 23 23 keys = node.getKeys(); 24 24 setNode(node); 25 26 resetMask(); 25 27 26 28 dlg.cbM01StyleOfMark.removeAllItems(); … … 47 49 dlg.cbM01Kennung.setSelectedIndex(0); 48 50 49 dlg.cM01Fired.setSelected(false);50 dlg.cM01TopMark.setSelected(false);51 dlg.cM01Fired.setEnabled(false);52 51 dlg.cM01TopMark.setEnabled(true); 53 52 … … 181 180 182 181 if (isFired()) { 183 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_ 240.png")));182 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_120.png"))); 184 183 if (getLightChar() != "") { 185 184 String c; -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyUkn.java
r22923 r22979 3 3 4 4 package toms.seamarks.buoys; 5 6 import javax.swing.ImageIcon; 5 7 6 8 import org.openstreetmap.josm.Main; … … 11 13 public BuoyUkn(SmpDialogAction dia, String Msg) { 12 14 super(dia); 13 14 dlg.cbM01StyleOfMark.removeAllItems(); 15 dlg.cbM01StyleOfMark.addItem("Not set"); 16 17 if (dlg.cbM01Kennung != null) { 18 dlg.cbM01Kennung.removeAllItems(); 19 dlg.cbM01Kennung.addItem("Not set"); 20 } 21 22 dlg.cM01Fired.setSelected(false); 23 dlg.cM01TopMark.setSelected(false); 24 15 resetMask(); 16 dlg.cbM01CatOfMark.removeAllItems(); 17 dlg.cbM01CatOfMark.setEnabled(false); 18 dlg.tfM01Name.setText(getName()); 25 19 setErrMsg(Msg); 26 setName("");27 setTopMark(false);28 setFired(false);29 setValid(false);30 setBuoyIndex(0);31 setRegion(Main.pref.get("tomsplugin.IALA").equals("B"));32 20 } 33 21 … … 35 23 super.paintSign(); 36 24 37 dlg.lM01Icon01.setIcon(null);38 dlg.lM01Icon02.setIcon(null);39 25 if (getErrMsg() != null) 40 26 dlg.sM01StatusBar.setText(getErrMsg()); 41 27 42 28 setErrMsg(null); 43 44 dlg.tfM01Name.setText(getName());45 dlg.tfM01Name.setEnabled(false);46 47 dlg.cM01Fired.setEnabled(false);48 dlg.cM01TopMark.setEnabled(false);49 50 dlg.bM01Save.setEnabled(false);51 52 29 } 53 30
Note:
See TracChangeset
for help on using the changeset viewer.