Changeset 23093 in osm for applications/editors/josm
- Timestamp:
- 2010-09-10T17:02:59+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r23086 r23093 663 663 public void actionPerformed(java.awt.event.ActionEvent e) { 664 664 buoy.setSectored(rbM01FiredN.isSelected()); 665 if (rbM01Fired1.isSelected()) buoy.setSectorIndex(0); 665 666 buoy.paintSign(); 666 667 } … … 1185 1186 tfM01Height.addFocusListener(new FocusAdapter() { 1186 1187 public void focusLost(FocusEvent e) { 1187 buoy.set Name(tfM01Height.getText().trim());1188 buoy.setHeight(tfM01Height.getText().trim()); 1188 1189 } 1189 1190 }); … … 1198 1199 tfM01Range.addFocusListener(new FocusAdapter() { 1199 1200 public void focusLost(FocusEvent e) { 1200 buoy.set Name(tfM01Range.getText().trim());1201 buoy.setRange(tfM01Range.getText().trim()); 1201 1202 } 1202 1203 }); … … 1276 1277 cbM01Sector.addActionListener(new ActionListener() { 1277 1278 public void actionPerformed(ActionEvent e) { 1278 int sec = cbM01Sector.getSelectedIndex(); 1279 buoy.setSectorIndex(cbM01Sector.getSelectedIndex()); 1280 buoy.paintSign(); 1279 1281 } 1280 1282 }); … … 1289 1291 tfM01Bearing.addFocusListener(new FocusAdapter() { 1290 1292 public void focusLost(FocusEvent e) { 1291 // buoy.setName(tfM01Bearing.getText());1292 1293 } 1293 1294 }); … … 1302 1303 tfM02Bearing.addFocusListener(new FocusAdapter() { 1303 1304 public void focusLost(FocusEvent e) { 1304 // buoy.setName(tfM02Bearing.getText());1305 1305 } 1306 1306 }); … … 1315 1315 tfM01Radius.addFocusListener(new FocusAdapter() { 1316 1316 public void focusLost(FocusEvent e) { 1317 // buoy.setName(tfM01Radius.getText());1318 1317 } 1319 1318 }); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r23086 r23093 6 6 import java.util.Enumeration; 7 7 import java.util.Map; 8 import java.util.Iterator; 8 9 import java.util.Vector; 9 10 import java.util.regex.Matcher; … … 158 159 } 159 160 160 private String LightChar = ""; 161 private int SectorIndex = 0; 162 163 public int getSectorIndex() { 164 return SectorIndex; 165 } 166 167 public void setSectorIndex(int sector) { 168 SectorIndex = sector; 169 } 170 171 private String[] LightChar = new String[10]; 161 172 162 173 public String getLightChar() { 163 return LightChar ;174 return LightChar[getSectorIndex()]; 164 175 } 165 176 166 177 public void setLightChar(String lightChar) { 167 LightChar = lightChar;168 } 169 170 private String LightColour = "";178 LightChar[getSectorIndex()] = lightChar; 179 } 180 181 private String[] LightColour = new String[10]; 171 182 172 183 public String getLightColour() { 173 return LightColour ;184 return LightColour[getSectorIndex()]; 174 185 } 175 186 176 187 public void setLightColour(String lightColour) { 177 LightColour = lightColour;178 } 179 180 private String LightGroup = "";188 LightColour[getSectorIndex()] = lightColour; 189 } 190 191 private String[] LightGroup = new String[10]; 181 192 182 193 public String getLightGroup() { 183 return LightGroup ;194 return LightGroup[getSectorIndex()]; 184 195 } 185 196 186 197 public void setLightGroup(String lightGroup) { 187 LightGroup = lightGroup;198 LightGroup[getSectorIndex()] = lightGroup; 188 199 } 189 200 190 201 protected void setLightGroup(Map<String, String> k) { 191 202 String s = ""; 192 193 203 if (k.containsKey("seamark:light:group")) { 194 204 s = k.get("seamark:light:group"); 195 196 LightGroup = s; 197 } 198 199 } 200 201 private String Height = ""; 205 setLightGroup(s); 206 } 207 } 208 209 private String[] Height = new String[10]; 202 210 203 211 public String getHeight() { 204 return Height ;212 return Height[getSectorIndex()]; 205 213 } 206 214 207 215 public void setHeight(String height) { 208 Height = height;209 } 210 211 private String Range = "";216 Height[getSectorIndex()] = height; 217 } 218 219 private String[] Range = new String[10]; 212 220 213 221 public String getRange() { 214 return Range ;222 return Range[getSectorIndex()]; 215 223 } 216 224 217 225 public void setRange(String range) { 218 Range = range;219 } 220 221 private String LightPeriod = "";226 Range[getSectorIndex()] = range; 227 } 228 229 private String[] LightPeriod = new String[10]; 222 230 223 231 public String getLightPeriod() { 224 return LightPeriod ;232 return LightPeriod[getSectorIndex()]; 225 233 } 226 234 … … 235 243 236 244 if (matcher.find()) { 237 LightPeriod = lightPeriod; 238 245 LightPeriod[getSectorIndex()] = lightPeriod; 239 246 setErrMsg(null); 240 247 } else { … … 242 249 dlg.tfM01RepeatTime.requestFocus(); 243 250 } 244 245 251 } 246 252 247 253 protected void setLightPeriod(Map<String, String> k) { 248 String s; 249 250 s = ""; 251 252 if (k.containsKey("seamark:light:signal:period")) { 253 s = k.get("seamark:light:signal:period"); 254 LightPeriod = s; 255 256 return; 257 } 258 254 String s = ""; 259 255 if (k.containsKey("seamark:light:period")) { 260 256 s = k.get("seamark:light:period"); 261 LightPeriod = s;262 257 setSectorIndex(0); 258 setLightPeriod(s); 263 259 return; 264 260 } 265 261 } 266 262 263 public void parseLights(Map<String, String> k) { 264 Iterator it = k.entrySet().iterator(); 265 while (it.hasNext()) { 266 String key = (String)((Map.Entry)it.next()).getKey(); 267 if (key.contains("seamark:light:")) { 268 String value = ((String)((Map.Entry)it.next()).getValue()).trim(); 269 270 } 271 } 272 } 273 267 274 private Node Node = null; 268 275 … … 326 333 dlg.cM01Fired.setSelected(isFired()); 327 334 328 dlg.tfM01RepeatTime.setText( LightPeriod);335 dlg.tfM01RepeatTime.setText(getLightPeriod()); 329 336 330 337 dlg.tfM01Name.setText(getName()); … … 496 503 setLightColour("W"); 497 504 } 498 if (LightPeriod != "" && LightPeriod != " " && LightChar != "Q") 499 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 500 "seamark:light:period", LightPeriod)); 501 502 if (LightChar != "") 503 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 504 "seamark:light:character", LightChar)); 505 506 if (LightGroup != "") 507 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 508 "seamark:light:group", LightGroup)); 505 if (getLightPeriod() != "" && getLightPeriod() != " " 506 && getLightChar() != "Q") 507 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 508 "seamark:light:period", getLightPeriod())); 509 510 if (getLightChar() != "") 511 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 512 "seamark:light:character", getLightChar())); 513 514 if (getLightGroup() != "") 515 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 516 "seamark:light:group", getLightGroup())); 509 517 } 510 518 } … … 581 589 break; 582 590 } 583 if (!getFogGroup().equals(""))584 Main.main.undoRedo.add(new ChangePropertyCommand(Node,585 "seamark:fog_group:group", getFogGroup()));586 if (!getFogPeriod().equals(""))587 Main.main.undoRedo.add(new ChangePropertyCommand(Node,588 "seamark:fog_period:group", getFogPeriod()));591 if (!getFogGroup().equals("")) 592 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 593 "seamark:fog_group:group", getFogGroup())); 594 if (!getFogPeriod().equals("")) 595 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 596 "seamark:fog_period:group", getFogPeriod())); 589 597 } 590 598 } 591 599 } 592 593 public final static int FOG_HORN = 1;594 public final static int FOG_SIREN = 2;595 public final static int FOG_DIA = 3;596 public final static int FOG_BELL = 4;597 public final static int FOG_WHIS = 5;598 public final static int FOG_GONG = 6;599 public final static int FOG_EXPLOS = 7;600 600 601 601 public void refreshStyles() { … … 674 674 dlg.rbM01FiredN.setVisible(false); 675 675 setSectored(false); 676 setSectorIndex(0); 676 677 dlg.cbM01Kennung.removeAllItems(); 677 678 dlg.cbM01Kennung.setVisible(false); 678 679 dlg.lM01Kennung.setVisible(false); 680 setLightChar(""); 679 681 dlg.tfM01Height.setText(""); 680 682 dlg.tfM01Height.setVisible(false); 681 683 dlg.lM01Height.setVisible(false); 684 setHeight(""); 682 685 dlg.tfM01Range.setText(""); 683 686 dlg.tfM01Range.setVisible(false); 684 687 dlg.lM01Range.setVisible(false); 688 setRange(""); 685 689 dlg.cbM01Colour.setVisible(false); 686 690 dlg.lM01Colour.setVisible(false); 691 setLightColour(""); 687 692 dlg.cbM01Sector.setVisible(false); 688 693 dlg.lM01Sector.setVisible(false); … … 690 695 dlg.tfM01Group.setVisible(false); 691 696 dlg.lM01Group.setVisible(false); 697 setLightGroup(""); 692 698 dlg.tfM01RepeatTime.setText(""); 693 699 dlg.tfM01RepeatTime.setVisible(false); 694 700 dlg.lM01RepeatTime.setVisible(false); 701 setLightPeriod(""); 695 702 dlg.tfM01Bearing.setText(""); 696 703 dlg.tfM01Bearing.setVisible(false); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r23086 r23093 25 25 26 26 resetMask(); 27 27 28 28 dlg.rbM01RegionA.setEnabled(true); 29 29 dlg.rbM01RegionB.setEnabled(true);
Note:
See TracChangeset
for help on using the changeset viewer.