Changeset 22836 in osm for applications/editors/josm/plugins/toms/src
- Timestamp:
- 2010-08-28T13:06:20+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r22828 r22836 171 171 String str = Main.pref.get("mappaint.style.sources"); 172 172 if (!str.contains("dev.openseamap.org")) { 173 if (!str.equals("")) 174 str += new String(new char[] { 0x1e }); 175 Main.pref.put("mappaint.style.sources", str 176 + "http://dev.openseamap.org/josm/seamark_styles.xml"); 173 if (!str.equals("")) str += new String(new char[] {0x1e}); 174 Main.pref.put("mappaint.style.sources", str + "http://dev.openseamap.org/josm/seamark_styles.xml"); 177 175 } 178 176 } … … 180 178 public void CloseDialog() { 181 179 onode = null; 182 DataSet.removeSelectionListener(SmpListener); 180 DataSet.selListeners.remove(SmpListener); 181 // DataSet.removeSelectionListener(SmpListener); 183 182 Selection = null; 184 183 … … 226 225 // siehe org.openstreetmap.josm.plugins.osb -> OsbLayer.java 227 226 // Einhängen des Listeners in die Eventqueue von josm 228 DataSet.addSelectionListener(SmpListener); 227 DataSet.selListeners.add(SmpListener); 228 // DataSet.addSelectionListener(SmpListener); 229 229 } 230 230 … … 444 444 PicRebuild(); 445 445 // Deaktivierung des Listeners 446 DataSet.removeSelectionListener(SmpListener); 446 DataSet.selListeners.remove(SmpListener); 447 // DataSet.removeSelectionListener(SmpListener); 447 448 Selection = null; 448 449 … … 816 817 PicRebuild(); 817 818 // Deaktivierung des Listeners 818 DataSet.removeSelectionListener(SmpListener); 819 DataSet.selListeners.remove(SmpListener); 820 // DataSet.removeSelectionListener(SmpListener); 819 821 Selection = null; 820 822 SmpItem.setEnabled(true); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r22746 r22836 117 117 setColour(SeaMark.GREEN); 118 118 } 119 } else if (cat. compareTo("starboard")== 0) {119 } else if (cat.equals("starboard")) { 120 120 121 121 setBuoyIndex(STARBOARD_HAND); 122 122 123 if (col. compareTo("green")== 0) {123 if (col.equals("green")) { 124 124 setRegion(SeaMark.IALA_A); 125 125 setColour(SeaMark.GREEN); … … 133 133 setColour(SeaMark.RED); 134 134 } 135 } else if (cat. compareTo("preferred_channel_port")== 0) {135 } else if (cat.equals("preferred_channel_port")) { 136 136 137 137 setBuoyIndex(PREF_PORT_HAND); 138 138 139 if (col. compareTo("red;green;red")== 0) {139 if (col.equals("red;green;red")) { 140 140 setRegion(SeaMark.IALA_A); 141 141 setColour(SeaMark.RED_GREEN_RED); 142 } else if (col. compareTo("green;red;green")== 0) {142 } else if (col.equals("green;red;green")) { 143 143 setRegion(SeaMark.IALA_B); 144 144 setColour(SeaMark.GREEN_RED_GREEN); … … 150 150 } 151 151 152 } else if (cat. compareTo("preferred_channel_starboard")== 0) {152 } else if (cat.equals("preferred_channel_starboard")) { 153 153 154 154 setBuoyIndex(PREF_STARBOARD_HAND); 155 155 156 if (col. compareTo("green;red;green")== 0) {156 if (col.equals("green;red;green")) { 157 157 setRegion(SeaMark.IALA_A); 158 158 setColour(SeaMark.GREEN_RED_GREEN); 159 } else if (col. compareTo("red;green;red")== 0) {159 } else if (col.equals("red;green;red")) { 160 160 setRegion(SeaMark.IALA_B); 161 161 setColour(SeaMark.RED_GREEN_RED); … … 173 173 switch (getBuoyIndex()) { 174 174 case PORT_HAND: 175 if (str. compareTo("can")== 0)175 if (str.equals("can")) 176 176 setStyleIndex(LAT_CAN); 177 else if (str. compareTo("pillar")== 0)177 else if (str.equals("pillar")) 178 178 setStyleIndex(LAT_PILLAR); 179 else if (str. compareTo("spar")== 0)179 else if (str.equals("spar")) 180 180 setStyleIndex(LAT_SPAR); 181 181 break; 182 182 183 183 case PREF_PORT_HAND: 184 if (str. compareTo("can")== 0)184 if (str.equals("can")) 185 185 setStyleIndex(LAT_CAN); 186 else if (str. compareTo("pillar")== 0)186 else if (str.equals("pillar")) 187 187 setStyleIndex(LAT_PILLAR); 188 else if (str. compareTo("spar")== 0)188 else if (str.equals("spar")) 189 189 setStyleIndex(LAT_SPAR); 190 190 break; 191 191 192 192 case STARBOARD_HAND: 193 if (str. compareTo("conical")== 0)193 if (str.equals("conical")) 194 194 setStyleIndex(LAT_CONE); 195 else if (str. compareTo("pillar")== 0)195 else if (str.equals("pillar")) 196 196 setStyleIndex(LAT_PILLAR); 197 else if (str. compareTo("spar")== 0)197 else if (str.equals("spar")) 198 198 setStyleIndex(LAT_SPAR); 199 199 break; 200 200 201 201 case PREF_STARBOARD_HAND: 202 if (str. compareTo("conical")== 0)202 if (str.equals("conical")) 203 203 setStyleIndex(LAT_CONE); 204 else if (str. compareTo("pillar")== 0)204 else if (str.equals("pillar")) 205 205 setStyleIndex(LAT_PILLAR); 206 else if (str. compareTo("spar")== 0)206 else if (str.equals("spar")) 207 207 setStyleIndex(LAT_SPAR); 208 208 break; 209 209 } 210 } else if (keys.containsKey("seamark:beacon_lateral:colour")) { 211 if (keys.containsKey("seamark:beacon_lateral:shape")) { 212 str = keys.get("seamark:beacon_lateral:shape"); 213 if (str.compareTo("tower") == 0) 214 setStyleIndex(LAT_TOWER); 215 else 216 setStyleIndex(LAT_BEACON); 217 } else 210 } else if (keys.containsKey("seamark:beacon_lateral:shape")) { 211 str = keys.get("seamark:beacon_lateral:shape"); 212 if (str.equals("tower")) 213 setStyleIndex(LAT_TOWER); 214 else if (str.equals("perch")) 215 setStyleIndex(LAT_PERCH); 216 else 218 217 setStyleIndex(LAT_BEACON); 219 218 } else if (keys.containsKey("seamark:type") … … 224 223 refreshStyles(); 225 224 226 if (keys.containsKey("seamark:topmark:shape") 227 || keys.containsKey("seamark:topmark:colour")) { 228 setTopMark(true); 229 } 230 231 if (keys.containsKey("seamark:light:colour")) { 232 setLightColour(keys.get("seamark:light:colour")); 233 setFired(true); 234 } 235 236 if (keys.containsKey("seamark:light:character")) { 237 setLightGroup(keys); 238 setLightChar(keys.get("seamark:light:character")); 239 setLightPeriod(keys); 225 if (getStyleIndex() != LAT_PERCH) { 226 if (keys.containsKey("seamark:topmark:shape") 227 || keys.containsKey("seamark:topmark:colour")) { 228 setTopMark(true); 229 } 230 231 if (keys.containsKey("seamark:light:colour")) { 232 setLightColour(keys.get("seamark:light:colour")); 233 setFired(true); 234 } 235 236 if (keys.containsKey("seamark:light:character")) { 237 setLightGroup(keys); 238 setLightChar(keys.get("seamark:light:character")); 239 setLightPeriod(keys); 240 } 240 241 } 241 242 } … … 312 313 int style = getStyleIndex(); 313 314 315 if (style == LAT_PERCH) { 316 dlg.cM01Fired.setSelected(false); 317 dlg.cM01TopMark.setSelected(false); 318 dlg.cM01Fired.setEnabled(false); 319 dlg.cM01TopMark.setEnabled(false); 320 } else { 321 dlg.cM01Fired.setEnabled(true); 322 dlg.cM01TopMark.setEnabled(true); 323 } 324 314 325 switch (getBuoyIndex()) { 315 326 case SeaMark.PORT_HAND: … … 588 599 break; 589 600 case LAT_PERCH: 590 super.saveSign("b uoy_lateral");591 Main.main.undoRedo.add(new ChangePropertyCommand(node, 592 "seamark:b uoy_lateral:shape", "perch"));601 super.saveSign("beacon_lateral"); 602 Main.main.undoRedo.add(new ChangePropertyCommand(node, 603 "seamark:beacon_lateral:shape", "perch")); 593 604 break; 594 605 default: … … 598 609 case LAT_PILLAR: 599 610 case LAT_SPAR: 611 Main.main.undoRedo.add(new ChangePropertyCommand(node, 612 "seamark:buoy_lateral:category", "port")); 613 if (getRegion() != SeaMark.IALA_B) { 614 Main.main.undoRedo.add(new ChangePropertyCommand(node, 615 "seamark:buoy_lateral:colour", "red")); 616 colour = "red"; 617 } else { 618 Main.main.undoRedo.add(new ChangePropertyCommand(node, 619 "seamark:buoy_lateral:colour", "green")); 620 colour = "green"; 621 } 622 break; 600 623 case LAT_PERCH: 601 624 Main.main.undoRedo.add(new ChangePropertyCommand(node, 602 "seamark:buoy_lateral:category", "port")); 603 if (getRegion() != SeaMark.IALA_B) { 604 Main.main.undoRedo.add(new ChangePropertyCommand(node, 605 "seamark:buoy_lateral:colour", "red")); 606 colour = "red"; 607 } else { 608 Main.main.undoRedo.add(new ChangePropertyCommand(node, 609 "seamark:buoy_lateral:colour", "green")); 610 colour = "green"; 611 } 625 "seamark:beacon_lateral:category", "port")); 612 626 break; 613 627 case LAT_BEACON: … … 752 766 break; 753 767 case LAT_PERCH: 754 super.saveSign("b uoy_lateral");755 Main.main.undoRedo.add(new ChangePropertyCommand(node, 756 "seamark:b uoy_lateral:shape", "perch"));768 super.saveSign("beacon_lateral"); 769 Main.main.undoRedo.add(new ChangePropertyCommand(node, 770 "seamark:beacon_lateral:shape", "perch")); 757 771 break; 758 772 default: … … 798 812 colour = "red"; 799 813 } 814 break; 815 case LAT_PERCH: 816 Main.main.undoRedo.add(new ChangePropertyCommand(node, 817 "seamark:beacon_lateral:category", "starboard")); 800 818 break; 801 819 }
Note:
See TracChangeset
for help on using the changeset viewer.