Changeset 22626 in osm for applications/editors/josm/plugins/toms/src/toms/seamarks/buoys
- Timestamp:
- 2010-08-13T19:17:07+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms/seamarks/buoys
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r22623 r22626 47 47 } 48 48 49 private int Region = 0;50 51 public intgetRegion() {49 private boolean Region = false; 50 51 public boolean getRegion() { 52 52 return Region; 53 53 } 54 54 55 public void setRegion( intregion) {55 public void setRegion(boolean region) { 56 56 Region = region; 57 dlg.tbM01Region.setSelected(region); 58 dlg.tbM01Region.setText(region ? "IALA-B" : "IALA-A"); 57 59 } 58 60 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
r22623 r22626 28 28 dlg.cbM01StyleOfMark.addItem("Float"); 29 29 30 dlg.cbM01Colour.removeAllItems();31 dlg.cbM01Colour.addItem("W");32 dlg.cbM01Colour.setSelectedIndex(0);33 dlg.cbM01Colour.setEnabled(false);34 30 dlg.cM01Fired.setSelected(false); 35 31 dlg.cM01TopMark.setSelected(false); 36 32 dlg.tbM01Region.setEnabled(false); 33 34 setBuoyIndex(type); 37 35 setStyleIndex(0); 38 setBuoyIndex(type);39 36 setLightColour("W"); 40 37 … … 251 248 else if (str.compareTo("spar") == 0) 252 249 setStyleIndex(CARD_SPAR); 253 else if (str.compareTo("float") == 0)254 setStyleIndex(CARD_FLOAT);255 250 else 256 251 ret = false; 257 } else if (keys.containsKey("seamark:beacon_cardinal ")) {252 } else if (keys.containsKey("seamark:beacon_cardinal:colour")) { 258 253 if (keys.containsKey("seamark:beacon_cardinal:shape")) { 259 254 str = keys.get("seamark:beacon_cardinal:shape"); … … 261 256 if (str.compareTo("tower") == 0) 262 257 setStyleIndex(CARD_TOWER); 258 else 259 setStyleIndex(CARD_BEACON); 263 260 } else 264 261 setStyleIndex(CARD_BEACON); 262 } else if ((keys.containsKey("seamark:type") == true) 263 && (keys.get("seamark:type").equals("light_float"))) { 264 setStyleIndex(CARD_FLOAT); 265 265 } 266 266 return ret; -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
r22623 r22626 31 31 dlg.cbM01Kennung.addItem("Fl(2)"); 32 32 33 dlg.cbM01Colour.removeAllItems();34 dlg.cbM01Colour.addItem("W");35 dlg.cbM01Colour.setSelectedIndex(0);36 dlg.cbM01Colour.setEnabled(false);37 33 dlg.cM01Fired.setSelected(false); 38 34 dlg.cM01TopMark.setSelected(true); 39 35 dlg.cM01TopMark.setEnabled(false); 36 dlg.tbM01Region.setEnabled(false); 40 37 41 38 setColour(SeaMark.BLACK_RED_BLACK); … … 243 240 else 244 241 ret = false; 245 } 246 if (keys.containsKey("seamark:beacon_isolated_danger:shape")) { 247 str = keys.get("seamark:beacon_isolated_danger:shape"); 248 249 if (str.compareTo("stake") == 0) 242 } else if (keys.containsKey("seamark:beacon_isolated_danger:colour")) { 243 if (keys.containsKey("seamark:beacon_isolated_danger:shape")) { 244 str = keys.get("seamark:beacon_isolated_danger:shape"); 245 246 if (str.compareTo("tower") == 0) 247 setStyleIndex(ISOL_TOWER); 248 else 249 setStyleIndex(ISOL_BEACON); 250 } else 250 251 setStyleIndex(ISOL_BEACON); 251 else252 ret = false;253 }254 252 } else if ((keys.containsKey("seamark:type") == true) 253 && (keys.get("seamark:type").equals("light_float"))) { 254 setStyleIndex(CARD_FLOAT); 255 } 255 256 return ret; 256 257 } -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r22623 r22626 32 32 dlg.cbM01Kennung.setSelectedIndex(0); 33 33 34 dlg.cbM01Colour.removeAllItems();35 dlg.cbM01Colour.addItem("");36 dlg.cbM01Colour.addItem("R");37 dlg.cbM01Colour.addItem("G");38 dlg.cbM01Colour.setSelectedIndex(0);39 dlg.cbM01Colour.setEnabled(false);40 41 34 setBuoyIndex(type); 42 35 setStyleIndex(0); … … 44 37 setFired(false); 45 38 setTopMark(false); 39 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); 46 40 47 41 refreshStyles(); … … 119 113 120 114 int cat = getBuoyIndex(); 121 intregion = getRegion();115 boolean region = getRegion(); 122 116 int style = getStyleIndex(); 123 117 … … 351 345 image += ".png"; 352 346 353 // System.out.println("finename: " + image);347 // System.out.println("finename: " + image); 354 348 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource(image))); 355 349 } else … … 701 695 702 696 saveTopMarkData(shape, colour); 703 704 697 saveLightData(colour); 698 699 Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A"); 705 700 } 706 701 … … 723 718 case PORT_HAND: 724 719 case PREF_PORT_HAND: 725 if (str. compareTo("cylinder") == 0) {720 if (str.equals("cylinder")) { 726 721 setTopMark(true); 727 722 setRegion(IALA_A); 723 } else if (str.equals("cone, point up")) { 724 setTopMark(true); 725 setRegion(IALA_B); 728 726 } else { 729 727 setTopMark(false); … … 734 732 case STARBOARD_HAND: 735 733 case PREF_STARBOARD_HAND: 736 if (str. compareTo("cone, point up") == 0 || str.compareTo("cone") == 0) {734 if (str.equals("cone, point up")) { 737 735 setTopMark(true); 738 736 setRegion(IALA_A); 737 } else if (str.equals("cylinder")) { 738 setTopMark(true); 739 setRegion(IALA_B); 739 740 } else { 740 741 setTopMark(false); … … 746 747 ret = false; 747 748 } 748 749 749 if (!hasTopMark()) { 750 750 setErrMsg("Parse-Error: Topmark falsch"); 751 751 ret = false; 752 752 } 753 754 } 755 753 } 756 754 return ret; 757 755 } … … 779 777 780 778 if (isFired()) { 779 781 780 } else { 782 781 if (getErrMsg() == null) … … 792 791 793 792 public void setLightColour() { 794 if (getRegion() != IALA_B793 if (getRegion() == IALA_A 795 794 && (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND)) { 796 795 super.setLightColour("R"); 797 dlg.cbM01Colour.setSelectedIndex(RED_LIGHT);798 796 } else { 799 797 super.setLightColour("G"); 800 dlg.cbM01Colour.setSelectedIndex(GREEN_LIGHT);801 798 } 802 799 } … … 812 809 case PORT_HAND: 813 810 case PREF_PORT_HAND: 814 if (str.compareTo("red") == 0) { 815 816 setFired(true); 817 super.setLightColour("R"); 811 if (getRegion() == IALA_A) { 812 if (str.compareTo("red") == 0) { 813 setFired(true); 814 super.setLightColour("R"); 815 } else { 816 super.setLightColour(""); 817 } 818 818 } else { 819 super.setLightColour(""); 820 } 821 819 if (str.compareTo("green") == 0) { 820 setFired(true); 821 super.setLightColour("G"); 822 } else { 823 super.setLightColour(""); 824 } 825 } 822 826 break; 823 827 824 828 case STARBOARD_HAND: 825 829 case PREF_STARBOARD_HAND: 826 if (str.compareTo("green") == 0) { 827 setFired(true); 828 super.setLightColour("G"); 830 if (getRegion() == IALA_A) { 831 if (str.compareTo("green") == 0) { 832 setFired(true); 833 super.setLightColour("G"); 834 } else { 835 super.setLightColour(""); 836 } 829 837 } else { 830 super.setLightColour(""); 838 if (str.compareTo("red") == 0) { 839 setFired(true); 840 super.setLightColour("R"); 841 } else { 842 super.setLightColour(""); 843 } 831 844 } 832 845 break; … … 856 869 else if (str.compareTo("spar") == 0) 857 870 setStyleIndex(LAT_SPAR); 858 else if (str.compareTo("float") == 0)859 setStyleIndex(LAT_FLOAT);860 else if (str.compareTo("perch") == 0)861 setStyleIndex(LAT_PERCH);862 871 else 863 872 ret = false; … … 882 891 else if (str.compareTo("spar") == 0) 883 892 setStyleIndex(LAT_SPAR); 884 else if (str.compareTo("float") == 0)885 setStyleIndex(LAT_FLOAT);886 else if (str.compareTo("perch") == 0)887 setStyleIndex(LAT_PERCH);888 893 else 889 894 ret = false; … … 904 909 ret = false; 905 910 } 906 } else if (keys.containsKey("seamark:beacon_lateral:shape")) { 907 str = keys.get("seamark:beacon_lateral:shape"); 908 909 int cat = getBuoyIndex(); 910 switch (cat) { 911 case PORT_HAND: 912 if (str.compareTo("stake") == 0) 913 setStyleIndex(LAT_BEACON); 914 else if (str.compareTo("tower") == 0) 911 } else if (keys.containsKey("seamark:beacon_lateral:colour")) { 912 if (keys.containsKey("seamark:beacon_lateral:shape")) { 913 str = keys.get("seamark:beacon_lateral:shape"); 914 if (str.compareTo("tower") == 0) 915 915 setStyleIndex(LAT_TOWER); 916 916 else 917 ret = false;918 break;919 920 case PREF_PORT_HAND:921 if (str.compareTo("stake") == 0)922 917 setStyleIndex(LAT_BEACON); 923 else if (str.compareTo("tower") == 0) 924 setStyleIndex(LAT_TOWER); 925 else 926 ret = false; 927 break; 928 929 case STARBOARD_HAND: 930 if (str.compareTo("stake") == 0) 931 setStyleIndex(LAT_BEACON); 932 else if (str.compareTo("tower") == 0) 933 setStyleIndex(LAT_TOWER); 934 else 935 ret = false; 936 break; 937 938 case PREF_STARBOARD_HAND: 939 if (str.compareTo("stake") == 0) 940 setStyleIndex(LAT_BEACON); 941 else if (str.compareTo("tower") == 0) 942 setStyleIndex(LAT_TOWER); 943 else 944 ret = false; 945 break; 946 947 default: 948 ret = false; 949 } 918 } else 919 setStyleIndex(LAT_BEACON); 920 } else if ((keys.containsKey("seamark:type") == true) 921 && (keys.get("seamark:type").equals("light_float"))) { 922 setStyleIndex(LAT_FLOAT); 950 923 } 951 924 return ret; -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyNota.java
r22623 r22626 32 32 dlg.cbM01Kennung.setSelectedIndex(0); 33 33 34 dlg.cbM01Colour.removeAllItems(); 35 dlg.cbM01Colour.addItem("Not set"); 36 dlg.cbM01Colour.addItem("R"); 37 dlg.cbM01Colour.addItem("G"); 38 dlg.cbM01Colour.addItem("W"); 39 dlg.cbM01Colour.setEnabled(true); 34 dlg.tbM01Region.setEnabled(false); 40 35 41 36 setBuoyIndex(type); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
r22623 r22626 33 33 dlg.cbM01Kennung.addItem("Mo()"); 34 34 35 dlg.cbM01Colour.removeAllItems();36 dlg.cbM01Colour.addItem("W");37 dlg.cbM01Colour.setSelectedIndex(0);38 dlg.cbM01Colour.setEnabled(false);39 35 dlg.cM01Fired.setSelected(false); 40 36 dlg.cM01TopMark.setSelected(false); 37 dlg.tbM01Region.setEnabled(false); 41 38 42 39 setColour(SeaMark.RED_WHITE); … … 227 224 else if (str.compareTo("sphere") == 0) 228 225 setStyleIndex(SAFE_SPHERE); 229 else if (str.compareTo("float") == 0)230 setStyleIndex(SAFE_FLOAT);231 226 else 232 227 ret = false; 228 } else if ((keys.containsKey("seamark:type") == true) 229 && (keys.get("seamark:type").equals("light_float"))) { 230 setStyleIndex(SAFE_FLOAT); 233 231 } 234 232 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
r22623 r22626 28 28 dlg.cbM01Kennung.addItem("Not set"); 29 29 30 dlg.cbM01Colour.removeAllItems();31 dlg.cbM01Colour.addItem("W");32 dlg.cbM01Colour.setSelectedIndex(0);33 dlg.cbM01Colour.setEnabled(false);34 30 dlg.cM01Fired.setSelected(false); 35 31 dlg.cM01TopMark.setSelected(false); 32 dlg.tbM01Region.setEnabled(false); 36 33 37 34 setColour(SeaMark.YELLOW); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyUkn.java
r22623 r22626 13 13 super(dia); 14 14 15 setBuoyIndex(0);16 15 if (dlg.cbM01Kennung != null) { 17 16 dlg.cbM01Kennung.removeAllItems(); … … 19 18 } 20 19 21 dlg.cbM01Colour.removeAllItems();22 dlg.cbM01Colour.setEnabled(false);23 20 dlg.cM01Fired.setSelected(false); 24 21 dlg.cM01TopMark.setSelected(false); 22 dlg.tbM01Region.setEnabled(false); 25 23 26 24 setErrMsg(Msg); … … 29 27 setFired(false); 30 28 setValid(false); 29 setBuoyIndex(0); 31 30 32 31 paintSign();
Note:
See TracChangeset
for help on using the changeset viewer.