Changeset 23086 in osm for applications/editors/josm/plugins/toms
- Timestamp:
- 2010-09-09T16:25:18+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
r23078 r23086 153 153 public JTextField tfM01Height = null; 154 154 public JLabel lM01Range = null; 155 public JTextField tfM01Range = null; 155 156 public JLabel lM01Group = null; 156 157 public JTextField tfM01Group = null; … … 165 166 public JTextField tfM02Bearing = null; 166 167 public JTextField tfM01Radius = null; 167 public JTextField tfM01Range = null;168 168 public JButton bM01Save = null; 169 169 public JButton bM01Close = null; … … 662 662 ActionListener alM01Fired = new ActionListener() { 663 663 public void actionPerformed(java.awt.event.ActionEvent e) { 664 buoy.setSectored(rbM01FiredN.isSelected()); 664 665 buoy.paintSign(); 665 666 } … … 865 866 return; 866 867 } 867 if (cat == 0)868 return;869 868 870 869 Node n = buoy.getNode(); … … 1035 1034 tfM01Racon.addFocusListener(new FocusAdapter() { 1036 1035 public void focusLost(FocusEvent e) { 1037 buoy.setRaconGroup(tfM01Racon.getText() );1036 buoy.setRaconGroup(tfM01Racon.getText().trim()); 1038 1037 } 1039 1038 }); … … 1091 1090 tfM01FogGroup.addFocusListener(new FocusAdapter() { 1092 1091 public void focusLost(FocusEvent e) { 1093 buoy.setFogGroup(tfM01FogGroup.getText() );1092 buoy.setFogGroup(tfM01FogGroup.getText().trim()); 1094 1093 } 1095 1094 }); … … 1104 1103 tfM01FogPeriod.addFocusListener(new FocusAdapter() { 1105 1104 public void focusLost(FocusEvent e) { 1106 buoy.setFogPeriod(tfM01FogPeriod.getText() );1105 buoy.setFogPeriod(tfM01FogPeriod.getText().trim()); 1107 1106 } 1108 1107 }); … … 1186 1185 tfM01Height.addFocusListener(new FocusAdapter() { 1187 1186 public void focusLost(FocusEvent e) { 1188 buoy.setName(tfM01Height.getText() );1187 buoy.setName(tfM01Height.getText().trim()); 1189 1188 } 1190 1189 }); … … 1199 1198 tfM01Range.addFocusListener(new FocusAdapter() { 1200 1199 public void focusLost(FocusEvent e) { 1201 buoy.setName(tfM01Range.getText() );1200 buoy.setName(tfM01Range.getText().trim()); 1202 1201 } 1203 1202 }); … … 1212 1211 tfM01Group.addFocusListener(new FocusAdapter() { 1213 1212 public void focusLost(FocusEvent e) { 1214 buoy.setLightGroup(tfM01Group.getText()); 1213 buoy.setLightGroup(tfM01Group.getText().trim()); 1214 buoy.paintSign(); 1215 1215 } 1216 1216 }); … … 1225 1225 tfM01RepeatTime.addActionListener(new ActionListener() { 1226 1226 public void actionPerformed(ActionEvent e) { 1227 String s = tfM01RepeatTime.getText(); 1228 1229 buoy.setLightPeriod(s); 1227 buoy.setLightPeriod(tfM01RepeatTime.getText().trim()); 1230 1228 buoy.paintSign(); 1231 1229 } … … 1234 1232 tfM01RepeatTime.addFocusListener(new FocusAdapter() { 1235 1233 public void focusLost(FocusEvent e) { 1236 String s = tfM01RepeatTime.getText(); 1237 1238 buoy.setLightPeriod(s); 1239 buoy.paintSign(); 1240 } 1241 }); 1242 } 1243 1234 buoy.setLightPeriod(tfM01RepeatTime.getText().trim()); 1235 buoy.paintSign(); 1236 } 1237 }); 1238 } 1244 1239 return tfM01RepeatTime; 1245 1240 } … … 1250 1245 cbM01Colour.setBounds(new Rectangle(165, 295, 40, 20)); 1251 1246 cbM01Colour.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$ 1247 cbM01Colour.addItem(""); //$NON-NLS-1$ 1252 1248 cbM01Colour.addItem(Messages.getString("SmpDialogAction.190")); //$NON-NLS-1$ 1253 1249 cbM01Colour.addItem(Messages.getString("SmpDialogAction.191")); //$NON-NLS-1$ … … 1255 1251 cbM01Colour.addActionListener(new ActionListener() { 1256 1252 public void actionPerformed(ActionEvent e) { 1257 int col = cbM01Colour.getSelectedIndex(); 1253 buoy.setLightColour((String)cbM01Colour.getSelectedItem()); 1254 buoy.paintSign(); 1258 1255 } 1259 1256 }); … … 1292 1289 tfM01Bearing.addFocusListener(new FocusAdapter() { 1293 1290 public void focusLost(FocusEvent e) { 1294 buoy.setName(tfM01Bearing.getText());1291 // buoy.setName(tfM01Bearing.getText()); 1295 1292 } 1296 1293 }); … … 1305 1302 tfM02Bearing.addFocusListener(new FocusAdapter() { 1306 1303 public void focusLost(FocusEvent e) { 1307 buoy.setName(tfM02Bearing.getText());1304 // buoy.setName(tfM02Bearing.getText()); 1308 1305 } 1309 1306 }); … … 1318 1315 tfM01Radius.addFocusListener(new FocusAdapter() { 1319 1316 public void focusLost(FocusEvent e) { 1320 buoy.setName(tfM01Radius.getText());1317 // buoy.setName(tfM01Radius.getText()); 1321 1318 } 1322 1319 }); … … 1329 1326 bM01Close = new JButton(); 1330 1327 bM01Close.setBounds(new Rectangle(20, 325, 110, 20)); 1331 bM01Close.setText(tr(" close"));1328 bM01Close.setText(tr("Close")); 1332 1329 bM01Close.addActionListener(new ActionListener() { 1333 1330 public void actionPerformed(ActionEvent e) { … … 1353 1350 bM01Save = new JButton(); 1354 1351 bM01Save.setBounds(new Rectangle(150, 325, 110, 20)); 1355 bM01Save.setText(tr(" save"));1352 bM01Save.setText(tr("Save")); 1356 1353 bM01Save.setEnabled(false); 1357 1354 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r23073 r23086 16 16 import org.openstreetmap.josm.data.osm.Node; 17 17 18 import toms.Messages; 18 19 import toms.dialogs.SmpDialogAction; 19 20 import toms.seamarks.SeaMark; … … 145 146 public void setFired(boolean fired) { 146 147 Fired = fired; 148 } 149 150 private boolean Sectored = false; 151 152 public boolean isSectored() { 153 return Sectored; 154 } 155 156 public void setSectored(boolean sectored) { 157 Sectored = sectored; 147 158 } 148 159 … … 387 398 388 399 c = getLightChar(); 389 if (dlg.cbM01Kennung.getSelectedIndex() == 0) 400 if (dlg.cbM01Kennung.getSelectedIndex() == 0) { 401 dlg.tfM01Group.setEnabled(false); 390 402 dlg.tfM01RepeatTime.setEnabled(false); 391 else 403 } else { 404 dlg.tfM01Group.setEnabled(true); 392 405 dlg.tfM01RepeatTime.setEnabled(true); 406 } 393 407 394 408 if (c.contains("+")) { … … 398 412 } 399 413 400 if ( getLightGroup() != "")414 if (!getLightGroup().equals("")) 401 415 c = c + "(" + getLightGroup() + ")"; 402 416 if (tmp != null) … … 405 419 c = c + " " + getLightColour(); 406 420 lp = getLightPeriod(); 407 if ( lp != "" && lp != " ")421 if (!lp.equals("")) 408 422 c = c + " " + lp + "s"; 409 423 dlg.lM01FireMark.setText(c); … … 589 603 590 604 public void refreshLights() { 605 dlg.cbM01Kennung.removeAllItems(); 606 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 607 dlg.cbM01Kennung.addItem("Fl"); //$NON-NLS-1$ 608 dlg.cbM01Kennung.addItem("LFl"); //$NON-NLS-1$ 609 dlg.cbM01Kennung.addItem("Iso"); //$NON-NLS-1$ 610 dlg.cbM01Kennung.addItem("F"); //$NON-NLS-1$ 611 dlg.cbM01Kennung.addItem("FFl"); //$NON-NLS-1$ 612 dlg.cbM01Kennung.addItem("Oc"); //$NON-NLS-1$ 613 dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$ 614 dlg.cbM01Kennung.addItem("IQ"); //$NON-NLS-1$ 615 dlg.cbM01Kennung.addItem("VQ"); //$NON-NLS-1$ 616 dlg.cbM01Kennung.addItem("IVQ"); //$NON-NLS-1$ 617 dlg.cbM01Kennung.addItem("UQ"); //$NON-NLS-1$ 618 dlg.cbM01Kennung.addItem("IUQ"); //$NON-NLS-1$ 619 dlg.cbM01Kennung.addItem("Mo"); //$NON-NLS-1$ 620 dlg.cbM01Kennung.setSelectedIndex(0); 591 621 } 592 622 … … 601 631 dlg.rbM01RegionA.setEnabled(false); 602 632 dlg.rbM01RegionB.setEnabled(false); 633 dlg.lM01FireMark.setText(""); 603 634 dlg.cbM01CatOfMark.removeAllItems(); 604 635 dlg.cbM01CatOfMark.setVisible(false); … … 642 673 dlg.rbM01Fired1.setVisible(false); 643 674 dlg.rbM01FiredN.setVisible(false); 675 setSectored(false); 644 676 dlg.cbM01Kennung.removeAllItems(); 645 677 dlg.cbM01Kennung.setVisible(false); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
r23078 r23086 199 199 dlg.sM01StatusBar.setText(getErrMsg()); 200 200 201 if ( (getBuoyIndex() > 0) && (getStyleIndex() > 0)) {201 if (isValid()) { 202 202 dlg.tfM01Name.setEnabled(true); 203 203 dlg.tfM01Name.setText(getName()); … … 205 205 dlg.cM01TopMark.setVisible(true); 206 206 dlg.cM01TopMark.setEnabled(false); 207 dlg.cM01Radar.setEnabled(true);208 207 dlg.cM01Radar.setVisible(true); 209 dlg.cM01Racon.setEnabled(true);210 208 dlg.cM01Racon.setVisible(true); 211 dlg.cM01Fog.setEnabled(true);212 209 dlg.cM01Fog.setVisible(true); 213 210 dlg.cM01Fired.setEnabled(true); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
r23078 r23086 37 37 dlg.lM01StyleOfMark.setVisible(true); 38 38 39 dlg.cbM01Kennung.removeAllItems(); 40 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 41 dlg.cbM01Kennung.addItem("Fl(2)"); //$NON-NLS-1$ 39 refreshLights(); 42 40 43 41 setBuoyIndex(ISOLATED_DANGER); … … 102 100 } 103 101 } 102 } 103 104 public void refreshLights() { 105 dlg.cbM01Kennung.removeAllItems(); 106 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 107 dlg.cbM01Kennung.addItem("Fl(2)"); //$NON-NLS-1$ 108 dlg.cbM01Kennung.setSelectedIndex(0); 104 109 } 105 110 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r23078 r23086 41 41 dlg.cbM01StyleOfMark.setEnabled(true); 42 42 43 dlg.cbM01Kennung.removeAllItems(); 44 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 45 dlg.cbM01Kennung.addItem("Fl"); //$NON-NLS-1$ 46 dlg.cbM01Kennung.addItem("Fl()"); //$NON-NLS-1$ 47 dlg.cbM01Kennung.addItem("Oc"); //$NON-NLS-1$ 48 dlg.cbM01Kennung.addItem("Oc()"); //$NON-NLS-1$ 49 dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$ 50 dlg.cbM01Kennung.addItem("IQ"); //$NON-NLS-1$ 51 dlg.cbM01Kennung.addItem("Mo()"); //$NON-NLS-1$ 52 dlg.cbM01Kennung.setSelectedIndex(0); 43 refreshLights(); 53 44 54 45 if (keys.containsKey("name")) //$NON-NLS-1$ … … 356 347 dlg.sM01StatusBar.setText(getErrMsg()); 357 348 358 if ( (getBuoyIndex() > 0) && (getStyleIndex() > 0)) {349 if (isValid()) { 359 350 dlg.tfM01Name.setEnabled(true); 360 351 dlg.tfM01Name.setText(getName()); 361 dlg.cM01TopMark.setEnabled(true);362 dlg.cM01TopMark.setVisible(true);363 dlg.cM01Radar.setEnabled(true);364 dlg.cM01Radar.setVisible(true);365 dlg.cM01Racon.setEnabled(true);366 dlg.cM01Racon.setVisible(true);367 dlg.cM01Fog.setEnabled(true);368 dlg.cM01Fog.setVisible(true);369 370 dlg.cM01Fired.setVisible(true);371 dlg.cM01Fired.setEnabled(true);372 352 373 353 String image = "/images/Lateral"; //$NON-NLS-1$ … … 378 358 379 359 if (style == LAT_PERCH) { 360 dlg.cM01TopMark.setVisible(false); 361 dlg.cM01TopMark.setSelected(false); 362 dlg.cM01Radar.setVisible(false); 363 dlg.cM01Racon.setVisible(false); 364 dlg.cM01Fog.setVisible(false); 365 dlg.cM01Fired.setVisible(false); 380 366 dlg.cM01Fired.setSelected(false); 381 dlg.cM01TopMark.setSelected(false);382 dlg.cM01Fired.setEnabled(false);383 dlg.cM01TopMark.setEnabled(false);384 367 } else { 368 dlg.cM01TopMark.setEnabled(true); 369 dlg.cM01TopMark.setVisible(true); 370 dlg.cM01Radar.setVisible(true); 371 dlg.cM01Racon.setVisible(true); 372 dlg.cM01Fog.setVisible(true); 373 dlg.cM01Fired.setVisible(true); 385 374 dlg.cM01Fired.setEnabled(true); 386 375 dlg.cM01TopMark.setEnabled(true); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyNota.java
r23078 r23086 31 31 dlg.lM01CatOfMark.setVisible(true); 32 32 33 dlg.cbM01Kennung.removeAllItems(); 34 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 35 dlg.cbM01Kennung.addItem("Fl"); //$NON-NLS-1$ 36 dlg.cbM01Kennung.addItem("Fl()"); //$NON-NLS-1$ 37 dlg.cbM01Kennung.addItem("Oc()"); //$NON-NLS-1$ 38 dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$ 39 dlg.cbM01Kennung.addItem("IQ"); //$NON-NLS-1$ 40 dlg.cbM01Kennung.setSelectedIndex(0); 33 refreshLights(); 41 34 42 35 setLightColour(); … … 57 50 dlg.sM01StatusBar.setText(getErrMsg()); 58 51 59 if (getBuoyIndex() > 0) { 60 dlg.cM01Radar.setEnabled(true); 52 if (isValid()) { 61 53 dlg.cM01Radar.setVisible(true); 62 dlg.cM01Racon.setEnabled(true);63 54 dlg.cM01Racon.setVisible(true); 64 65 dlg.cM01Fog.setEnabled(true);66 55 dlg.cM01Fog.setVisible(true); 67 56 … … 70 59 dlg.cM01Fired.setEnabled(false); 71 60 dlg.cM01Fired.setSelected(true); 61 dlg.rbM01Fired1.setVisible(true); 62 dlg.rbM01FiredN.setVisible(true); 63 dlg.lM01Kennung.setVisible(true); 64 dlg.cbM01Kennung.setVisible(true); 65 dlg.lM01Height.setVisible(true); 66 dlg.tfM01Height.setVisible(true); 67 dlg.lM01Range.setVisible(true); 68 dlg.tfM01Range.setVisible(true); 69 dlg.lM01Group.setVisible(true); 70 dlg.tfM01Group.setVisible(true); 71 dlg.lM01RepeatTime.setVisible(true); 72 dlg.tfM01RepeatTime.setVisible(true); 73 dlg.lM01Colour.setVisible(true); 74 dlg.cbM01Colour.setVisible(true); 75 if (isSectored()) { 76 dlg.lM01Sector.setVisible(true); 77 dlg.cbM01Sector.setVisible(true); 78 dlg.lM01Bearing.setVisible(true); 79 dlg.tfM01Bearing.setVisible(true); 80 dlg.tfM02Bearing.setVisible(true); 81 dlg.tfM01Radius.setVisible(true); 82 } else { 83 dlg.lM01Sector.setVisible(false); 84 dlg.cbM01Sector.setVisible(false); 85 dlg.lM01Bearing.setVisible(false); 86 dlg.tfM01Bearing.setVisible(false); 87 dlg.tfM02Bearing.setVisible(false); 88 dlg.tfM01Radius.setVisible(false); 89 } 72 90 73 91 switch (getBuoyIndex()) { -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
r23078 r23086 37 37 dlg.lM01StyleOfMark.setVisible(true); 38 38 39 dlg.cbM01Kennung.removeAllItems(); 40 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 41 dlg.cbM01Kennung.addItem("Iso"); //$NON-NLS-1$ 42 dlg.cbM01Kennung.addItem("Oc"); //$NON-NLS-1$ 43 dlg.cbM01Kennung.addItem("LFl"); //$NON-NLS-1$ 44 dlg.cbM01Kennung.addItem("Mo()"); //$NON-NLS-1$ 45 39 refreshLights(); 40 46 41 setBuoyIndex(SAFE_WATER); 47 42 setColour(SeaMark.RED_WHITE); … … 103 98 } 104 99 100 public void refreshLights() { 101 dlg.cbM01Kennung.removeAllItems(); 102 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 103 dlg.cbM01Kennung.addItem("Iso"); //$NON-NLS-1$ 104 dlg.cbM01Kennung.addItem("Oc"); //$NON-NLS-1$ 105 dlg.cbM01Kennung.addItem("LFl"); //$NON-NLS-1$ 106 dlg.cbM01Kennung.addItem("Mo()"); //$NON-NLS-1$ 107 dlg.cbM01Kennung.setSelectedIndex(0); 108 } 109 105 110 public boolean isValid() { 106 111 return (getBuoyIndex() > 0) && (getStyleIndex() > 0); … … 114 119 dlg.sM01StatusBar.setText(getErrMsg()); 115 120 116 if ( (getBuoyIndex() > 0) && (getStyleIndex() > 0)) {121 if (isValid()) { 117 122 dlg.tfM01Name.setEnabled(true); 118 123 dlg.tfM01Name.setText(getName()); 119 124 dlg.cM01TopMark.setEnabled(true); 120 125 dlg.cM01TopMark.setVisible(true); 121 dlg.cM01Radar.setEnabled(true);122 126 dlg.cM01Radar.setVisible(true); 123 dlg.cM01Racon.setEnabled(true);124 127 dlg.cM01Racon.setVisible(true); 125 dlg.cM01Fired.setEnabled(true);126 127 dlg.cM01Fog.setEnabled(true);128 128 dlg.cM01Fog.setVisible(true); 129 130 129 dlg.cM01Fired.setVisible(true); 131 130 dlg.cM01Fired.setEnabled(true); -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
r23078 r23086 39 39 dlg.lM01StyleOfMark.setVisible(true); 40 40 41 dlg.cbM01Kennung.removeAllItems(); 42 dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$ 43 dlg.cbM01Kennung.addItem("Fl"); //$NON-NLS-1$ 44 dlg.cbM01Kennung.addItem("Fl()"); //$NON-NLS-1$ 45 dlg.cbM01Kennung.addItem("Oc"); //$NON-NLS-1$ 46 dlg.cbM01Kennung.addItem("Oc()"); //$NON-NLS-1$ 47 dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$ 48 dlg.cbM01Kennung.addItem("IQ"); //$NON-NLS-1$ 49 dlg.cbM01Kennung.setSelectedIndex(0); 41 refreshLights(); 50 42 51 43 dlg.cM01TopMark.setEnabled(true); … … 148 140 dlg.sM01StatusBar.setText(getErrMsg()); 149 141 150 if ( (getBuoyIndex() > 0) && (getStyleIndex() > 0)) {142 if (isValid()) { 151 143 dlg.tfM01Name.setEnabled(true); 152 144 dlg.tfM01Name.setText(getName()); 153 dlg.cM01Radar.setEnabled(true);154 145 dlg.cM01Radar.setVisible(true); 155 dlg.cM01Racon.setEnabled(true);156 146 dlg.cM01Racon.setVisible(true); 157 158 147 dlg.cM01TopMark.setEnabled(true); 159 148 dlg.cM01TopMark.setVisible(true); … … 164 153 dlg.cbM01TopMark.setVisible(false); 165 154 } 166 167 dlg.cM01Fog.setEnabled(true);168 155 dlg.cM01Fog.setVisible(true); 169 170 156 dlg.cM01Fired.setVisible(true); 171 157 dlg.cM01Fired.setEnabled(true);
Note:
See TracChangeset
for help on using the changeset viewer.