Changeset 24917 in osm for applications/editors/josm/plugins/smed/plugs/oseam/src
- Timestamp:
- 2010-12-30T17:11:22+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src
- Files:
-
- 24 deleted
- 11 edited
- 129 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
r24904 r24917 131 131 mark = new MarkIsol(this); 132 132 mark.setObject(Obj.BCNISD); 133 } else if (type.equals("landmark") || type.equals("light_vessel") || type.equals("light_major") || type.equals("light_minor")) { 134 mark = new MarkLight(this); 135 mark.setObject(Obj.LIGHTS); 133 } else if (type.equals("landmark")) { 134 mark = new MarkLight(this); 135 mark.setObject(Obj.LNDMRK); 136 } else if (type.equals("light_vessel")) { 137 mark = new MarkLight(this); 138 mark.setObject(Obj.LITVES); 139 } else if (type.equals("light_major")) { 140 mark = new MarkLight(this); 141 mark.setObject(Obj.LITMAJ); 142 } else if (type.equals("light_minor")) { 143 mark = new MarkLight(this); 144 mark.setObject(Obj.LITMIN); 136 145 } else if (type.equals("light_float")) { 137 146 if (keys.containsKey("seamark:light_float:colour")) { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r24904 r24917 16 16 import oseam.panels.PanelStbd; 17 17 import oseam.panels.PanelSaw; 18 import oseam.seamarks.SeaMark;19 18 import oseam.seamarks.SeaMark.Cat; 20 19 import oseam.seamarks.SeaMark.Col; 21 20 import oseam.seamarks.SeaMark.Ent; 22 21 import oseam.seamarks.SeaMark.Shp; 22 import oseam.seamarks.SeaMark.Reg; 23 23 import oseam.seamarks.MarkLat; 24 24 import oseam.seamarks.MarkSaw; … … 55 55 dlg.panelMain.panelTop.canTopButton.setEnabled(true); 56 56 dlg.panelMain.panelTop.panelCol.enableAll(false); 57 if (dlg.mark.getRegion() == SeaMark.IALA_A) {57 if (dlg.mark.getRegion() == Reg.A) { 58 58 dlg.panelMain.panelTop.panelCol.redButton.setEnabled(true); 59 59 dlg.panelMain.panelTop.panelCol.redButton.doClick(); … … 71 71 dlg.mark.setShape(Shp.UNKNOWN); 72 72 } 73 if (dlg.mark.getRegion() == SeaMark.IALA_A) {73 if (dlg.mark.getRegion() == Reg.A) { 74 74 dlg.mark.setColour(Ent.BODY, Col.RED); 75 75 panelPort.regionAButton.doClick(); … … 93 93 dlg.mark.setShape(Shp.UNKNOWN); 94 94 } 95 if (dlg.mark.getRegion() == SeaMark.IALA_A) {95 if (dlg.mark.getRegion() == Reg.A) { 96 96 dlg.mark.setColour(Ent.BODY, Col.RED_GREEN_RED); 97 97 panelPort.regionAButton.doClick(); … … 120 120 dlg.panelMain.panelTop.coneTopButton.setEnabled(true); 121 121 dlg.panelMain.panelTop.panelCol.enableAll(false); 122 if (dlg.mark.getRegion() == SeaMark.IALA_A) {122 if (dlg.mark.getRegion() == Reg.A) { 123 123 dlg.panelMain.panelTop.panelCol.greenButton.setEnabled(true); 124 124 dlg.panelMain.panelTop.panelCol.greenButton.doClick(); … … 136 136 dlg.mark.setShape(Shp.UNKNOWN); 137 137 } 138 if (dlg.mark.getRegion() == SeaMark.IALA_A) {138 if (dlg.mark.getRegion() == Reg.A) { 139 139 dlg.mark.setColour(Ent.BODY, Col.GREEN); 140 140 panelStbd.regionAButton.doClick(); … … 158 158 dlg.mark.setShape(Shp.UNKNOWN); 159 159 } 160 if (dlg.mark.getRegion() == SeaMark.IALA_A) {160 if (dlg.mark.getRegion() == Reg.A) { 161 161 dlg.mark.setColour(Ent.BODY, Col.GREEN_RED_GREEN); 162 162 panelStbd.regionAButton.doClick(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r24885 r24917 52 52 this.setLayout(null); 53 53 this.add(getCatButton(houseButton, 0, 0, 34, 32, "LighthouseTip", Cat.LIGHT_HOUSE, Obj.LNDMRK), null); 54 this.add(getCatButton(majorButton, 0, 32, 34, 32, "MajorLightTip", Cat.LIGHT_MAJOR, Obj.LI GHTS), null);55 this.add(getCatButton(minorButton, 0, 64, 34, 32, "MinorLightTip", Cat.LIGHT_MINOR, Obj.LI GHTS), null);54 this.add(getCatButton(majorButton, 0, 32, 34, 32, "MajorLightTip", Cat.LIGHT_MAJOR, Obj.LITMAJ), null); 55 this.add(getCatButton(minorButton, 0, 64, 34, 32, "MinorLightTip", Cat.LIGHT_MINOR, Obj.LITMIN), null); 56 56 this.add(getCatButton(vesselButton, 0, 96, 34, 32, "LightVesselTip", Cat.LIGHT_VESSEL, Obj.LITVES), null); 57 57 this.add(getCatButton(floatButton, 0, 128, 34, 32, "LightFloatTip", Cat.LIGHT_FLOAT, Obj.LITFLT), null); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r24904 r24917 17 17 import oseam.seamarks.SeaMark.Col; 18 18 import oseam.seamarks.SeaMark.Top; 19 import oseam.seamarks.SeaMark.Day; 19 20 import oseam.seamarks.SeaMark.Ent; 20 21 … … 41 42 public JRadioButton mooringTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/MooringTopButton.png"))); 42 43 private EnumMap<Top, JRadioButton> tops = new EnumMap<Top, JRadioButton>(Top.class); 44 private EnumMap<Day, JRadioButton> days = new EnumMap<Day, JRadioButton>(Day.class); 43 45 private ActionListener alTop = new ActionListener() { 44 46 public void actionPerformed(java.awt.event.ActionEvent e) { … … 49 51 if (button.isSelected()) { 50 52 dlg.mark.setTopmark(top); 53 dlg.mark.setDaymark(Day.NONE); 51 54 button.setBorderPainted(true); 52 55 } else 53 56 button.setBorderPainted(false); 54 57 } 58 Iterator<Day> id = days.keySet().iterator(); 59 while (id.hasNext()) { 60 Day day = id.next(); 61 JRadioButton button = days.get(day); 62 if (button.isSelected()) { 63 dlg.mark.setDaymark(day); 64 dlg.mark.setTopmark(Top.NONE); 65 button.setBorderPainted(true); 66 } else 67 button.setBorderPainted(false); 68 } 69 mooringTopButton.setBorderPainted(mooringTopButton.isSelected()); 55 70 } 56 71 }; … … 72 87 this.add(getTopButton(westTopButton, 130, 35, 27, 27, "WestTopTip", Top.WEST), null); 73 88 this.add(getTopButton(spheres2TopButton, 160, 35, 27, 27, "Spheres2TopTip", Top.SPHERES2), null); 74 this.add(get TopButton(boardDayButton, 40, 65, 27, 27, "BoardDayTip", Top.BOARD), null);75 this.add(get TopButton(diamondDayButton, 70, 65, 27, 27, "DiamondDayTip", Top.DIAMOND), null);76 this.add(get TopButton(triangleDayButton, 100, 65, 27, 27, "TriangleDayTip", Top.TRIANGLE), null);77 this.add(get TopButton(triangleInvDayButton, 130, 65, 27, 27, "TriangleInvDayTip", Top.TRIANGLE_INV), null);78 this.add(get TopButton(squareDayButton, 160, 65, 27, 27, "SquareDayTip", Top.SQUARE), null);79 this.add(get TopButton(mooringTopButton, 40, 95, 27, 27, "MooringTopTip", Top.MOORING), null);89 this.add(getDayButton(boardDayButton, 40, 65, 27, 27, "BoardDayTip", Day.BOARD), null); 90 this.add(getDayButton(diamondDayButton, 70, 65, 27, 27, "DiamondDayTip", Day.DIAMOND), null); 91 this.add(getDayButton(triangleDayButton, 100, 65, 27, 27, "TriangleDayTip", Day.TRIANGLE), null); 92 this.add(getDayButton(triangleInvDayButton, 130, 65, 27, 27, "TriangleInvDayTip", Day.TRIANGLE_INV), null); 93 this.add(getDayButton(squareDayButton, 160, 65, 27, 27, "SquareDayTip", Day.SQUARE), null); 94 this.add(getMoorButton(mooringTopButton, 40, 95, 27, 27, "MooringTopTip"), null); 80 95 } 81 96 … … 94 109 95 110 private JRadioButton getTopButton(JRadioButton button, int x, int y, int w, int h, String tip, Top top) { 96 button.setBounds(new Rectangle(x, y, w, h)); 97 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 98 button.setToolTipText(Messages.getString(tip)); 99 button.addActionListener(alTop); 100 topButtons.add(button); 101 tops.put(top, button); 102 return button; 103 } 111 button.setBounds(new Rectangle(x, y, w, h)); 112 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 113 button.setToolTipText(Messages.getString(tip)); 114 button.addActionListener(alTop); 115 topButtons.add(button); 116 tops.put(top, button); 117 return button; 118 } 119 120 private JRadioButton getDayButton(JRadioButton button, int x, int y, int w, int h, String tip, Day day) { 121 button.setBounds(new Rectangle(x, y, w, h)); 122 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 123 button.setToolTipText(Messages.getString(tip)); 124 button.addActionListener(alTop); 125 topButtons.add(button); 126 days.put(day, button); 127 return button; 128 } 129 130 private JRadioButton getMoorButton(JRadioButton button, int x, int y, int w, int h, String tip) { 131 button.setBounds(new Rectangle(x, y, w, h)); 132 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 133 button.setToolTipText(Messages.getString(tip)); 134 button.addActionListener(alTop); 135 topButtons.add(button); 136 return button; 137 } 104 138 105 139 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkCard.java
r24904 r24917 93 93 } 94 94 95 public void paintSign() {96 String image = "/images/Cardinal";97 switch (getShape()) {98 case PILLAR:99 image += "_Pillar";100 break;101 case SPAR:102 image += "_Spar";103 break;104 case BEACON:105 image += "_Beacon";106 break;107 case TOWER:108 image += "_Tower";109 break;110 case FLOAT:111 image += "_Float";112 break;113 default:114 dlg.panelMain.shapeIcon.setIcon(null);115 return;116 }117 switch (getCategory()) {118 case CARD_NORTH:119 image += "_North";120 break;121 case CARD_EAST:122 image += "_East";123 break;124 case CARD_SOUTH:125 image += "_South";126 break;127 case CARD_WEST:128 image += "_West";129 break;130 default:131 dlg.panelMain.shapeIcon.setIcon(null);132 return;133 }134 image += ".png";135 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image)));136 137 super.paintSign();138 }139 95 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java
r24904 r24917 62 62 } 63 63 64 public void paintSign() {65 String image = "/images/Cardinal";66 67 switch (getShape()) {68 case PILLAR:69 image += "_Pillar_Single";70 break;71 case SPAR:72 image += "_Spar_Single";73 break;74 case BEACON:75 image += "_Beacon_Single";76 break;77 case TOWER:78 image += "_Tower_Single";79 break;80 case FLOAT:81 image += "_Float_Single";82 break;83 default:84 dlg.panelMain.shapeIcon.setIcon(null);85 return;86 }87 image += ".png";88 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image)));89 90 super.paintSign();91 }92 64 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java
r24904 r24917 77 77 dlg.panelMain.panelChan.panelPort.regionBButton.doClick(); 78 78 } else { 79 if (getRegion() == IALA_A)79 if (getRegion() == Reg.A) 80 80 dlg.panelMain.panelChan.portButton.doClick(); 81 81 else … … 91 91 dlg.panelMain.panelChan.panelPort.regionBButton.doClick(); 92 92 } else { 93 if (getRegion() == IALA_A)93 if (getRegion() == Reg.A) 94 94 dlg.panelMain.panelChan.stbdButton.doClick(); 95 95 else … … 105 105 dlg.panelMain.panelChan.panelPort.regionBButton.doClick(); 106 106 } else { 107 if (getRegion() == IALA_A)107 if (getRegion() == Reg.A) 108 108 dlg.panelMain.panelChan.prefPortButton.doClick(); 109 109 else … … 119 119 dlg.panelMain.panelChan.panelPort.regionBButton.doClick(); 120 120 } else { 121 if (getRegion() == IALA_A)121 if (getRegion() == Reg.A) 122 122 dlg.panelMain.panelChan.prefStbdButton.doClick(); 123 123 else … … 211 211 } 212 212 213 public void paintSign() {214 boolean region = getRegion();215 Shp style = getShape();216 217 String image = "/images/Lateral";218 219 switch (getCategory()) {220 case LAT_PORT:221 if (region == IALA_A)222 switch (style) {223 case CAN:224 image += "_Can_Red";225 break;226 case PILLAR:227 image += "_Pillar_Red";228 break;229 case SPAR:230 image += "_Spar_Red";231 break;232 case BEACON:233 image += "_Beacon_Red";234 break;235 case TOWER:236 image += "_Tower_Red";237 break;238 case FLOAT:239 image += "_Float_Red";240 break;241 case PERCH:242 image += "_Perch_Port";243 break;244 default:245 dlg.panelMain.shapeIcon.setIcon(null);246 return;247 }248 else249 switch (style) {250 case CAN:251 image += "_Can_Green";252 break;253 case PILLAR:254 image += "_Pillar_Green";255 break;256 case SPAR:257 image += "_Spar_Green";258 break;259 case BEACON:260 image += "_Beacon_Green";261 break;262 case TOWER:263 image += "_Tower_Green";264 break;265 case FLOAT:266 image += "_Float_Green";267 break;268 case PERCH:269 image += "_Perch_Port";270 break;271 default:272 dlg.panelMain.shapeIcon.setIcon(null);273 return;274 }275 break;276 277 case LAT_STBD:278 if (region == IALA_A)279 switch (style) {280 case CONE:281 image += "_Cone_Green";282 break;283 case PILLAR:284 image += "_Pillar_Green";285 break;286 case SPAR:287 image += "_Spar_Green";288 break;289 case BEACON:290 image += "_Beacon_Green";291 break;292 case TOWER:293 image += "_Tower_Green";294 break;295 case FLOAT:296 image += "_Float_Green";297 break;298 case PERCH:299 image += "_Perch_Starboard";300 break;301 default:302 dlg.panelMain.shapeIcon.setIcon(null);303 return;304 }305 else306 switch (style) {307 case CONE:308 image += "_Cone_Red";309 break;310 case PILLAR:311 image += "_Pillar_Red";312 break;313 case SPAR:314 image += "_Spar_Red";315 break;316 case BEACON:317 image += "_Beacon_Red";318 break;319 case TOWER:320 image += "_Tower_Red";321 break;322 case FLOAT:323 image += "_Float_Red";324 break;325 case PERCH:326 image += "_Perch_Starboard";327 break;328 default:329 dlg.panelMain.shapeIcon.setIcon(null);330 return;331 }332 break;333 334 case LAT_PREF_PORT:335 if (region == IALA_A)336 switch (style) {337 case CAN:338 image += "_Can_Red_Green_Red";339 break;340 case PILLAR:341 image += "_Pillar_Red_Green_Red";342 break;343 case SPAR:344 image += "_Spar_Red_Green_Red";345 break;346 case BEACON:347 image += "_Beacon_Red_Green_Red";348 break;349 case TOWER:350 image += "_Tower_Red_Green_Red";351 break;352 case FLOAT:353 image += "_Float_Red_Green_Red";354 break;355 default:356 dlg.panelMain.shapeIcon.setIcon(null);357 return;358 }359 else360 switch (style) {361 case CAN:362 image += "_Can_Green_Red_Green";363 break;364 case PILLAR:365 image += "_Pillar_Green_Red_Green";366 break;367 case SPAR:368 image += "_Spar_Green_Red_Green";369 break;370 case BEACON:371 image += "_Beacon_Green_Red_Green";372 break;373 case TOWER:374 image += "_Tower_Green_Red_Green";375 break;376 case FLOAT:377 image += "_Float_Green_Red_Green";378 break;379 default:380 dlg.panelMain.shapeIcon.setIcon(null);381 return;382 }383 break;384 385 case LAT_PREF_STBD:386 if (region == IALA_A)387 switch (style) {388 case CONE:389 image += "_Cone_Green_Red_Green";390 break;391 case PILLAR:392 image += "_Pillar_Green_Red_Green";393 break;394 case SPAR:395 image += "_Spar_Green_Red_Green";396 break;397 case BEACON:398 image += "_Beacon_Green_Red_Green";399 break;400 case TOWER:401 image += "_Tower_Green_Red_Green";402 break;403 case FLOAT:404 image += "_Float_Green_Red_Green";405 break;406 default:407 dlg.panelMain.shapeIcon.setIcon(null);408 return;409 }410 else411 switch (style) {412 case CONE:413 image += "_Cone_Red_Green_Red";414 break;415 case PILLAR:416 image += "_Pillar_Red_Green_Red";417 break;418 case SPAR:419 image += "_Spar_Red_Green_Red";420 break;421 case BEACON:422 image += "_Beacon_Red_Green_Red";423 break;424 case TOWER:425 image += "_Tower_Red_Green_Red";426 break;427 case FLOAT:428 image += "_Float_Red_Green_Red";429 break;430 default:431 dlg.panelMain.shapeIcon.setIcon(null);432 return;433 }434 break;435 default:436 dlg.panelMain.shapeIcon.setIcon(null);437 return;438 }439 image += ".png";440 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image)));441 442 super.paintSign();443 }444 213 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java
r24904 r24917 55 55 } 56 56 57 public void paintSign() {58 switch (getCategory()) {59 case LIGHT_HOUSE:60 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_House.png")));61 break;62 63 case LIGHT_MAJOR:64 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Major.png")));65 break;66 67 case LIGHT_MINOR:68 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Minor.png")));69 break;70 71 case LIGHT_VESSEL:72 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Float_Major.png")));73 break;74 75 case LIGHT_FLOAT:76 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Float_Minor.png")));77 break;78 }79 super.paintSign();80 }81 82 57 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java
r24904 r24917 55 55 } 56 56 57 public void paintSign() {58 59 String image = "/images/Safe_Water";60 61 switch (getShape()) {62 case PILLAR:63 image += "_Pillar";64 break;65 case SPAR:66 image += "_Spar";67 break;68 case SPHERE:69 image += "_Sphere";70 break;71 case BEACON:72 image += "_Beacon";73 break;74 case FLOAT:75 image += "_Float";76 break;77 default:78 dlg.panelMain.shapeIcon.setIcon(null);79 return;80 }81 image += ".png";82 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image)));83 84 super.paintSign();85 }86 57 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java
r24904 r24917 83 83 } 84 84 85 public void paintSign() {86 87 String image = "/images/Special_Purpose";88 89 switch (getShape()) {90 case PILLAR:91 image += "_Pillar";92 break;93 case CAN:94 image += "_Can";95 break;96 case CONE:97 image += "_Cone";98 break;99 case SPAR:100 image += "_Spar";101 break;102 case SPHERE:103 image += "_Sphere";104 break;105 case BARREL:106 image += "_Barrel";107 break;108 case FLOAT:109 image += "_Float";110 break;111 case BEACON:112 image += "_Beacon";113 break;114 case TOWER:115 image += "_Tower";116 break;117 default:118 dlg.panelMain.shapeIcon.setIcon(null);119 return;120 }121 image += ".png";122 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image)));123 124 super.paintSign();125 }126 85 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r24904 r24917 2 2 3 3 import javax.swing.ImageIcon; 4 4 import javax.swing.JRadioButton; 5 6 import java.util.EnumMap; 5 7 import java.util.Iterator; 6 8 import java.util.Map; … … 15 17 abstract public class SeaMark { 16 18 17 /**18 * Variables19 */20 21 19 protected OSeaMAction dlg = null; 22 20 … … 27 25 protected SeaMark(OSeaMAction dia) { 28 26 dlg = dia; 29 region = Main.pref.get("tomsplugin.IALA").equals("B"); 30 } 31 32 public final static boolean IALA_A = false; 33 public final static boolean IALA_B = true; 34 35 private boolean region = false; 36 37 public boolean getRegion() { 27 region = Main.pref.get("tomsplugin.IALA").equals("A") ? Reg.A : Reg.B; 28 } 29 30 public enum Reg { 31 A, B 32 } 33 34 private Reg region = Reg.A; 35 36 public Reg getRegion() { 38 37 return region; 39 38 } 40 39 41 public void setRegion( booleanreg) {40 public void setRegion(Reg reg) { 42 41 region = reg; 43 42 } … … 54 53 55 54 public enum Obj { 56 UNKNOWN, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP, BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, LIGHTS, LITFLT, LITVES, LNDMRK, MORFAC 55 UNKNOWN, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP, BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, LITMAJ, LITMIN, LITFLT, LITVES, LNDMRK, MORFAC 56 } 57 58 public static final EnumMap<Obj, String> objects = new EnumMap<Obj, String>(Obj.class); 59 static { 60 objects.put(Obj.BCNCAR, "beacon_cardinal"); 61 objects.put(Obj.BCNISD, "beacon_isolated_danger"); 62 objects.put(Obj.BCNLAT, "beacon_lateral"); 63 objects.put(Obj.BCNSAW, "beacon_safe_water"); 64 objects.put(Obj.BCNSPP, "beacon_special_purpose"); 65 objects.put(Obj.BOYCAR, "buoy_cardinal"); 66 objects.put(Obj.BOYISD, "buoy_isolated_danger"); 67 objects.put(Obj.BOYLAT, "buoy_lateral"); 68 objects.put(Obj.BOYSAW, "buoy_safe_water"); 69 objects.put(Obj.BOYSPP, "buoy_special_purpose"); 70 objects.put(Obj.LITMAJ, "light_major"); 71 objects.put(Obj.LITMIN, "light_minor"); 72 objects.put(Obj.LITFLT, "light_float"); 73 objects.put(Obj.LITVES, "light_vessel"); 74 objects.put(Obj.LNDMRK, "landmark"); 75 objects.put(Obj.MORFAC, "mooring"); 76 57 77 } 58 78 … … 68 88 69 89 public enum Ent { 70 BODY, BUOY, BEACON, FLOAT, TOPMARK, LIGHT90 BODY, BUOY, BEACON, FLOAT, TOPMARK, DAYMARK, LIGHT 71 91 } 72 92 73 93 public enum Col { 74 94 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 95 } 96 97 public static final EnumMap<Col, String> colours = new EnumMap<Col, String>(Col.class); 98 static { 99 colours.put(Col.WHITE, "white"); 100 colours.put(Col.RED, "red"); 101 colours.put(Col.ORANGE, "orange"); 102 colours.put(Col.AMBER, "amber"); 103 colours.put(Col.YELLOW, "yellow"); 104 colours.put(Col.GREEN, "green"); 105 colours.put(Col.BLUE, "blue"); 106 colours.put(Col.VIOLET, "violet"); 107 colours.put(Col.BLACK, "black"); 108 colours.put(Col.RED_GREEN_RED, "red;green;red"); 109 colours.put(Col.GREEN_RED_GREEN, "green;red;green"); 110 colours.put(Col.RED_WHITE, "red;white"); 111 colours.put(Col.BLACK_YELLOW, "black;yellow"); 112 colours.put(Col.BLACK_YELLOW_BLACK, "black;yellow;black"); 113 colours.put(Col.YELLOW_BLACK, "yellow;black"); 114 colours.put(Col.YELLOW_BLACK_YELLOW, "yellow;black;yellow"); 115 colours.put(Col.BLACK_RED_BLACK, "black;red;black"); 75 116 } 76 117 … … 86 127 case TOPMARK: 87 128 return topColour; 129 case DAYMARK: 130 return dayColour; 88 131 case LIGHT: 89 132 return lightColour[sectorIndex]; … … 103 146 topColour = col; 104 147 break; 148 case DAYMARK: 149 dayColour = col; 150 break; 105 151 case LIGHT: 106 152 lightColour[sectorIndex] = col; … … 113 159 } 114 160 161 public static final EnumMap<Cat, String> categories = new EnumMap<Cat, String>(Cat.class); 162 static { 163 categories.put(Cat.LAT_PORT, "port"); 164 categories.put(Cat.LAT_STBD, "starboard"); 165 categories.put(Cat.LAT_PREF_PORT, "preferred_channel_port"); 166 categories.put(Cat.LAT_PREF_STBD, "preferred_channel_starboard"); 167 categories.put(Cat.CARD_NORTH, "north"); 168 categories.put(Cat.CARD_EAST, "east"); 169 categories.put(Cat.CARD_SOUTH, "south"); 170 categories.put(Cat.CARD_WEST, "west"); 171 categories.put(Cat.MOORING_BUOY, "mooring_buoy"); 172 } 173 115 174 private Cat category = Cat.UNKNOWN; 116 175 … … 127 186 } 128 187 188 public static final EnumMap<Shp, String> shapes = new EnumMap<Shp, String>(Shp.class); 189 static { 190 shapes.put(Shp.PILLAR, "pillar"); 191 shapes.put(Shp.SPAR, "spar"); 192 shapes.put(Shp.CAN, "can"); 193 shapes.put(Shp.CONE, "conical"); 194 shapes.put(Shp.SPHERE, "sphere"); 195 shapes.put(Shp.BARREL, "barrel"); 196 shapes.put(Shp.FLOAT, "float"); 197 shapes.put(Shp.SUPER, "super-buoy"); 198 shapes.put(Shp.BEACON, "beacon"); 199 shapes.put(Shp.TOWER, "tower"); 200 shapes.put(Shp.STAKE, "stake"); 201 shapes.put(Shp.PERCH, "perch"); 202 } 203 129 204 private Shp shape = Shp.UNKNOWN; 130 205 … … 138 213 139 214 public enum Top { 140 NONE, CAN, CONE, SPHERE, X_SHAPE, NORTH, SOUTH, EAST, WEST, SPHERES2, BOARD, DIAMOND, TRIANGLE, TRIANGLE_INV, SQUARE, MOORING 215 NONE, CAN, CONE, SPHERE, X_SHAPE, NORTH, SOUTH, EAST, WEST, SPHERES2 216 } 217 218 public static final EnumMap<Top, String> tops = new EnumMap<Top, String>(Top.class); 219 static { 220 tops.put(Top.CAN, "cylinder"); 221 tops.put(Top.CONE, "cylinder"); 222 tops.put(Top.SPHERE, "SPHERE"); 223 tops.put(Top.X_SHAPE, "X-SHAPE"); 224 tops.put(Top.NORTH, "2 cones up"); 225 tops.put(Top.SOUTH, "2 cones down"); 226 tops.put(Top.EAST, "2 cones base together"); 227 tops.put(Top.WEST, "2 cones points together"); 228 tops.put(Top.SPHERES2, "2 spheres"); 141 229 } 142 230 … … 154 242 public void setTopmark(Top top) { 155 243 topShape = top; 244 } 245 246 public enum Day { 247 NONE, BOARD, DIAMOND, TRIANGLE, TRIANGLE_INV, SQUARE 248 } 249 250 public static final EnumMap<Day, String> days = new EnumMap<Day, String>(Day.class); 251 static { 252 days.put(Day.BOARD, "board"); 253 days.put(Day.DIAMOND, "diamond"); 254 days.put(Day.TRIANGLE, "triangle, point up"); 255 days.put(Day.TRIANGLE_INV, "triangle, point down"); 256 days.put(Day.SQUARE, "square"); 257 } 258 259 private Day dayShape = Day.NONE; 260 private Col dayColour = Col.UNKNOWN; 261 262 public boolean hasDaymark() { 263 return (dayShape != Day.NONE); 264 } 265 266 public Day getDaymark() { 267 return dayShape; 268 } 269 270 public void setDaymark(Day day) { 271 dayShape = day; 156 272 } 157 273 … … 441 557 Map<String, String> keys; 442 558 keys = dlg.node.getKeys(); 559 560 if (keys.containsKey("seamark:topmark:shape")) { 561 str = keys.get("seamark:topmark:shape"); 562 } 443 563 444 564 setFired(false); … … 550 670 public void paintSign() { 551 671 672 String imgStr = "/images/"; 673 String shpStr = shapes.get(shape); 674 if (shpStr == null) 675 dlg.panelMain.topIcon.setIcon(null); 676 else { 677 imgStr += shpStr; 678 if (shpStr.equals("perch")) { 679 imgStr += (getCategory() == Cat.LAT_PORT ? "_port" : "_stbd"); 680 } else { 681 String colStr = colours.get(bodyColour); 682 if (colStr != null) 683 imgStr += ("_" + colStr); 684 } 685 imgStr += ".png"; 686 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(imgStr))); 687 } 688 552 689 if (hasRadar()) { 553 690 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png"))); 554 } 691 } else if (hasRacon()) { 555 692 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Station.png"))); 556 //if (getRaType() != 0) {557 //String c = (String) dlg.cbM01Racon.getSelectedItem();558 //if ((getRaType() == RATYPE_RACON) && !getRaconGroup().isEmpty())559 //c += ("(" + getRaconGroup() + ")");560 //dlg.lM01RadarMarkeys.setText(c);561 //}693 // if (getRaType() != 0) { 694 // String c = (String) dlg.cbM01Racon.getSelectedItem(); 695 // if ((getRaType() == RATYPE_RACON) && !getRaconGroup().isEmpty()) 696 // c += ("(" + getRaconGroup() + ")"); 697 // dlg.lM01RadarMarkeys.setText(c); 698 // } 562 699 } 563 700 564 701 if (hasFog()) { 565 702 dlg.panelMain.fogIcon.setIcon(new ImageIcon(getClass().getResource("/images/Fog_Signal.png"))); 566 //if (getFogSound() != 0) {567 //String c = (String) dlg.cbM01Fog.getSelectedItem();568 //if (!getFogGroup().isEmpty())569 //c += ("(" + getFogGroup() + ")");570 //if (!getFogPeriod().isEmpty())571 //c += (" " + getFogPeriod() + "s");572 //dlg.lM01FogMarkeys.setText(c);573 //}703 // if (getFogSound() != 0) { 704 // String c = (String) dlg.cbM01Fog.getSelectedItem(); 705 // if (!getFogGroup().isEmpty()) 706 // c += ("(" + getFogGroup() + ")"); 707 // if (!getFogPeriod().isEmpty()) 708 // c += (" " + getFogPeriod() + "s"); 709 // dlg.lM01FogMarkeys.setText(c); 710 // } 574 711 } 575 712 … … 590 727 } 591 728 592 /* c = getLightChar(); 593 if (c.contains("+")) { 594 i1 = c.indexOf("+"); 595 tmp = c.substring(i1, c.length()); 596 c = c.substring(0, i1); 597 if (!getLightGroup().isEmpty()) { 598 c = c + "(" + getLightGroup() + ")"; 599 } 600 if (tmp != null) 601 c = c + tmp; 602 } else if (!getLightGroup().isEmpty()) 603 c = c + "(" + getLightGroup() + ")"; 604 c = c + " " + getLightColour(); 605 lp = getLightPeriod(); 606 if (!lp.isEmpty()) 607 c = c + " " + lp + "s"; 608 */ } 729 /* 730 * c = getLightChar(); if (c.contains("+")) { i1 = c.indexOf("+"); tmp = 731 * c.substring(i1, c.length()); c = c.substring(0, i1); if 732 * (!getLightGroup().isEmpty()) { c = c + "(" + getLightGroup() + ")"; } 733 * if (tmp != null) c = c + tmp; } else if (!getLightGroup().isEmpty()) c 734 * = c + "(" + getLightGroup() + ")"; c = c + " " + getLightColour(); lp = 735 * getLightPeriod(); if (!lp.isEmpty()) c = c + " " + lp + "s"; 736 */} 609 737 } 610 738 … … 613 741 String str; 614 742 615 Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A");743 Main.pref.put("tomsplugin.IALA", getRegion() == Reg.A ? "A" : "B"); 616 744 617 745 while (it.hasNext()) { … … 625 753 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:name", name)); 626 754 627 String objStr = ""; 628 switch (object) { 629 case BCNCAR: 630 objStr = "beacon_cardinal"; 631 break; 632 case BCNISD: 633 objStr = "beacon_isolated_danger"; 634 break; 635 case BCNLAT: 636 objStr = "beacon_lateral"; 637 break; 638 case BCNSAW: 639 objStr = "beacon_safe_water"; 640 break; 641 case BCNSPP: 642 objStr = "beacon_special_purpose"; 643 break; 644 case BOYCAR: 645 objStr = "buoy_cardinal"; 646 break; 647 case BOYISD: 648 objStr = "buoy_isolated_danger"; 649 break; 650 case BOYLAT: 651 objStr = "buoy_lateral"; 652 break; 653 case BOYSAW: 654 objStr = "buoy_safe_water"; 655 break; 656 case BOYSPP: 657 objStr = "buoy_special_purpose"; 658 break; 659 case LIGHTS: 660 if (category == Cat.LIGHT_MAJOR) 661 objStr = "light_major"; 662 else 663 objStr = "light_minor"; 664 break; 665 case LITFLT: 666 objStr = "light_float"; 667 break; 668 case LITVES: 669 objStr = "light_vessel"; 670 break; 671 case LNDMRK: 672 objStr = "landmark"; 673 break; 674 case MORFAC: 675 objStr = "mooring"; 676 break; 677 } 678 if (!objStr.isEmpty()) { 755 String objStr = objects.get(object); 756 if (objStr != null) { 679 757 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", objStr)); 680 758 681 switch (category) { 682 case LAT_PORT: 683 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "port")); 684 break; 685 case LAT_STBD: 686 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "starboard")); 687 break; 688 case LAT_PREF_PORT: 689 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "preferred_channel_port")); 690 break; 691 case LAT_PREF_STBD: 692 Main.main.undoRedo 693 .add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "preferred_channel_starboard")); 694 break; 695 case CARD_NORTH: 696 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "north")); 697 break; 698 case CARD_EAST: 699 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "east")); 700 break; 701 case CARD_SOUTH: 702 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "south")); 703 break; 704 case CARD_WEST: 705 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "west")); 706 break; 707 case MOORING_BUOY: 708 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "mooring_buoy")); 759 str = categories.get(category); 760 if (str != null) 761 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", str)); 762 763 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", shapes.get(shape))); 764 765 str = colours.get(bodyColour); 766 if (str != null) 767 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", str)); 768 769 switch (bodyColour) { 770 case RED_GREEN_RED: 771 case GREEN_RED_GREEN: 772 case BLACK_YELLOW: 773 case BLACK_YELLOW_BLACK: 774 case YELLOW_BLACK: 775 case YELLOW_BLACK_YELLOW: 776 case BLACK_RED_BLACK: 777 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 778 break; 779 case RED_WHITE: 780 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "vertical stripes")); 709 781 break; 710 782 } 711 712 switch (shape) { 713 case PILLAR: 714 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "pillar")); 715 break; 716 case SPAR: 717 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "spar")); 718 break; 719 case CAN: 720 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "can")); 721 break; 722 case CONE: 723 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "conical")); 724 break; 725 case SPHERE: 726 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "sphere")); 727 break; 728 case BARREL: 729 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "barrel")); 730 break; 731 case SUPER: 732 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "super-buoy")); 733 break; 734 case TOWER: 735 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "tower")); 736 break; 737 case STAKE: 738 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "stake")); 739 break; 740 case PERCH: 741 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":shape", "perch")); 742 break; 743 } 744 745 switch (bodyColour) { 746 case WHITE: 747 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "white")); 748 break; 749 case RED: 750 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "red")); 751 break; 752 case ORANGE: 753 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "orange")); 754 break; 755 case AMBER: 756 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "amber")); 757 break; 758 case YELLOW: 759 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "yellow")); 760 break; 761 case GREEN: 762 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "green")); 763 break; 764 case BLUE: 765 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "blue")); 766 break; 767 case VIOLET: 768 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "violet")); 769 break; 770 case BLACK: 771 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "black")); 772 break; 773 case RED_GREEN_RED: 774 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "red;green;red")); 775 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 776 break; 777 case GREEN_RED_GREEN: 778 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "green;red;green")); 779 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 780 break; 781 case RED_WHITE: 782 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "red;white")); 783 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "vertical stripes")); 784 break; 785 case BLACK_YELLOW: 786 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "black;yellow")); 787 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 788 break; 789 case BLACK_YELLOW_BLACK: 790 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "black;yellow;black")); 791 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 792 break; 793 case YELLOW_BLACK: 794 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "yellow;black")); 795 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 796 break; 797 case YELLOW_BLACK_YELLOW: 798 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "yellow;black;yellow")); 799 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 800 break; 801 case BLACK_RED_BLACK: 802 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "black;red;black")); 803 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes")); 804 break; 805 } 806 } 807 808 String top = ""; 809 switch (topShape) { 810 case CAN: 811 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "cylinder")); 812 top = "top"; 813 break; 814 case CONE: 815 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "cone, point up")); 816 top = "top"; 817 break; 818 case SPHERE: 819 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "sphere")); 820 top = "top"; 821 break; 822 case X_SHAPE: 823 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "x-shape")); 824 top = "top"; 825 break; 826 case NORTH: 827 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 cones up")); 828 top = "top"; 829 break; 830 case SOUTH: 831 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 cones down")); 832 top = "top"; 833 break; 834 case EAST: 835 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 cones base together")); 836 top = "top"; 837 break; 838 case WEST: 839 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 cones points together")); 840 top = "top"; 841 break; 842 case SPHERES2: 843 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 spheres")); 844 top = "top"; 845 break; 846 case BOARD: 847 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:daymark:shape", "board")); 848 top = "day"; 849 break; 850 case DIAMOND: 851 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:daymark:shape", "diamond")); 852 top = "day"; 853 break; 854 case TRIANGLE: 855 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:daymark:shape", "triangle, point up")); 856 top = "day"; 857 break; 858 case TRIANGLE_INV: 859 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:daymark:shape", "triangle, point down")); 860 top = "day"; 861 break; 862 case SQUARE: 863 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:daymark:shape", "square")); 864 top = "day"; 865 break; 866 } 867 if (!top.isEmpty()) { 868 switch (topColour) { 869 case WHITE: 870 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "white")); 871 break; 872 case RED: 873 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "red")); 874 break; 875 case ORANGE: 876 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "orange")); 877 break; 878 case AMBER: 879 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "amber")); 880 break; 881 case YELLOW: 882 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "yellow")); 883 break; 884 case GREEN: 885 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "green")); 886 break; 887 case BLUE: 888 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "blue")); 889 break; 890 case VIOLET: 891 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "violet")); 892 break; 893 case BLACK: 894 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + top + "mark:colour", "black")); 895 break; 896 } 783 } 784 785 str = tops.get(topShape); 786 if (str != null) { 787 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", str)); 788 789 str = colours.get(topColour); 790 if (str != null) 791 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", str)); 792 } 793 794 str = days.get(dayShape); 795 if (str != null) { 796 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:daymark:shape", str)); 797 798 str = colours.get(dayColour); 799 if (str != null) 800 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:daymark:colour", str)); 897 801 } 898 802
Note:
See TracChangeset
for help on using the changeset viewer.