Changeset 24881 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2010-12-26T19:11:37+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r24879 r24881 28 28 29 29 private OSeaMAction dlg; 30 public PanelPort panelPort = null; 31 public PanelStbd panelStbd = null; 32 public PanelSaw panelSaw = null; 30 33 private ButtonGroup catButtons = new ButtonGroup(); 31 34 public JRadioButton portButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PortButton.png"))); … … 123 126 }; 124 127 125 public PanelPort panelPort = null;126 public PanelStbd panelStbd = null;127 public PanelSaw panelSaw = null;128 129 128 public PanelChan(OSeaMAction dia) { 130 129 dlg = dia; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r24875 r24881 47 47 JRadioButton button = tops.get(top); 48 48 if (button.isSelected()) { 49 dlg.mark.setTop Mark(top);49 dlg.mark.setTopmark(top); 50 50 button.setBorderPainted(true); 51 51 } else -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkCard.java
r24875 r24881 179 179 default: 180 180 } 181 182 181 switch (getShape()) { 183 182 case PILLAR: … … 189 188 shape = "2 cones up"; 190 189 break; 191 192 190 case CARD_EAST: 193 191 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "east")); … … 195 193 shape = "2 cones base together"; 196 194 break; 197 198 195 case CARD_SOUTH: 199 196 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "south")); … … 201 198 shape = "2 cones down"; 202 199 break; 203 204 200 case CARD_WEST: 205 201 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "west")); … … 210 206 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour_pattern", "horizontal stripes")); 211 207 break; 212 213 208 case BEACON: 214 209 case TOWER: … … 219 214 shape = "2 cones up"; 220 215 break; 221 222 216 case CARD_EAST: 223 217 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "east")); … … 225 219 shape = "2 cones base together"; 226 220 break; 227 228 221 case CARD_SOUTH: 229 222 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "south")); … … 231 224 shape = "2 cones down"; 232 225 break; 233 234 226 case CARD_WEST: 235 227 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "west")); … … 240 232 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour_pattern", "horizontal stripes")); 241 233 break; 242 243 234 case FLOAT: 244 235 switch (getCategory()) { … … 247 238 shape = "2 cones up"; 248 239 break; 249 250 240 case CARD_EAST: 251 241 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "black;yellow;black")); 252 242 shape = "2 cones base together"; 253 243 break; 254 255 244 case CARD_SOUTH: 256 245 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow;black")); 257 246 shape = "2 cones down"; 258 247 break; 259 260 248 case CARD_WEST: 261 249 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow;black;yellow")); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java
r24875 r24881 109 109 else 110 110 super.saveSign(); 111 112 111 switch (getShape()) { 113 112 case PILLAR: … … 131 130 default: 132 131 } 133 134 132 switch (getShape()) { 135 133 case PILLAR: … … 150 148 break; 151 149 } 152 153 150 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 spheres")); 154 151 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "black")); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java
r24875 r24881 384 384 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image))); 385 385 386 if (hasTop Mark()) {386 if (hasTopmark()) { 387 387 image = ""; 388 388 switch (getCategory()) { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java
r24870 r24881 108 108 } 109 109 110 public void setLightColour() {111 }112 113 110 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java
r24870 r24881 106 106 image += ".png"; 107 107 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image))); 108 if (hasTop Mark()) {108 if (hasTopmark()) { 109 109 image = ""; 110 110 switch (getShape()) { … … 161 161 default: 162 162 } 163 164 163 switch (getShape()) { 165 164 case PILLAR: -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java
r24875 r24881 172 172 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 173 173 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "pillar")); 174 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));174 saveColour(Obj.BUOY); 175 175 break; 176 176 case SPAR: 177 177 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 178 178 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "spar")); 179 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));179 saveColour(Obj.BUOY); 180 180 break; 181 181 case CAN: 182 182 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 183 183 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "can")); 184 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));184 saveColour(Obj.BUOY); 185 185 break; 186 186 case CONE: 187 187 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 188 188 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "conical")); 189 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));189 saveColour(Obj.BUOY); 190 190 break; 191 191 case SPHERE: 192 192 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 193 193 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "sphere")); 194 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));194 saveColour(Obj.BUOY); 195 195 break; 196 196 case BARREL: 197 197 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 198 198 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "barrel")); 199 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow")); 199 saveColour(Obj.BUOY); 200 break; 201 case SUPER: 202 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose")); 203 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "super-buoy")); 204 saveColour(Obj.BUOY); 200 205 break; 201 206 case FLOAT: 202 207 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float")); 203 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow"));208 saveColour(Obj.FLOAT); 204 209 break; 205 210 case BEACON: 206 211 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_special_purpose")); 207 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:colour", "yellow"));212 saveColour(Obj.BEACON); 208 213 break; 209 214 case TOWER: 210 215 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_special_purpose")); 211 216 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:shape", "tower")); 212 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:colour", "yellow"));217 saveColour(Obj.BEACON); 213 218 break; 214 219 default: 215 220 } 216 /* 217 * switch (getTopMarkIndex()) { case TOP_YELLOW_X: 218 * saveTopMarkData("x-shape", "yellow"); break; case TOP_RED_X: 219 * saveTopMarkData("x-shape", "red"); break; case TOP_YELLOW_CAN: 220 * saveTopMarkData("cylinder", "yellow"); break; case TOP_YELLOW_CONE: 221 * saveTopMarkData("cone, point up", "yellow"); break; } 222 * Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, 223 * "seamark:topmark:shape", shape)); Main.main.undoRedo.add(new 224 * ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "yellow")); 225 */ 221 if (hasTopmark()) { 222 switch (getTopmark()) { 223 case X_SHAPE: 224 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "x-shape")); 225 break; 226 } 227 saveColour(Obj.TOPMARK); 228 } 229 } 230 231 private void saveColour(Obj obj) { 232 String str = ""; 233 switch (obj) { 234 case BUOY: 235 str = "seamark:buoy_special_purpose:colour"; 236 break; 237 case BEACON: 238 str = "seamark:beacon_special_purpose:colour"; 239 break; 240 case FLOAT: 241 str = "seamark:light_float:colour"; 242 break; 243 case TOPMARK: 244 str = "seamark:topmark:colour"; 245 break; 246 } 247 switch (getColour(obj)) { 248 case WHITE: 249 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "white")); 250 break; 251 case RED: 252 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "red")); 253 break; 254 case ORANGE: 255 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "orange")); 256 break; 257 case AMBER: 258 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "amber")); 259 break; 260 case YELLOW: 261 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "yellow")); 262 break; 263 case GREEN: 264 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "green")); 265 break; 266 case BLUE: 267 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "blue")); 268 break; 269 case VIOLET: 270 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "violet")); 271 break; 272 case BLACK: 273 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, "black")); 274 break; 275 } 226 276 } 227 277 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r24875 r24881 45 45 46 46 public enum Col { 47 UNKNOWN, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, 48 RED_GREEN_RED, GREEN_RED_GREEN, RED_WHITE, 49 BLACK_YELLOW, BLACK_YELLOW_BLACK, YELLOW_BLACK, YELLOW_BLACK_YELLOW, BLACK_RED_BLACK 47 UNKNOWN, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, RED_GREEN_RED, GREEN_RED_GREEN, RED_WHITE, BLACK_YELLOW, BLACK_YELLOW_BLACK, YELLOW_BLACK, YELLOW_BLACK_YELLOW, BLACK_RED_BLACK 50 48 } 51 49 52 50 public enum Obj { 53 BODY, TOPMARK, LIGHT51 BODY, BUOY, BEACON, FLOAT, TOPMARK, LIGHT 54 52 } 55 53 … … 59 57 switch (obj) { 60 58 case BODY: 59 case BUOY: 60 case BEACON: 61 case FLOAT: 61 62 return bodyColour; 62 63 case TOPMARK: … … 71 72 switch (obj) { 72 73 case BODY: 74 case BUOY: 75 case BEACON: 76 case FLOAT: 73 77 bodyColour = col; 74 78 break; … … 93 97 94 98 public enum Cat { 95 UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, 96 CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, 97 LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT 99 UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT 98 100 } 99 101 … … 109 111 110 112 public enum Shp { 111 UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER, 112 BEACON, TOWER, STAKE, PERCH 113 UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER, BEACON, TOWER, STAKE, PERCH 113 114 } 114 115 … … 124 125 125 126 public enum Top { 126 NONE, CAN, CONE, SPHERE, X_SHAPE, NORTH, SOUTH, EAST, WEST, SPHERES2, 127 BOARD, DIAMOND, TRIANGLE, TRIANGLE_INV, SQUARE, MOORING 128 } 129 130 private Top topMark = Top.NONE; 127 NONE, CAN, CONE, SPHERE, X_SHAPE, NORTH, SOUTH, EAST, WEST, SPHERES2, BOARD, DIAMOND, TRIANGLE, TRIANGLE_INV, SQUARE, MOORING 128 } 129 130 private Top topShape = Top.NONE; 131 131 private Col topColour = Col.UNKNOWN; 132 132 133 public boolean hasTopMark() { 134 return (topMark != Top.NONE); 135 } 136 137 public void setTopMark(Top top) { 138 topMark = top; 133 public boolean hasTopmark() { 134 return (topShape != Top.NONE); 135 } 136 137 public Top getTopmark() { 138 return topShape; 139 } 140 141 public void setTopmark(Top top) { 142 topShape = top; 139 143 } 140 144 … … 642 646 if (!str.isEmpty()) 643 647 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:name", str)); 644 /* 645 * String colour; if (dlg.cM01Fired.isSelected()) { if (!(colour = 646 * LightColour[0]).isEmpty()) if (colour.equals("R")) { 647 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, 648 * "seamark:light:colour", "red")); } else if (colour.equals("G")) { 649 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, 650 * "seamark:light:colour", "green")); } else if (colour.equals("W")) { 651 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, 652 * "seamark:light:colour", "white")); } 653 * 654 * if (!LightPeriod[0].isEmpty()) Main.main.undoRedo.add(new 655 * ChangePropertyCommand(Node, "seamark:light:period", LightPeriod[0])); 656 * 657 * if (!LightChar[0].isEmpty()) Main.main.undoRedo.add(new 658 * ChangePropertyCommand(Node, "seamark:light:character", LightChar[0])); 659 * 660 * if (!LightGroup[0].isEmpty()) Main.main.undoRedo.add(new 661 * ChangePropertyCommand(Node, "seamark:light:group", LightGroup[0])); 662 * 663 * if (!Height[0].isEmpty()) Main.main.undoRedo.add(new 664 * ChangePropertyCommand(Node, "seamark:light:height", Height[0])); 665 * 666 * if (!Range[0].isEmpty()) Main.main.undoRedo.add(new 667 * ChangePropertyCommand(Node, "seamark:light:range", Range[0])); 668 * 669 * for (int i = 1; i < 10; i++) { if ((colour = LightColour[i]) != null) if 670 * (colour.equals("R")) { Main.main.undoRedo.add(new 671 * ChangePropertyCommand(Node, "seamark:light:" + i + ":colour", "red")); if 672 * ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null)) 673 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, "seamark:light:" + 674 * i, "red:" + Bearing1[i] + ":" + Bearing2[i] + ":" + Radius[i])); } else 675 * if (colour.equals("G")) { Main.main.undoRedo.add(new 676 * ChangePropertyCommand(Node, "seamark:light:" + i + ":colour", "green")); 677 * if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != 678 * null)) Main.main.undoRedo.add(new ChangePropertyCommand(Node, 679 * "seamark:light:" + i, "green:" + Bearing1[i] + ":" + Bearing2[i] + ":" + 680 * Radius[i])); } else if (colour.equals("W")) { Main.main.undoRedo.add(new 681 * ChangePropertyCommand(Node, "seamark:light:" + i + ":colour", "white")); 682 * if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != 683 * null)) Main.main.undoRedo.add(new ChangePropertyCommand(Node, 684 * "seamark:light:" + i, "white:" + Bearing1[i] + ":" + Bearing2[i] + ":" + 685 * Radius[i])); } 686 * 687 * if (LightPeriod[i] != null) Main.main.undoRedo.add(new 688 * ChangePropertyCommand(Node, "seamark:light:" + i + ":period", 689 * LightPeriod[i])); 690 * 691 * if (LightChar[i] != null) Main.main.undoRedo.add(new 692 * ChangePropertyCommand(Node, "seamark:light:" + i + ":character", 693 * LightChar[i])); 694 * 695 * if (LightGroup[i] != null) Main.main.undoRedo.add(new 696 * ChangePropertyCommand(Node, "seamark:light:" + i + ":group", 697 * LightGroup[i])); 698 * 699 * if (Height[i] != null) Main.main.undoRedo.add(new 700 * ChangePropertyCommand(Node, "seamark:light:" + i + ":height", 701 * Height[i])); 702 * 703 * if (Range[i] != null) Main.main.undoRedo.add(new 704 * ChangePropertyCommand(Node, "seamark:light:" + i + ":range", Range[i])); 705 * 706 * if (Bearing1[i] != null) Main.main.undoRedo.add(new 707 * ChangePropertyCommand(Node, "seamark:light:" + i + ":sector_start", 708 * Bearing1[i])); 709 * 710 * if (Bearing2[i] != null) Main.main.undoRedo.add(new 711 * ChangePropertyCommand(Node, "seamark:light:" + i + ":sector_end", 712 * Bearing2[i])); } } if (hasTopMark()) { Main.main.undoRedo.add(new 713 * ChangePropertyCommand(Node, "seamark:topmark:shape", shape)); 714 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, 715 * "seamark:topmark:colour", colour)); } if (hasRadar()) { 716 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, 717 * "seamark:radar_reflector", "yes")); } if (hasRacon()) { switch (RaType) { 718 * case RATYPE_RACON: Main.main.undoRedo.add(new ChangePropertyCommand(Node, 719 * "seamark:radar_transponder:category", "racon")); if 720 * (!getRaconGroup().isEmpty()) Main.main.undoRedo.add(new 721 * ChangePropertyCommand(Node, "seamark:radar_transponder:group", 722 * getRaconGroup())); break; case RATYPE_RAMARK: Main.main.undoRedo.add(new 723 * ChangePropertyCommand(Node, "seamark:radar_transponder:category", 724 * "ramark")); break; case RATYPE_LEADING: Main.main.undoRedo.add(new 725 * ChangePropertyCommand(Node, "seamark:radar_transponder:category", 726 * "leading")); break; default: Main.main.undoRedo.add(new 727 * ChangePropertyCommand(Node, "seamark:radar_transponder", "yes")); } } if 728 * (hasFog()) { if (getFogSound() == 0) { Main.main.undoRedo.add(new 729 * ChangePropertyCommand(Node, "seamark:fog_signal", "yes")); } else { 730 * switch (getFogSound()) { case FOG_HORN: Main.main.undoRedo.add(new 731 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "horn")); 732 * break; case FOG_SIREN: Main.main.undoRedo.add(new 733 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "siren")); 734 * break; case FOG_DIA: Main.main.undoRedo.add(new 735 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "diaphone")); 736 * break; case FOG_BELL: Main.main.undoRedo.add(new 737 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "bell")); 738 * break; case FOG_WHIS: Main.main.undoRedo.add(new 739 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "whistle")); 740 * break; case FOG_GONG: Main.main.undoRedo.add(new 741 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "gong")); 742 * break; case FOG_EXPLOS: Main.main.undoRedo.add(new 743 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "explosive")); 744 * break; } if (!getFogGroup().isEmpty()) Main.main.undoRedo.add(new 745 * ChangePropertyCommand(Node, "seamark:fog_signal:group", getFogGroup())); 746 * if (!getFogPeriod().isEmpty()) Main.main.undoRedo.add(new 747 * ChangePropertyCommand(Node, "seamark:fog_signal:period", 748 * getFogPeriod())); } } 749 */} 648 649 Col colour; 650 if (isFired()) { 651 if ((colour = lightColour[0]) != Col.UNKNOWN) 652 if (colour == Col.RED) { 653 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:colour", "red")); 654 } else if (colour.equals("G")) { 655 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:colour", "green")); 656 } else if (colour.equals("W")) { 657 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:colour", "white")); 658 } 659 if (!LightPeriod[0].isEmpty()) 660 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:period", LightPeriod[0])); 661 if (!LightChar[0].isEmpty()) 662 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:character", LightChar[0])); 663 if (!LightGroup[0].isEmpty()) 664 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:group", LightGroup[0])); 665 if (!Height[0].isEmpty()) 666 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:height", Height[0])); 667 if (!Range[0].isEmpty()) 668 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:range", Range[0])); 669 for (int i = 1; i < 10; i++) { 670 if ((colour = lightColour[i]) != Col.UNKNOWN) 671 if (colour.equals("R")) { 672 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i + ":colour", "red")); 673 if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null)) 674 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i, "red:" + Bearing1[i] + ":" + Bearing2[i] 675 + ":" + Radius[i])); 676 } else if (colour.equals("G")) { 677 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i + ":colour", "green")); 678 if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null)) 679 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i, "green:" + Bearing1[i] + ":" 680 + Bearing2[i] + ":" + Radius[i])); 681 } else if (colour.equals("W")) { 682 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i + ":colour", "white")); 683 if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null)) 684 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i, "white:" + Bearing1[i] + ":" 685 + Bearing2[i] + ":" + Radius[i])); 686 } 687 if (LightPeriod[i] != null) 688 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i + ":period", LightPeriod[i])); 689 if (LightChar[i] != null) 690 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i + ":character", LightChar[i])); 691 if (LightGroup[i] != null) 692 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i + ":group", LightGroup[i])); 693 if (Height[i] != null) 694 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i + ":height", Height[i])); 695 if (Range[i] != null) 696 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i + ":range", Range[i])); 697 if (Bearing1[i] != null) 698 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i + ":sector_start", Bearing1[i])); 699 if (Bearing2[i] != null) 700 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i + ":sector_end", Bearing2[i])); 701 } 702 } 703 if (hasRadar()) { 704 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:radar_reflector", "yes")); 705 } 706 if (hasRacon()) { 707 switch (RaType) { 708 case RACON: 709 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:radar_transponder:category", "racon")); 710 if (!getRaconGroup().isEmpty()) 711 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:radar_transponder:group", getRaconGroup())); 712 break; 713 case RAMARK: 714 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:radar_transponder:category", "ramark")); 715 break; 716 case LEADING: 717 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:radar_transponder:category", "leading")); 718 break; 719 default: 720 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:radar_transponder", "yes")); 721 } 722 } 723 if (hasFog()) { 724 switch (getFogSound()) { 725 case HORN: 726 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:fog_signal:category", "horn")); 727 break; 728 case SIREN: 729 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:fog_signal:category", "siren")); 730 break; 731 case DIA: 732 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:fog_signal:category", "diaphone")); 733 break; 734 case BELL: 735 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:fog_signal:category", "bell")); 736 break; 737 case WHIS: 738 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:fog_signal:category", "whistle")); 739 break; 740 case GONG: 741 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:fog_signal:category", "gong")); 742 break; 743 case EXPLOS: 744 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:fog_signal:category", "explosive")); 745 break; 746 default: 747 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:fog_signal", "yes")); 748 } 749 if (!getFogGroup().isEmpty()) 750 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:fog_signal:group", getFogGroup())); 751 if (!getFogPeriod().isEmpty()) 752 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:fog_signal:period", getFogPeriod())); 753 } 754 } 750 755 751 756 }
Note:
See TracChangeset
for help on using the changeset viewer.