Changeset 24779 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2010-12-16T22:50:22+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 2 edited
- 7 copied
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
r24778 r24779 102 102 return panelMain; 103 103 } 104 /* 104 105 105 private void parseSeaMark() { 106 106 … … 112 112 113 113 ds = Main.main.getCurrentDataSet(); 114 114 /* 115 115 if (ds == null) { 116 116 mark = new MarkUkn(this, Messages.getString("SmpDialogAction.26")); … … 268 268 mark.paintSign(); 269 269 return; 270 }271 */ 270 */ } 271 272 272 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkCard.java
r24762 r24779 1 //License: GPL. For details, see LICENSE file. 2 // Copyright (c) 2009 / 2010 by Werner Koenig & Malcolm Herring 3 4 package toms.seamarks.buoys; 1 package oseam.seamarks; 5 2 6 3 import java.util.Map; … … 12 9 import org.openstreetmap.josm.data.osm.Node; 13 10 14 import toms.Messages;15 import toms.dialogs.SmpDialogAction;16 import toms.seamarks.SeaMark;17 18 public class BuoyCard extends Buoy{19 20 public BuoyCard(SmpDialogAction dia, Node node) {11 import oseam.Messages; 12 import oseam.dialogs.OSeaMAction; 13 import oseam.seamarks.SeaMark; 14 15 public class MarkCard extends SeaMark { 16 17 public MarkCard(OSeaMAction dia, Node node) { 21 18 super(dia); 22 19 … … 25 22 keys = node.getKeys(); 26 23 setNode(node); 27 28 resetMask(); 24 /* 29 25 dlg.cbM01TypeOfMark.setSelectedIndex(CARDINAL); 30 26 … … 49 45 dlg.cbM01StyleOfMark.setVisible(true); 50 46 dlg.lM01StyleOfMark.setVisible(true); 51 47 */ 52 48 setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$ 53 49 if (keys.containsKey("name")) //$NON-NLS-1$ … … 81 77 if (cat.isEmpty()) { //$NON-NLS-1$ 82 78 if (col.equals("black;yellow")) { //$NON-NLS-1$ 83 set BuoyIndex(CARD_NORTH);79 setMarkIndex(CARD_NORTH); 84 80 setColour(BLACK_YELLOW); 85 81 } else if (col.equals("black;yellow;black")) { //$NON-NLS-1$ 86 set BuoyIndex(CARD_EAST);82 setMarkIndex(CARD_EAST); 87 83 setColour(BLACK_YELLOW_BLACK); 88 84 } else if (col.equals("yellow;black")) { //$NON-NLS-1$ 89 set BuoyIndex(CARD_SOUTH);85 setMarkIndex(CARD_SOUTH); 90 86 setColour(YELLOW_BLACK); 91 87 } else if (col.equals("yellow;black;yellow")) { //$NON-NLS-1$ 92 set BuoyIndex(CARD_WEST);88 setMarkIndex(CARD_WEST); 93 89 setColour(YELLOW_BLACK_YELLOW); 94 90 } 95 91 } else if (cat.equals("north")) { //$NON-NLS-1$ 96 set BuoyIndex(CARD_NORTH);92 setMarkIndex(CARD_NORTH); 97 93 setColour(BLACK_YELLOW); 98 94 } else if (cat.equals("east")) { //$NON-NLS-1$ 99 set BuoyIndex(CARD_EAST);95 setMarkIndex(CARD_EAST); 100 96 setColour(BLACK_YELLOW_BLACK); 101 97 } else if (cat.equals("south")) { //$NON-NLS-1$ 102 set BuoyIndex(CARD_SOUTH);98 setMarkIndex(CARD_SOUTH); 103 99 setColour(YELLOW_BLACK); 104 100 } else if (cat.equals("west")) { //$NON-NLS-1$ 105 set BuoyIndex(CARD_WEST);101 setMarkIndex(CARD_WEST); 106 102 setColour(YELLOW_BLACK_YELLOW); 107 103 } … … 129 125 } 130 126 131 if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())132 setStyleIndex(0);133 134 refreshLights();135 parseLights(keys);136 parseFogRadar(keys);137 138 dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());139 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());140 dlg.tfM01Name.setText(getName());141 dlg.cM01TopMark.setSelected(hasTopMark());127 // if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount()) 128 // setStyleIndex(0); 129 130 // refreshLights(); 131 // parseLights(keys); 132 // parseFogRadar(keys); 133 134 // dlg.cbM01CatOfMark.setSelectedIndex(getMarkIndex()); 135 // dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex()); 136 // dlg.tfM01Name.setText(getName()); 137 // dlg.cM01TopMark.setSelected(hasTopMark()); 142 138 } 143 139 /* 144 140 public void refreshLights() { 145 141 dlg.cbM01Kennung.removeAllItems(); … … 147 143 dlg.cbM01Kennung.setSelectedIndex(0); 148 144 149 switch (get BuoyIndex()) {145 switch (getMarkIndex()) { 150 146 case CARD_NORTH: 151 147 dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$ … … 168 164 169 165 public boolean isValid() { 170 return (get BuoyIndex() > 0) && (getStyleIndex() > 0);166 return (getMarkIndex() > 0) && (getStyleIndex() > 0); 171 167 } 172 168 */ 173 169 public void setLightColour() { 174 170 super.setLightColour("W"); //$NON-NLS-1$ … … 176 172 177 173 public void paintSign() { 178 if (dlg.paintlock)174 /* if (dlg.paintlock) 179 175 return; 180 176 super.paintSign(); … … 241 237 } 242 238 243 switch (get BuoyIndex()) {239 switch (getMarkIndex()) { 244 240 case CARD_NORTH: 245 241 image += "_North"; //$NON-NLS-1$ … … 265 261 dlg.lM01Icon.setIcon(null); 266 262 } 267 }263 */ } 268 264 269 265 public void saveSign() { 270 Node node = getNode();266 /* Node node = getNode(); 271 267 if (node == null) { 272 268 return; … … 303 299 case CARD_PILLAR: 304 300 case CARD_SPAR: 305 switch (get BuoyIndex()) {301 switch (getMarkIndex()) { 306 302 case SeaMark.CARD_NORTH: 307 303 Main.main.undoRedo.add(new ChangePropertyCommand(node, … … 341 337 case CARD_BEACON: 342 338 case CARD_TOWER: 343 switch (get BuoyIndex()) {339 switch (getMarkIndex()) { 344 340 case SeaMark.CARD_NORTH: 345 341 Main.main.undoRedo.add(new ChangePropertyCommand(node, … … 378 374 break; 379 375 case CARD_FLOAT: 380 switch (get BuoyIndex()) {376 switch (getMarkIndex()) { 381 377 case SeaMark.CARD_NORTH: 382 378 Main.main.undoRedo.add(new ChangePropertyCommand(node, … … 410 406 saveLightData(); //$NON-NLS-1$ 411 407 saveRadarFogData(); 412 } 408 */ } 409 413 410 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java
r24762 r24779 1 //License: GPL. For details, see LICENSE file. 2 // Copyright (c) 2009 / 2010 by Werner Koenig & Malcolm Herring 3 4 package toms.seamarks.buoys; 1 package oseam.seamarks; 5 2 6 3 import java.util.Map; … … 12 9 import org.openstreetmap.josm.data.osm.Node; 13 10 14 import toms.Messages;15 import toms.dialogs.SmpDialogAction;16 import toms.seamarks.SeaMark;17 18 public class BuoyIsol extends Buoy{19 public BuoyIsol(SmpDialogAction dia, Node node) {11 import oseam.Messages; 12 import oseam.dialogs.OSeaMAction; 13 import oseam.seamarks.SeaMark; 14 15 public class MarkIsol extends SeaMark { 16 public MarkIsol(OSeaMAction dia, Node node) { 20 17 super(dia); 21 18 … … 24 21 keys = node.getKeys(); 25 22 setNode(node); 26 27 resetMask(); 23 /* 28 24 dlg.cbM01TypeOfMark.setSelectedIndex(ISOLATED_DANGER); 29 25 … … 92 88 dlg.tfM01Name.setText(getName()); 93 89 dlg.cM01TopMark.setSelected(hasTopMark()); 94 }95 90 */ } 91 /* 96 92 public void refreshLights() { 97 93 dlg.cbM01Kennung.removeAllItems(); … … 108 104 super.setLightColour("W"); //$NON-NLS-1$ 109 105 } 110 106 */ 111 107 public void paintSign() { 112 if (dlg.paintlock)108 /* if (dlg.paintlock) 113 109 return; 114 110 … … 184 180 dlg.cM01Fired.setVisible(false); 185 181 } 186 }182 */ } 187 183 188 184 public void saveSign() { 189 Node node = getNode();185 /* Node node = getNode(); 190 186 191 187 if (node == null) { … … 245 241 saveLightData(); //$NON-NLS-1$ 246 242 saveRadarFogData(); 247 }243 */ } 248 244 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java
r24762 r24779 1 //License: GPL. For details, see LICENSE file. 2 // Copyright (c) 2009 / 2010 by Werner Koenig & Malcolm Herring 3 4 package toms.seamarks.buoys; 1 package oseam.seamarks; 5 2 6 3 import java.util.Map; … … 12 9 import org.openstreetmap.josm.data.osm.Node; 13 10 14 import toms.Messages;15 import toms.dialogs.SmpDialogAction;16 17 public class BuoyLat extends Buoy{18 public BuoyLat(SmpDialogAction dia, Node node) {11 import oseam.Messages; 12 import oseam.dialogs.OSeaMAction; 13 14 public class MarkLat extends SeaMark { 15 public MarkLat(OSeaMAction dia, Node node) { 19 16 super(dia); 20 17 … … 23 20 keys = node.getKeys(); 24 21 setNode(node); 25 26 resetMask(); 22 /* 27 23 dlg.cbM01TypeOfMark.setSelectedIndex(LATERAL); 28 24 … … 285 281 dlg.tfM01Name.setText(getName()); 286 282 dlg.cM01TopMark.setSelected(hasTopMark()); 287 }288 283 */ } 284 /* 289 285 public void refreshStyles() { 290 286 int type = getBuoyIndex(); … … 360 356 } 361 357 } 362 358 */ 363 359 public void paintSign() { 364 if (dlg.paintlock)360 /* if (dlg.paintlock) 365 361 return; 366 362 super.paintSign(); … … 714 710 dlg.lM01Icon.setIcon(null); 715 711 } 716 }712 */ } 717 713 718 714 public void saveSign() { 719 Node node = getNode();715 /* Node node = getNode(); 720 716 721 717 if (node == null) { … … 1070 1066 1071 1067 Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 1072 }1068 */ } 1073 1069 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java
r24762 r24779 1 //License: GPL. For details, see LICENSE file. 2 // Copyright (c) 2009 / 2010 by Werner Koenig & Malcolm Herring 3 4 package toms.seamarks.buoys; 1 package oseam.seamarks; 5 2 6 3 import java.util.Map; … … 12 9 import org.openstreetmap.josm.data.osm.Node; 13 10 14 import toms.Messages;15 import toms.dialogs.SmpDialogAction;16 import toms.seamarks.SeaMark;11 import oseam.Messages; 12 import oseam.dialogs.OSeaMAction; 13 import oseam.seamarks.SeaMark; 17 14 18 public class BuoyNota extends Buoy{19 public BuoyNota(SmpDialogAction dia, Node node) {15 public class MarkLight extends SeaMark { 16 public MarkLight(OSeaMAction dia, Node node) { 20 17 super(dia); 21 18 … … 24 21 setNode(node); 25 22 26 resetMask(); 27 28 dlg.cbM01TypeOfMark.setSelectedIndex(LIGHT); 23 /* dlg.cbM01TypeOfMark.setSelectedIndex(LIGHT); 29 24 30 25 dlg.cbM01CatOfMark.setEnabled(true); … … 78 73 dlg.cM01Fired.setEnabled(false); 79 74 dlg.cM01Fired.setSelected(true); 80 }81 75 */ } 76 /* 82 77 public boolean isValid() { 83 78 return (getBuoyIndex() > 0); 84 79 } 85 80 */ 86 81 public void paintSign() { 87 if (dlg.paintlock)82 /* if (dlg.paintlock) 88 83 return; 89 84 super.paintSign(); … … 127 122 } 128 123 } 129 }124 */ } 130 125 131 126 public void saveSign() { 132 Node node = getNode();127 /* Node node = getNode(); 133 128 134 129 if (node == null) { … … 153 148 saveLightData(); //$NON-NLS-1$ 154 149 saveRadarFogData(); 155 }150 */ } 156 151 157 152 public void setLightColour() { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java
r24762 r24779 1 //License: GPL. For details, see LICENSE file. 2 // Copyright (c) 2009 / 2010 by Werner Koenig & Malcolm Herring 3 4 package toms.seamarks.buoys; 1 package oseam.seamarks; 5 2 6 3 import java.util.Map; … … 12 9 import org.openstreetmap.josm.data.osm.Node; 13 10 14 import toms.Messages;15 import toms.dialogs.SmpDialogAction;16 import toms.seamarks.SeaMark;17 18 public class BuoySaw extends Buoy{19 public BuoySaw(SmpDialogAction dia, Node node) {11 import oseam.Messages; 12 import oseam.dialogs.OSeaMAction; 13 import oseam.seamarks.SeaMark; 14 15 public class MarkSaw extends SeaMark { 16 public MarkSaw(OSeaMAction dia, Node node) { 20 17 super(dia); 21 18 … … 25 22 setNode(node); 26 23 27 resetMask(); 28 dlg.cbM01TypeOfMark.setSelectedIndex(SAFE_WATER); 24 /* dlg.cbM01TypeOfMark.setSelectedIndex(SAFE_WATER); 29 25 30 26 dlg.cbM01StyleOfMark.removeAllItems(); … … 88 84 dlg.tfM01Name.setText(getName()); 89 85 dlg.cM01TopMark.setSelected(hasTopMark()); 90 }91 86 */ } 87 /* 92 88 public void refreshLights() { 93 89 dlg.cbM01Kennung.removeAllItems(); … … 107 103 super.setLightColour("W"); //$NON-NLS-1$ 108 104 } 109 105 */ 110 106 public void paintSign() { 111 if (dlg.paintlock)107 /* if (dlg.paintlock) 112 108 return; 113 109 super.paintSign(); … … 196 192 dlg.lM01Icon.setIcon(null); 197 193 } 198 }194 */ } 199 195 200 196 public void saveSign() { 201 Node node = getNode();197 /* Node node = getNode(); 202 198 203 199 if (node == null) { … … 256 252 saveLightData(); //$NON-NLS-1$ 257 253 saveRadarFogData(); 258 }254 */ } 259 255 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java
r24762 r24779 1 //License: GPL. For details, see LICENSE file. 2 // Copyright (c) 2009 / 2010 by Werner Koenig & Malcolm Herring 3 4 package toms.seamarks.buoys; 1 package oseam.seamarks; 5 2 6 3 import java.util.Map; … … 12 9 import org.openstreetmap.josm.data.osm.Node; 13 10 14 import toms.Messages;15 import toms.dialogs.SmpDialogAction;16 import toms.seamarks.SeaMark;17 18 public class BuoySpec extends Buoy{19 public BuoySpec(SmpDialogAction dia, Node node) {11 import oseam.Messages; 12 import oseam.dialogs.OSeaMAction; 13 import oseam.seamarks.SeaMark; 14 15 public class MarkSpec extends SeaMark { 16 public MarkSpec(OSeaMAction dia, Node node) { 20 17 super(dia); 21 18 … … 25 22 setNode(node); 26 23 27 resetMask(); 28 dlg.cbM01TypeOfMark.setSelectedIndex(SPECIAL_PURPOSE); 24 /* dlg.cbM01TypeOfMark.setSelectedIndex(SPECIAL_PURPOSE); 29 25 30 26 dlg.cbM01StyleOfMark.removeAllItems(); … … 139 135 dlg.tfM01Name.setText(getName()); 140 136 dlg.cM01TopMark.setSelected(hasTopMark()); 141 }142 137 */ } 138 /* 143 139 public void refreshLights() { 144 140 super.refreshLights(); … … 163 159 super.setLightColour("W"); //$NON-NLS-1$ 164 160 } 165 161 */ 166 162 public void paintSign() { 167 if (dlg.paintlock)163 /* if (dlg.paintlock) 168 164 return; 169 165 super.paintSign(); … … 327 323 dlg.lM01Icon.setIcon(null); 328 324 } 329 }325 */ } 330 326 331 327 public void saveSign() { 332 Node node = getNode();328 /* Node node = getNode(); 333 329 334 330 if (node == null) { … … 414 410 saveLightData(); //$NON-NLS-1$ 415 411 saveRadarFogData(); 416 }412 */ } 417 413 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkUkn.java
r24762 r24779 1 //License: GPL. For details, see LICENSE file. 2 // Copyright (c) 2009 / 2010 by Werner Koenig & Malcolm Herring 3 4 package toms.seamarks.buoys; 1 package oseam.seamarks; 5 2 6 3 import javax.swing.ImageIcon; … … 8 5 import org.openstreetmap.josm.Main; 9 6 10 import toms.dialogs.SmpDialogAction;7 import oseam.dialogs.OSeaMAction; 11 8 12 public class BuoyUkn extends Buoy{13 public BuoyUkn(SmpDialogAction dia, String Msg) {9 public class MarkUkn extends SeaMark { 10 public MarkUkn(OSeaMAction dia, String Msg) { 14 11 super(dia); 15 resetMask(); 16 dlg.cbM01TypeOfMark.setSelectedIndex(0); 12 // dlg.cbM01TypeOfMark.setSelectedIndex(0); 17 13 setErrMsg(Msg); 18 14 } 19 15 20 16 public void paintSign() { 21 if (dlg.paintlock)17 /* if (dlg.paintlock) 22 18 return; 23 19 super.paintSign(); … … 27 23 28 24 setErrMsg(null); 29 }25 */ } 30 26 31 27 public void setLightColour() { -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r24778 r24779 6 6 import org.openstreetmap.josm.command.ChangePropertyCommand; 7 7 import org.openstreetmap.josm.data.osm.Node; 8 9 import oseam.dialogs.OSeaMAction; 8 10 9 11 abstract public class SeaMark { … … 140 142 */ 141 143 142 public abstract void setLightColour(); 143 144 public abstract void paintSign(); 145 146 public abstract void saveSign(); 144 protected OSeaMAction dlg = null; 145 146 public OSeaMAction getDlg() { 147 return dlg; 148 } 149 150 public void setDlg(OSeaMAction dlg) { 151 this.dlg = dlg; 152 } 153 154 protected SeaMark(OSeaMAction dia) { 155 dlg = dia; 156 } 157 158 private Node Node = null; 159 160 public Node getNode() { 161 return Node; 162 } 163 164 public void setNode(Node node) { 165 Node = node; 166 } 167 168 private boolean Region = false; 169 170 public boolean getRegion() { 171 return Region; 172 } 173 174 public void setRegion(boolean region) { 175 Region = region; 176 } 147 177 148 178 private int Colour = UNKNOWN_COLOUR; … … 180 210 } 181 211 212 private int MarkIndex = 0; 213 214 public int getMarkIndex() { 215 return MarkIndex; 216 } 217 218 public void setMarkIndex(int buoyIndex) { 219 MarkIndex = buoyIndex; 220 } 221 222 private int StyleIndex = 0; 223 224 public int getStyleIndex() { 225 return StyleIndex; 226 } 227 228 public void setStyleIndex(int styleIndex) { 229 StyleIndex = styleIndex; 230 } 231 182 232 private boolean valid = true; 183 233 … … 190 240 191 241 } 242 243 private int SectorIndex = 0; 244 245 public int getSectorIndex() { 246 return SectorIndex; 247 } 248 249 public void setSectorIndex(int sector) { 250 SectorIndex = sector; 251 } 252 253 private String[] LightColour = new String[10]; 254 255 public String getLightColour() { 256 if (LightColour[SectorIndex] == null) 257 return (LightColour[0]); 258 return LightColour[SectorIndex]; 259 } 260 261 public void setLightColour(String lightColour) { 262 LightColour[SectorIndex] = lightColour; 263 } 264 265 public abstract void paintSign(); 266 267 public abstract void saveSign(); 192 268 193 269 protected void delSeaMarkKeys(Node node) {
Note:
See TracChangeset
for help on using the changeset viewer.