Changeset 24904 in osm for applications/editors
- Timestamp:
- 2010-12-29T16:04:11+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
r24896 r24904 42 42 Selection = newSelection; 43 43 44 // System.out.println( newSelection);44 // System.out.println("hello"); 45 45 for (OsmPrimitive osm : Selection) { 46 46 if (osm instanceof Node) { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r24896 r24904 41 41 public void actionPerformed(java.awt.event.ActionEvent e) { 42 42 Shp shp = null; 43 if (dlg.mark != null) shp = dlg.mark.getShape(); 43 if (dlg.mark != null) 44 shp = dlg.mark.getShape(); 45 if (portButton.isSelected() || prefPortButton.isSelected()) { 46 if (!(dlg.mark instanceof MarkLat)) { 47 dlg.mark = new MarkLat(dlg); 48 dlg.panelMain.topButton.setEnabled(true); 49 dlg.panelMain.fogButton.setEnabled(true); 50 dlg.panelMain.radButton.setEnabled(true); 51 dlg.panelMain.litButton.setEnabled(true); 52 } 53 dlg.panelMain.panelTop.enableAll(false); 54 dlg.panelMain.panelTop.noTopButton.setEnabled(true); 55 dlg.panelMain.panelTop.canTopButton.setEnabled(true); 56 dlg.panelMain.panelTop.panelCol.enableAll(false); 57 if (dlg.mark.getRegion() == SeaMark.IALA_A) { 58 dlg.panelMain.panelTop.panelCol.redButton.setEnabled(true); 59 dlg.panelMain.panelTop.panelCol.redButton.doClick(); 60 } else { 61 dlg.panelMain.panelTop.panelCol.greenButton.setEnabled(true); 62 dlg.panelMain.panelTop.panelCol.greenButton.doClick(); 63 } 64 } 44 65 if (portButton.isSelected()) { 45 if (!(dlg.mark instanceof MarkLat))46 dlg.mark = new MarkLat(dlg);47 66 dlg.mark.setCategory(Cat.LAT_PORT); 48 67 if (panelPort.shapes.containsKey(shp)) { … … 66 85 panelPort.setVisible(false); 67 86 } 87 if (prefPortButton.isSelected()) { 88 dlg.mark.setCategory(Cat.LAT_PREF_PORT); 89 if (panelPort.shapes.containsKey(shp) && (shp != Shp.PERCH)) { 90 panelPort.shapes.get(shp).doClick(); 91 } else { 92 panelPort.clearSelections(); 93 dlg.mark.setShape(Shp.UNKNOWN); 94 } 95 if (dlg.mark.getRegion() == SeaMark.IALA_A) { 96 dlg.mark.setColour(Ent.BODY, Col.RED_GREEN_RED); 97 panelPort.regionAButton.doClick(); 98 } else { 99 dlg.mark.setColour(Ent.BODY, Col.GREEN_RED_GREEN); 100 panelPort.regionBButton.doClick(); 101 } 102 prefPortButton.setBorderPainted(true); 103 panelPort.setVisible(true); 104 panelPort.perchButton.setVisible(false); 105 } else { 106 prefPortButton.setBorderPainted(false); 107 if (!portButton.isSelected()) 108 panelPort.setVisible(false); 109 } 110 if (stbdButton.isSelected() || prefStbdButton.isSelected()) { 111 if (!(dlg.mark instanceof MarkLat)) { 112 dlg.mark = new MarkLat(dlg); 113 dlg.panelMain.topButton.setEnabled(true); 114 dlg.panelMain.fogButton.setEnabled(true); 115 dlg.panelMain.radButton.setEnabled(true); 116 dlg.panelMain.litButton.setEnabled(true); 117 } 118 dlg.panelMain.panelTop.enableAll(false); 119 dlg.panelMain.panelTop.noTopButton.setEnabled(true); 120 dlg.panelMain.panelTop.coneTopButton.setEnabled(true); 121 dlg.panelMain.panelTop.panelCol.enableAll(false); 122 if (dlg.mark.getRegion() == SeaMark.IALA_A) { 123 dlg.panelMain.panelTop.panelCol.greenButton.setEnabled(true); 124 dlg.panelMain.panelTop.panelCol.greenButton.doClick(); 125 } else { 126 dlg.panelMain.panelTop.panelCol.redButton.setEnabled(true); 127 dlg.panelMain.panelTop.panelCol.redButton.doClick(); 128 } 129 } 68 130 if (stbdButton.isSelected()) { 69 if (!(dlg.mark instanceof MarkLat))70 dlg.mark = new MarkLat(dlg);71 131 dlg.mark.setCategory(Cat.LAT_STBD); 72 132 if (panelStbd.shapes.containsKey(shp)) { … … 90 150 panelStbd.setVisible(false); 91 151 } 92 if (prefPortButton.isSelected()) {93 if (!(dlg.mark instanceof MarkLat))94 dlg.mark = new MarkLat(dlg);95 dlg.mark.setCategory(Cat.LAT_PREF_PORT);96 if (panelPort.shapes.containsKey(shp) && (shp != Shp.PERCH)) {97 panelPort.shapes.get(shp).doClick();98 } else {99 panelPort.clearSelections();100 dlg.mark.setShape(Shp.UNKNOWN);101 }102 if (dlg.mark.getRegion() == SeaMark.IALA_A) {103 dlg.mark.setColour(Ent.BODY, Col.RED_GREEN_RED);104 panelPort.regionAButton.doClick();105 } else {106 dlg.mark.setColour(Ent.BODY, Col.GREEN_RED_GREEN);107 panelPort.regionBButton.doClick();108 }109 prefPortButton.setBorderPainted(true);110 panelPort.setVisible(true);111 panelPort.perchButton.setVisible(false);112 } else {113 prefPortButton.setBorderPainted(false);114 if (!portButton.isSelected()) panelPort.setVisible(false);115 }116 152 if (prefStbdButton.isSelected()) { 117 if (!(dlg.mark instanceof MarkLat))118 dlg.mark = new MarkLat(dlg);119 153 dlg.mark.setCategory(Cat.LAT_PREF_STBD); 120 154 if (panelStbd.shapes.containsKey(shp) && (shp != Shp.PERCH)) { … … 136 170 } else { 137 171 prefStbdButton.setBorderPainted(false); 138 if (!stbdButton.isSelected()) panelStbd.setVisible(false); 172 if (!stbdButton.isSelected()) 173 panelStbd.setVisible(false); 139 174 } 140 175 if (safeWaterButton.isSelected()) { … … 147 182 dlg.mark.setShape(Shp.UNKNOWN); 148 183 } 184 dlg.panelMain.panelTop.enableAll(false); 185 dlg.panelMain.panelTop.noTopButton.setEnabled(true); 186 dlg.panelMain.panelTop.sphereTopButton.setEnabled(true); 187 dlg.panelMain.panelTop.panelCol.enableAll(false); 188 dlg.panelMain.panelTop.panelCol.redButton.setEnabled(true); 189 dlg.panelMain.panelTop.panelCol.redButton.doClick(); 149 190 } 150 191 dlg.mark.setColour(Ent.BODY, Col.RED_WHITE); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r24885 r24904 72 72 } 73 73 74 public void enableAll(boolean state) { 75 Iterator<Col> it = colours.keySet().iterator(); 76 while (it.hasNext()) { 77 colours.get(it.next()).setEnabled(state); 78 } 79 } 80 74 81 private JRadioButton getColButton(JRadioButton button, int x, int y, int w, int h, String tip, Col col) { 75 82 button.setBounds(new Rectangle(x, y, w, h)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r24885 r24904 18 18 import oseam.seamarks.MarkCard; 19 19 import oseam.seamarks.MarkIsol; 20 import oseam.seamarks.MarkLat; 20 21 import oseam.seamarks.SeaMark.Cat; 21 22 import oseam.seamarks.SeaMark.Col; … … 35 36 private ActionListener alCat = new ActionListener() { 36 37 public void actionPerformed(java.awt.event.ActionEvent e) { 37 if ( northButton.isSelected()) {38 if (!(dlg.mark instanceof MarkCard) ) {38 if (catButtons.getSelection() != null) { 39 if (!(dlg.mark instanceof MarkCard) && !isolButton.isSelected()) { 39 40 dlg.mark = new MarkCard(dlg); 40 41 alShape.actionPerformed(null); 41 42 } 43 dlg.panelMain.topButton.setEnabled(true); 44 dlg.panelMain.fogButton.setEnabled(true); 45 dlg.panelMain.radButton.setEnabled(true); 46 dlg.panelMain.litButton.setEnabled(true); 47 dlg.panelMain.panelTop.enableAll(false); 48 dlg.panelMain.panelTop.panelCol.enableAll(false); 49 dlg.panelMain.panelTop.panelCol.blackButton.setEnabled(true); 50 dlg.panelMain.panelTop.panelCol.blackButton.doClick(); 51 } 52 if (northButton.isSelected()) { 42 53 dlg.mark.setCategory(Cat.CARD_NORTH); 43 54 dlg.mark.setColour(Ent.BODY, Col.BLACK_YELLOW); 55 dlg.panelMain.panelTop.northTopButton.setEnabled(true); 44 56 dlg.panelMain.panelTop.northTopButton.doClick(); 45 dlg.panelMain.panelTop.panelCol.blackButton.doClick();46 57 northButton.setBorderPainted(true); 47 58 } else { … … 49 60 } 50 61 if (southButton.isSelected()) { 51 if (!(dlg.mark instanceof MarkCard)) {52 dlg.mark = new MarkCard(dlg);53 alShape.actionPerformed(null);54 }55 62 dlg.mark.setCategory(Cat.CARD_SOUTH); 56 63 dlg.mark.setColour(Ent.BODY, Col.YELLOW_BLACK); 64 dlg.panelMain.panelTop.southTopButton.setEnabled(true); 57 65 dlg.panelMain.panelTop.southTopButton.doClick(); 58 dlg.panelMain.panelTop.panelCol.blackButton.doClick();59 66 southButton.setBorderPainted(true); 60 67 } else { … … 62 69 } 63 70 if (eastButton.isSelected()) { 64 if (!(dlg.mark instanceof MarkCard)) {65 dlg.mark = new MarkCard(dlg);66 alShape.actionPerformed(null);67 }68 71 dlg.mark.setCategory(Cat.CARD_EAST); 69 72 dlg.mark.setColour(Ent.BODY, Col.BLACK_YELLOW_BLACK); 73 dlg.panelMain.panelTop.eastTopButton.setEnabled(true); 70 74 dlg.panelMain.panelTop.eastTopButton.doClick(); 71 dlg.panelMain.panelTop.panelCol.blackButton.doClick();72 75 eastButton.setBorderPainted(true); 73 76 } else { … … 75 78 } 76 79 if (westButton.isSelected()) { 77 if (!(dlg.mark instanceof MarkCard)) {78 dlg.mark = new MarkCard(dlg);79 alShape.actionPerformed(null);80 }81 80 dlg.mark.setCategory(Cat.CARD_WEST); 82 81 dlg.mark.setColour(Ent.BODY, Col.YELLOW_BLACK_YELLOW); 82 dlg.panelMain.panelTop.westTopButton.setEnabled(true); 83 83 dlg.panelMain.panelTop.westTopButton.doClick(); 84 dlg.panelMain.panelTop.panelCol.blackButton.doClick();85 84 westButton.setBorderPainted(true); 86 85 } else { … … 93 92 } 94 93 dlg.mark.setColour(Ent.BODY, Col.BLACK_RED_BLACK); 94 dlg.panelMain.panelTop.spheres2TopButton.setEnabled(true); 95 95 dlg.panelMain.panelTop.spheres2TopButton.doClick(); 96 dlg.panelMain.panelTop.panelCol.blackButton.doClick();97 96 isolButton.setBorderPainted(true); 98 97 } else { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r24896 r24904 45 45 public JRadioButton topButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TopButton.png"))); 46 46 public JRadioButton fogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogButton.png"))); 47 public JRadioButton rad arButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarButton.png")));47 public JRadioButton radButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarButton.png"))); 48 48 public JRadioButton litButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LitButton.png"))); 49 49 private ActionListener alMisc = null; … … 126 126 if (!((dlg.mark instanceof MarkLat) || (dlg.mark instanceof MarkSaw))) { 127 127 dlg.mark = null; 128 clear Icons();128 clearType(); 129 129 } 130 130 chanButton.setBorderPainted(true); … … 138 138 if (!((dlg.mark instanceof MarkCard) || (dlg.mark instanceof MarkIsol))) { 139 139 dlg.mark = null; 140 clear Icons();140 clearType(); 141 141 } 142 142 hazButton.setBorderPainted(true); … … 150 150 if (!(dlg.mark instanceof MarkSpec)) { 151 151 dlg.mark = new MarkSpec(dlg); 152 clearIcons(); 152 clearType(); 153 dlg.panelMain.panelSpec.panelCol.yellowButton.doClick(); 154 dlg.panelMain.panelTop.enableAll(true); 155 dlg.panelMain.panelTop.noTopButton.doClick(); 156 dlg.panelMain.panelTop.panelCol.enableAll(true); 157 dlg.panelMain.panelTop.panelCol.yellowButton.doClick(); 158 topButton.setEnabled(true); 159 fogButton.setEnabled(true); 160 radButton.setEnabled(true); 161 litButton.setEnabled(true); 153 162 } 154 163 specButton.setBorderPainted(true); … … 162 171 if (!(dlg.mark instanceof MarkLight)) { 163 172 dlg.mark = new MarkLight(dlg); 164 clearIcons(); 173 clearType(); 174 fogButton.setEnabled(true); 175 radButton.setEnabled(true); 176 litButton.setEnabled(true); 177 litButton.doClick(); 165 178 } 166 179 lightsButton.setBorderPainted(true); … … 180 193 this.add(getButton(topButton, 0, 165, 34, 32, "TopmarksTip"), null); 181 194 this.add(getButton(fogButton, 0, 205, 34, 32, "FogSignalsTip"), null); 182 this.add(getButton(rad arButton, 0, 245, 34, 32, "RadarTip"), null);195 this.add(getButton(radButton, 0, 245, 34, 32, "RadarTip"), null); 183 196 this.add(getButton(litButton, 0, 285, 34, 32, "LitTip"), null); 184 197 miscButtons = new ButtonGroup(); 185 198 miscButtons.add(topButton); 186 199 miscButtons.add(fogButton); 187 miscButtons.add(rad arButton);200 miscButtons.add(radButton); 188 201 miscButtons.add(litButton); 189 202 alMisc = new ActionListener() { … … 191 204 if (dlg.mark == null) { 192 205 miscButtons.clearSelection(); 193 return;194 206 } 195 207 if (topButton.isSelected()) { … … 207 219 panelFog.setVisible(false); 208 220 } 209 if (rad arButton.isSelected()) {210 rad arButton.setBorderPainted(true);221 if (radButton.isSelected()) { 222 radButton.setBorderPainted(true); 211 223 panelRadar.setVisible(true); 212 224 } else { 213 rad arButton.setBorderPainted(false);225 radButton.setBorderPainted(false); 214 226 panelRadar.setVisible(false); 215 227 } … … 225 237 topButton.addActionListener(alMisc); 226 238 fogButton.addActionListener(alMisc); 227 rad arButton.addActionListener(alMisc);239 radButton.addActionListener(alMisc); 228 240 litButton.addActionListener(alMisc); 229 241 … … 244 256 typeButtons.clearSelection(); 245 257 alType.actionPerformed(null); 258 clearType(); 259 } 260 261 public void clearType() { 262 topButton.setEnabled(false); 263 fogButton.setEnabled(false); 264 radButton.setEnabled(false); 265 litButton.setEnabled(false); 246 266 miscButtons.clearSelection(); 247 267 alMisc.actionPerformed(null); … … 254 274 panelRadar.clearSelections(); 255 275 panelLit.clearSelections(); 256 clearIcons();257 }258 259 public void clearIcons() {260 276 shapeIcon.setIcon(null); 261 277 lightIcon.setIcon(null); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r24885 r24904 15 15 import oseam.Messages; 16 16 import oseam.dialogs.OSeaMAction; 17 import oseam.seamarks.SeaMark.Col; 17 18 import oseam.seamarks.SeaMark.Top; 18 19 import oseam.seamarks.SeaMark.Ent; … … 85 86 } 86 87 88 public void enableAll(boolean state) { 89 Iterator<Top> it = tops.keySet().iterator(); 90 while (it.hasNext()) { 91 tops.get(it.next()).setEnabled(state); 92 } 93 } 94 87 95 private JRadioButton getTopButton(JRadioButton button, int x, int y, int w, int h, String tip, Top top) { 88 96 button.setBounds(new Rectangle(x, y, w, h)); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkCard.java
r24896 r24904 90 90 } 91 91 92 parseLights(keys); 93 parseFogRadar(keys); 94 95 } 96 97 public void setLightColour() { 98 super.setLightColour(Col.WHITE); 92 super.parseMark(); 99 93 } 100 94 … … 121 115 return; 122 116 } 123 124 117 switch (getCategory()) { 125 118 case CARD_NORTH: … … 139 132 return; 140 133 } 141 142 134 image += ".png"; 143 135 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image))); 136 144 137 super.paintSign(); 145 138 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java
r24896 r24904 59 59 } 60 60 61 parseLights(keys); 62 parseFogRadar(keys); 63 } 64 65 public void setLightColour() { 66 super.setLightColour(Col.WHITE); 61 super.parseMark(); 67 62 } 68 63 … … 87 82 break; 88 83 default: 84 dlg.panelMain.shapeIcon.setIcon(null); 85 return; 89 86 } 87 image += ".png"; 88 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image))); 90 89 91 if (!image.equals("/images/Cardinal")) {92 image += ".png";93 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image)));94 } else95 dlg.panelMain.shapeIcon.setIcon(null);96 90 super.paintSign(); 97 91 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java
r24896 r24904 208 208 } 209 209 210 parseLights(keys); 211 parseFogRadar(keys); 212 setLightColour(); 213 } 214 215 public void setLightColour() { 216 if (getRegion() == IALA_A) { 217 if (getCategory() == Cat.LAT_PORT || getCategory() == Cat.LAT_PREF_PORT) 218 super.setLightColour(Col.RED); 219 else 220 super.setLightColour(Col.GREEN); 221 } else { 222 if (getCategory() == Cat.LAT_PORT || getCategory() == Cat.LAT_PREF_PORT) 223 super.setLightColour(Col.GREEN); 224 else 225 super.setLightColour(Col.RED); 226 } 210 super.parseMark(); 227 211 } 228 212 … … 259 243 break; 260 244 default: 245 dlg.panelMain.shapeIcon.setIcon(null); 246 return; 261 247 } 262 248 else … … 284 270 break; 285 271 default: 272 dlg.panelMain.shapeIcon.setIcon(null); 273 return; 286 274 } 287 275 break; … … 312 300 break; 313 301 default: 302 dlg.panelMain.shapeIcon.setIcon(null); 303 return; 314 304 } 315 305 else … … 337 327 break; 338 328 default: 329 dlg.panelMain.shapeIcon.setIcon(null); 330 return; 339 331 } 340 332 break; … … 362 354 break; 363 355 default: 356 dlg.panelMain.shapeIcon.setIcon(null); 357 return; 364 358 } 365 359 else … … 384 378 break; 385 379 default: 380 dlg.panelMain.shapeIcon.setIcon(null); 381 return; 386 382 } 387 383 break; … … 409 405 break; 410 406 default: 407 dlg.panelMain.shapeIcon.setIcon(null); 408 return; 411 409 } 412 410 else … … 431 429 break; 432 430 default: 433 } 434 break; 435 431 dlg.panelMain.shapeIcon.setIcon(null); 432 return; 433 } 434 break; 436 435 default: 436 dlg.panelMain.shapeIcon.setIcon(null); 437 return; 437 438 } 438 439 if (!image.equals("/images/Lateral")) {440 441 439 image += ".png"; 442 440 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image))); 443 441 444 if (hasTopmark()) {445 image = "";446 switch (getCategory()) {447 case LAT_PORT:448 case LAT_PREF_PORT:449 if (region == IALA_A)450 switch (style) {451 case CAN:452 image = "/images/Top_Can_Red_Buoy_Small.png";453 break;454 case PILLAR:455 case SPAR:456 image = "/images/Top_Can_Red_Buoy.png";457 break;458 case BEACON:459 case TOWER:460 image = "/images/Top_Can_Red_Beacon.png";461 break;462 case FLOAT:463 image = "/images/Top_Can_Red_Float.png";464 break;465 }466 else467 switch (style) {468 case CAN:469 image = "/images/Top_Can_Green_Buoy_Small.png";470 break;471 case PILLAR:472 case SPAR:473 image = "/images/Top_Can_Green_Buoy.png";474 break;475 case BEACON:476 case TOWER:477 image = "/images/Top_Can_Green_Beacon.png";478 break;479 case FLOAT:480 image = "/images/Top_Can_Green_Float.png";481 break;482 }483 break;484 485 case LAT_STBD:486 case LAT_PREF_STBD:487 if (region == IALA_A)488 switch (style) {489 case CONE:490 image = "/images/Top_Cone_Green_Buoy_Small.png";491 break;492 case PILLAR:493 case SPAR:494 image = "/images/Top_Cone_Green_Buoy.png";495 break;496 case BEACON:497 case TOWER:498 image = "/images/Top_Cone_Green_Beacon.png";499 break;500 case FLOAT:501 image = "/images/Top_Cone_Green_Float.png";502 break;503 }504 else505 switch (style) {506 case CONE:507 image = "/images/Top_Cone_Red_Buoy_Small.png";508 break;509 case PILLAR:510 case SPAR:511 image = "/images/Top_Cone_Red_Buoy.png";512 break;513 case BEACON:514 case TOWER:515 image = "/images/Top_Cone_Red_Beacon.png";516 break;517 case FLOAT:518 image = "/images/Top_Cone_Red_Float.png";519 break;520 }521 break;522 }523 if (!image.isEmpty())524 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image)));525 }526 } else527 dlg.panelMain.shapeIcon.setIcon(null);528 442 super.paintSign(); 529 443 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java
r24896 r24904 52 52 } 53 53 54 parseLights(keys); 55 parseFogRadar(keys); 56 setFired(true); 54 super.parseMark(); 57 55 } 58 56 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java
r24896 r24904 52 52 } 53 53 54 if (keys.containsKey("seamark:topmark:shape") || keys.containsKey("seamark:topmark:colour")) { 55 // setTopMark(true); 56 } 57 58 parseLights(keys); 59 parseFogRadar(keys); 54 super.parseMark(); 60 55 } 61 56 … … 81 76 break; 82 77 default: 78 dlg.panelMain.shapeIcon.setIcon(null); 79 return; 83 80 } 84 85 if (!image.equals("/images/Safe_Water")) {86 81 image += ".png"; 87 82 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image))); 88 if (hasTopmark()) { 89 image = ""; 90 switch (getShape()) { 91 case PILLAR: 92 case SPAR: 93 image = "/images/Top_Sphere_Red_Buoy.png"; 94 break; 95 case SPHERE: 96 image = "/images/Top_Sphere_Red_Buoy_Small.png"; 97 break; 98 case BEACON: 99 image = "/images/Top_Sphere_Red_Beacon.png"; 100 break; 101 case FLOAT: 102 image = "/images/Top_Sphere_Red_Float.png"; 103 break; 104 } 105 if (!image.isEmpty()) 106 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image))); 107 } else 108 dlg.panelMain.topIcon.setIcon(null); 109 } else { 110 dlg.panelMain.shapeIcon.setIcon(null); 111 dlg.panelMain.topIcon.setIcon(null); 112 } 113 super.paintSign(); 83 84 super.paintSign(); 114 85 } 115 86 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java
r24896 r24904 78 78 if (keys.containsKey("seamark:topmark:shape")) { 79 79 str = keys.get("seamark:topmark:shape"); 80 /* setTopMark(true); 81 if (str.equals("x-shape")) { 82 if (keys.containsKey("seamark:topmark:colour")) { 83 if (keys.get("seamark:topmark:colour").equals("red")) 84 setTopMarkIndex(TOP_RED_X); 85 else 86 setTopMarkIndex(TOP_YELLOW_X); 87 } 88 } else if (str.equals("cone, point up")) { 89 setTopMarkIndex(TOP_YELLOW_CONE); 90 } else if (str.equals("cylinder")) { 91 setTopMarkIndex(TOP_YELLOW_CAN); 92 } 93 */ } 80 } 94 81 95 parseLights(keys); 96 parseFogRadar(keys); 82 super.parseMark(); 97 83 } 98 84 … … 129 115 image += "_Tower"; 130 116 break; 117 default: 118 dlg.panelMain.shapeIcon.setIcon(null); 119 return; 131 120 } 121 image += ".png"; 122 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image))); 132 123 133 if (!image.equals("/images/Special_Purpose")) {134 image += ".png";135 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image)));136 137 if (hasTopmark()) {138 image = "";139 switch (getShape()) {140 case PILLAR:141 case SPAR:142 switch (getTopmark()) {143 case X_SHAPE:144 if (getColour(Ent.TOPMARK) == Col.YELLOW)145 image = "/images/Top_X_Yellow_Buoy.png";146 else147 image = "/images/Top_X_Red_Buoy.png";148 break;149 case CAN:150 image = "/images/Top_Can_Yellow_Buoy.png";151 break;152 case CONE:153 image = "/images/Top_Cone_Yellow_Buoy.png";154 break;155 }156 break;157 case CAN:158 case CONE:159 case SPHERE:160 case BARREL:161 switch (getTopmark()) {162 case X_SHAPE:163 if (getColour(Ent.TOPMARK) == Col.YELLOW)164 image = "/images/Top_X_Yellow_Buoy_Small.png";165 else166 image = "/images/Top_X_Red_Buoy_Small.png";167 break;168 case CAN:169 image = "/images/Top_Can_Yellow_Buoy_Small.png";170 break;171 case CONE:172 image = "/images/Top_Cone_Yellow_Buoy_Small.png";173 break;174 }175 break;176 case BEACON:177 case TOWER:178 switch (getTopmark()) {179 case X_SHAPE:180 if (getColour(Ent.TOPMARK) == Col.YELLOW)181 image = "/images/Top_X_Yellow_Beacon.png";182 else183 image = "/images/Top_X_Red_Beacon.png";184 break;185 case CAN:186 image = "/images/Top_Can_Yellow_Beacon.png";187 break;188 case CONE:189 image = "/images/Top_Cone_Yellow_Beacon.png";190 break;191 }192 break;193 case FLOAT:194 case SUPER:195 switch (getTopmark()) {196 case X_SHAPE:197 if (getColour(Ent.TOPMARK) == Col.YELLOW)198 image = "/images/Top_X_Yellow_Float.png";199 else200 image = "/images/Top_X_Red_Float.png";201 break;202 case CAN:203 image = "/images/Top_Can_Yellow_Float.png";204 break;205 case CONE:206 image = "/images/Top_Cone_Yellow_Float.png";207 break;208 }209 break;210 }211 if (!image.isEmpty())212 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image)));213 }214 215 } else216 dlg.panelMain.shapeIcon.setIcon(null);217 124 super.paintSign(); 218 125 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r24896 r24904 329 329 } 330 330 331 protected void setLightGroup(Map<String, String> k ) {331 protected void setLightGroup(Map<String, String> keys) { 332 332 String s = ""; 333 if (k .containsKey("seamark:light:group")) {334 s = k .get("seamark:light:group");333 if (keys.containsKey("seamark:light:group")) { 334 s = keys.get("seamark:light:group"); 335 335 setLightGroup(s); 336 336 } … … 436 436 } 437 437 438 public abstract void parseMark(); 439 440 public void parseLights(Map<String, String> k) { 438 public void parseMark() { 439 440 String str; 441 Map<String, String> keys; 442 keys = dlg.node.getKeys(); 443 441 444 setFired(false); 442 445 setSectored(false); 443 Iterator it = k .entrySet().iterator();446 Iterator it = keys.entrySet().iterator(); 444 447 while (it.hasNext()) { 445 448 Map.Entry entry = (Map.Entry) it.next(); … … 493 496 } 494 497 } 495 } 496 497 public void parseFogRadar(Map<String, String> k) { 498 String str; 498 499 499 setFog(false); 500 500 setRadar(false); 501 501 setRacon(false); 502 if (k .containsKey("seamark:fog_signal") || k.containsKey("seamark:fog_signal:category")503 || k .containsKey("seamark:fog_signal:group") || k.containsKey("seamark:fog_signal:period")) {502 if (keys.containsKey("seamark:fog_signal") || keys.containsKey("seamark:fog_signal:category") 503 || keys.containsKey("seamark:fog_signal:group") || keys.containsKey("seamark:fog_signal:period")) { 504 504 setFog(true); 505 if (k .containsKey("seamark:fog_signal:category")) {506 str = k .get("seamark:fog_signal:category");505 if (keys.containsKey("seamark:fog_signal:category")) { 506 str = keys.get("seamark:fog_signal:category"); 507 507 if (str.equals("horn")) 508 508 setFogSound(Fog.HORN); … … 522 522 setFogSound(Fog.UNKNOWN); 523 523 } 524 if (k .containsKey("seamark:fog_signal:group"))525 setFogGroup(k .get("seamark:fog_signal:group"));526 if (k .containsKey("seamark:fog_signal:period"))527 setFogPeriod(k .get("seamark:fog_signal:period"));528 } 529 530 if (k .containsKey("seamark:radar_transponder") || k.containsKey("seamark:radar_transponder:category")531 || k .containsKey("seamark:radar_transponder:group")) {524 if (keys.containsKey("seamark:fog_signal:group")) 525 setFogGroup(keys.get("seamark:fog_signal:group")); 526 if (keys.containsKey("seamark:fog_signal:period")) 527 setFogPeriod(keys.get("seamark:fog_signal:period")); 528 } 529 530 if (keys.containsKey("seamark:radar_transponder") || keys.containsKey("seamark:radar_transponder:category") 531 || keys.containsKey("seamark:radar_transponder:group")) { 532 532 setRacon(true); 533 if (k .containsKey("seamark:radar_transponder:category")) {534 str = k .get("seamark:radar_transponder:category");533 if (keys.containsKey("seamark:radar_transponder:category")) { 534 str = keys.get("seamark:radar_transponder:category"); 535 535 if (str.equals("racon")) 536 536 setRaType(Rtb.RACON); … … 542 542 setRaType(Rtb.UNKNOWN); 543 543 } 544 if (k .containsKey("seamark:radar_transponder:group"))545 setRaconGroup(k .get("seamark:radar_transponder:group"));546 } else if (k .containsKey("seamark:radar_reflector"))544 if (keys.containsKey("seamark:radar_transponder:group")) 545 setRaconGroup(keys.get("seamark:radar_transponder:group")); 546 } else if (keys.containsKey("seamark:radar_reflector")) 547 547 setRadar(true); 548 548 } 549 549 550 550 public void paintSign() { 551 /* 552 dlg.lM01NameMark.setText(getName()); 553 554 dlg.bM01Save.setEnabled(true); 555 556 dlg.cM01TopMark.setSelected(hasTopMark()); 557 dlg.cM01Fired.setSelected(isFired()); 558 559 dlg.tfM01RepeatTime.setText(getLightPeriod()); 560 561 dlg.tfM01Name.setText(getName()); 562 dlg.tfM01Name.setEnabled(true); 563 */ 551 564 552 if (hasRadar()) { 565 553 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png"))); … … 570 558 // if ((getRaType() == RATYPE_RACON) && !getRaconGroup().isEmpty()) 571 559 // c += ("(" + getRaconGroup() + ")"); 572 // dlg.lM01RadarMark .setText(c);560 // dlg.lM01RadarMarkeys.setText(c); 573 561 // } 574 562 } … … 582 570 // if (!getFogPeriod().isEmpty()) 583 571 // c += (" " + getFogPeriod() + "s"); 584 // dlg.lM01FogMark .setText(c);572 // dlg.lM01FogMarkeys.setText(c); 585 573 // } 586 574 }
Note:
See TracChangeset
for help on using the changeset viewer.