Changeset 22623 in osm
- Timestamp:
- 2010-08-12T21:02:08+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms
- Files:
-
- 1 added
- 56 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r22572 r22623 117 117 private JLabel lM01Range = null; 118 118 private JLabel lM01Name = null; 119 public JLabel lM01Icon03 = null;120 public JLabel lM01Icon02 = null;121 119 private JLabel lM01Props02 = null; 122 120 private JLabel lM01StyleOfMark = null; … … 177 175 178 176 public SmpDialogAction() { 179 super(tr(" SeaMap Symbol Entry"), "Smp", tr("Seamark Editor"), Shortcut177 super(tr("Edit SeaMap Symbols"), "Smp", tr("Seamark Editor"), Shortcut 180 178 .registerShortcut("tools:Semarks", 181 179 tr("Tool: {0}", tr("Seamark Editor")), KeyEvent.VK_S, … … 826 824 lM01Name.setText("Name:"); 827 825 828 lM01Icon03 = new JLabel();829 lM01Icon03.setBounds(new Rectangle(205, 135, 70, 60));830 lM01Icon03.setIcon(null);831 lM01Icon03.setText("");832 833 lM01Icon02 = new JLabel();834 lM01Icon02.setBounds(new Rectangle(250, 0, 85, 140));835 lM01Icon02.setIcon(null);836 lM01Icon02.setText("");837 838 826 lM01Props02 = new JLabel(); 839 827 lM01Props02.setBounds(new Rectangle(5, 170, 90, 16)); … … 861 849 862 850 lM01Icon01 = new JLabel(); 863 lM01Icon01.setBounds(new Rectangle(2 50, 0, 85, 140));851 lM01Icon01.setBounds(new Rectangle(225, 0, 160, 200)); 864 852 lM01Icon01.setIcon(null); 865 853 lM01Icon01.setText(""); … … 876 864 pM01SeaMap.add(lM01Kennung, null); 877 865 pM01SeaMap.add(lM01Name, null); 878 pM01SeaMap.add(lM01Icon03, null);879 pM01SeaMap.add(lM01Icon02, null);880 866 pM01SeaMap.add(lM01Props02, null); 881 867 pM01SeaMap.add(lM01StyleOfMark, null); … … 1200 1186 if (tfM01Name == null) { 1201 1187 tfM01Name = new JTextField(); 1202 tfM01Name.setBounds(new Rectangle(50, 120, 1 90, 20));1188 tfM01Name.setBounds(new Rectangle(50, 120, 175, 20)); 1203 1189 tfM01Name.addFocusListener(new java.awt.event.FocusAdapter() { 1204 1190 public void focusLost(java.awt.event.FocusEvent e) { … … 1397 1383 if (tfM01FireMark == null) { 1398 1384 tfM01FireMark = new JTextField(); 1399 tfM01FireMark.setBounds(new Rectangle(240, 1 80, 100, 20));1385 tfM01FireMark.setBounds(new Rectangle(240, 160, 100, 20)); 1400 1386 tfM01FireMark.setEditable(false); 1401 1387 } -
applications/editors/josm/plugins/toms/src/toms/seamarks/SeaMark.java
r22561 r22623 84 84 public final static int ISOL_SPAR = 2; 85 85 public final static int ISOL_BEACON = 3; 86 public final static int ISOL_TOWER = 4; 87 public final static int ISOL_FLOAT = 5; 86 88 public final static int SPEC_PILLAR = 1; 87 89 public final static int SPEC_SPAR = 2; -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r22540 r22623 71 71 72 72 } 73 73 74 74 private String LightChar = ""; 75 75 … … 190 190 191 191 public boolean parseShape(Node node, String str) { 192 String lstr;193 192 boolean ret = true; 194 193 Map<String, String> keys; … … 279 278 280 279 dlg.lM01Icon01.setIcon(null); 281 dlg.lM01Icon02.setIcon(null);282 dlg.lM01Icon03.setIcon(null);283 280 } 284 281 … … 300 297 301 298 if (dlg.cM01Fired.isSelected()) { 302 if ( LightColour == "R")299 if (colour == "red") { 303 300 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 304 301 "seamark:light:colour", "red")); 305 else if (LightColour == "G") 302 setLightColour("R"); 303 } else if (colour == "green") { 306 304 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 307 305 "seamark:light:colour", "green")); 308 else if (LightColour == "W") 306 setLightColour("G"); 307 } else if (colour == "white") { 309 308 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 310 309 "seamark:light:colour", "white")); 311 310 setLightColour("W"); 311 } 312 312 if (LightPeriod != "" && LightPeriod != " " && LightChar != "Q") 313 313 Main.main.undoRedo.add(new ChangePropertyCommand(Node, … … 335 335 } 336 336 337 protected void Checker(String pic1, String pic2) {338 // Abfrage Topzeichen339 if (pic1 != null) {340 if (dlg.cM01TopMark.isSelected())341 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource(pic1)));342 else343 dlg.lM01Icon02.setIcon(null);344 }345 346 // Abfrage befeuert347 if (pic2 != null) {348 if (dlg.cM01Fired.isSelected())349 dlg.lM01Icon03.setIcon(new ImageIcon(getClass().getResource(pic2)));350 else351 dlg.lM01Icon03.setIcon(null);352 }353 354 }355 356 337 public boolean parseShape(Node node) { 357 338 return false; -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
r22561 r22623 104 104 dlg.cM01Fired.setEnabled(true); 105 105 106 String image = "/images/Cardinal"; 107 108 switch (getStyleIndex()) { 109 case SeaMark.CARD_PILLAR: 110 image += "_Pillar"; 111 break; 112 113 case SeaMark.CARD_SPAR: 114 image += "_Spar"; 115 break; 116 117 case SeaMark.CARD_BEACON: 118 image += "_Beacon"; 119 break; 120 121 case SeaMark.CARD_TOWER: 122 image += "_Tower"; 123 break; 124 125 case SeaMark.CARD_FLOAT: 126 image += "_Float"; 127 break; 128 129 default: 130 return; 131 } 132 106 133 switch (getBuoyIndex()) { 107 case SeaMark.CARD_NORTH: 108 switch (getStyleIndex()) { 109 case CARD_PILLAR: 110 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 111 "/images/Cardinal_Pillar_North.png"))); 112 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 113 "/images/North_Top_Buoy.png"))); 114 break; 115 case CARD_SPAR: 116 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 117 "/images/Cardinal_Spar_North.png"))); 118 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 119 "/images/North_Top_Buoy.png"))); 120 break; 121 case CARD_BEACON: 122 if (isFired()) 123 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 124 "/images/Cardinal_Beacon_Lit_North.png"))); 125 else 126 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 127 "/images/Cardinal_Beacon_North.png"))); 128 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 129 "/images/North_Top_Post.png"))); 130 break; 131 case CARD_TOWER: 132 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 133 "/images/Cardinal_Tower_North.png"))); 134 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 135 "/images/North_Top_Post.png"))); 136 break; 137 case CARD_FLOAT: 138 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 139 "/images/Cardinal_Float_North.png"))); 140 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 141 "/images/North_Top_Post.png"))); 142 break; 143 default: 144 } 145 break; 146 147 case SeaMark.CARD_EAST: 148 switch (getStyleIndex()) { 149 case CARD_PILLAR: 150 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 151 "/images/Cardinal_Pillar_East.png"))); 152 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 153 "/images/East_Top_Buoy.png"))); 154 break; 155 case CARD_SPAR: 156 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 157 "/images/Cardinal_Spar_East.png"))); 158 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 159 "/images/East_Top_Buoy.png"))); 160 break; 161 case CARD_BEACON: 162 if (isFired()) 163 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 164 "/images/Cardinal_Beacon_Lit_East.png"))); 165 else 166 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 167 "/images/Cardinal_Beacon_East.png"))); 168 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 169 "/images/East_Top_Post.png"))); 170 break; 171 case CARD_TOWER: 172 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 173 "/images/Cardinal_Tower_East.png"))); 174 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 175 "/images/East_Top_Post.png"))); 176 break; 177 case CARD_FLOAT: 178 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 179 "/images/Cardinal_Float_East.png"))); 180 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 181 "/images/East_Top_Post.png"))); 182 break; 183 default: 184 } 185 break; 186 187 case SeaMark.CARD_SOUTH: 188 switch (getStyleIndex()) { 189 case CARD_PILLAR: 190 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 191 "/images/Cardinal_Pillar_South.png"))); 192 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 193 "/images/South_Top_Buoy.png"))); 194 break; 195 case CARD_SPAR: 196 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 197 "/images/Cardinal_Spar_South.png"))); 198 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 199 "/images/South_Top_Buoy.png"))); 200 break; 201 case CARD_BEACON: 202 if (isFired()) 203 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 204 "/images/Cardinal_Beacon_Lit_South.png"))); 205 else 206 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 207 "/images/Cardinal_Beacon_South.png"))); 208 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 209 "/images/South_Top_Post.png"))); 210 break; 211 case CARD_TOWER: 212 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 213 "/images/Cardinal_Tower_South.png"))); 214 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 215 "/images/South_Top_Post.png"))); 216 break; 217 case CARD_FLOAT: 218 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 219 "/images/Cardinal_Float_South.png"))); 220 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 221 "/images/South_Top_Post.png"))); 222 break; 223 default: 224 } 225 break; 226 227 case SeaMark.CARD_WEST: 228 switch (getStyleIndex()) { 229 case CARD_PILLAR: 230 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 231 "/images/Cardinal_Pillar_West.png"))); 232 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 233 "/images/West_Top_Buoy.png"))); 234 break; 235 case CARD_SPAR: 236 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 237 "/images/Cardinal_Spar_West.png"))); 238 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 239 "/images/West_Top_Buoy.png"))); 240 break; 241 case CARD_BEACON: 242 if (isFired()) 243 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 244 "/images/Cardinal_Beacon_Lit_West.png"))); 245 else 246 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 247 "/images/Cardinal_Beacon_Lit_West.png"))); 248 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 249 "/images/West_Top_Post.png"))); 250 break; 251 case CARD_TOWER: 252 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 253 "/images/Cardinal_Tower_West.png"))); 254 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 255 "/images/West_Top_Post.png"))); 256 break; 257 case CARD_FLOAT: 258 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 259 "/images/Cardinal_Float_West.png"))); 260 dlg.lM01Icon02.setIcon(new ImageIcon(getClass().getResource( 261 "/images/West_Top_Post.png"))); 262 break; 263 default: 264 } 265 break; 266 134 case CARD_NORTH: 135 image += "_North"; 136 break; 137 case CARD_EAST: 138 image += "_East"; 139 break; 140 case CARD_SOUTH: 141 image += "_South"; 142 break; 143 case CARD_WEST: 144 image += "_West"; 145 break; 267 146 default: 268 } 269 270 if (getLightChar() != "") { 271 String tmp = null; 272 String c; 273 int i1; 274 275 c = getLightChar(); 276 if (c.contains("+")) { 277 i1 = c.indexOf("+"); 278 tmp = c.substring(i1, c.length()); 279 c = c.substring(0, i1); 280 } 281 282 if (getLightGroup() != "") 283 c = c + "(" + getLightGroup() + ")"; 284 if (tmp != null) 285 c = c + tmp; 286 287 dlg.cbM01Kennung.setSelectedItem(c); 288 if (dlg.cbM01Kennung.getSelectedItem() == "Not set") 289 c = ""; 290 } 291 292 Checker(null, "/images/Light_White.png"); 147 return; 148 } 149 150 if (image != "") { 151 if (isFired()) { 152 image += "_Lit"; 153 154 if (getLightChar() != "") { 155 String tmp = null; 156 String c; 157 int i1; 158 159 c = getLightChar(); 160 if (c.contains("+")) { 161 i1 = c.indexOf("+"); 162 tmp = c.substring(i1, c.length()); 163 c = c.substring(0, i1); 164 } 165 166 if (getLightGroup() != "") 167 c = c + "(" + getLightGroup() + ")"; 168 if (tmp != null) 169 c = c + tmp; 170 171 dlg.cbM01Kennung.setSelectedItem(c); 172 if (dlg.cbM01Kennung.getSelectedItem() == "Not set") 173 c = ""; 174 } 175 } 176 177 image += ".png"; 178 179 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource(image))); 180 } else 181 dlg.lM01Icon01.setIcon(null); 293 182 } 294 183 … … 319 208 320 209 if (getLightGroup() != "") 321 if (tmp != null) {322 c = c + tmp;323 }210 if (tmp != null) { 211 c = c + tmp; 212 } 324 213 325 214 setLightChar(c); … … 366 255 else 367 256 ret = false; 368 } 369 else if (keys.containsKey("seamark:beacon_cardinal:shape")) { 370 str = keys.get("seamark:beacon_cardinal:shape"); 371 372 if (str.compareTo("stake") == 0) 257 } else if (keys.containsKey("seamark:beacon_cardinal")) { 258 if (keys.containsKey("seamark:beacon_cardinal:shape")) { 259 str = keys.get("seamark:beacon_cardinal:shape"); 260 261 if (str.compareTo("tower") == 0) 262 setStyleIndex(CARD_TOWER); 263 } else 373 264 setStyleIndex(CARD_BEACON); 374 else if (str.compareTo("tower") == 0) 375 setStyleIndex(CARD_TOWER); 376 else 377 ret = false; 378 } 379 265 } 380 266 return ret; 381 267 } … … 391 277 } 392 278 279 String shape = ""; 280 393 281 switch (getStyleIndex()) { 394 282 case CARD_PILLAR: … … 404 292 case CARD_BEACON: 405 293 super.saveSign("beacon_cardinal"); 406 Main.main.undoRedo.add(new ChangePropertyCommand(node,407 "seamark:beacon_cardinal:shape", "stake"));408 294 break; 409 295 case CARD_TOWER: … … 413 299 break; 414 300 case CARD_FLOAT: 415 super.saveSign("buoy_cardinal"); 416 Main.main.undoRedo.add(new ChangePropertyCommand(node, 417 "seamark:buoy_cardinal:shape", "float")); 301 super.saveSign("light_float"); 418 302 break; 419 303 default: 420 304 } 421 Main.main.undoRedo.add(new ChangePropertyCommand(node,422 "seamark:buoy_cardinal:colour_pattern", "horizontal stripes"));423 305 424 306 switch (getStyleIndex()) { 425 307 case CARD_PILLAR: 426 308 case CARD_SPAR: 427 case CARD_FLOAT:428 309 switch (getBuoyIndex()) { 429 310 case SeaMark.CARD_NORTH: … … 432 313 Main.main.undoRedo.add(new ChangePropertyCommand(node, 433 314 "seamark:buoy_cardinal:colour", "black;yellow")); 315 shape = "2 cones up"; 434 316 break; 435 317 … … 439 321 Main.main.undoRedo.add(new ChangePropertyCommand(node, 440 322 "seamark:buoy_cardinal:colour", "black;yellow;black")); 323 shape = "2 cones base together"; 441 324 break; 442 325 … … 446 329 Main.main.undoRedo.add(new ChangePropertyCommand(node, 447 330 "seamark:buoy_cardinal:colour", "yellow;black")); 331 shape = "2 cones down"; 448 332 break; 449 333 … … 453 337 Main.main.undoRedo.add(new ChangePropertyCommand(node, 454 338 "seamark:buoy_cardinal:colour", "yellow;black;yellow")); 455 break; 456 } 339 shape = "2 cones point together"; 340 break; 341 } 342 Main.main.undoRedo.add(new ChangePropertyCommand(node, 343 "seamark:buoy_cardinal:colour_pattern", "horizontal stripes")); 344 break; 457 345 case CARD_BEACON: 458 346 case CARD_TOWER: … … 463 351 Main.main.undoRedo.add(new ChangePropertyCommand(node, 464 352 "seamark:beacon_cardinal:colour", "black;yellow")); 353 shape = "2 cones up"; 465 354 break; 466 355 … … 470 359 Main.main.undoRedo.add(new ChangePropertyCommand(node, 471 360 "seamark:beacon_cardinal:colour", "black;yellow;black")); 361 shape = "2 cones base together"; 472 362 break; 473 363 … … 477 367 Main.main.undoRedo.add(new ChangePropertyCommand(node, 478 368 "seamark:beacon_cardinal:colour", "yellow;black")); 369 shape = "2 cones down"; 479 370 break; 480 371 … … 484 375 Main.main.undoRedo.add(new ChangePropertyCommand(node, 485 376 "seamark:beacon_cardinal:colour", "yellow;black;yellow")); 486 break; 487 } 488 } 489 377 shape = "2 cones point together"; 378 break; 379 } 380 Main.main.undoRedo.add(new ChangePropertyCommand(node, 381 "seamark:beacon_cardinal:colour_pattern", "horizontal stripes")); 382 break; 383 case CARD_FLOAT: 384 switch (getBuoyIndex()) { 385 case SeaMark.CARD_NORTH: 386 Main.main.undoRedo.add(new ChangePropertyCommand(node, 387 "seamark:light_float:colour", "black;yellow")); 388 shape = "2 cones up"; 389 break; 390 391 case SeaMark.CARD_EAST: 392 Main.main.undoRedo.add(new ChangePropertyCommand(node, 393 "seamark:light_float:colour", "black;yellow;black")); 394 shape = "2 cones base together"; 395 break; 396 397 case SeaMark.CARD_SOUTH: 398 Main.main.undoRedo.add(new ChangePropertyCommand(node, 399 "seamark:light_float:colour", "yellow;black")); 400 shape = "2 cones down"; 401 break; 402 403 case SeaMark.CARD_WEST: 404 Main.main.undoRedo.add(new ChangePropertyCommand(node, 405 "seamark:light_float:colour", "yellow;black;yellow")); 406 shape = "2 cones point together"; 407 break; 408 } 409 Main.main.undoRedo.add(new ChangePropertyCommand(node, 410 "seamark:light_float:colour_pattern", "horizontal stripes")); 411 break; 412 } 413 saveTopMarkData(shape, "black"); 490 414 saveLightData("white"); 491 415 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
r22561 r22623 24 24 dlg.cbM01StyleOfMark.addItem("Spar Buoy"); 25 25 dlg.cbM01StyleOfMark.addItem("Beacon"); 26 dlg.cbM01StyleOfMark.addItem("Tower"); 27 dlg.cbM01StyleOfMark.addItem("Float"); 26 28 27 29 dlg.cbM01Kennung.removeAllItems(); … … 55 57 dlg.cM01TopMark.setEnabled(false); 56 58 59 String image = "/images/Cardinal"; 60 57 61 switch (getStyleIndex()) { 58 62 case ISOL_PILLAR: 59 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 60 "/images/Isolated_Danger_Pillar.png"))); 63 image += "_Pillar_Single"; 61 64 break; 62 65 case ISOL_SPAR: 63 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 64 "/images/Isolated_Danger_Spar.png"))); 66 image += "_Spar_Single"; 65 67 break; 66 68 case ISOL_BEACON: 67 if (isFired()) 68 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 69 "/images/Isolated_Danger_Beacon_Lit.png"))); 70 else 71 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 72 "/images/Isolated_Danger_Beacon.png"))); 69 image += "_Beacon_Single"; 70 break; 71 case ISOL_TOWER: 72 image += "_Tower_Single"; 73 break; 74 case ISOL_FLOAT: 75 image += "_Float_Single"; 73 76 break; 74 77 default: 75 78 } 76 79 77 if (getLightChar() != "") { 78 String c; 79 80 c = getLightChar(); 81 82 dlg.cbM01Kennung.setSelectedItem(c); 83 if (dlg.cbM01Kennung.getSelectedItem() == "Not set") 84 c = ""; 85 } 86 80 if (image != "/images/Cardinal") { 81 if (isFired()) { 82 image += "_Lit"; 83 if (getLightChar() != "") { 84 String c; 85 86 c = getLightChar(); 87 88 dlg.cbM01Kennung.setSelectedItem(c); 89 if (dlg.cbM01Kennung.getSelectedItem() == "Not set") 90 c = ""; 91 } 92 } 93 image += ".png"; 94 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource(image))); 95 } else 96 dlg.lM01Icon01.setIcon(null); 97 } 98 99 public void saveSign() { 100 Node node = getNode(); 101 102 if (node == null) { 103 return; 104 } 105 106 switch (getStyleIndex()) { 107 case ISOL_PILLAR: 108 super.saveSign("buoy_isolated_danger"); 109 Main.main.undoRedo.add(new ChangePropertyCommand(node, 110 "seamark:buoy_isolated_danger:shape", "pillar")); 111 break; 112 case ISOL_SPAR: 113 super.saveSign("buoy_isolated_danger"); 114 Main.main.undoRedo.add(new ChangePropertyCommand(node, 115 "seamark:buoy_isolated_danger:shape", "spar")); 116 break; 117 case ISOL_BEACON: 118 super.saveSign("beacon_isolated_danger"); 119 break; 120 case ISOL_TOWER: 121 super.saveSign("beacon_isolated_danger"); 122 Main.main.undoRedo.add(new ChangePropertyCommand(node, 123 "seamark:beacon_isolated_danger:shape", "tower")); 124 break; 125 case ISOL_FLOAT: 126 super.saveSign("light_float"); 127 break; 128 default: 129 } 130 87 131 switch (getStyleIndex()) { 88 132 case ISOL_PILLAR: 89 133 case ISOL_SPAR: 90 Checker("/images/Danger_Top_Buoy.png", "/images/Light_White.png"); 134 Main.main.undoRedo.add(new ChangePropertyCommand(node, 135 "seamark:buoy_isolated_danger:colour_pattern", "horizontal stripes")); 136 Main.main.undoRedo.add(new ChangePropertyCommand(node, 137 "seamark:buoy_isolated_danger:colour", "black;red;black")); 91 138 break; 92 139 case ISOL_BEACON: 93 Checker("/images/Danger_Top_Post.png", "/images/Light_White.png"); 94 break; 95 default: 96 } 97 } 98 99 public void saveSign() { 100 Node node = getNode(); 101 102 if (node == null) { 103 return; 104 } 105 106 super.saveSign("buoy_isolated_danger"); 107 108 switch (getStyleIndex()) { 109 case ISOL_PILLAR: 110 Main.main.undoRedo.add(new ChangePropertyCommand(node, 111 "seamark:buoy_isolated_danger:shape", "pillar")); 112 break; 113 case ISOL_SPAR: 114 Main.main.undoRedo.add(new ChangePropertyCommand(node, 115 "seamark:buoy_isolated_danger:shape", "spar")); 116 break; 117 case ISOL_BEACON: 118 Main.main.undoRedo.add(new ChangePropertyCommand(node, 119 "seamark:beacon_isolated_danger:shape", "stake")); 120 break; 121 default: 122 } 123 if (getStyleIndex() == ISOL_BEACON) { 124 Main.main.undoRedo.add(new ChangePropertyCommand(node, 125 "seamark:beacon_isolated_danger:colour_pattern", "horizontal stripes")); 126 Main.main.undoRedo.add(new ChangePropertyCommand(node, 127 "seamark:beacon_isolated_danger:colour", "black;red;black")); 128 } else { 129 Main.main.undoRedo.add(new ChangePropertyCommand(node, 130 "seamark:buoy_isolated_danger:colour_pattern", "horizontal stripes")); 131 Main.main.undoRedo.add(new ChangePropertyCommand(node, 132 "seamark:buoy_isolated_danger:colour", "black;red;black")); 140 case ISOL_TOWER: 141 Main.main.undoRedo 142 .add(new ChangePropertyCommand(node, 143 "seamark:beacon_isolated_danger:colour_pattern", 144 "horizontal stripes")); 145 Main.main.undoRedo.add(new ChangePropertyCommand(node, 146 "seamark:beacon_isolated_danger:colour", "black;red;black")); 147 break; 148 case ISOL_FLOAT: 149 Main.main.undoRedo.add(new ChangePropertyCommand(node, 150 "seamark:light_float:colour_pattern", "horizontal stripes")); 151 Main.main.undoRedo.add(new ChangePropertyCommand(node, 152 "seamark:light_float:colour", "black;red;black")); 153 break; 133 154 } 134 155 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r22561 r22623 84 84 dlg.cbM01StyleOfMark.addItem("Beacon"); 85 85 dlg.cbM01StyleOfMark.addItem("Tower"); 86 dlg.cbM01StyleOfMark.addItem("Float"); 86 87 break; 87 88 … … 92 93 dlg.cbM01StyleOfMark.addItem("Beacon"); 93 94 dlg.cbM01StyleOfMark.addItem("Tower"); 95 dlg.cbM01StyleOfMark.addItem("Float"); 94 96 break; 95 97 … … 113 115 dlg.cM01Fired.setEnabled(true); 114 116 dlg.cM01TopMark.setEnabled(true); 117 118 String image = "/images/Lateral"; 115 119 116 120 int cat = getBuoyIndex(); … … 123 127 switch (style) { 124 128 case LAT_CAN: 125 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 126 "/images/Can_Red.png"))); 129 image += "_Can_Red"; 127 130 break; 128 131 case LAT_PILLAR: 129 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 130 "/images/Lateral_Pillar_Red.png"))); 132 image += "_Pillar_Red"; 131 133 break; 132 134 case LAT_SPAR: 133 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 134 "/images/Lateral_Spar_Red.png"))); 135 image += "_Spar_Red"; 135 136 break; 136 137 case LAT_BEACON: 137 if (isFired()) 138 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 139 "/images/Lateral_Beacon_Lit_Red.png"))); 140 else 141 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 142 "/images/Lateral_Beacon_Red.png"))); 138 image += "_Beacon_Red"; 143 139 break; 144 140 case LAT_TOWER: 145 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 146 "/images/Lateral_Tower_Red.png"))); 141 image += "_Tower_Red"; 147 142 break; 148 143 case LAT_FLOAT: 149 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 150 "/images/Lateral_Float_Red.png"))); 144 image += "_Float_Red"; 151 145 break; 152 146 case LAT_PERCH: 153 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 154 "/images/Lateral_Perch_Port.png"))); 147 image += "_Perch_Port"; 155 148 break; 156 149 default: … … 159 152 switch (style) { 160 153 case LAT_CAN: 161 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 162 "/images/Can_Green.png"))); 154 image += "_Can_Green"; 163 155 break; 164 156 case LAT_PILLAR: 165 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 166 "/images/Lateral_Pillar_Green.png"))); 157 image += "_Pillar_Green"; 167 158 break; 168 159 case LAT_SPAR: 169 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 170 "/images/Lateral_Spar_Green.png"))); 160 image += "_Spar_Green"; 171 161 break; 172 162 case LAT_BEACON: 173 if (isFired()) 174 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 175 "/images/Lateral_Beacon_Lit_Green.png"))); 176 else 177 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 178 "/images/Lateral_Beacon_Green.png"))); 163 image += "_Beacon_Green"; 179 164 break; 180 165 case LAT_TOWER: 181 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 182 "/images/Lateral_Tower_Green.png"))); 166 image += "_Tower_Green"; 183 167 break; 184 168 case LAT_FLOAT: 185 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 186 "/images/Lateral_Float_Green.png"))); 169 image += "_Float_Green"; 187 170 break; 188 171 case LAT_PERCH: 189 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 190 "/images/Lateral_Perch_Port.png"))); 172 image += "_Perch_Port"; 191 173 break; 192 174 default: … … 198 180 switch (style) { 199 181 case LAT_CONE: 200 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 201 "/images/Cone_Green.png"))); 182 image += "_Cone_Green"; 202 183 break; 203 184 case LAT_PILLAR: 204 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 205 "/images/Lateral_Pillar_Green.png"))); 185 image += "_Pillar_Green"; 206 186 break; 207 187 case LAT_SPAR: 208 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 209 "/images/Lateral_Spar_Green.png"))); 188 image += "_Spar_Green"; 210 189 break; 211 190 case LAT_BEACON: 212 if (isFired()) 213 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 214 "/images/Lateral_Beacon_Lit_Green.png"))); 215 else 216 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 217 "/images/Lateral_Beacon_Green.png"))); 191 image += "_Beacon_Green"; 218 192 break; 219 193 case LAT_TOWER: 220 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 221 "/images/Lateral_Tower_Green.png"))); 194 image += "_Tower_Green"; 222 195 break; 223 196 case LAT_FLOAT: 224 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 225 "/images/Lateral_Float_Green.png"))); 197 image += "_Float_Green"; 226 198 break; 227 199 case LAT_PERCH: 228 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 229 "/images/Lateral_Perch_Starboard.png"))); 200 image += "_Perch_Starboard"; 230 201 break; 231 202 default: … … 234 205 switch (style) { 235 206 case LAT_CONE: 236 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 237 "/images/Cone_Red.png"))); 207 image += "_Cone_Red"; 238 208 break; 239 209 case LAT_PILLAR: 240 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 241 "/images/Lateral_Pillar_Red.png"))); 210 image += "_Pillar_Red"; 242 211 break; 243 212 case LAT_SPAR: 244 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 245 "/images/Lateral_Spar_Red.png"))); 213 image += "_Spar_Red"; 246 214 break; 247 215 case LAT_BEACON: 248 if (isFired()) 249 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 250 "/images/Lateral_Beacon_Lit_Red.png"))); 251 else 252 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 253 "/images/Lateral_Beacon_Red.png"))); 216 image += "_Beacon_Red"; 254 217 break; 255 218 case LAT_TOWER: 256 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 257 "/images/Lateral_Tower_Red.png"))); 219 image += "_Tower_Red"; 258 220 break; 259 221 case LAT_FLOAT: 260 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 261 "/images/Lateral_Float_Red.png"))); 222 image += "_Float_Red"; 262 223 break; 263 224 case LAT_PERCH: 264 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 265 "/images/Lateral_Perch_Starboard.png"))); 225 image += "_Perch_Starboard"; 266 226 break; 267 227 default: … … 273 233 switch (style) { 274 234 case LAT_CAN: 275 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 276 "/images/Can_Red_Green_Red.png"))); 235 image += "_Can_Red_Green_Red"; 277 236 break; 278 237 case LAT_PILLAR: 279 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 280 "/images/Lateral_Pillar_Red_Green_Red.png"))); 238 image += "_Pillar_Red_Green_Red"; 281 239 break; 282 240 case LAT_SPAR: 283 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 284 "/images/Lateral_Spar_Red_Green_Red.png"))); 241 image += "_Spar_Red_Green_Red"; 285 242 break; 286 243 case LAT_BEACON: 287 if (isFired()) 288 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 289 "/images/Lateral_Beacon_Lit_Red_Green_Red.png"))); 290 else 291 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 292 "/images/Lateral_Beacon_Red_Green_Red.png"))); 244 image += "_Beacon_Red_Green_Red"; 293 245 break; 294 246 case LAT_TOWER: 295 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 296 "/images/Lateral_Tower_Red_Green_Red.png"))); 247 image += "_Tower_Red_Green_Red"; 248 break; 249 case LAT_FLOAT: 250 image += "_Float_Red_Green_Red"; 297 251 break; 298 252 default: … … 301 255 switch (style) { 302 256 case LAT_CAN: 303 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 304 "/images/Can_Green_Red_Green.png"))); 257 image += "_Can_Green_Red_Green"; 305 258 break; 306 259 case LAT_PILLAR: 307 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 308 "/images/Lateral_Pillar_Green_Red_Green.png"))); 260 image += "_Pillar_Green_Red_Green"; 309 261 break; 310 262 case LAT_SPAR: 311 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 312 "/images/Lateral_Spar_Green_Red_Green.png"))); 263 image += "_Spar_Green_Red_Green"; 313 264 break; 314 265 case LAT_BEACON: 315 if (isFired()) 316 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 317 "/images/Lateral_Beacon_Lit_Green_Red_Green.png"))); 318 else 319 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 320 "/images/Lateral_Beacon_Green_Red_Green.png"))); 266 image += "_Beacon_Green_Red_Green"; 321 267 break; 322 268 case LAT_TOWER: 323 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 324 "/images/Lateral_Tower_Green_Red_Green.png"))); 269 image += "_Tower_Green_Red_Green"; 270 break; 271 case LAT_FLOAT: 272 image += "_Float_Green_Red_Green"; 325 273 break; 326 274 default: … … 332 280 switch (style) { 333 281 case LAT_CONE: 334 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 335 "/images/Cone_Green_Red_Green.png"))); 282 image += "_Cone_Green_Red_Green"; 336 283 break; 337 284 case LAT_PILLAR: 338 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 339 "/images/Lateral_Pillar_Green_Red_Green.png"))); 285 image += "_Pillar_Green_Red_Green"; 340 286 break; 341 287 case LAT_SPAR: 342 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 343 "/images/Lateral_Spar_Green_Red_Green.png"))); 288 image += "_Spar_Green_Red_Green"; 344 289 break; 345 290 case LAT_BEACON: 346 if (isFired()) 347 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 348 "/images/Lateral_Beacon_Lit_Green_Red_Green.png"))); 349 else 350 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 351 "/images/Lateral_Beacon_Green_Red_Green.png"))); 291 image += "_Beacon_Green_Red_Green"; 352 292 break; 353 293 case LAT_TOWER: 354 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 355 "/images/Lateral_Tower_Green_Red_Green.png"))); 294 image += "_Tower_Green_Red_Green"; 295 break; 296 case LAT_FLOAT: 297 image += "_Float_Green_Red_Green"; 356 298 break; 357 299 default: … … 360 302 switch (style) { 361 303 case LAT_CONE: 362 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 363 "/images/Cone_Red_Green_Red.png"))); 304 image += "_Cone_Red_Green_Red"; 364 305 break; 365 306 case LAT_PILLAR: 366 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 367 "/images/Lateral_Pillar_Red_Green_Red.png"))); 307 image += "_Pillar_Red_Green_Red"; 368 308 break; 369 309 case LAT_SPAR: 370 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 371 "/images/Lateral_Spar_Red_Green_Red.png"))); 310 image += "_Spar_Red_Green_Red"; 372 311 break; 373 312 case LAT_BEACON: 374 if (isFired()) 375 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 376 "/images/Lateral_Beacon_Li_Red_Green_Red.png"))); 377 else 378 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 379 "/images/Lateral_Beacon_Red_Green_Red.png"))); 313 image += "_Beacon_Red_Green_Red"; 380 314 break; 381 315 case LAT_TOWER: 382 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 383 "/images/Lateral_Tower_Red_Green_Red.png"))); 316 image += "_Tower_Red_Green_Red"; 317 break; 318 case LAT_FLOAT: 319 image += "_Float_Red_Green_Red"; 384 320 break; 385 321 default: … … 390 326 } 391 327 392 if (getLightChar() != "") { 393 String c; 394 395 c = getLightChar(); 396 if (getLightGroup() != "") 397 c = c + "(" + getLightGroup() + ")"; 398 399 dlg.cbM01Kennung.setSelectedItem(c); 400 if (dlg.cbM01Kennung.getSelectedItem() == "Not set") 401 c = ""; 402 } 403 404 if (cat == PORT_HAND || cat == PREF_PORT_HAND) 405 switch (style) { 406 case LAT_CAN: 407 if (region != SeaMark.IALA_B) 408 Checker("/images/Can_Top_Can_Red.png", "/images/Light_Red.png"); 328 if (image != "/images/Lateral") { 329 330 if (hasTopMark()) { 331 if (cat == PORT_HAND || cat == PREF_PORT_HAND) 332 image += "_Can"; 409 333 else 410 Checker("/images/Can_Top_Can_Green.png", "/images/Light_Green.png"); 411 break; 412 case LAT_PILLAR: 413 case LAT_SPAR: 414 if (region != SeaMark.IALA_B) 415 Checker("/images/Can_Top_Buoy_Red.png", "/images/Light_Red.png"); 416 else 417 Checker("/images/Can_Top_Buoy_Green.png", "/images/Light_Green.png"); 418 break; 419 case LAT_BEACON: 420 case LAT_TOWER: 421 case LAT_FLOAT: 422 if (region != SeaMark.IALA_B) 423 Checker("/images/Can_Top_Post_Red.png", "/images/Light_Red.png"); 424 else 425 Checker("/images/Can_Top_Post_Green.png", "/images/Light_Green.png"); 426 break; 427 default: 428 } 429 else 430 switch (style) { 431 case LAT_CONE: 432 if (region != SeaMark.IALA_B) 433 Checker("/images/Cone_Top_Cone_Green.png", "/images/Light_Green.png"); 434 else 435 Checker("/images/Cone_Top_Cone_Red.png", "/images/Light_Red.png"); 436 break; 437 case LAT_PILLAR: 438 case LAT_SPAR: 439 if (region != SeaMark.IALA_B) 440 Checker("/images/Cone_Top_Buoy_Green.png", "/images/Light_Green.png"); 441 else 442 Checker("/images/Cone_Top_Buoy_Red.png", "/images/Light_Red.png"); 443 break; 444 case LAT_BEACON: 445 case LAT_TOWER: 446 case LAT_FLOAT: 447 if (region != SeaMark.IALA_B) 448 Checker("/images/Cone_Top_Post_Green.png", "/images/Light_Green.png"); 449 else 450 Checker("/images/Cone_Top_Post_Red.png", "/images/Light_Red.png"); 451 break; 452 default: 453 } 454 334 image += "_Cone"; 335 } 336 337 if (isFired()) 338 image += "_Lit"; 339 if (getLightChar() != "") { 340 String c; 341 342 c = getLightChar(); 343 if (getLightGroup() != "") 344 c = c + "(" + getLightGroup() + ")"; 345 346 dlg.cbM01Kennung.setSelectedItem(c); 347 if (dlg.cbM01Kennung.getSelectedItem() == "Not set") 348 c = ""; 349 } 350 351 image += ".png"; 352 353 // System.out.println("finename: " + image); 354 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource(image))); 355 } else 356 dlg.lM01Icon01.setIcon(null); 455 357 } 456 358 … … 487 389 case LAT_BEACON: 488 390 super.saveSign("beacon_lateral"); 489 Main.main.undoRedo.add(new ChangePropertyCommand(node,490 "seamark:beacon_lateral:shape", "stake"));491 391 break; 492 392 case LAT_TOWER: … … 496 396 break; 497 397 case LAT_FLOAT: 498 super.saveSign("buoy_lateral"); 499 Main.main.undoRedo.add(new ChangePropertyCommand(node, 500 "seamark:buoy_lateral:shape", "float")); 398 super.saveSign("light_float"); 501 399 break; 502 400 case LAT_PERCH: … … 511 409 case LAT_PILLAR: 512 410 case LAT_SPAR: 513 case LAT_FLOAT:514 411 case LAT_PERCH: 515 412 Main.main.undoRedo.add(new ChangePropertyCommand(node, … … 536 433 Main.main.undoRedo.add(new ChangePropertyCommand(node, 537 434 "seamark:beacon_lateral:colour", "green")); 435 colour = "green"; 436 } 437 break; 438 case LAT_FLOAT: 439 if (getRegion() != SeaMark.IALA_B) { 440 Main.main.undoRedo.add(new ChangePropertyCommand(node, 441 "seamark:light_float:colour", "red")); 442 colour = "red"; 443 } else { 444 Main.main.undoRedo.add(new ChangePropertyCommand(node, 445 "seamark:light_float:colour", "green")); 538 446 colour = "green"; 539 447 } … … 562 470 case LAT_BEACON: 563 471 super.saveSign("beacon_lateral"); 564 Main.main.undoRedo.add(new ChangePropertyCommand(node,565 "seamark:beacon_lateral:shape", "stake"));566 472 break; 567 473 case LAT_TOWER: … … 571 477 break; 572 478 case LAT_FLOAT: 573 super.saveSign("buoy_lateral"); 574 Main.main.undoRedo.add(new ChangePropertyCommand(node, 575 "seamark:buoy_lateral:shape", "float")); 479 super.saveSign("light_float"); 576 480 break; 577 481 default: … … 581 485 case LAT_PILLAR: 582 486 case LAT_SPAR: 583 case LAT_FLOAT:584 487 Main.main.undoRedo.add(new ChangePropertyCommand(node, 585 488 "seamark:buoy_lateral:category", "preferred_channel_port")); … … 609 512 Main.main.undoRedo.add(new ChangePropertyCommand(node, 610 513 "seamark:beacon_lateral:colour", "green;red;green")); 514 colour = "green"; 515 } 516 break; 517 case LAT_FLOAT: 518 Main.main.undoRedo.add(new ChangePropertyCommand(node, 519 "seamark:light_float:colour_pattern", "horizontal stripes")); 520 if (getRegion() != SeaMark.IALA_B) { 521 Main.main.undoRedo.add(new ChangePropertyCommand(node, 522 "seamark:light_float:colour", "red;green;red")); 523 colour = "red"; 524 } else { 525 Main.main.undoRedo.add(new ChangePropertyCommand(node, 526 "seamark:light_float:colour", "green;red;green")); 611 527 colour = "green"; 612 528 } … … 644 560 break; 645 561 case LAT_FLOAT: 646 super.saveSign("buoy_lateral"); 647 Main.main.undoRedo.add(new ChangePropertyCommand(node, 648 "seamark:buoy_lateral:shape", "float")); 562 super.saveSign("light_float"); 649 563 break; 650 564 case LAT_PERCH: … … 659 573 case LAT_PILLAR: 660 574 case LAT_SPAR: 661 case LAT_FLOAT:662 575 Main.main.undoRedo.add(new ChangePropertyCommand(node, 663 576 "seamark:buoy_lateral:category", "starboard")); … … 683 596 Main.main.undoRedo.add(new ChangePropertyCommand(node, 684 597 "seamark:beacon_lateral:colour", "red")); 598 colour = "red"; 599 } 600 break; 601 case LAT_FLOAT: 602 if (getRegion() != SeaMark.IALA_B) { 603 Main.main.undoRedo.add(new ChangePropertyCommand(node, 604 "seamark:light_float:colour", "green")); 605 colour = "green"; 606 } else { 607 Main.main.undoRedo.add(new ChangePropertyCommand(node, 608 "seamark:light_float:colour", "red")); 685 609 colour = "red"; 686 610 } … … 716 640 Main.main.undoRedo.add(new ChangePropertyCommand(node, 717 641 "seamark:beacon_lateral:shape", "tower")); 642 break; 643 case LAT_FLOAT: 644 super.saveSign("light_float"); 718 645 break; 719 646 default: … … 723 650 case LAT_PILLAR: 724 651 case LAT_SPAR: 725 case LAT_FLOAT:726 652 Main.main.undoRedo.add(new ChangePropertyCommand(node, 727 653 "seamark:buoy_lateral:category", "preferred_channel_starboard")); … … 751 677 Main.main.undoRedo.add(new ChangePropertyCommand(node, 752 678 "seamark:beacon_lateral:colour", "red;green;red")); 679 colour = "red"; 680 } 681 break; 682 case LAT_FLOAT: 683 Main.main.undoRedo.add(new ChangePropertyCommand(node, 684 "seamark:light_float:colour_pattern", "horizontal stripes")); 685 if (getRegion() != SeaMark.IALA_B) { 686 Main.main.undoRedo.add(new ChangePropertyCommand(node, 687 "seamark:light_float:colour", "green;red;green")); 688 colour = "green"; 689 } else { 690 Main.main.undoRedo.add(new ChangePropertyCommand(node, 691 "seamark:light_float:colour", "red;green;red")); 753 692 colour = "red"; 754 693 } -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyNota.java
r22561 r22623 99 99 } 100 100 101 if (getLightColour() == "W")102 dlg.lM01Icon03.setIcon(new ImageIcon(getClass().getResource(103 "/images/Light_White.png")));104 else if (getLightColour() == "R")105 dlg.lM01Icon03.setIcon(new ImageIcon(getClass().getResource(106 "/images/Light_Red.png")));107 else if (getLightColour() == "G")108 dlg.lM01Icon03.setIcon(new ImageIcon(getClass().getResource(109 "/images/Light_Green.png")));110 111 101 } 112 102 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
r22563 r22623 57 57 dlg.cM01TopMark.setEnabled(true); 58 58 59 String image = "/images/Safe_Water"; 60 59 61 switch (getStyleIndex()) { 60 62 case SAFE_PILLAR: 61 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 62 "/images/Safe_Water_Pillar.png"))); 63 image += "_Pillar"; 63 64 break; 64 65 case SAFE_SPAR: 65 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 66 "/images/Safe_Water_Spar.png"))); 66 image += "_Spar"; 67 67 break; 68 68 case SAFE_SPHERE: 69 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 70 "/images/Safe_Water_Sphere.png"))); 69 image += "_Sphere"; 71 70 break; 72 71 case SAFE_FLOAT: 73 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 74 "/images/Safe_Water_Float.png"))); 72 image += "_Float"; 75 73 break; 76 74 default: 77 75 } 78 76 79 if (getLightChar() != "") { 80 String c; 81 82 c = getLightChar(); 83 84 dlg.cbM01Kennung.setSelectedItem(c); 85 if (dlg.cbM01Kennung.getSelectedItem() == "Not set") 86 c = ""; 87 } 88 77 if (image != "/images/Safe_Water") { 78 79 if (hasTopMark()) 80 image += "_Sphere"; 81 82 if (isFired()) { 83 image += "_Lit"; 84 if (getLightChar() != "") { 85 String c; 86 87 c = getLightChar(); 88 89 dlg.cbM01Kennung.setSelectedItem(c); 90 if (dlg.cbM01Kennung.getSelectedItem() == "Not set") 91 c = ""; 92 } 93 } 94 image += ".png"; 95 96 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource(image))); 97 } else 98 dlg.lM01Icon01.setIcon(null); 99 } 100 101 public void saveSign() { 102 Node node = getNode(); 103 104 if (node == null) { 105 return; 106 } 107 89 108 switch (getStyleIndex()) { 90 109 case SAFE_PILLAR: 110 super.saveSign("buoy_safe_water"); 111 Main.main.undoRedo.add(new ChangePropertyCommand(node, 112 "seamark:buoy_safe_water:shape", "pillar")); 113 break; 91 114 case SAFE_SPAR: 92 Checker("/images/Sphere_Top_Buoy_Red.png", "/images/Light_White.png"); 115 super.saveSign("buoy_safe_water"); 116 Main.main.undoRedo.add(new ChangePropertyCommand(node, 117 "seamark:buoy_safe_water:shape", "spar")); 93 118 break; 94 119 case SAFE_SPHERE: 95 Checker("/images/Sphere_Top_Sphere_Red.png", "/images/Light_White.png"); 120 super.saveSign("buoy_safe_water"); 121 Main.main.undoRedo.add(new ChangePropertyCommand(node, 122 "seamark:buoy_safe_water:shape", "sphere")); 96 123 break; 97 124 case SAFE_FLOAT: 98 Checker("/images/Sphere_Top_Post_Red.png", "/images/Light_White.png");125 super.saveSign("light_float"); 99 126 break; 100 127 default: 101 128 } 102 } 103 104 public void saveSign() { 105 Node node = getNode(); 106 107 if (node == null) { 108 return; 109 } 110 111 super.saveSign("buoy_safe_water"); 112 113 switch (getStyleIndex()) { 114 case SAFE_PILLAR: 115 Main.main.undoRedo.add(new ChangePropertyCommand(node, 116 "seamark:buoy_safe_water:shape", "pillar")); 117 break; 118 case SAFE_SPAR: 119 Main.main.undoRedo.add(new ChangePropertyCommand(node, 120 "seamark:buoy_safe_water:shape", "spar")); 121 break; 122 case SAFE_SPHERE: 123 Main.main.undoRedo.add(new ChangePropertyCommand(node, 124 "seamark:buoy_safe_water:shape", "sphere")); 125 break; 126 case SAFE_FLOAT: 127 Main.main.undoRedo.add(new ChangePropertyCommand(node, 128 "seamark:buoy_safe_water:shape", "float")); 129 break; 130 default: 131 } 132 Main.main.undoRedo.add(new ChangePropertyCommand(node, 133 "seamark:buoy_safe_water:colour_pattern", "vertical stripes")); 134 Main.main.undoRedo.add(new ChangePropertyCommand(node, 135 "seamark:buoy_safe_water:colour", "red;white")); 136 129 if (getStyleIndex() == SAFE_FLOAT) { 130 Main.main.undoRedo.add(new ChangePropertyCommand(node, 131 "seamark:light_float:colour_pattern", "vertical stripes")); 132 Main.main.undoRedo.add(new ChangePropertyCommand(node, 133 "seamark:light_float:colour", "red;white")); 134 } else { 135 Main.main.undoRedo.add(new ChangePropertyCommand(node, 136 "seamark:buoy_safe_water:colour_pattern", "vertical stripes")); 137 Main.main.undoRedo.add(new ChangePropertyCommand(node, 138 "seamark:buoy_safe_water:colour", "red;white")); 139 } 137 140 saveTopMarkData("spherical", "red"); 138 141 … … 217 220 if (keys.containsKey("seamark:buoy_safe_water:shape")) { 218 221 str = keys.get("seamark:buoy_safe_water:shape"); 219 222 220 223 if (str.compareTo("pillar") == 0) 221 224 setStyleIndex(SAFE_PILLAR); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
r22561 r22623 24 24 dlg.cbM01StyleOfMark.addItem("Spar Buoy"); 25 25 dlg.cbM01StyleOfMark.addItem("Sphere Buoy"); 26 dlg.cbM01StyleOfMark.addItem("Barrel");27 26 28 27 dlg.cbM01Kennung.removeAllItems(); … … 53 52 dlg.cM01TopMark.setEnabled(true); 54 53 54 String image = "/images/Special_Purpose"; 55 55 56 switch (getStyleIndex()) { 56 57 case SPEC_PILLAR: 57 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 58 "/images/Special_Purpose_Pillar.png"))); 58 image += "_Pillar"; 59 59 break; 60 60 case SPEC_SPAR: 61 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 62 "/images/Special_Purpose_Spar.png"))); 61 image += "_Spar"; 63 62 break; 64 63 case SPEC_SPHERE: 65 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 66 "/images/Special_Purpose_Sphere.png"))); 67 break; 68 case SPEC_BARREL: 69 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource( 70 "/images/Special_Purpose_Barrel.png"))); 64 image += "_Sphere"; 71 65 break; 72 66 default: 73 67 } 74 68 75 if (getLightChar() != "") { 76 String c; 77 78 c = getLightChar(); 79 80 dlg.cbM01Kennung.setSelectedItem(c); 81 if (dlg.cbM01Kennung.getSelectedItem() == "Not set") 82 c = ""; 83 } 69 if (image != "/images/Special_Purpose") { 70 71 if (hasTopMark()) 72 image += "_CrossY"; 73 74 if (isFired()) { 75 image += "_Lit"; 76 if (getLightChar() != "") { 77 String c; 78 79 c = getLightChar(); 80 81 dlg.cbM01Kennung.setSelectedItem(c); 82 if (dlg.cbM01Kennung.getSelectedItem() == "Not set") 83 c = ""; 84 } 85 } 86 image += ".png"; 87 88 dlg.lM01Icon01.setIcon(new ImageIcon(getClass().getResource(image))); 89 } else 90 dlg.lM01Icon01.setIcon(null); 91 } 92 93 public void saveSign() { 94 Node node = getNode(); 95 96 if (node == null) { 97 return; 98 } 99 100 super.saveSign("buoy_special_purpose"); 84 101 85 102 switch (getStyleIndex()) { 86 103 case SPEC_PILLAR: 87 case SPEC_SPAR:88 Checker("/images/Cross_Top_Buoy_Yellow.png", "/images/Light_White.png");89 break;90 case SPEC_SPHERE:91 case SPEC_BARREL:92 Checker("/images/Cross_Top_Sphere_Yellow.png", "/images/Light_White.png");93 break;94 default:95 }96 }97 98 public void saveSign() {99 Node node = getNode();100 101 if (node == null) {102 return;103 }104 105 super.saveSign("buoy_special_purpose");106 107 switch (getStyleIndex()) {108 case SPEC_PILLAR:109 104 Main.main.undoRedo.add(new ChangePropertyCommand(node, 110 105 "seamark:buoy_special_purpose:shape", "pillar")); … … 127 122 "seamark:buoy_special_purpose:colour", "yellow")); 128 123 129 saveTopMarkData(" cross", "yellow");124 saveTopMarkData("x-shape", "yellow"); 130 125 131 126 saveLightData("white"); … … 148 143 str = keys.get("seamark:topmark:shape"); 149 144 150 if (str.compareTo(" cross") == 0) {145 if (str.compareTo("x-shape") == 0) { 151 146 setTopMark(true); 152 147 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyUkn.java
r22527 r22623 38 38 if (dlg.lM01Icon01 != null) 39 39 dlg.lM01Icon01.setIcon(null); 40 if (dlg.lM01Icon02 != null)41 dlg.lM01Icon02.setIcon(null);42 if (dlg.lM01Icon03 != null)43 dlg.lM01Icon03.setIcon(null);44 40 if (getErrMsg() != null) 45 41 dlg.sM01StatusBar.setText(getErrMsg());
Note:
See TracChangeset
for help on using the changeset viewer.