Changeset 27041 in osm for applications/editors
- Timestamp:
- 2011-11-12T11:42:58+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r27040 r27041 236 236 safeWaterButton.setBorderPainted(false); 237 237 } 238 topmarkButton.setBorderPainted(dlg.mark.hasTopmark()); 238 topmarkButton.setBorderPainted(dlg.mark.getTopmark() != Top.NONE); 239 topmarkButton.setSelected(dlg.mark.getTopmark() != Top.NONE); 239 240 if (dlg.mark.isValid()) { 240 241 topmarkButton.setVisible(true); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelFog.java
r27035 r27041 18 18 public JRadioButton yesFogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogYesButton.png"))); 19 19 public JRadioButton hornButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogHornButton.png"))); 20 public JRadioButton sirenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ OffButton.png")));21 public JRadioButton diaButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ OffButton.png")));20 public JRadioButton sirenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogSirenButton.png"))); 21 public JRadioButton diaButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogDiaButton.png"))); 22 22 public JRadioButton bellButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogBellButton.png"))); 23 23 public JRadioButton whisButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogWhisButton.png"))); … … 35 35 button.setBorderPainted(false); 36 36 } 37 dlg.mark.setFog(!noFogButton.isSelected());38 37 dlg.mark.paintSign(); 39 38 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r27035 r27041 75 75 private ActionListener alMultiple = new ActionListener() { 76 76 public void actionPerformed(java.awt.event.ActionEvent e) { 77 dlg.mark.setLight Multiple(multipleBox.getText());77 dlg.mark.setLightAtt(Att.MLT, 0, multipleBox.getText()); 78 78 } 79 79 }; … … 129 129 panelSector = new PanelSectors(dlg); 130 130 } 131 dlg.mark.setSectored(true);132 131 panelSector.setVisible(true); 133 132 } else { 134 dlg.mark.setSectored(false);135 133 if (panelSector != null) { 136 134 panelSector.setVisible(false); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r27040 r27041 210 210 fogIcon.setBounds(new Rectangle(235, 0, 150, 185)); 211 211 this.add(fogIcon, null); 212 radarLabel = new JLabel("", SwingConstants. RIGHT);212 radarLabel = new JLabel("", SwingConstants.CENTER); 213 213 radarLabel.setBounds(new Rectangle(210, 35, 100, 20)); 214 214 this.add(radarLabel, null); 215 fogLabel = new JLabel("", SwingConstants. RIGHT);215 fogLabel = new JLabel("", SwingConstants.CENTER); 216 216 fogLabel.setBounds(new Rectangle(210, 60, 100, 20)); 217 217 this.add(fogLabel, null); … … 291 291 lightsButton.setBorderPainted(false); 292 292 lightsButton.setEnabled(false); 293 miscButtons.clearSelection(); 293 294 topButton.setEnabled(false); 294 295 fogButton.setEnabled(false); … … 297 298 saveButton.setEnabled(false); 298 299 moreButton.setVisible(false); 300 moreButton.setSelected(false); 299 301 panelChan.setVisible(false); 300 302 panelHaz.setVisible(false); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r27040 r27041 517 517 } 518 518 519 public enum Att { COL, CHR, GRP, SEQ, PER, LIT, BEG, END, RAD, HGT, RNG, VIS, EXH, ORT }519 public enum Att { COL, CHR, GRP, SEQ, PER, LIT, BEG, END, RAD, HGT, RNG, VIS, EXH, ORT, MLT } 520 520 521 public Object[] sector = {Col.UNKNOWN, "", "", "", "", Lit.UNKNOWN, "", "", "", "", "", Vis.UNKNOWN, Exh.UNKNOWN, "" };521 public Object[] sector = {Col.UNKNOWN, "", "", "", "", Lit.UNKNOWN, "", "", "", "", "", Vis.UNKNOWN, Exh.UNKNOWN, "", "" }; 522 522 523 523 private ArrayList<Object[]> sectors = new ArrayList<Object[]>(); … … 542 542 543 543 public void setLightAtt(int att, int i, Object obj) { 544 if (sectors.size() == i) 545 addLight(i); 544 546 if (sectors.size() > i) 545 547 sectors.get(i)[att] = obj; … … 565 567 if (sectors.size() > i) 566 568 sectors.remove(i); 567 }568 569 private boolean Fired = false;570 571 public boolean isFired() {572 return Fired;573 }574 575 public void setFired(boolean fired) {576 Fired = fired;577 }578 579 private boolean Sectored = false;580 581 public boolean isSectored() {582 return Sectored;583 }584 585 public void setSectored(boolean sectored) {586 Sectored = sectored;587 }588 589 private String lightMultiple = "";590 591 public String getLightMiltiple() {592 return lightMultiple;593 }594 595 public void setLightMultiple(String str) {596 lightMultiple = str;597 569 } 598 570 … … 669 641 private Top topShape = Top.NONE; 670 642 671 public boolean hasTopmark() {672 return (topShape != Top.NONE);673 }674 675 643 public Top getTopmark() { 676 644 return topShape; … … 694 662 private Rtb RaType = Rtb.NONE; 695 663 696 public boolean hasRadar() {697 return (RaType != Rtb.NONE);698 }699 700 public boolean hasRacon() {701 return (RaType == Rtb.RACON);702 }703 704 664 public Rtb getRadar() { 705 665 return RaType; … … 768 728 public void setRaconSector2(String sec) { 769 729 raconSector2 = validDecimal(sec); 770 }771 772 private boolean fogSignal = false;773 774 public boolean hasFog() {775 return fogSignal;776 }777 778 public void setFog(boolean fog) {779 fogSignal = fog;780 730 } 781 731 … … 1304 1254 sectors.clear(); 1305 1255 sectors.add(sector.clone()); 1306 boolean found;1307 1256 for (int i = 0; i < 30; i++) { 1308 found = false;1309 addLight();1310 1257 String secStr = (i == 0) ? "" : (":" + Integer.toString(i)); 1311 1258 if (keys.containsKey("seamark:light" + secStr + ":colour")) { 1312 setLightAtt(Att.COL, i, keys.get("seamark:light" + secStr + ":colour")); 1313 found = true; 1314 } 1315 if (!found) { 1316 delLight(i); 1317 break; 1318 } 1259 str = keys.get("seamark:light" + secStr + ":colour"); 1260 for (Col col : ColSTR.keySet()) 1261 if (ColSTR.get(col).equals(str)) 1262 setLightAtt(Att.COL, i, col); 1263 } 1264 if (keys.containsKey("seamark:light" + secStr + ":character")) 1265 setLightAtt(Att.CHR, i, keys.get("seamark:light" + secStr + ":character")); 1266 if (keys.containsKey("seamark:light" + secStr + ":group")) 1267 setLightAtt(Att.GRP, i, keys.get("seamark:light" + secStr + ":group")); 1268 if (keys.containsKey("seamark:light" + secStr + ":sequence")) 1269 setLightAtt(Att.SEQ, i, keys.get("seamark:light" + secStr + ":sequence")); 1270 if (keys.containsKey("seamark:light" + secStr + ":period")) 1271 setLightAtt(Att.PER, i, keys.get("seamark:light" + secStr + ":period")); 1272 if (keys.containsKey("seamark:light" + secStr + ":category")) { 1273 str = keys.get("seamark:light" + secStr + ":category"); 1274 for (Lit lit : LitSTR.keySet()) 1275 if (LitSTR.get(lit).equals(str)) 1276 setLightAtt(Att.LIT, i, lit); 1277 } 1278 if (keys.containsKey("seamark:light" + secStr + ":sector_start")) 1279 setLightAtt(Att.BEG, i, keys.get("seamark:light" + secStr + ":sector_start")); 1280 if (keys.containsKey("seamark:light" + secStr + ":sector_end")) 1281 setLightAtt(Att.END, i, keys.get("seamark:light" + secStr + ":sector_end")); 1282 if (keys.containsKey("seamark:light" + secStr + ":radius")) 1283 setLightAtt(Att.RAD, i, keys.get("seamark:light" + secStr + ":radius")); 1284 if (keys.containsKey("seamark:light" + secStr + ":height")) 1285 setLightAtt(Att.HGT, i, keys.get("seamark:light" + secStr + ":height")); 1286 if (keys.containsKey("seamark:light" + secStr + ":range")) 1287 setLightAtt(Att.RNG, i, keys.get("seamark:light" + secStr + ":range")); 1288 if (keys.containsKey("seamark:light" + secStr + ":visibility")) { 1289 str = keys.get("seamark:light" + secStr + ":visibility"); 1290 for (Vis vis : VisSTR.keySet()) 1291 if (VisSTR.get(vis).equals(str)) 1292 setLightAtt(Att.VIS, i, vis); 1293 } 1294 if (keys.containsKey("seamark:light" + secStr + ":exhibition")) { 1295 str = keys.get("seamark:light" + secStr + ":exhibition"); 1296 for (Exh exh : ExhSTR.keySet()) 1297 if (ExhSTR.get(exh).equals(str)) 1298 setLightAtt(Att.EXH, i, exh); 1299 } 1300 if (keys.containsKey("seamark:light" + secStr + ":orientation")) 1301 setLightAtt(Att.ORT, i, keys.get("seamark:light" + secStr + ":orientation")); 1302 if (keys.containsKey("seamark:light" + secStr + ":multiple")) 1303 setLightAtt(Att.HGT, i, keys.get("seamark:light" + secStr + ":multiple")); 1304 if (sectors.size() == i) 1305 break; 1319 1306 } 1320 1307 … … 1339 1326 if (keys.containsKey("seamark:fog_signal:range")) { 1340 1327 setFogRange(keys.get("seamark:fog_signal:range")); 1328 } 1329 1330 if (keys.containsKey("seamark:radar_reflector")) { 1331 setRadar(Rtb.REFLECTOR); 1332 } 1333 if (keys.containsKey("seamark:radar_transponder:category")) { 1334 str = keys.get("seamark:radar_transponder:category"); 1335 setRadar(Rtb.NONE); 1336 for (Rtb rtb : RtbSTR.keySet()) { 1337 if (RtbSTR.get(rtb).equals(str)) { 1338 setRadar(rtb); 1339 } 1340 } 1341 } 1342 if (keys.containsKey("seamark:radar_transponder:group")) { 1343 setRaconGroup(keys.get("seamark:radar_transponder:group")); 1344 } 1345 if (keys.containsKey("seamark:radar_transponder:period")) { 1346 setRaconPeriod(keys.get("seamark:radar_transponder:period")); 1347 } 1348 if (keys.containsKey("seamark:radar_transponder:sequence")) { 1349 setRaconSequence(keys.get("seamark:radar_transponder:sequence")); 1350 } 1351 if (keys.containsKey("seamark:radar_transponder:range")) { 1352 setRaconRange(keys.get("seamark:radar_transponder:range")); 1353 } 1354 if (keys.containsKey("seamark:radar_transponder:sector_start")) { 1355 setRaconSector1(keys.get("seamark:radar_transponder:sector_start")); 1356 } 1357 if (keys.containsKey("seamark:radar_transponder:sector_end")) { 1358 setRaconSector2(keys.get("seamark:radar_transponder:sector_end")); 1341 1359 } 1342 1360 … … 1687 1705 } 1688 1706 1689 if ( hasFog()) {1707 if (getFogSound() != Fog.NONE) { 1690 1708 dlg.panelMain.fogIcon.setIcon(new ImageIcon(getClass().getResource("/images/Fog_Signal.png"))); 1691 1709 String str = ""; … … 1723 1741 } 1724 1742 1725 if ( hasRadar()) {1743 if (RaType != Rtb.NONE) { 1726 1744 if (getRadar() == Rtb.REFLECTOR) { 1727 1745 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png"))); … … 1743 1761 } 1744 1762 1745 if ( isFired()) {1763 if ((getLightAtt(Att.COL, 0) != Col.UNKNOWN) && (sectors.size() == 1)) { 1746 1764 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png"))); 1747 1765 } … … 1803 1821 } 1804 1822 } 1805 if ( hasTopmark()) {1823 if (getTopmark() != Top.NONE) { 1806 1824 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:shape", TopSTR.get(getTopmark()))); 1807 1825 if (getTopPattern() != Pat.NONE) … … 1847 1865 if (!((String)sectors.get(i)[13]).isEmpty()) 1848 1866 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":orientation", (String)sectors.get(i)[13])); 1867 if (!((String)sectors.get(i)[14]).isEmpty()) 1868 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String)sectors.get(i)[14])); 1849 1869 } 1850 1870 1851 if ( hasFog()) {1871 if (getFogSound() != Fog.NONE) { 1852 1872 if (getFogSound() == Fog.UNKNOWN) 1853 1873 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal", "yes")); … … 1868 1888 } 1869 1889 1870 if ( hasRadar()) {1890 if (RaType != Rtb.NONE) { 1871 1891 if (getRadar() == Rtb.REFLECTOR) { 1872 1892 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_reflector", "yes"));
Note:
See TracChangeset
for help on using the changeset viewer.