Changeset 24823 in osm for applications/editors
- Timestamp:
- 2010-12-20T16:28:04+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/OSeaM.java
r24799 r24823 29 29 @Override 30 30 public boolean stop() { 31 DataSet.removeSelectionListener(oseam.SmpListener);31 // DataSet.removeSelectionListener(oseam.SmpListener); 32 32 return true; 33 33 } … … 35 35 @Override 36 36 public boolean hasFocus() { 37 DataSet.addSelectionListener(oseam.SmpListener);37 // DataSet.addSelectionListener(oseam.SmpListener); 38 38 return true; 39 39 } … … 41 41 @Override 42 42 public boolean lostFocus() { 43 DataSet.removeSelectionListener(oseam.SmpListener);43 // DataSet.removeSelectionListener(oseam.SmpListener); 44 44 return true; 45 45 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
r24808 r24823 39 39 40 40 public SelectionChangedListener SmpListener = new SelectionChangedListener() { 41 public void selectionChanged( 42 Collection<? extends OsmPrimitive> newSelection) { 43 Node node; 41 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 42 Node node = null; 44 43 Selection = newSelection; 45 44 45 //System.out.println(newSelection); 46 46 for (OsmPrimitive osm : Selection) { 47 47 if (osm instanceof Node) { 48 48 node = (Node) osm; 49 if (Selection.size() == 1) 49 if (Selection.size() == 1) { 50 50 if (node.compareTo(SelNode) != 0) { 51 51 SelNode = node; … … 53 53 mark.paintSign(); 54 54 } 55 } 55 56 } 56 57 } 57 Selection = null; 58 if (node == null) { 59 panelMain.clearSelections(); 60 SelNode = null; 61 } 58 62 } 59 63 }; … … 61 65 public OSeaMAction(SmedPluginManager mngr) { 62 66 67 DataSet.addSelectionListener(SmpListener); 63 68 manager = mngr; 64 69 String str = Main.pref.get("mappaint.style.sources"); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r24808 r24823 25 25 26 26 private ButtonGroup catButtons = null; 27 p rivateJRadioButton portButton = null;28 p rivateJRadioButton stbdButton = null;29 p rivateJRadioButton prefPortButton = null;30 p rivateJRadioButton prefStbdButton = null;31 p rivateJRadioButton safeWaterButton = null;27 public JRadioButton portButton = null; 28 public JRadioButton stbdButton = null; 29 public JRadioButton prefPortButton = null; 30 public JRadioButton prefStbdButton = null; 31 public JRadioButton safeWaterButton = null; 32 32 private ActionListener alCat = null; 33 p rivatePanelPort panelPort = null;34 p rivatePanelStbd panelStbd = null;35 p rivatePanelPrefPort panelPrefPort = null;36 p rivatePanelPrefStbd panelPrefStbd = null;37 p rivatePanelSafeWater panelSafeWater = null;33 public PanelPort panelPort = null; 34 public PanelStbd panelStbd = null; 35 public PanelPrefPort panelPrefPort = null; 36 public PanelPrefStbd panelPrefStbd = null; 37 public PanelSafeWater panelSafeWater = null; 38 38 39 39 public PanelChan() { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r24808 r24823 23 23 private OSeaMAction dlg; 24 24 public JLabel shapeIcon = null; 25 p rivateJLabel lightIcon = null;26 p rivateJLabel topIcon = null;27 p rivateJLabel reflIcon = null;28 p rivateJLabel radarIcon = null;29 p rivateJLabel fogIcon = null;30 p rivateJLabel nameLabel = null;25 public JLabel lightIcon = null; 26 public JLabel topIcon = null; 27 public JLabel reflIcon = null; 28 public JLabel radarIcon = null; 29 public JLabel fogIcon = null; 30 public JLabel nameLabel = null; 31 31 public JTextField nameBox = null; 32 32 private JButton saveButton = null; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java
r24808 r24823 3 3 import java.util.Map; 4 4 5 import org.openstreetmap.josm.Main; 6 import org.openstreetmap.josm.command.ChangePropertyCommand; 5 7 import org.openstreetmap.josm.data.osm.Node; 6 8 7 9 import oseam.dialogs.OSeaMAction; 8 10 import oseam.seamarks.SeaMark; 9 import oseam.seamarks.SeaMark.Cat;10 import oseam.seamarks.SeaMark.Styl;11 11 12 12 public class MarkIsol extends SeaMark { … … 23 23 if (!dlg.panelMain.hazButton.isSelected()) 24 24 dlg.panelMain.hazButton.doClick(); 25 26 if (!dlg.panelMain.panelHaz.isolButton.isSelected()) 27 dlg.panelMain.panelHaz.isolButton.doClick(); 25 28 26 29 if (keys.containsKey("name")) … … 36 39 else if (keys.containsKey("seamark:light_float:name")) 37 40 setName(keys.get("seamark:light_float:name")); 38 39 dlg.panelMain.panelHaz.isolButton.doClick();40 41 41 42 if (keys.containsKey("seamark:buoy_isolated_danger:shape")) { … … 116 117 } 117 118 118 String image = "/images/Cardinal"; //$NON-NLS-1$119 String image = "/images/Cardinal"; 119 120 120 121 switch (getStyleIndex()) { 121 122 case ISOL_PILLAR: 122 image += "_Pillar_Single"; //$NON-NLS-1$123 image += "_Pillar_Single"; 123 124 break; 124 125 case ISOL_SPAR: 125 image += "_Spar_Single"; //$NON-NLS-1$126 image += "_Spar_Single"; 126 127 break; 127 128 case ISOL_BEACON: 128 image += "_Beacon_Single"; //$NON-NLS-1$129 image += "_Beacon_Single"; 129 130 break; 130 131 case ISOL_TOWER: 131 image += "_Tower_Single"; //$NON-NLS-1$132 image += "_Tower_Single"; 132 133 break; 133 134 case ISOL_FLOAT: 134 image += "_Float_Single"; //$NON-NLS-1$135 image += "_Float_Single"; 135 136 break; 136 137 default: 137 138 } 138 139 139 if (!image.equals("/images/Cardinal")) { //$NON-NLS-1$140 image += ".png"; //$NON-NLS-1$140 if (!image.equals("/images/Cardinal")) { 141 image += ".png"; 141 142 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 142 143 } else … … 144 145 } else { 145 146 dlg.tfM01Name.setEnabled(false); 146 dlg.tfM01Name.setText(""); //$NON-NLS-1$147 dlg.tfM01Name.setText(""); 147 148 dlg.cM01TopMark.setVisible(false); 148 149 dlg.cM01Radar.setVisible(false); … … 154 155 155 156 public void saveSign() { 156 /*Node node = getNode();157 Node node = getNode(); 157 158 158 159 if (node == null) { … … 160 161 } 161 162 162 switch (getS tyleIndex()) {163 case ISOL_PILLAR:164 super.saveSign("buoy_isolated_danger"); //$NON-NLS-1$165 Main.main.undoRedo.add(new ChangePropertyCommand(node, 166 "seamark:buoy_isolated_danger:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$167 break; 168 case ISOL_SPAR:169 super.saveSign("buoy_isolated_danger"); //$NON-NLS-1$170 Main.main.undoRedo.add(new ChangePropertyCommand(node, 171 "seamark:buoy_isolated_danger:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$172 break; 173 case ISOL_BEACON:174 super.saveSign("beacon_isolated_danger"); //$NON-NLS-1$175 break; 176 case ISOL_TOWER:177 super.saveSign("beacon_isolated_danger"); //$NON-NLS-1$178 Main.main.undoRedo.add(new ChangePropertyCommand(node, 179 "seamark:beacon_isolated_danger:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$180 break; 181 case ISOL_FLOAT:182 super.saveSign("light_float"); //$NON-NLS-1$163 switch (getShape()) { 164 case PILLAR: 165 super.saveSign("buoy_isolated_danger"); 166 Main.main.undoRedo.add(new ChangePropertyCommand(node, 167 "seamark:buoy_isolated_danger:shape", "pillar")); 168 break; 169 case SPAR: 170 super.saveSign("buoy_isolated_danger"); 171 Main.main.undoRedo.add(new ChangePropertyCommand(node, 172 "seamark:buoy_isolated_danger:shape", "spar")); 173 break; 174 case BEACON: 175 super.saveSign("beacon_isolated_danger"); 176 break; 177 case TOWER: 178 super.saveSign("beacon_isolated_danger"); 179 Main.main.undoRedo.add(new ChangePropertyCommand(node, 180 "seamark:beacon_isolated_danger:shape", "tower")); 181 break; 182 case FLOAT: 183 super.saveSign("light_float"); 183 184 break; 184 185 default: 185 186 } 186 187 187 switch (getS tyleIndex()) {188 case ISOL_PILLAR:189 case ISOL_SPAR:190 Main.main.undoRedo.add(new ChangePropertyCommand(node, 191 "seamark:buoy_isolated_danger:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$192 Main.main.undoRedo.add(new ChangePropertyCommand(node, 193 "seamark:buoy_isolated_danger:colour", "black;red;black")); //$NON-NLS-1$ //$NON-NLS-2$194 break; 195 case ISOL_BEACON:196 case ISOL_TOWER:197 Main.main.undoRedo.add(new ChangePropertyCommand(node, 198 "seamark:beacon_isolated_danger:colour_pattern", //$NON-NLS-1$199 "horizontal stripes")); //$NON-NLS-1$200 Main.main.undoRedo.add(new ChangePropertyCommand(node, 201 "seamark:beacon_isolated_danger:colour", "black;red;black")); //$NON-NLS-1$ //$NON-NLS-2$202 break; 203 case ISOL_FLOAT:204 Main.main.undoRedo.add(new ChangePropertyCommand(node, 205 "seamark:light_float:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$206 Main.main.undoRedo.add(new ChangePropertyCommand(node, 207 "seamark:light_float:colour", "black;red;black")); //$NON-NLS-1$ //$NON-NLS-2$208 break; 209 } 210 211 saveTopMarkData("2 spheres", "black"); //$NON-NLS-1$ //$NON-NLS-2$212 saveLightData(); //$NON-NLS-1$188 switch (getShape()) { 189 case PILLAR: 190 case SPAR: 191 Main.main.undoRedo.add(new ChangePropertyCommand(node, 192 "seamark:buoy_isolated_danger:colour_pattern", "horizontal stripes")); 193 Main.main.undoRedo.add(new ChangePropertyCommand(node, 194 "seamark:buoy_isolated_danger:colour", "black;red;black")); 195 break; 196 case BEACON: 197 case TOWER: 198 Main.main.undoRedo.add(new ChangePropertyCommand(node, 199 "seamark:beacon_isolated_danger:colour_pattern", 200 "horizontal stripes")); 201 Main.main.undoRedo.add(new ChangePropertyCommand(node, 202 "seamark:beacon_isolated_danger:colour", "black;red;black")); 203 break; 204 case FLOAT: 205 Main.main.undoRedo.add(new ChangePropertyCommand(node, 206 "seamark:light_float:colour_pattern", "horizontal stripes")); 207 Main.main.undoRedo.add(new ChangePropertyCommand(node, 208 "seamark:light_float:colour", "black;red;black")); 209 break; 210 } 211 212 saveTopMarkData("2 spheres", "black"); 213 saveLightData(); 213 214 saveRadarFogData(); 214 */}215 } 215 216 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java
r24801 r24823 4 4 5 5 import org.openstreetmap.josm.data.osm.Node; 6 import org.openstreetmap.josm.Main; 7 import org.openstreetmap.josm.command.ChangePropertyCommand; 6 8 7 9 import oseam.dialogs.OSeaMAction; … … 17 19 Map<String, String> keys; 18 20 keys = getNode().getKeys(); 19 /* 20 dlg.cbM01TypeOfMark.setSelectedIndex(LATERAL); 21 22 dlg.cbM01CatOfMark.removeAllItems(); 23 dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.152")); //$NON-NLS-1$ 24 dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.153")); //$NON-NLS-1$ 25 dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.154")); //$NON-NLS-1$ 26 dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.155")); //$NON-NLS-1$ 27 dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.156")); //$NON-NLS-1$ 28 29 dlg.rbM01RegionA.setEnabled(true); 30 dlg.rbM01RegionB.setEnabled(true); 31 dlg.cbM01CatOfMark.setEnabled(true); 32 dlg.cbM01CatOfMark.setVisible(true); 33 dlg.lM01CatOfMark.setVisible(true); 34 35 dlg.cbM01StyleOfMark.removeAllItems(); 36 dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 37 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$ 38 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$ 39 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$ 40 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$ 41 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$ 42 dlg.cbM01StyleOfMark.setEnabled(true); 43 44 if (keys.containsKey("name")) //$NON-NLS-1$ 45 setName(keys.get("name")); //$NON-NLS-1$ 46 47 if (keys.containsKey("seamark:name")) //$NON-NLS-1$ 48 setName(keys.get("seamark:name")); //$NON-NLS-1$ 49 50 if (keys.containsKey("seamark:buoy_lateral:name")) //$NON-NLS-1$ 51 setName(keys.get("seamark:buoy_lateral:name")); //$NON-NLS-1$ 52 else if (keys.containsKey("seamark:beacon_lateral:name")) //$NON-NLS-1$ 53 setName(keys.get("seamark:beacon_lateral:name")); //$NON-NLS-1$ 54 else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$ 55 setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$ 56 57 String cat = ""; //$NON-NLS-1$ 58 String col = ""; //$NON-NLS-1$ 59 String top = ""; //$NON-NLS-1$ 60 61 if (keys.containsKey("seamark:buoy_lateral:category")) //$NON-NLS-1$ 62 cat = keys.get("seamark:buoy_lateral:category"); //$NON-NLS-1$ 63 else if (keys.containsKey("seamark:beacon_lateral:category")) //$NON-NLS-1$ 64 cat = keys.get("seamark:beacon_lateral:category"); //$NON-NLS-1$ 65 66 if (keys.containsKey("seamark:buoy_lateral:colour")) //$NON-NLS-1$ 67 col = keys.get("seamark:buoy_lateral:colour"); //$NON-NLS-1$ 68 else if (keys.containsKey("seamark:beacon_lateral:colour")) //$NON-NLS-1$ 69 col = keys.get("seamark:beacon_lateral:colour"); //$NON-NLS-1$ 70 else if (keys.containsKey("seamark:light_float:colour")) //$NON-NLS-1$ 71 col = keys.get("seamark:light_float:colour"); //$NON-NLS-1$ 72 73 if (getStyleIndex() != LAT_PERCH) { 74 if (keys.containsKey("seamark:topmark:shape")) { //$NON-NLS-1$ 75 top = keys.get("seamark:topmark:shape"); //$NON-NLS-1$ 76 setTopMark(true); 77 } 78 if (keys.containsKey("seamark:topmark:colour")) { //$NON-NLS-1$ 21 22 if (!dlg.panelMain.chanButton.isSelected()) 23 dlg.panelMain.chanButton.doClick(); 24 25 if (keys.containsKey("name")) 26 setName(keys.get("name")); 27 28 if (keys.containsKey("seamark:name")) 29 setName(keys.get("seamark:name")); 30 31 if (keys.containsKey("seamark:buoy_lateral:name")) 32 setName(keys.get("seamark:buoy_lateral:name")); 33 else if (keys.containsKey("seamark:beacon_lateral:name")) 34 setName(keys.get("seamark:beacon_lateral:name")); 35 else if (keys.containsKey("seamark:light_float:name")) 36 setName(keys.get("seamark:light_float:name")); 37 38 String cat = ""; 39 String col = ""; 40 String top = ""; 41 42 if (keys.containsKey("seamark:buoy_lateral:category")) 43 cat = keys.get("seamark:buoy_lateral:category"); 44 else if (keys.containsKey("seamark:beacon_lateral:category")) 45 cat = keys.get("seamark:beacon_lateral:category"); 46 47 if (keys.containsKey("seamark:buoy_lateral:colour")) 48 col = keys.get("seamark:buoy_lateral:colour"); 49 else if (keys.containsKey("seamark:beacon_lateral:colour")) 50 col = keys.get("seamark:beacon_lateral:colour"); 51 else if (keys.containsKey("seamark:light_float:colour")) 52 col = keys.get("seamark:light_float:colour"); 53 54 if (getShape() != Styl.PERCH) { 55 if (keys.containsKey("seamark:topmark:shape")) { 56 top = keys.get("seamark:topmark:shape"); 57 // setTopMark(true); 58 } 59 if (keys.containsKey("seamark:topmark:colour")) { 79 60 if (col.isEmpty()) col = keys.get("seamark:topmark:colour"); 80 setTopMark(true);61 // setTopMark(true); 81 62 } 82 63 } 83 64 84 65 if (col.isEmpty()) { 85 if (keys.containsKey("seamark:light:colour")) //$NON-NLS-1$86 col = keys.get("seamark:light:colour"); //$NON-NLS-1$66 if (keys.containsKey("seamark:light:colour")) 67 col = keys.get("seamark:light:colour"); 87 68 } 88 69 89 if (cat.isEmpty()) { //$NON-NLS-1$ 90 if (col.equals("red")) { //$NON-NLS-1$ 70 /* 71 if (cat.isEmpty()) { 72 if (col.equals("red")) { 91 73 setColour(RED); 92 if (top.equals("cylinder")) { //$NON-NLS-1$74 if (top.equals("cylinder")) { 93 75 setBuoyIndex(PORT_HAND); 94 76 setRegion(IALA_A); 95 } else if (top.equals("cone, point up")) { //$NON-NLS-1$77 } else if (top.equals("cone, point up")) { 96 78 setBuoyIndex(STARBOARD_HAND); 97 79 setRegion(IALA_B); … … 102 84 setBuoyIndex(STARBOARD_HAND); 103 85 } 104 } else if (col.equals("green")) { //$NON-NLS-1$86 } else if (col.equals("green")) { 105 87 setColour(GREEN); 106 if (top.equals("cone, point up")) { //$NON-NLS-1$88 if (top.equals("cone, point up")) { 107 89 setBuoyIndex(STARBOARD_HAND); 108 90 setRegion(IALA_A); 109 } else if (top.equals("cylinder")) { //$NON-NLS-1$91 } else if (top.equals("cylinder")) { 110 92 setBuoyIndex(PORT_HAND); 111 93 setRegion(IALA_B); … … 116 98 setBuoyIndex(PORT_HAND); 117 99 } 118 } else if (col.equals("red;green;red")) { //$NON-NLS-1$100 } else if (col.equals("red;green;red")) { 119 101 setColour(RED_GREEN_RED); 120 if (top.equals("cylinder")) { //$NON-NLS-1$102 if (top.equals("cylinder")) { 121 103 setBuoyIndex(PREF_PORT_HAND); 122 104 setRegion(IALA_A); 123 } else if (top.equals("cone, point up")) { //$NON-NLS-1$105 } else if (top.equals("cone, point up")) { 124 106 setBuoyIndex(PREF_STARBOARD_HAND); 125 107 setRegion(IALA_B); … … 130 112 setBuoyIndex(PREF_STARBOARD_HAND); 131 113 } 132 } else if (col.equals("green;red;green")) { //$NON-NLS-1$114 } else if (col.equals("green;red;green")) { 133 115 setColour(GREEN_RED_GREEN); 134 if (top.equals("cone, point up")) { //$NON-NLS-1$116 if (top.equals("cone, point up")) { 135 117 setBuoyIndex(PREF_STARBOARD_HAND); 136 118 setRegion(IALA_A); 137 } else if (top.equals("cylinder")) { //$NON-NLS-1$119 } else if (top.equals("cylinder")) { 138 120 setBuoyIndex(PREF_PORT_HAND); 139 121 setRegion(IALA_B); … … 145 127 } 146 128 } 147 } else if (cat.equals("port")) { //$NON-NLS-1$129 } else if (cat.equals("port")) { 148 130 149 131 setBuoyIndex(PORT_HAND); 150 132 151 if (col.equals("red")) { //$NON-NLS-1$133 if (col.equals("red")) { 152 134 setRegion(IALA_A); 153 135 setColour(RED); 154 } else if (col.equals("green")) { //$NON-NLS-1$136 } else if (col.equals("green")) { 155 137 setRegion(IALA_B); 156 138 setColour(GREEN); … … 161 143 setColour(GREEN); 162 144 } 163 } else if (cat.equals("starboard")) { //$NON-NLS-1$145 } else if (cat.equals("starboard")) { 164 146 165 147 setBuoyIndex(STARBOARD_HAND); 166 148 167 if (col.equals("green")) { //$NON-NLS-1$149 if (col.equals("green")) { 168 150 setRegion(IALA_A); 169 151 setColour(GREEN); 170 } else if (col.equals("red")) { //$NON-NLS-1$152 } else if (col.equals("red")) { 171 153 setRegion(IALA_B); 172 154 setColour(RED); … … 177 159 setColour(RED); 178 160 } 179 } else if (cat.equals("preferred_channel_port")) { //$NON-NLS-1$161 } else if (cat.equals("preferred_channel_port")) { 180 162 181 163 setBuoyIndex(PREF_PORT_HAND); 182 164 183 if (col.equals("red;green;red")) { //$NON-NLS-1$165 if (col.equals("red;green;red")) { 184 166 setRegion(IALA_A); 185 167 setColour(RED_GREEN_RED); 186 } else if (col.equals("green;red;green")) { //$NON-NLS-1$168 } else if (col.equals("green;red;green")) { 187 169 setRegion(IALA_B); 188 170 setColour(GREEN_RED_GREEN); … … 194 176 } 195 177 196 } else if (cat.equals("preferred_channel_starboard")) { //$NON-NLS-1$178 } else if (cat.equals("preferred_channel_starboard")) { 197 179 198 180 setBuoyIndex(PREF_STARBOARD_HAND); 199 181 200 if (col.equals("green;red;green")) { //$NON-NLS-1$182 if (col.equals("green;red;green")) { 201 183 setRegion(IALA_A); 202 184 setColour(GREEN_RED_GREEN); 203 } else if (col.equals("red;green;red")) { //$NON-NLS-1$185 } else if (col.equals("red;green;red")) { 204 186 setRegion(IALA_B); 205 187 setColour(RED_GREEN_RED); … … 212 194 } 213 195 214 if (keys.containsKey("seamark:buoy_lateral:shape")) { //$NON-NLS-1$215 str = keys.get("seamark:buoy_lateral:shape"); //$NON-NLS-1$196 if (keys.containsKey("seamark:buoy_lateral:shape")) { 197 str = keys.get("seamark:buoy_lateral:shape"); 216 198 217 199 switch (getBuoyIndex()) { 218 200 case PORT_HAND: 219 if (str.equals("can")) //$NON-NLS-1$201 if (str.equals("can")) 220 202 setStyleIndex(LAT_CAN); 221 else if (str.equals("pillar")) //$NON-NLS-1$203 else if (str.equals("pillar")) 222 204 setStyleIndex(LAT_PILLAR); 223 else if (str.equals("spar")) //$NON-NLS-1$205 else if (str.equals("spar")) 224 206 setStyleIndex(LAT_SPAR); 225 207 break; 226 208 227 209 case PREF_PORT_HAND: 228 if (str.equals("can")) //$NON-NLS-1$210 if (str.equals("can")) 229 211 setStyleIndex(LAT_CAN); 230 else if (str.equals("pillar")) //$NON-NLS-1$212 else if (str.equals("pillar")) 231 213 setStyleIndex(LAT_PILLAR); 232 else if (str.equals("spar")) //$NON-NLS-1$214 else if (str.equals("spar")) 233 215 setStyleIndex(LAT_SPAR); 234 216 break; 235 217 236 218 case STARBOARD_HAND: 237 if (str.equals("conical")) //$NON-NLS-1$219 if (str.equals("conical")) 238 220 setStyleIndex(LAT_CONE); 239 else if (str.equals("pillar")) //$NON-NLS-1$221 else if (str.equals("pillar")) 240 222 setStyleIndex(LAT_PILLAR); 241 else if (str.equals("spar")) //$NON-NLS-1$223 else if (str.equals("spar")) 242 224 setStyleIndex(LAT_SPAR); 243 225 break; 244 226 245 227 case PREF_STARBOARD_HAND: 246 if (str.equals("conical")) //$NON-NLS-1$228 if (str.equals("conical")) 247 229 setStyleIndex(LAT_CONE); 248 else if (str.equals("pillar")) //$NON-NLS-1$230 else if (str.equals("pillar")) 249 231 setStyleIndex(LAT_PILLAR); 250 else if (str.equals("spar")) //$NON-NLS-1$232 else if (str.equals("spar")) 251 233 setStyleIndex(LAT_SPAR); 252 234 break; 253 235 } 254 } else if (keys.containsKey("seamark:beacon_lateral:shape")) { //$NON-NLS-1$255 str = keys.get("seamark:beacon_lateral:shape"); //$NON-NLS-1$256 if (str.equals("tower")) //$NON-NLS-1$236 } else if (keys.containsKey("seamark:beacon_lateral:shape")) { 237 str = keys.get("seamark:beacon_lateral:shape"); 238 if (str.equals("tower")) 257 239 setStyleIndex(LAT_TOWER); 258 else if (str.equals("perch")) //$NON-NLS-1$240 else if (str.equals("perch")) 259 241 setStyleIndex(LAT_PERCH); 260 242 else 261 243 setStyleIndex(LAT_BEACON); 262 } else if (keys.containsKey("seamark:type") //$NON-NLS-1$263 && (keys.get("seamark:type").equals("beacon_lateral"))) { //$NON-NLS-1$ //$NON-NLS-2$244 } else if (keys.containsKey("seamark:type") 245 && (keys.get("seamark:type").equals("beacon_lateral"))) { 264 246 setStyleIndex(LAT_BEACON); 265 } else if (keys.containsKey("seamark:type") //$NON-NLS-1$266 && (keys.get("seamark:type").equals("light_float"))) { //$NON-NLS-1$ //$NON-NLS-2$247 } else if (keys.containsKey("seamark:type") 248 && (keys.get("seamark:type").equals("light_float"))) { 267 249 setStyleIndex(LAT_FLOAT); 268 250 } … … 285 267 286 268 dlg.cbM01StyleOfMark.removeAllItems(); 287 dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.213")); //$NON-NLS-1$269 dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.213")); 288 270 289 271 switch (type) { 290 272 case PORT_HAND: 291 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); //$NON-NLS-1$292 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$293 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$294 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$295 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$296 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$297 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10")); //$NON-NLS-1$273 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); 274 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); 275 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); 276 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); 277 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); 278 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); 279 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10")); 298 280 break; 299 281 case STARBOARD_HAND: 300 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$301 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$302 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$303 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$304 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$305 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$306 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10")); //$NON-NLS-1$282 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); 283 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); 284 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); 285 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); 286 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); 287 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); 288 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10")); 307 289 break; 308 290 case PREF_PORT_HAND: 309 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); //$NON-NLS-1$310 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$311 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$312 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$313 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$314 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$291 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); 292 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); 293 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); 294 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); 295 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); 296 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); 315 297 break; 316 298 case PREF_STARBOARD_HAND: 317 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$318 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$319 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$320 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$321 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$322 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$299 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); 300 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); 301 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); 302 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); 303 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); 304 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); 323 305 break; 324 306 } … … 343 325 if (getRegion() == IALA_A) { 344 326 if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND) 345 super.setLightColour("R"); //$NON-NLS-1$327 super.setLightColour("R"); 346 328 else 347 super.setLightColour("G"); //$NON-NLS-1$329 super.setLightColour("G"); 348 330 } else { 349 331 if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND) 350 super.setLightColour("G"); //$NON-NLS-1$332 super.setLightColour("G"); 351 333 else 352 super.setLightColour("R"); //$NON-NLS-1$334 super.setLightColour("R"); 353 335 } 354 336 } … … 411 393 } 412 394 413 String image = "/images/Lateral"; //$NON-NLS-1$395 String image = "/images/Lateral"; 414 396 415 397 switch (getBuoyIndex()) { … … 418 400 switch (style) { 419 401 case LAT_CAN: 420 image += "_Can_Red"; //$NON-NLS-1$402 image += "_Can_Red"; 421 403 break; 422 404 case LAT_PILLAR: 423 image += "_Pillar_Red"; //$NON-NLS-1$405 image += "_Pillar_Red"; 424 406 break; 425 407 case LAT_SPAR: 426 image += "_Spar_Red"; //$NON-NLS-1$408 image += "_Spar_Red"; 427 409 break; 428 410 case LAT_BEACON: 429 image += "_Beacon_Red"; //$NON-NLS-1$411 image += "_Beacon_Red"; 430 412 break; 431 413 case LAT_TOWER: 432 image += "_Tower_Red"; //$NON-NLS-1$414 image += "_Tower_Red"; 433 415 break; 434 416 case LAT_FLOAT: 435 image += "_Float_Red"; //$NON-NLS-1$417 image += "_Float_Red"; 436 418 break; 437 419 case LAT_PERCH: 438 image += "_Perch_Port"; //$NON-NLS-1$420 image += "_Perch_Port"; 439 421 break; 440 422 default: … … 443 425 switch (style) { 444 426 case LAT_CAN: 445 image += "_Can_Green"; //$NON-NLS-1$427 image += "_Can_Green"; 446 428 break; 447 429 case LAT_PILLAR: 448 image += "_Pillar_Green"; //$NON-NLS-1$430 image += "_Pillar_Green"; 449 431 break; 450 432 case LAT_SPAR: 451 image += "_Spar_Green"; //$NON-NLS-1$433 image += "_Spar_Green"; 452 434 break; 453 435 case LAT_BEACON: 454 image += "_Beacon_Green"; //$NON-NLS-1$436 image += "_Beacon_Green"; 455 437 break; 456 438 case LAT_TOWER: 457 image += "_Tower_Green"; //$NON-NLS-1$439 image += "_Tower_Green"; 458 440 break; 459 441 case LAT_FLOAT: 460 image += "_Float_Green"; //$NON-NLS-1$442 image += "_Float_Green"; 461 443 break; 462 444 case LAT_PERCH: 463 image += "_Perch_Port"; //$NON-NLS-1$445 image += "_Perch_Port"; 464 446 break; 465 447 default: … … 471 453 switch (style) { 472 454 case LAT_CONE: 473 image += "_Cone_Green"; //$NON-NLS-1$455 image += "_Cone_Green"; 474 456 break; 475 457 case LAT_PILLAR: 476 image += "_Pillar_Green"; //$NON-NLS-1$458 image += "_Pillar_Green"; 477 459 break; 478 460 case LAT_SPAR: 479 image += "_Spar_Green"; //$NON-NLS-1$461 image += "_Spar_Green"; 480 462 break; 481 463 case LAT_BEACON: 482 image += "_Beacon_Green"; //$NON-NLS-1$464 image += "_Beacon_Green"; 483 465 break; 484 466 case LAT_TOWER: 485 image += "_Tower_Green"; //$NON-NLS-1$467 image += "_Tower_Green"; 486 468 break; 487 469 case LAT_FLOAT: 488 image += "_Float_Green"; //$NON-NLS-1$470 image += "_Float_Green"; 489 471 break; 490 472 case LAT_PERCH: 491 image += "_Perch_Starboard"; //$NON-NLS-1$473 image += "_Perch_Starboard"; 492 474 break; 493 475 default: … … 496 478 switch (style) { 497 479 case LAT_CONE: 498 image += "_Cone_Red"; //$NON-NLS-1$480 image += "_Cone_Red"; 499 481 break; 500 482 case LAT_PILLAR: 501 image += "_Pillar_Red"; //$NON-NLS-1$483 image += "_Pillar_Red"; 502 484 break; 503 485 case LAT_SPAR: 504 image += "_Spar_Red"; //$NON-NLS-1$486 image += "_Spar_Red"; 505 487 break; 506 488 case LAT_BEACON: 507 image += "_Beacon_Red"; //$NON-NLS-1$489 image += "_Beacon_Red"; 508 490 break; 509 491 case LAT_TOWER: 510 image += "_Tower_Red"; //$NON-NLS-1$492 image += "_Tower_Red"; 511 493 break; 512 494 case LAT_FLOAT: 513 image += "_Float_Red"; //$NON-NLS-1$495 image += "_Float_Red"; 514 496 break; 515 497 case LAT_PERCH: 516 image += "_Perch_Starboard"; //$NON-NLS-1$498 image += "_Perch_Starboard"; 517 499 break; 518 500 default: … … 524 506 switch (style) { 525 507 case LAT_CAN: 526 image += "_Can_Red_Green_Red"; //$NON-NLS-1$508 image += "_Can_Red_Green_Red"; 527 509 break; 528 510 case LAT_PILLAR: 529 image += "_Pillar_Red_Green_Red"; //$NON-NLS-1$511 image += "_Pillar_Red_Green_Red"; 530 512 break; 531 513 case LAT_SPAR: 532 image += "_Spar_Red_Green_Red"; //$NON-NLS-1$514 image += "_Spar_Red_Green_Red"; 533 515 break; 534 516 case LAT_BEACON: 535 image += "_Beacon_Red_Green_Red"; //$NON-NLS-1$517 image += "_Beacon_Red_Green_Red"; 536 518 break; 537 519 case LAT_TOWER: 538 image += "_Tower_Red_Green_Red"; //$NON-NLS-1$520 image += "_Tower_Red_Green_Red"; 539 521 break; 540 522 case LAT_FLOAT: 541 image += "_Float_Red_Green_Red"; //$NON-NLS-1$523 image += "_Float_Red_Green_Red"; 542 524 break; 543 525 default: … … 546 528 switch (style) { 547 529 case LAT_CAN: 548 image += "_Can_Green_Red_Green"; //$NON-NLS-1$530 image += "_Can_Green_Red_Green"; 549 531 break; 550 532 case LAT_PILLAR: 551 image += "_Pillar_Green_Red_Green"; //$NON-NLS-1$533 image += "_Pillar_Green_Red_Green"; 552 534 break; 553 535 case LAT_SPAR: 554 image += "_Spar_Green_Red_Green"; //$NON-NLS-1$536 image += "_Spar_Green_Red_Green"; 555 537 break; 556 538 case LAT_BEACON: 557 image += "_Beacon_Green_Red_Green"; //$NON-NLS-1$539 image += "_Beacon_Green_Red_Green"; 558 540 break; 559 541 case LAT_TOWER: 560 image += "_Tower_Green_Red_Green"; //$NON-NLS-1$542 image += "_Tower_Green_Red_Green"; 561 543 break; 562 544 case LAT_FLOAT: 563 image += "_Float_Green_Red_Green"; //$NON-NLS-1$545 image += "_Float_Green_Red_Green"; 564 546 break; 565 547 default: … … 571 553 switch (style) { 572 554 case LAT_CONE: 573 image += "_Cone_Green_Red_Green"; //$NON-NLS-1$555 image += "_Cone_Green_Red_Green"; 574 556 break; 575 557 case LAT_PILLAR: 576 image += "_Pillar_Green_Red_Green"; //$NON-NLS-1$558 image += "_Pillar_Green_Red_Green"; 577 559 break; 578 560 case LAT_SPAR: 579 image += "_Spar_Green_Red_Green"; //$NON-NLS-1$561 image += "_Spar_Green_Red_Green"; 580 562 break; 581 563 case LAT_BEACON: 582 image += "_Beacon_Green_Red_Green"; //$NON-NLS-1$564 image += "_Beacon_Green_Red_Green"; 583 565 break; 584 566 case LAT_TOWER: 585 image += "_Tower_Green_Red_Green"; //$NON-NLS-1$567 image += "_Tower_Green_Red_Green"; 586 568 break; 587 569 case LAT_FLOAT: 588 image += "_Float_Green_Red_Green"; //$NON-NLS-1$570 image += "_Float_Green_Red_Green"; 589 571 break; 590 572 default: … … 593 575 switch (style) { 594 576 case LAT_CONE: 595 image += "_Cone_Red_Green_Red"; //$NON-NLS-1$577 image += "_Cone_Red_Green_Red"; 596 578 break; 597 579 case LAT_PILLAR: 598 image += "_Pillar_Red_Green_Red"; //$NON-NLS-1$580 image += "_Pillar_Red_Green_Red"; 599 581 break; 600 582 case LAT_SPAR: 601 image += "_Spar_Red_Green_Red"; //$NON-NLS-1$583 image += "_Spar_Red_Green_Red"; 602 584 break; 603 585 case LAT_BEACON: 604 image += "_Beacon_Red_Green_Red"; //$NON-NLS-1$586 image += "_Beacon_Red_Green_Red"; 605 587 break; 606 588 case LAT_TOWER: 607 image += "_Tower_Red_Green_Red"; //$NON-NLS-1$589 image += "_Tower_Red_Green_Red"; 608 590 break; 609 591 case LAT_FLOAT: 610 image += "_Float_Red_Green_Red"; //$NON-NLS-1$592 image += "_Float_Red_Green_Red"; 611 593 break; 612 594 default: … … 617 599 } 618 600 619 if (!image.equals("/images/Lateral")) { //$NON-NLS-1$620 621 image += ".png"; //$NON-NLS-1$601 if (!image.equals("/images/Lateral")) { 602 603 image += ".png"; 622 604 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 623 605 … … 630 612 switch (style) { 631 613 case LAT_CAN: 632 image = "/images/Top_Can_Red_Buoy_Small.png"; //$NON-NLS-1$614 image = "/images/Top_Can_Red_Buoy_Small.png"; 633 615 break; 634 616 case LAT_PILLAR: 635 617 case LAT_SPAR: 636 image = "/images/Top_Can_Red_Buoy.png"; //$NON-NLS-1$618 image = "/images/Top_Can_Red_Buoy.png"; 637 619 break; 638 620 case LAT_BEACON: 639 621 case LAT_TOWER: 640 image = "/images/Top_Can_Red_Beacon.png"; //$NON-NLS-1$622 image = "/images/Top_Can_Red_Beacon.png"; 641 623 break; 642 624 case LAT_FLOAT: 643 image = "/images/Top_Can_Red_Float.png"; //$NON-NLS-1$625 image = "/images/Top_Can_Red_Float.png"; 644 626 break; 645 627 } … … 647 629 switch (style) { 648 630 case LAT_CAN: 649 image = "/images/Top_Can_Green_Buoy_Small.png"; //$NON-NLS-1$631 image = "/images/Top_Can_Green_Buoy_Small.png"; 650 632 break; 651 633 case LAT_PILLAR: 652 634 case LAT_SPAR: 653 image = "/images/Top_Can_Green_Buoy.png"; //$NON-NLS-1$635 image = "/images/Top_Can_Green_Buoy.png"; 654 636 break; 655 637 case LAT_BEACON: 656 638 case LAT_TOWER: 657 image = "/images/Top_Can_Green_Beacon.png"; //$NON-NLS-1$639 image = "/images/Top_Can_Green_Beacon.png"; 658 640 break; 659 641 case LAT_FLOAT: 660 image = "/images/Top_Can_Green_Float.png"; //$NON-NLS-1$642 image = "/images/Top_Can_Green_Float.png"; 661 643 break; 662 644 } … … 668 650 switch (style) { 669 651 case LAT_CONE: 670 image = "/images/Top_Cone_Green_Buoy_Small.png"; //$NON-NLS-1$652 image = "/images/Top_Cone_Green_Buoy_Small.png"; 671 653 break; 672 654 case LAT_PILLAR: 673 655 case LAT_SPAR: 674 image = "/images/Top_Cone_Green_Buoy.png"; //$NON-NLS-1$656 image = "/images/Top_Cone_Green_Buoy.png"; 675 657 break; 676 658 case LAT_BEACON: 677 659 case LAT_TOWER: 678 image = "/images/Top_Cone_Green_Beacon.png"; //$NON-NLS-1$660 image = "/images/Top_Cone_Green_Beacon.png"; 679 661 break; 680 662 case LAT_FLOAT: 681 image = "/images/Top_Cone_Green_Float.png"; //$NON-NLS-1$663 image = "/images/Top_Cone_Green_Float.png"; 682 664 break; 683 665 } … … 685 667 switch (style) { 686 668 case LAT_CONE: 687 image = "/images/Top_Cone_Red_Buoy_Small.png"; //$NON-NLS-1$669 image = "/images/Top_Cone_Red_Buoy_Small.png"; 688 670 break; 689 671 case LAT_PILLAR: 690 672 case LAT_SPAR: 691 image = "/images/Top_Cone_Red_Buoy.png"; //$NON-NLS-1$673 image = "/images/Top_Cone_Red_Buoy.png"; 692 674 break; 693 675 case LAT_BEACON: 694 676 case LAT_TOWER: 695 image = "/images/Top_Cone_Red_Beacon.png"; //$NON-NLS-1$677 image = "/images/Top_Cone_Red_Beacon.png"; 696 678 break; 697 679 case LAT_FLOAT: 698 image = "/images/Top_Cone_Red_Float.png"; //$NON-NLS-1$680 image = "/images/Top_Cone_Red_Float.png"; 699 681 break; 700 682 } … … 710 692 711 693 public void saveSign() { 712 /*Node node = getNode();694 Node node = getNode(); 713 695 714 696 if (node == null) { … … 716 698 } 717 699 718 int cat = getBuoyIndex();719 String shape = ""; //$NON-NLS-1$720 String colour = ""; //$NON-NLS-1$700 Cat cat = getCategory(); 701 String shape = ""; 702 String colour = ""; 721 703 722 704 switch (cat) { 723 705 724 706 case PORT_HAND: 725 switch (getS tyleIndex()) {726 case LAT_CAN:727 super.saveSign("buoy_lateral"); //$NON-NLS-1$728 Main.main.undoRedo.add(new ChangePropertyCommand(node, 729 "seamark:buoy_lateral:shape", "can")); //$NON-NLS-1$ //$NON-NLS-2$730 break; 731 case LAT_PILLAR:732 super.saveSign("buoy_lateral"); //$NON-NLS-1$733 Main.main.undoRedo.add(new ChangePropertyCommand(node, 734 "seamark:buoy_lateral:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$735 break; 736 case LAT_SPAR:737 super.saveSign("buoy_lateral"); //$NON-NLS-1$738 Main.main.undoRedo.add(new ChangePropertyCommand(node, 739 "seamark:buoy_lateral:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$740 break; 741 case LAT_BEACON:742 super.saveSign("beacon_lateral"); //$NON-NLS-1$743 break; 744 case LAT_TOWER:745 super.saveSign("beacon_lateral"); //$NON-NLS-1$746 Main.main.undoRedo.add(new ChangePropertyCommand(node, 747 "seamark:beacon_lateral:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$748 break; 749 case LAT_FLOAT:750 super.saveSign("light_float"); //$NON-NLS-1$751 break; 752 case LAT_PERCH:753 super.saveSign("beacon_lateral"); //$NON-NLS-1$754 Main.main.undoRedo.add(new ChangePropertyCommand(node, 755 "seamark:beacon_lateral:shape", "perch")); //$NON-NLS-1$ //$NON-NLS-2$707 switch (getShape()) { 708 case CAN: 709 super.saveSign("buoy_lateral"); 710 Main.main.undoRedo.add(new ChangePropertyCommand(node, 711 "seamark:buoy_lateral:shape", "can")); 712 break; 713 case PILLAR: 714 super.saveSign("buoy_lateral"); 715 Main.main.undoRedo.add(new ChangePropertyCommand(node, 716 "seamark:buoy_lateral:shape", "pillar")); 717 break; 718 case SPAR: 719 super.saveSign("buoy_lateral"); 720 Main.main.undoRedo.add(new ChangePropertyCommand(node, 721 "seamark:buoy_lateral:shape", "spar")); 722 break; 723 case BEACON: 724 super.saveSign("beacon_lateral"); 725 break; 726 case TOWER: 727 super.saveSign("beacon_lateral"); 728 Main.main.undoRedo.add(new ChangePropertyCommand(node, 729 "seamark:beacon_lateral:shape", "tower")); 730 break; 731 case FLOAT: 732 super.saveSign("light_float"); 733 break; 734 case PERCH: 735 super.saveSign("beacon_lateral"); 736 Main.main.undoRedo.add(new ChangePropertyCommand(node, 737 "seamark:beacon_lateral:shape", "perch")); 756 738 break; 757 739 default: 758 740 } 759 switch (getS tyleIndex()) {760 case LAT_CAN:761 case LAT_PILLAR:762 case LAT_SPAR:763 Main.main.undoRedo.add(new ChangePropertyCommand(node, 764 "seamark:buoy_lateral:category", "port")); //$NON-NLS-1$ //$NON-NLS-2$765 if (getRegion() == IALA_A) { 766 Main.main.undoRedo.add(new ChangePropertyCommand(node, 767 "seamark:buoy_lateral:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$768 colour = "red"; //$NON-NLS-1$769 } else { 770 Main.main.undoRedo.add(new ChangePropertyCommand(node, 771 "seamark:buoy_lateral:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$772 colour = "green"; //$NON-NLS-1$773 } 774 break; 775 case LAT_PERCH:776 Main.main.undoRedo.add(new ChangePropertyCommand(node, 777 "seamark:beacon_lateral:category", "port")); //$NON-NLS-1$ //$NON-NLS-2$778 break; 779 case LAT_BEACON:780 case LAT_TOWER:781 Main.main.undoRedo.add(new ChangePropertyCommand(node, 782 "seamark:beacon_lateral:category", "port")); //$NON-NLS-1$ //$NON-NLS-2$783 if (getRegion() == IALA_A) { 784 Main.main.undoRedo.add(new ChangePropertyCommand(node, 785 "seamark:beacon_lateral:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$786 colour = "red"; //$NON-NLS-1$787 } else { 788 Main.main.undoRedo.add(new ChangePropertyCommand(node, 789 "seamark:beacon_lateral:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$790 colour = "green"; //$NON-NLS-1$791 } 792 break; 793 case LAT_FLOAT:794 if (getRegion() == IALA_A) { 795 Main.main.undoRedo.add(new ChangePropertyCommand(node, 796 "seamark:light_float:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$797 colour = "red"; //$NON-NLS-1$798 } else { 799 Main.main.undoRedo.add(new ChangePropertyCommand(node, 800 "seamark:light_float:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$801 colour = "green"; //$NON-NLS-1$802 } 803 break; 804 } 805 shape = "cylinder"; //$NON-NLS-1$741 switch (getShape()) { 742 case CAN: 743 case PILLAR: 744 case SPAR: 745 Main.main.undoRedo.add(new ChangePropertyCommand(node, 746 "seamark:buoy_lateral:category", "port")); 747 if (getRegion() == IALA_A) { 748 Main.main.undoRedo.add(new ChangePropertyCommand(node, 749 "seamark:buoy_lateral:colour", "red")); 750 colour = "red"; 751 } else { 752 Main.main.undoRedo.add(new ChangePropertyCommand(node, 753 "seamark:buoy_lateral:colour", "green")); 754 colour = "green"; 755 } 756 break; 757 case PERCH: 758 Main.main.undoRedo.add(new ChangePropertyCommand(node, 759 "seamark:beacon_lateral:category", "port")); 760 break; 761 case BEACON: 762 case TOWER: 763 Main.main.undoRedo.add(new ChangePropertyCommand(node, 764 "seamark:beacon_lateral:category", "port")); 765 if (getRegion() == IALA_A) { 766 Main.main.undoRedo.add(new ChangePropertyCommand(node, 767 "seamark:beacon_lateral:colour", "red")); 768 colour = "red"; 769 } else { 770 Main.main.undoRedo.add(new ChangePropertyCommand(node, 771 "seamark:beacon_lateral:colour", "green")); 772 colour = "green"; 773 } 774 break; 775 case FLOAT: 776 if (getRegion() == IALA_A) { 777 Main.main.undoRedo.add(new ChangePropertyCommand(node, 778 "seamark:light_float:colour", "red")); 779 colour = "red"; 780 } else { 781 Main.main.undoRedo.add(new ChangePropertyCommand(node, 782 "seamark:light_float:colour", "green")); 783 colour = "green"; 784 } 785 break; 786 } 787 shape = "cylinder"; 806 788 break; 807 789 808 790 case PREF_PORT_HAND: 809 switch (getS tyleIndex()) {810 case LAT_CAN:811 super.saveSign("buoy_lateral"); //$NON-NLS-1$812 Main.main.undoRedo.add(new ChangePropertyCommand(node, 813 "seamark:buoy_lateral:shape", "can")); //$NON-NLS-1$ //$NON-NLS-2$814 break; 815 case LAT_PILLAR:816 super.saveSign("buoy_lateral"); //$NON-NLS-1$817 Main.main.undoRedo.add(new ChangePropertyCommand(node, 818 "seamark:buoy_lateral:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$819 break; 820 case LAT_SPAR:821 super.saveSign("buoy_lateral"); //$NON-NLS-1$822 Main.main.undoRedo.add(new ChangePropertyCommand(node, 823 "seamark:buoy_lateral:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$824 break; 825 case LAT_BEACON:826 super.saveSign("beacon_lateral"); //$NON-NLS-1$827 break; 828 case LAT_TOWER:829 super.saveSign("beacon_lateral"); //$NON-NLS-1$830 Main.main.undoRedo.add(new ChangePropertyCommand(node, 831 "seamark:beacon_lateral:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$832 break; 833 case LAT_FLOAT:834 super.saveSign("light_float"); //$NON-NLS-1$791 switch (getShape()) { 792 case CAN: 793 super.saveSign("buoy_lateral"); 794 Main.main.undoRedo.add(new ChangePropertyCommand(node, 795 "seamark:buoy_lateral:shape", "can")); 796 break; 797 case PILLAR: 798 super.saveSign("buoy_lateral"); 799 Main.main.undoRedo.add(new ChangePropertyCommand(node, 800 "seamark:buoy_lateral:shape", "pillar")); 801 break; 802 case SPAR: 803 super.saveSign("buoy_lateral"); 804 Main.main.undoRedo.add(new ChangePropertyCommand(node, 805 "seamark:buoy_lateral:shape", "spar")); 806 break; 807 case BEACON: 808 super.saveSign("beacon_lateral"); 809 break; 810 case TOWER: 811 super.saveSign("beacon_lateral"); 812 Main.main.undoRedo.add(new ChangePropertyCommand(node, 813 "seamark:beacon_lateral:shape", "tower")); 814 break; 815 case FLOAT: 816 super.saveSign("light_float"); 835 817 break; 836 818 default: 837 819 } 838 switch (getS tyleIndex()) {839 case LAT_CAN:840 case LAT_PILLAR:841 case LAT_SPAR:842 Main.main.undoRedo.add(new ChangePropertyCommand(node, 843 "seamark:buoy_lateral:category", "preferred_channel_port")); //$NON-NLS-1$ //$NON-NLS-2$844 Main.main.undoRedo.add(new ChangePropertyCommand(node, 845 "seamark:buoy_lateral:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$846 if (getRegion() == IALA_A) { 847 Main.main.undoRedo.add(new ChangePropertyCommand(node, 848 "seamark:buoy_lateral:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$849 colour = "red"; //$NON-NLS-1$850 } else { 851 Main.main.undoRedo.add(new ChangePropertyCommand(node, 852 "seamark:buoy_lateral:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$853 colour = "green"; //$NON-NLS-1$854 } 855 break; 856 case LAT_BEACON:857 case LAT_TOWER:858 Main.main.undoRedo.add(new ChangePropertyCommand(node, 859 "seamark:beacon_lateral:category", "preferred_channel_port")); //$NON-NLS-1$ //$NON-NLS-2$860 Main.main.undoRedo.add(new ChangePropertyCommand(node, 861 "seamark:beacon_lateral:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$862 if (getRegion() == IALA_A) { 863 Main.main.undoRedo.add(new ChangePropertyCommand(node, 864 "seamark:beacon_lateral:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$865 colour = "red"; //$NON-NLS-1$866 } else { 867 Main.main.undoRedo.add(new ChangePropertyCommand(node, 868 "seamark:beacon_lateral:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$869 colour = "green"; //$NON-NLS-1$870 } 871 break; 872 case LAT_FLOAT:873 Main.main.undoRedo.add(new ChangePropertyCommand(node, 874 "seamark:light_float:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$875 if (getRegion() == IALA_A) { 876 Main.main.undoRedo.add(new ChangePropertyCommand(node, 877 "seamark:light_float:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$878 colour = "red"; //$NON-NLS-1$879 } else { 880 Main.main.undoRedo.add(new ChangePropertyCommand(node, 881 "seamark:light_float:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$882 colour = "green"; //$NON-NLS-1$883 } 884 break; 885 } 886 shape = "cylinder"; //$NON-NLS-1$820 switch (getShape()) { 821 case CAN: 822 case PILLAR: 823 case SPAR: 824 Main.main.undoRedo.add(new ChangePropertyCommand(node, 825 "seamark:buoy_lateral:category", "preferred_channel_port")); 826 Main.main.undoRedo.add(new ChangePropertyCommand(node, 827 "seamark:buoy_lateral:colour_pattern", "horizontal stripes")); 828 if (getRegion() == IALA_A) { 829 Main.main.undoRedo.add(new ChangePropertyCommand(node, 830 "seamark:buoy_lateral:colour", "red;green;red")); 831 colour = "red"; 832 } else { 833 Main.main.undoRedo.add(new ChangePropertyCommand(node, 834 "seamark:buoy_lateral:colour", "green;red;green")); 835 colour = "green"; 836 } 837 break; 838 case BEACON: 839 case TOWER: 840 Main.main.undoRedo.add(new ChangePropertyCommand(node, 841 "seamark:beacon_lateral:category", "preferred_channel_port")); 842 Main.main.undoRedo.add(new ChangePropertyCommand(node, 843 "seamark:beacon_lateral:colour_pattern", "horizontal stripes")); 844 if (getRegion() == IALA_A) { 845 Main.main.undoRedo.add(new ChangePropertyCommand(node, 846 "seamark:beacon_lateral:colour", "red;green;red")); 847 colour = "red"; 848 } else { 849 Main.main.undoRedo.add(new ChangePropertyCommand(node, 850 "seamark:beacon_lateral:colour", "green;red;green")); 851 colour = "green"; 852 } 853 break; 854 case FLOAT: 855 Main.main.undoRedo.add(new ChangePropertyCommand(node, 856 "seamark:light_float:colour_pattern", "horizontal stripes")); 857 if (getRegion() == IALA_A) { 858 Main.main.undoRedo.add(new ChangePropertyCommand(node, 859 "seamark:light_float:colour", "red;green;red")); 860 colour = "red"; 861 } else { 862 Main.main.undoRedo.add(new ChangePropertyCommand(node, 863 "seamark:light_float:colour", "green;red;green")); 864 colour = "green"; 865 } 866 break; 867 } 868 shape = "cylinder"; 887 869 break; 888 870 889 871 case STARBOARD_HAND: 890 switch (getS tyleIndex()) {891 case LAT_CONE:892 super.saveSign("buoy_lateral"); //$NON-NLS-1$893 Main.main.undoRedo.add(new ChangePropertyCommand(node, 894 "seamark:buoy_lateral:shape", "conical")); //$NON-NLS-1$ //$NON-NLS-2$895 break; 896 case LAT_PILLAR:897 super.saveSign("buoy_lateral"); //$NON-NLS-1$898 Main.main.undoRedo.add(new ChangePropertyCommand(node, 899 "seamark:buoy_lateral:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$900 break; 901 case LAT_SPAR:902 super.saveSign("buoy_lateral"); //$NON-NLS-1$903 Main.main.undoRedo.add(new ChangePropertyCommand(node, 904 "seamark:buoy_lateral:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$905 break; 906 case LAT_BEACON:907 super.saveSign("beacon_lateral"); //$NON-NLS-1$908 Main.main.undoRedo.add(new ChangePropertyCommand(node, 909 "seamark:beacon_lateral:shape", "stake")); //$NON-NLS-1$ //$NON-NLS-2$910 break; 911 case LAT_TOWER:912 super.saveSign("beacon_lateral"); //$NON-NLS-1$913 Main.main.undoRedo.add(new ChangePropertyCommand(node, 914 "seamark:beacon_lateral:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$915 break; 916 case LAT_FLOAT:917 super.saveSign("light_float"); //$NON-NLS-1$918 break; 919 case LAT_PERCH:920 super.saveSign("beacon_lateral"); //$NON-NLS-1$921 Main.main.undoRedo.add(new ChangePropertyCommand(node, 922 "seamark:beacon_lateral:shape", "perch")); //$NON-NLS-1$ //$NON-NLS-2$872 switch (getShape()) { 873 case CONE: 874 super.saveSign("buoy_lateral"); 875 Main.main.undoRedo.add(new ChangePropertyCommand(node, 876 "seamark:buoy_lateral:shape", "conical")); 877 break; 878 case PILLAR: 879 super.saveSign("buoy_lateral"); 880 Main.main.undoRedo.add(new ChangePropertyCommand(node, 881 "seamark:buoy_lateral:shape", "pillar")); 882 break; 883 case SPAR: 884 super.saveSign("buoy_lateral"); 885 Main.main.undoRedo.add(new ChangePropertyCommand(node, 886 "seamark:buoy_lateral:shape", "spar")); 887 break; 888 case BEACON: 889 super.saveSign("beacon_lateral"); 890 Main.main.undoRedo.add(new ChangePropertyCommand(node, 891 "seamark:beacon_lateral:shape", "stake")); 892 break; 893 case TOWER: 894 super.saveSign("beacon_lateral"); 895 Main.main.undoRedo.add(new ChangePropertyCommand(node, 896 "seamark:beacon_lateral:shape", "tower")); 897 break; 898 case FLOAT: 899 super.saveSign("light_float"); 900 break; 901 case PERCH: 902 super.saveSign("beacon_lateral"); 903 Main.main.undoRedo.add(new ChangePropertyCommand(node, 904 "seamark:beacon_lateral:shape", "perch")); 923 905 break; 924 906 default: 925 907 } 926 switch (getS tyleIndex()) {927 case LAT_CAN:928 case LAT_PILLAR:929 case LAT_SPAR:930 Main.main.undoRedo.add(new ChangePropertyCommand(node, 931 "seamark:buoy_lateral:category", "starboard")); //$NON-NLS-1$ //$NON-NLS-2$932 if (getRegion() == IALA_A) { 933 Main.main.undoRedo.add(new ChangePropertyCommand(node, 934 "seamark:buoy_lateral:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$935 colour = "green"; //$NON-NLS-1$936 } else { 937 Main.main.undoRedo.add(new ChangePropertyCommand(node, 938 "seamark:buoy_lateral:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$939 colour = "red"; //$NON-NLS-1$940 } 941 break; 942 case LAT_BEACON:943 case LAT_TOWER:944 Main.main.undoRedo.add(new ChangePropertyCommand(node, 945 "seamark:beacon_lateral:category", "starboard")); //$NON-NLS-1$ //$NON-NLS-2$946 if (getRegion() == IALA_A) { 947 Main.main.undoRedo.add(new ChangePropertyCommand(node, 948 "seamark:beacon_lateral:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$949 colour = "green"; //$NON-NLS-1$950 } else { 951 Main.main.undoRedo.add(new ChangePropertyCommand(node, 952 "seamark:beacon_lateral:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$953 colour = "red"; //$NON-NLS-1$954 } 955 break; 956 case LAT_FLOAT:957 if (getRegion() == IALA_A) { 958 Main.main.undoRedo.add(new ChangePropertyCommand(node, 959 "seamark:light_float:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$960 colour = "green"; //$NON-NLS-1$961 } else { 962 Main.main.undoRedo.add(new ChangePropertyCommand(node, 963 "seamark:light_float:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$964 colour = "red"; //$NON-NLS-1$965 } 966 break; 967 case LAT_PERCH:968 Main.main.undoRedo.add(new ChangePropertyCommand(node, 969 "seamark:beacon_lateral:category", "starboard")); //$NON-NLS-1$ //$NON-NLS-2$970 break; 971 } 972 shape = "cone, point up"; //$NON-NLS-1$908 switch (getShape()) { 909 case CAN: 910 case PILLAR: 911 case SPAR: 912 Main.main.undoRedo.add(new ChangePropertyCommand(node, 913 "seamark:buoy_lateral:category", "starboard")); 914 if (getRegion() == IALA_A) { 915 Main.main.undoRedo.add(new ChangePropertyCommand(node, 916 "seamark:buoy_lateral:colour", "green")); 917 colour = "green"; 918 } else { 919 Main.main.undoRedo.add(new ChangePropertyCommand(node, 920 "seamark:buoy_lateral:colour", "red")); 921 colour = "red"; 922 } 923 break; 924 case BEACON: 925 case TOWER: 926 Main.main.undoRedo.add(new ChangePropertyCommand(node, 927 "seamark:beacon_lateral:category", "starboard")); 928 if (getRegion() == IALA_A) { 929 Main.main.undoRedo.add(new ChangePropertyCommand(node, 930 "seamark:beacon_lateral:colour", "green")); 931 colour = "green"; 932 } else { 933 Main.main.undoRedo.add(new ChangePropertyCommand(node, 934 "seamark:beacon_lateral:colour", "red")); 935 colour = "red"; 936 } 937 break; 938 case FLOAT: 939 if (getRegion() == IALA_A) { 940 Main.main.undoRedo.add(new ChangePropertyCommand(node, 941 "seamark:light_float:colour", "green")); 942 colour = "green"; 943 } else { 944 Main.main.undoRedo.add(new ChangePropertyCommand(node, 945 "seamark:light_float:colour", "red")); 946 colour = "red"; 947 } 948 break; 949 case PERCH: 950 Main.main.undoRedo.add(new ChangePropertyCommand(node, 951 "seamark:beacon_lateral:category", "starboard")); 952 break; 953 } 954 shape = "cone, point up"; 973 955 break; 974 956 975 957 case PREF_STARBOARD_HAND: 976 switch (getS tyleIndex()) {977 case LAT_CONE:978 super.saveSign("buoy_lateral"); //$NON-NLS-1$979 Main.main.undoRedo.add(new ChangePropertyCommand(node, 980 "seamark:buoy_lateral:shape", "conical")); //$NON-NLS-1$ //$NON-NLS-2$981 break; 982 case LAT_PILLAR:983 super.saveSign("buoy_lateral"); //$NON-NLS-1$984 Main.main.undoRedo.add(new ChangePropertyCommand(node, 985 "seamark:buoy_lateral:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$986 break; 987 case LAT_SPAR:988 super.saveSign("buoy_lateral"); //$NON-NLS-1$989 Main.main.undoRedo.add(new ChangePropertyCommand(node, 990 "seamark:buoy_lateral:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$991 break; 992 case LAT_BEACON:993 super.saveSign("beacon_lateral"); //$NON-NLS-1$994 Main.main.undoRedo.add(new ChangePropertyCommand(node, 995 "seamark:beacon_lateral:shape", "stake")); //$NON-NLS-1$ //$NON-NLS-2$996 break; 997 case LAT_TOWER:998 super.saveSign("beacon_lateral"); //$NON-NLS-1$999 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1000 "seamark:beacon_lateral:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$1001 break; 1002 case LAT_FLOAT:1003 super.saveSign("light_float"); //$NON-NLS-1$958 switch (getShape()) { 959 case CONE: 960 super.saveSign("buoy_lateral"); 961 Main.main.undoRedo.add(new ChangePropertyCommand(node, 962 "seamark:buoy_lateral:shape", "conical")); 963 break; 964 case PILLAR: 965 super.saveSign("buoy_lateral"); 966 Main.main.undoRedo.add(new ChangePropertyCommand(node, 967 "seamark:buoy_lateral:shape", "pillar")); 968 break; 969 case SPAR: 970 super.saveSign("buoy_lateral"); 971 Main.main.undoRedo.add(new ChangePropertyCommand(node, 972 "seamark:buoy_lateral:shape", "spar")); 973 break; 974 case BEACON: 975 super.saveSign("beacon_lateral"); 976 Main.main.undoRedo.add(new ChangePropertyCommand(node, 977 "seamark:beacon_lateral:shape", "stake")); 978 break; 979 case TOWER: 980 super.saveSign("beacon_lateral"); 981 Main.main.undoRedo.add(new ChangePropertyCommand(node, 982 "seamark:beacon_lateral:shape", "tower")); 983 break; 984 case FLOAT: 985 super.saveSign("light_float"); 1004 986 break; 1005 987 default: 1006 988 } 1007 switch (getS tyleIndex()) {1008 case LAT_CAN:1009 case LAT_PILLAR:1010 case LAT_SPAR:1011 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1012 "seamark:buoy_lateral:category", "preferred_channel_starboard")); //$NON-NLS-1$ //$NON-NLS-2$1013 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1014 "seamark:buoy_lateral:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$1015 if (getRegion() == IALA_A) { 1016 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1017 "seamark:buoy_lateral:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$1018 colour = "green"; //$NON-NLS-1$1019 } else { 1020 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1021 "seamark:buoy_lateral:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$1022 colour = "red"; //$NON-NLS-1$1023 } 1024 break; 1025 case LAT_BEACON:1026 case LAT_TOWER:1027 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1028 "seamark:beacon_lateral:category", "preferred_channel_starboard")); //$NON-NLS-1$ //$NON-NLS-2$1029 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1030 "seamark:beacon_lateral:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$1031 if (getRegion() == IALA_A) { 1032 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1033 "seamark:beacon_lateral:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$1034 colour = "green"; //$NON-NLS-1$1035 } else { 1036 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1037 "seamark:beacon_lateral:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$1038 colour = "red"; //$NON-NLS-1$1039 } 1040 break; 1041 case LAT_FLOAT:1042 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1043 "seamark:light_float:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$1044 if (getRegion() == IALA_A) { 1045 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1046 "seamark:light_float:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$1047 colour = "green"; //$NON-NLS-1$1048 } else { 1049 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1050 "seamark:light_float:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$1051 colour = "red"; //$NON-NLS-1$1052 } 1053 break; 1054 } 1055 shape = "cone, point up"; //$NON-NLS-1$989 switch (getShape()) { 990 case CAN: 991 case PILLAR: 992 case SPAR: 993 Main.main.undoRedo.add(new ChangePropertyCommand(node, 994 "seamark:buoy_lateral:category", "preferred_channel_starboard")); 995 Main.main.undoRedo.add(new ChangePropertyCommand(node, 996 "seamark:buoy_lateral:colour_pattern", "horizontal stripes")); 997 if (getRegion() == IALA_A) { 998 Main.main.undoRedo.add(new ChangePropertyCommand(node, 999 "seamark:buoy_lateral:colour", "green;red;green")); 1000 colour = "green"; 1001 } else { 1002 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1003 "seamark:buoy_lateral:colour", "red;green;red")); 1004 colour = "red"; 1005 } 1006 break; 1007 case BEACON: 1008 case TOWER: 1009 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1010 "seamark:beacon_lateral:category", "preferred_channel_starboard")); 1011 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1012 "seamark:beacon_lateral:colour_pattern", "horizontal stripes")); 1013 if (getRegion() == IALA_A) { 1014 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1015 "seamark:beacon_lateral:colour", "green;red;green")); 1016 colour = "green"; 1017 } else { 1018 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1019 "seamark:beacon_lateral:colour", "red;green;red")); 1020 colour = "red"; 1021 } 1022 break; 1023 case FLOAT: 1024 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1025 "seamark:light_float:colour_pattern", "horizontal stripes")); 1026 if (getRegion() == IALA_A) { 1027 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1028 "seamark:light_float:colour", "green;red;green")); 1029 colour = "green"; 1030 } else { 1031 Main.main.undoRedo.add(new ChangePropertyCommand(node, 1032 "seamark:light_float:colour", "red;green;red")); 1033 colour = "red"; 1034 } 1035 break; 1036 } 1037 shape = "cone, point up"; 1056 1038 break; 1057 1039 … … 1062 1044 saveRadarFogData(); 1063 1045 1064 Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$1065 */}1046 Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A"); 1047 } 1066 1048 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java
r24801 r24823 18 18 keys = getNode().getKeys(); 19 19 20 /* dlg.cbM01TypeOfMark.setSelectedIndex(LIGHT); 20 if (!dlg.panelMain.lightsButton.isSelected()) 21 dlg.panelMain.lightsButton.doClick(); 21 22 22 dlg.cbM01CatOfMark.setEnabled(true); 23 dlg.cbM01CatOfMark.setVisible(true); 24 dlg.lM01CatOfMark.setVisible(true); 23 if (keys.containsKey("name")) 24 setName(keys.get("name")); 25 25 26 dlg.cbM01CatOfMark.removeAllItems(); 27 dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.157")); //$NON-NLS-1$ 28 dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.206")); //$NON-NLS-1$ 29 dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.207")); //$NON-NLS-1$ 30 dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.208")); //$NON-NLS-1$ 31 dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.209")); //$NON-NLS-1$ 26 if (keys.containsKey("seamark:name")) 27 setName(keys.get("seamark:name")); 32 28 33 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$ 29 if (keys.containsKey("seamark:landmark:name")) 30 setName(keys.get("seamark:landmark:name")); 31 else if (keys.containsKey("seamark:light_major:name")) 32 setName(keys.get("seamark:light_major:name")); 33 else if (keys.containsKey("seamark:light_minor:name")) 34 setName(keys.get("seamark:light_minor:name")); 35 else if (keys.containsKey("seamark:light_vessel:name")) 36 setName(keys.get("seamark:light_vessel:name")); 37 else if (keys.containsKey("seamark:light_float:name")) 38 setName(keys.get("seamark:light_float:name")); 34 39 35 if (keys.containsKey("name")) //$NON-NLS-1$ 36 setName(keys.get("name")); //$NON-NLS-1$ 37 38 if (keys.containsKey("seamark:name")) //$NON-NLS-1$ 39 setName(keys.get("seamark:name")); //$NON-NLS-1$ 40 41 if (keys.containsKey("seamark:landmark:name")) //$NON-NLS-1$ 42 setName(keys.get("seamark:landmark:name")); //$NON-NLS-1$ 43 else if (keys.containsKey("seamark:light_major:name")) //$NON-NLS-1$ 44 setName(keys.get("seamark:light_major:name")); //$NON-NLS-1$ 45 else if (keys.containsKey("seamark:light_minor:name")) //$NON-NLS-1$ 46 setName(keys.get("seamark:light_minor:name")); //$NON-NLS-1$ 47 else if (keys.containsKey("seamark:light_vessel:name")) //$NON-NLS-1$ 48 setName(keys.get("seamark:light_vessel:name")); //$NON-NLS-1$ 49 50 if (keys.containsKey("seamark:type")) { //$NON-NLS-1$ 51 String type = keys.get("seamark:type"); //$NON-NLS-1$ 40 /* 41 if (keys.containsKey("seamark:type")) { 42 String type = keys.get("seamark:type"); 52 43 if (type.equals("landmark")) 53 44 setBuoyIndex(LIGHT_HOUSE); … … 60 51 } 61 52 62 refreshLights();63 53 parseLights(keys); 64 54 parseFogRadar(keys); … … 98 88 case SeaMark.LIGHT_HOUSE: 99 89 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource( 100 "/images/Light_House.png"))); //$NON-NLS-1$90 "/images/Light_House.png"))); 101 91 break; 102 92 103 93 case SeaMark.LIGHT_MAJOR: 104 94 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource( 105 "/images/Light_Major.png"))); //$NON-NLS-1$95 "/images/Light_Major.png"))); 106 96 break; 107 97 108 98 case SeaMark.LIGHT_MINOR: 109 99 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource( 110 "/images/Light_Minor.png"))); //$NON-NLS-1$100 "/images/Light_Minor.png"))); 111 101 break; 112 102 113 103 case SeaMark.LIGHT_VESSEL: 114 104 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource( 115 "/images/Major_Float.png"))); //$NON-NLS-1$105 "/images/Major_Float.png"))); 116 106 break; 117 107 … … 122 112 123 113 public void saveSign() { 124 /*Node node = getNode();114 Node node = getNode(); 125 115 126 116 if (node == null) { … … 128 118 } 129 119 130 switch (get BuoyIndex()) {120 switch (getCategory()) { 131 121 case LIGHT_HOUSE: 132 super.saveSign("landmark"); //$NON-NLS-1$122 super.saveSign("landmark"); 133 123 break; 134 124 case LIGHT_MAJOR: 135 super.saveSign("light_major"); //$NON-NLS-1$125 super.saveSign("light_major"); 136 126 break; 137 127 case LIGHT_MINOR: 138 super.saveSign("light_minor"); //$NON-NLS-1$128 super.saveSign("light_minor"); 139 129 break; 140 130 case LIGHT_VESSEL: 141 super.saveSign("light_vessel"); //$NON-NLS-1$131 super.saveSign("light_vessel"); 142 132 break; 143 133 default: 144 134 } 145 saveLightData(); //$NON-NLS-1$135 saveLightData(); 146 136 saveRadarFogData(); 147 */}137 } 148 138 149 139 public void setLightColour() { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java
r24801 r24823 4 4 5 5 import org.openstreetmap.josm.data.osm.Node; 6 import org.openstreetmap.josm.Main; 7 import org.openstreetmap.josm.command.ChangePropertyCommand; 6 8 7 9 import oseam.dialogs.OSeaMAction; … … 19 21 keys = getNode().getKeys(); 20 22 21 /* dlg.cbM01TypeOfMark.setSelectedIndex(SAFE_WATER); 22 23 dlg.cbM01StyleOfMark.removeAllItems(); 24 dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 25 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$ 26 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$ 27 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.08")); //$NON-NLS-1$ 28 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$ 29 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$ 30 dlg.cbM01StyleOfMark.setVisible(true); 31 dlg.lM01StyleOfMark.setVisible(true); 23 if (!dlg.panelMain.chanButton.isSelected()) 24 dlg.panelMain.chanButton.doClick(); 25 if (!dlg.panelMain.panelChan.safeWaterButton.isSelected()) 26 dlg.panelMain.panelChan.safeWaterButton.doClick(); 27 28 if (keys.containsKey("name")) 29 setName(keys.get("name")); 30 31 if (keys.containsKey("seamark:name")) 32 setName(keys.get("seamark:name")); 33 34 if (keys.containsKey("seamark:buoy_safe_water:name")) 35 setName(keys.get("seamark:buoy_safe_water:name")); 36 else if (keys.containsKey("seamark:beacon_safe_water:name")) 37 setName(keys.get("seamark:beacon_safe_water:name")); 38 else if (keys.containsKey("seamark:light_float:name")) 39 setName(keys.get("seamark:light_float:name")); 40 41 /* 32 42 33 43 setBuoyIndex(SAFE_WATER); 34 44 setColour(SeaMark.RED_WHITE); 35 setLightColour("W"); //$NON-NLS-1$ 36 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$ 37 38 if (keys.containsKey("name")) //$NON-NLS-1$ 39 setName(keys.get("name")); //$NON-NLS-1$ 40 41 if (keys.containsKey("seamark:name")) //$NON-NLS-1$ 42 setName(keys.get("seamark:name")); //$NON-NLS-1$ 43 44 if (keys.containsKey("seamark:buoy_safe_water:name")) //$NON-NLS-1$ 45 setName(keys.get("seamark:buoy_safe_water:name")); //$NON-NLS-1$ 46 else if (keys.containsKey("seamark:beacon_safe_water:name")) //$NON-NLS-1$ 47 setName(keys.get("seamark:beacon_safe_water:name")); //$NON-NLS-1$ 48 else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$ 49 setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$ 50 51 if (keys.containsKey("seamark:buoy_safe_water:shape")) { //$NON-NLS-1$ 52 str = keys.get("seamark:buoy_safe_water:shape"); //$NON-NLS-1$ 53 54 if (str.equals("pillar")) //$NON-NLS-1$ 45 setLightColour("W"); 46 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); 47 48 if (keys.containsKey("seamark:buoy_safe_water:shape")) { 49 str = keys.get("seamark:buoy_safe_water:shape"); 50 51 if (str.equals("pillar")) 55 52 setStyleIndex(SAFE_PILLAR); 56 else if (str.equals("spar")) //$NON-NLS-1$53 else if (str.equals("spar")) 57 54 setStyleIndex(SAFE_SPAR); 58 else if (str.equals("sphere")) //$NON-NLS-1$55 else if (str.equals("sphere")) 59 56 setStyleIndex(SAFE_SPHERE); 60 } else if ((keys.containsKey("seamark:type")) //$NON-NLS-1$61 && (keys.get("seamark:type").equals("light_float"))) { //$NON-NLS-1$ //$NON-NLS-2$57 } else if ((keys.containsKey("seamark:type")) 58 && (keys.get("seamark:type").equals("light_float"))) { 62 59 setStyleIndex(SAFE_FLOAT); 63 } else if ((keys.containsKey("seamark:type")) //$NON-NLS-1$64 && (keys.get("seamark:type").equals("beacon_safe_water"))) { //$NON-NLS-1$ //$NON-NLS-2$60 } else if ((keys.containsKey("seamark:type")) 61 && (keys.get("seamark:type").equals("beacon_safe_water"))) { 65 62 setStyleIndex(SAFE_BEACON); 66 63 } … … 69 66 setStyleIndex(0); 70 67 71 if (keys.containsKey("seamark:topmark:shape") //$NON-NLS-1$72 || keys.containsKey("seamark:topmark:colour")) { //$NON-NLS-1$68 if (keys.containsKey("seamark:topmark:shape") 69 || keys.containsKey("seamark:topmark:colour")) { 73 70 setTopMark(true); 74 71 } … … 85 82 public void refreshLights() { 86 83 dlg.cbM01Kennung.removeAllItems(); 87 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$88 dlg.cbM01Kennung.addItem("Iso"); //$NON-NLS-1$89 dlg.cbM01Kennung.addItem("Oc"); //$NON-NLS-1$90 dlg.cbM01Kennung.addItem("LFl"); //$NON-NLS-1$91 dlg.cbM01Kennung.addItem("Mo"); //$NON-NLS-1$84 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); 85 dlg.cbM01Kennung.addItem("Iso"); 86 dlg.cbM01Kennung.addItem("Oc"); 87 dlg.cbM01Kennung.addItem("LFl"); 88 dlg.cbM01Kennung.addItem("Mo"); 92 89 dlg.cbM01Kennung.setSelectedIndex(0); 93 90 } … … 98 95 99 96 public void setLightColour() { 100 super.setLightColour("W"); //$NON-NLS-1$97 super.setLightColour("W"); 101 98 } 102 99 */ … … 142 139 } 143 140 144 String image = "/images/Safe_Water"; //$NON-NLS-1$141 String image = "/images/Safe_Water"; 145 142 146 143 switch (getStyleIndex()) { 147 144 case SAFE_PILLAR: 148 image += "_Pillar"; //$NON-NLS-1$145 image += "_Pillar"; 149 146 break; 150 147 case SAFE_SPAR: 151 image += "_Spar"; //$NON-NLS-1$148 image += "_Spar"; 152 149 break; 153 150 case SAFE_SPHERE: 154 image += "_Sphere"; //$NON-NLS-1$151 image += "_Sphere"; 155 152 break; 156 153 case SAFE_BEACON: 157 image += "_Beacon"; //$NON-NLS-1$154 image += "_Beacon"; 158 155 break; 159 156 case SAFE_FLOAT: 160 image += "_Float"; //$NON-NLS-1$157 image += "_Float"; 161 158 break; 162 159 default: 163 160 } 164 161 165 if (!image.equals("/images/Safe_Water")) { //$NON-NLS-1$166 image += ".png"; //$NON-NLS-1$162 if (!image.equals("/images/Safe_Water")) { 163 image += ".png"; 167 164 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 168 165 if (hasTopMark()) { … … 171 168 case SAFE_PILLAR: 172 169 case SAFE_SPAR: 173 image = "/images/Top_Sphere_Red_Buoy.png"; //$NON-NLS-1$170 image = "/images/Top_Sphere_Red_Buoy.png"; 174 171 break; 175 172 case SAFE_SPHERE: 176 image = "/images/Top_Sphere_Red_Buoy_Small.png"; //$NON-NLS-1$173 image = "/images/Top_Sphere_Red_Buoy_Small.png"; 177 174 break; 178 175 case SAFE_BEACON: 179 image = "/images/Top_Sphere_Red_Beacon.png"; //$NON-NLS-1$176 image = "/images/Top_Sphere_Red_Beacon.png"; 180 177 break; 181 178 case SAFE_FLOAT: 182 image = "/images/Top_Sphere_Red_Float.png"; //$NON-NLS-1$179 image = "/images/Top_Sphere_Red_Float.png"; 183 180 break; 184 181 } … … 192 189 193 190 public void saveSign() { 194 /*Node node = getNode();191 Node node = getNode(); 195 192 196 193 if (node == null) { … … 198 195 } 199 196 200 switch (getS tyleIndex()) {201 case SAFE_PILLAR:202 super.saveSign("buoy_safe_water"); //$NON-NLS-1$203 Main.main.undoRedo.add(new ChangePropertyCommand(node, 204 "seamark:buoy_safe_water:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$205 break; 206 case S AFE_SPAR:207 super.saveSign("buoy_safe_water"); //$NON-NLS-1$208 Main.main.undoRedo.add(new ChangePropertyCommand(node, 209 "seamark:buoy_safe_water:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$210 break; 211 case S AFE_SPHERE:212 super.saveSign("buoy_safe_water"); //$NON-NLS-1$213 Main.main.undoRedo.add(new ChangePropertyCommand(node, 214 "seamark:buoy_safe_water:shape", "sphere")); //$NON-NLS-1$ //$NON-NLS-2$215 break; 216 case SAFE_BEACON:217 super.saveSign("beacon_safe_water"); //$NON-NLS-1$218 break; 219 case SAFE_FLOAT:220 super.saveSign("light_float"); //$NON-NLS-1$197 switch (getShape()) { 198 case PILLAR: 199 super.saveSign("buoy_safe_water"); 200 Main.main.undoRedo.add(new ChangePropertyCommand(node, 201 "seamark:buoy_safe_water:shape", "pillar")); 202 break; 203 case SPAR: 204 super.saveSign("buoy_safe_water"); 205 Main.main.undoRedo.add(new ChangePropertyCommand(node, 206 "seamark:buoy_safe_water:shape", "spar")); 207 break; 208 case SPHERE: 209 super.saveSign("buoy_safe_water"); 210 Main.main.undoRedo.add(new ChangePropertyCommand(node, 211 "seamark:buoy_safe_water:shape", "sphere")); 212 break; 213 case BEACON: 214 super.saveSign("beacon_safe_water"); 215 break; 216 case FLOAT: 217 super.saveSign("light_float"); 221 218 break; 222 219 default: 223 220 } 224 221 225 switch (getS tyleIndex()) {226 case SAFE_PILLAR:227 case S AFE_SPAR:228 case S AFE_SPHERE:229 Main.main.undoRedo.add(new ChangePropertyCommand(node, 230 "seamark:buoy_safe_water:colour_pattern", "vertical stripes")); //$NON-NLS-1$ //$NON-NLS-2$231 Main.main.undoRedo.add(new ChangePropertyCommand(node, 232 "seamark:buoy_safe_water:colour", "red;white")); //$NON-NLS-1$ //$NON-NLS-2$233 break; 234 case SAFE_BEACON:235 Main.main.undoRedo.add(new ChangePropertyCommand(node, 236 "seamark:beacon_safe_water:colour_pattern", "vertical stripes")); //$NON-NLS-1$ //$NON-NLS-2$237 Main.main.undoRedo.add(new ChangePropertyCommand(node, 238 "seamark:beacon_safe_water:colour", "red;white")); //$NON-NLS-1$ //$NON-NLS-2$239 break; 240 case SAFE_FLOAT:241 Main.main.undoRedo.add(new ChangePropertyCommand(node, 242 "seamark:light_float:colour_pattern", "vertical stripes")); //$NON-NLS-1$ //$NON-NLS-2$243 Main.main.undoRedo.add(new ChangePropertyCommand(node, 244 "seamark:light_float:colour", "red;white")); //$NON-NLS-1$ //$NON-NLS-2$222 switch (getShape()) { 223 case PILLAR: 224 case SPAR: 225 case SPHERE: 226 Main.main.undoRedo.add(new ChangePropertyCommand(node, 227 "seamark:buoy_safe_water:colour_pattern", "vertical stripes")); 228 Main.main.undoRedo.add(new ChangePropertyCommand(node, 229 "seamark:buoy_safe_water:colour", "red;white")); 230 break; 231 case BEACON: 232 Main.main.undoRedo.add(new ChangePropertyCommand(node, 233 "seamark:beacon_safe_water:colour_pattern", "vertical stripes")); 234 Main.main.undoRedo.add(new ChangePropertyCommand(node, 235 "seamark:beacon_safe_water:colour", "red;white")); 236 break; 237 case FLOAT: 238 Main.main.undoRedo.add(new ChangePropertyCommand(node, 239 "seamark:light_float:colour_pattern", "vertical stripes")); 240 Main.main.undoRedo.add(new ChangePropertyCommand(node, 241 "seamark:light_float:colour", "red;white")); 245 242 break; 246 243 default: 247 244 } 248 saveTopMarkData("sphere", "red"); //$NON-NLS-1$ //$NON-NLS-2$249 saveLightData(); //$NON-NLS-1$245 saveTopMarkData("sphere", "red"); 246 saveLightData(); 250 247 saveRadarFogData(); 251 */}248 } 252 249 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java
r24801 r24823 4 4 5 5 import org.openstreetmap.josm.data.osm.Node; 6 import org.openstreetmap.josm.Main; 7 import org.openstreetmap.josm.command.ChangePropertyCommand; 6 8 7 9 import oseam.dialogs.OSeaMAction; … … 19 21 keys = getNode().getKeys(); 20 22 21 /* dlg.cbM01TypeOfMark.setSelectedIndex(SPECIAL_PURPOSE); 22 23 dlg.cbM01StyleOfMark.removeAllItems(); 24 dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 25 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$ 26 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); //$NON-NLS-1$ 27 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$ 28 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$ 29 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$ 30 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$ 31 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$ 32 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.08")); //$NON-NLS-1$ 33 dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.09")); //$NON-NLS-1$ 34 dlg.cbM01StyleOfMark.setVisible(true); 35 dlg.lM01StyleOfMark.setVisible(true); 36 37 dlg.cbM01TopMark.removeAllItems(); 38 dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.212")); 39 dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.210")); //$NON-NLS-1$ 40 dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.211")); //$NON-NLS-1$ 41 dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.214")); //$NON-NLS-1$ 42 dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.215")); //$NON-NLS-1$ 43 23 if (!dlg.panelMain.specButton.isSelected()) 24 dlg.panelMain.specButton.doClick(); 25 26 if (keys.containsKey("name")) 27 setName(keys.get("name")); 28 29 if (keys.containsKey("seamark:name")) 30 setName(keys.get("seamark:name")); 31 32 if (keys.containsKey("seamark:buoy_special_purpose:name")) 33 setName(keys.get("seamark:buoy_special_purpose:name")); 34 else if (keys.containsKey("seamark:beacon_special_purpose:name")) 35 setName(keys.get("seamark:beacon_special_purpose:name")); 36 else if (keys.containsKey("seamark:light_float:name")) 37 setName(keys.get("seamark:light_float:name")); 38 39 /* 44 40 dlg.cM01TopMark.setEnabled(true); 45 41 46 42 setBuoyIndex(SPECIAL_PURPOSE); 47 43 setColour(SeaMark.YELLOW); 48 setLightColour("W"); //$NON-NLS-1$ 49 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$ 50 51 if (keys.containsKey("name")) //$NON-NLS-1$ 52 setName(keys.get("name")); //$NON-NLS-1$ 53 54 if (keys.containsKey("seamark:name")) //$NON-NLS-1$ 55 setName(keys.get("seamark:name")); //$NON-NLS-1$ 56 57 if (keys.containsKey("seamark:buoy_special_purpose:name")) //$NON-NLS-1$ 58 setName(keys.get("seamark:buoy_special_purpose:name")); //$NON-NLS-1$ 59 else if (keys.containsKey("seamark:beacon_special_purpose:name")) //$NON-NLS-1$ 60 setName(keys.get("seamark:beacon_special_purpose:name")); //$NON-NLS-1$ 61 else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$ 62 setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$ 63 64 if (keys.containsKey("seamark:buoy_special_purpose:shape")) { //$NON-NLS-1$ 65 str = keys.get("seamark:buoy_special_purpose:shape"); //$NON-NLS-1$ 66 67 if (str.equals("pillar")) //$NON-NLS-1$ 44 setLightColour("W"); 45 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); 46 47 if (keys.containsKey("seamark:buoy_special_purpose:shape")) { 48 str = keys.get("seamark:buoy_special_purpose:shape"); 49 50 if (str.equals("pillar")) 68 51 setStyleIndex(SPEC_PILLAR); 69 else if (str.equals("can")) //$NON-NLS-1$52 else if (str.equals("can")) 70 53 setStyleIndex(SPEC_CAN); 71 else if (str.equals("conical")) //$NON-NLS-1$54 else if (str.equals("conical")) 72 55 setStyleIndex(SPEC_CONE); 73 else if (str.equals("spar")) //$NON-NLS-1$56 else if (str.equals("spar")) 74 57 setStyleIndex(SPEC_SPAR); 75 else if (str.equals("sphere")) //$NON-NLS-1$58 else if (str.equals("sphere")) 76 59 setStyleIndex(SPEC_SPHERE); 77 else if (str.equals("barrel")) //$NON-NLS-1$60 else if (str.equals("barrel")) 78 61 setStyleIndex(SPEC_BARREL); 79 62 } 80 63 81 if (keys.containsKey("seamark:beacon_special_purpose:shape")) { //$NON-NLS-1$82 str = keys.get("seamark:beacon_special_purpose:shape"); //$NON-NLS-1$83 if (str.equals("tower")) //$NON-NLS-1$64 if (keys.containsKey("seamark:beacon_special_purpose:shape")) { 65 str = keys.get("seamark:beacon_special_purpose:shape"); 66 if (str.equals("tower")) 84 67 setStyleIndex(SPEC_TOWER); 85 68 else … … 91 74 } 92 75 93 if ((keys.containsKey("seamark:type") && keys.get("seamark:type").equals( //$NON-NLS-1$ //$NON-NLS-2$94 "beacon_special_purpose")) //$NON-NLS-1$95 || keys.containsKey("seamark:beacon_special_purpose:colour") //$NON-NLS-1$96 || keys.containsKey("seamark:beacon_special_purpose:shape")) { //$NON-NLS-1$97 if (keys.containsKey("seamark:beacon_special_purpose:shape") //$NON-NLS-1$98 && keys.get("seamark:beacon_special_purpose:shape").equals("tower")) //$NON-NLS-1$ //$NON-NLS-2$76 if ((keys.containsKey("seamark:type") && keys.get("seamark:type").equals( 77 "beacon_special_purpose")) 78 || keys.containsKey("seamark:beacon_special_purpose:colour") 79 || keys.containsKey("seamark:beacon_special_purpose:shape")) { 80 if (keys.containsKey("seamark:beacon_special_purpose:shape") 81 && keys.get("seamark:beacon_special_purpose:shape").equals("tower")) 99 82 setStyleIndex(SPEC_TOWER); 100 83 else 101 84 setStyleIndex(SPEC_BEACON); 102 } else if (keys.containsKey("seamark:light_float:colour") //$NON-NLS-1$103 && keys.get("seamark:light_float:colour").equals("yellow")) //$NON-NLS-1$ //$NON-NLS-2$85 } else if (keys.containsKey("seamark:light_float:colour") 86 && keys.get("seamark:light_float:colour").equals("yellow")) 104 87 setStyleIndex(SPEC_FLOAT); 105 88 … … 108 91 109 92 keys = node.getKeys(); 110 if (keys.containsKey("seamark:topmark:shape")) { //$NON-NLS-1$111 str = keys.get("seamark:topmark:shape"); //$NON-NLS-1$93 if (keys.containsKey("seamark:topmark:shape")) { 94 str = keys.get("seamark:topmark:shape"); 112 95 setTopMark(true); 113 if (str.equals("x-shape")) { //$NON-NLS-1$114 if (keys.containsKey("seamark:topmark:colour")) { //$NON-NLS-1$96 if (str.equals("x-shape")) { 97 if (keys.containsKey("seamark:topmark:colour")) { 115 98 if (keys.get("seamark:topmark:colour").equals("red")) 116 99 setTopMarkIndex(TOP_RED_X); … … 118 101 setTopMarkIndex(TOP_YELLOW_X); 119 102 } 120 } else if (str.equals("cone, point up")) { //$NON-NLS-1$103 } else if (str.equals("cone, point up")) { 121 104 setTopMarkIndex(TOP_YELLOW_CONE); 122 } else if (str.equals("cylinder")) { //$NON-NLS-1$105 } else if (str.equals("cylinder")) { 123 106 setTopMarkIndex(TOP_YELLOW_CAN); 124 107 } … … 154 137 155 138 public void setLightColour() { 156 super.setLightColour("W"); //$NON-NLS-1$139 super.setLightColour("W"); 157 140 } 158 141 */ … … 205 188 } 206 189 207 String image = "/images/Special_Purpose"; //$NON-NLS-1$190 String image = "/images/Special_Purpose"; 208 191 209 192 switch (getStyleIndex()) { 210 193 case SPEC_PILLAR: 211 image += "_Pillar"; //$NON-NLS-1$194 image += "_Pillar"; 212 195 break; 213 196 case SPEC_CAN: 214 image += "_Can"; //$NON-NLS-1$197 image += "_Can"; 215 198 break; 216 199 case SPEC_CONE: 217 image += "_Cone"; //$NON-NLS-1$200 image += "_Cone"; 218 201 break; 219 202 case SPEC_SPAR: 220 image += "_Spar"; //$NON-NLS-1$203 image += "_Spar"; 221 204 break; 222 205 case SPEC_SPHERE: 223 image += "_Sphere"; //$NON-NLS-1$206 image += "_Sphere"; 224 207 break; 225 208 case SPEC_BARREL: 226 image += "_Barrel"; //$NON-NLS-1$209 image += "_Barrel"; 227 210 break; 228 211 case SPEC_FLOAT: 229 image += "_Float"; //$NON-NLS-1$212 image += "_Float"; 230 213 break; 231 214 case SPEC_BEACON: 232 image += "_Beacon"; //$NON-NLS-1$215 image += "_Beacon"; 233 216 break; 234 217 case SPEC_TOWER: 235 image += "_Tower"; //$NON-NLS-1$218 image += "_Tower"; 236 219 break; 237 220 default: 238 221 } 239 222 240 if (!image.equals("/images/Special_Purpose")) { //$NON-NLS-1$241 image += ".png"; //$NON-NLS-1$223 if (!image.equals("/images/Special_Purpose")) { 224 image += ".png"; 242 225 dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image))); 243 226 if (hasTopMark()) { … … 248 231 switch (getTopMarkIndex()) { 249 232 case TOP_YELLOW_X: 250 image = "/images/Top_X_Yellow_Buoy.png"; //$NON-NLS-1$233 image = "/images/Top_X_Yellow_Buoy.png"; 251 234 break; 252 235 case TOP_RED_X: 253 image = "/images/Top_X_Red_Buoy.png"; //$NON-NLS-1$236 image = "/images/Top_X_Red_Buoy.png"; 254 237 break; 255 238 case TOP_YELLOW_CAN: 256 image = "/images/Top_Can_Yellow_Buoy.png"; //$NON-NLS-1$239 image = "/images/Top_Can_Yellow_Buoy.png"; 257 240 break; 258 241 case TOP_YELLOW_CONE: 259 image = "/images/Top_Cone_Yellow_Buoy.png"; //$NON-NLS-1$242 image = "/images/Top_Cone_Yellow_Buoy.png"; 260 243 break; 261 244 } … … 267 250 switch (getTopMarkIndex()) { 268 251 case TOP_YELLOW_X: 269 image = "/images/Top_X_Yellow_Buoy_Small.png"; //$NON-NLS-1$252 image = "/images/Top_X_Yellow_Buoy_Small.png"; 270 253 break; 271 254 case TOP_RED_X: 272 image = "/images/Top_X_Red_Buoy_Small.png"; //$NON-NLS-1$255 image = "/images/Top_X_Red_Buoy_Small.png"; 273 256 break; 274 257 case TOP_YELLOW_CAN: 275 image = "/images/Top_Can_Yellow_Buoy_Small.png"; //$NON-NLS-1$258 image = "/images/Top_Can_Yellow_Buoy_Small.png"; 276 259 break; 277 260 case TOP_YELLOW_CONE: 278 image = "/images/Top_Cone_Yellow_Buoy_Small.png"; //$NON-NLS-1$261 image = "/images/Top_Cone_Yellow_Buoy_Small.png"; 279 262 break; 280 263 } … … 284 267 switch (getTopMarkIndex()) { 285 268 case TOP_YELLOW_X: 286 image = "/images/Top_X_Yellow_Beacon.png"; //$NON-NLS-1$269 image = "/images/Top_X_Yellow_Beacon.png"; 287 270 break; 288 271 case TOP_RED_X: 289 image = "/images/Top_X_Red_Beacon.png"; //$NON-NLS-1$272 image = "/images/Top_X_Red_Beacon.png"; 290 273 break; 291 274 case TOP_YELLOW_CAN: 292 image = "/images/Top_Can_Yellow_Beacon.png"; //$NON-NLS-1$275 image = "/images/Top_Can_Yellow_Beacon.png"; 293 276 break; 294 277 case TOP_YELLOW_CONE: 295 image = "/images/Top_Cone_Yellow_Beacon.png"; //$NON-NLS-1$278 image = "/images/Top_Cone_Yellow_Beacon.png"; 296 279 break; 297 280 } … … 300 283 switch (getTopMarkIndex()) { 301 284 case TOP_YELLOW_X: 302 image = "/images/Top_X_Yellow_Float.png"; //$NON-NLS-1$285 image = "/images/Top_X_Yellow_Float.png"; 303 286 break; 304 287 case TOP_RED_X: 305 image = "/images/Top_X_Red_Float.png"; //$NON-NLS-1$288 image = "/images/Top_X_Red_Float.png"; 306 289 break; 307 290 case TOP_YELLOW_CAN: 308 image = "/images/Top_Can_Yellow_Float.png"; //$NON-NLS-1$291 image = "/images/Top_Can_Yellow_Float.png"; 309 292 break; 310 293 case TOP_YELLOW_CONE: 311 image = "/images/Top_Cone_Yellow_Float.png"; //$NON-NLS-1$294 image = "/images/Top_Cone_Yellow_Float.png"; 312 295 break; 313 296 } … … 323 306 324 307 public void saveSign() { 325 /*Node node = getNode();308 Node node = getNode(); 326 309 327 310 if (node == null) { … … 329 312 } 330 313 331 switch (getS tyleIndex()) {332 case SPEC_PILLAR:333 super.saveSign("buoy_special_purpose"); //$NON-NLS-1$334 Main.main.undoRedo.add(new ChangePropertyCommand(node, 335 "seamark:buoy_special_purpose:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$336 Main.main.undoRedo.add(new ChangePropertyCommand(node, 337 "seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$338 break; 339 case SP EC_SPAR:340 super.saveSign("buoy_special_purpose"); //$NON-NLS-1$341 Main.main.undoRedo.add(new ChangePropertyCommand(node, 342 "seamark:buoy_special_purpose:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$343 Main.main.undoRedo.add(new ChangePropertyCommand(node, 344 "seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$345 break; 346 case SPEC_CAN:347 super.saveSign("buoy_special_purpose"); //$NON-NLS-1$348 Main.main.undoRedo.add(new ChangePropertyCommand(node, 349 "seamark:buoy_special_purpose:shape", "can")); //$NON-NLS-1$ //$NON-NLS-2$350 Main.main.undoRedo.add(new ChangePropertyCommand(node, 351 "seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$352 break; 353 case SPEC_CONE:354 super.saveSign("buoy_special_purpose"); //$NON-NLS-1$355 Main.main.undoRedo.add(new ChangePropertyCommand(node, 356 "seamark:buoy_special_purpose:shape", "conical")); //$NON-NLS-1$ //$NON-NLS-2$357 Main.main.undoRedo.add(new ChangePropertyCommand(node, 358 "seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$359 break; 360 case SP EC_SPHERE:361 super.saveSign("buoy_special_purpose"); //$NON-NLS-1$362 Main.main.undoRedo.add(new ChangePropertyCommand(node, 363 "seamark:buoy_special_purpose:shape", "sphere")); //$NON-NLS-1$ //$NON-NLS-2$364 Main.main.undoRedo.add(new ChangePropertyCommand(node, 365 "seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$366 break; 367 case SPEC_BARREL:368 super.saveSign("buoy_special_purpose"); //$NON-NLS-1$369 Main.main.undoRedo.add(new ChangePropertyCommand(node, 370 "seamark:buoy_special_purpose:shape", "barrel")); //$NON-NLS-1$ //$NON-NLS-2$371 Main.main.undoRedo.add(new ChangePropertyCommand(node, 372 "seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$373 break; 374 case SPEC_FLOAT:375 super.saveSign("light_float"); //$NON-NLS-1$376 Main.main.undoRedo.add(new ChangePropertyCommand(node, 377 "seamark:light_float:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$378 break; 379 case SPEC_BEACON:380 super.saveSign("beacon_special_purpose"); //$NON-NLS-1$381 Main.main.undoRedo.add(new ChangePropertyCommand(node, 382 "seamark:beacon_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$383 break; 384 case SPEC_TOWER:385 super.saveSign("beacon_special_purpose"); //$NON-NLS-1$386 Main.main.undoRedo.add(new ChangePropertyCommand(node, 387 "seamark:beacon_special_purpose:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$388 Main.main.undoRedo.add(new ChangePropertyCommand(node, 389 "seamark:beacon_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$314 switch (getShape()) { 315 case PILLAR: 316 super.saveSign("buoy_special_purpose"); 317 Main.main.undoRedo.add(new ChangePropertyCommand(node, 318 "seamark:buoy_special_purpose:shape", "pillar")); 319 Main.main.undoRedo.add(new ChangePropertyCommand(node, 320 "seamark:buoy_special_purpose:colour", "yellow")); 321 break; 322 case SPAR: 323 super.saveSign("buoy_special_purpose"); 324 Main.main.undoRedo.add(new ChangePropertyCommand(node, 325 "seamark:buoy_special_purpose:shape", "spar")); 326 Main.main.undoRedo.add(new ChangePropertyCommand(node, 327 "seamark:buoy_special_purpose:colour", "yellow")); 328 break; 329 case CAN: 330 super.saveSign("buoy_special_purpose"); 331 Main.main.undoRedo.add(new ChangePropertyCommand(node, 332 "seamark:buoy_special_purpose:shape", "can")); 333 Main.main.undoRedo.add(new ChangePropertyCommand(node, 334 "seamark:buoy_special_purpose:colour", "yellow")); 335 break; 336 case CONE: 337 super.saveSign("buoy_special_purpose"); 338 Main.main.undoRedo.add(new ChangePropertyCommand(node, 339 "seamark:buoy_special_purpose:shape", "conical")); 340 Main.main.undoRedo.add(new ChangePropertyCommand(node, 341 "seamark:buoy_special_purpose:colour", "yellow")); 342 break; 343 case SPHERE: 344 super.saveSign("buoy_special_purpose"); 345 Main.main.undoRedo.add(new ChangePropertyCommand(node, 346 "seamark:buoy_special_purpose:shape", "sphere")); 347 Main.main.undoRedo.add(new ChangePropertyCommand(node, 348 "seamark:buoy_special_purpose:colour", "yellow")); 349 break; 350 case BARREL: 351 super.saveSign("buoy_special_purpose"); 352 Main.main.undoRedo.add(new ChangePropertyCommand(node, 353 "seamark:buoy_special_purpose:shape", "barrel")); 354 Main.main.undoRedo.add(new ChangePropertyCommand(node, 355 "seamark:buoy_special_purpose:colour", "yellow")); 356 break; 357 case FLOAT: 358 super.saveSign("light_float"); 359 Main.main.undoRedo.add(new ChangePropertyCommand(node, 360 "seamark:light_float:colour", "yellow")); 361 break; 362 case BEACON: 363 super.saveSign("beacon_special_purpose"); 364 Main.main.undoRedo.add(new ChangePropertyCommand(node, 365 "seamark:beacon_special_purpose:colour", "yellow")); 366 break; 367 case TOWER: 368 super.saveSign("beacon_special_purpose"); 369 Main.main.undoRedo.add(new ChangePropertyCommand(node, 370 "seamark:beacon_special_purpose:shape", "tower")); 371 Main.main.undoRedo.add(new ChangePropertyCommand(node, 372 "seamark:beacon_special_purpose:colour", "yellow")); 390 373 break; 391 374 default: 392 375 } 393 switch (getTopMarkIndex()) {376 /* switch (getTopMarkIndex()) { 394 377 case TOP_YELLOW_X: 395 saveTopMarkData("x-shape", "yellow"); //$NON-NLS-1$ //$NON-NLS-2$378 saveTopMarkData("x-shape", "yellow"); 396 379 break; 397 380 case TOP_RED_X: 398 saveTopMarkData("x-shape", "red"); //$NON-NLS-1$ //$NON-NLS-2$381 saveTopMarkData("x-shape", "red"); 399 382 break; 400 383 case TOP_YELLOW_CAN: 401 saveTopMarkData("cylinder", "yellow"); //$NON-NLS-1$ //$NON-NLS-2$384 saveTopMarkData("cylinder", "yellow"); 402 385 break; 403 386 case TOP_YELLOW_CONE: 404 saveTopMarkData("cone, point up", "yellow"); //$NON-NLS-1$ //$NON-NLS-2$405 break; 406 } 407 saveLightData(); //$NON-NLS-1$ 387 saveTopMarkData("cone, point up", "yellow"); 388 break; 389 } 390 */ saveLightData(); 408 391 saveRadarFogData(); 409 */}392 } 410 393 }
Note:
See TracChangeset
for help on using the changeset viewer.