Changeset 27112 in osm for applications/editors/josm
- Timestamp:
- 2011-11-21T20:12:59+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages.properties
r27058 r27112 23 23 SSWarning=Warning Signal Station 24 24 SSTraffic=Traffic Signal Station 25 Topmark=Topmark 25 26 Topmarks=Topmarks 26 27 FogSignals=Fog signals 27 28 Radar=Radar 29 Light=Light 28 30 Lit=Lights 29 31 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_de.properties
r27058 r27112 23 23 SSWarning=Warning Signal Station 24 24 SSTraffic=Traffic Signal Station 25 Topmark=Topmark 25 26 Topmarks=Topmarks 26 27 FogSignals=Fog signals 27 28 Radar=Radar 29 Light=Light 28 30 Lit=Lights 29 31 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_en.properties
r27058 r27112 23 23 SSWarning=Warning Signal Station 24 24 SSTraffic=Traffic Signal Station 25 Topmark=Topmark 25 26 Topmarks=Topmarks 26 27 FogSignals=Fog signals 27 28 Radar=Radar 29 Light=Light 28 30 Lit=Lights 29 31 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r27056 r27112 31 31 dlg.panelMain.saveButton.setEnabled(false); 32 32 topmarkButton.setVisible(false); 33 lightButton.setVisible(false); 33 34 Shp shp = dlg.mark.getShape(); 34 35 if (portButton.isSelected()) { … … 105 106 topmarkButton.setVisible(dlg.mark.testValid()); 106 107 alTop.actionPerformed(null); 108 lightButton.setVisible(dlg.mark.testValid()); 109 alLit.actionPerformed(null); 107 110 dlg.mark.paintSign(); 108 111 } … … 139 142 case LAM_STBD: 140 143 case LAM_PSTBD: 141 dlg. panelMain.panelTop.coneTopButton.doClick();144 dlg.mark.setTopmark(Top.CONE); 142 145 switch (dlg.mark.getRegion()) { 143 146 case A: … … 166 169 } 167 170 dlg.panelMain.panelTop.syncPanel(); 171 dlg.mark.paintSign(); 172 } 173 }; 174 public JToggleButton lightButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/DefLitButton.png"))); 175 private ActionListener alLit = new ActionListener() { 176 public void actionPerformed(java.awt.event.ActionEvent e) { 177 if (lightButton.isSelected()) { 178 if (SeaMark.GrpMAP.get(dlg.mark.getObject()) == Grp.SAW) { 179 dlg.mark.setLightAtt(Att.CHR, 0, "LFl"); 180 dlg.mark.setLightAtt(Att.COL, 0, Col.WHITE); 181 } else { 182 dlg.mark.setLightAtt(Att.CHR, 0, "Fl"); 183 switch (dlg.mark.getCategory()) { 184 case LAM_PORT: 185 case LAM_PPORT: 186 switch (dlg.mark.getRegion()) { 187 case A: 188 case C: 189 dlg.mark.setLightAtt(Att.COL, 0, Col.RED); 190 break; 191 case B: 192 dlg.mark.setLightAtt(Att.COL, 0, Col.GREEN); 193 break; 194 } 195 break; 196 case LAM_STBD: 197 case LAM_PSTBD: 198 switch (dlg.mark.getRegion()) { 199 case A: 200 case C: 201 dlg.mark.setLightAtt(Att.COL, 0, Col.GREEN); 202 break; 203 case B: 204 dlg.mark.setLightAtt(Att.COL, 0, Col.RED); 205 break; 206 } 207 break; 208 } 209 } 210 lightButton.setBorderPainted(true); 211 } else { 212 dlg.mark.clrLight(); 213 lightButton.setBorderPainted(false); 214 } 215 dlg.panelMain.panelLit.syncPanel(); 168 216 dlg.mark.paintSign(); 169 217 } … … 192 240 193 241 topmarkButton.setBounds(new Rectangle(130, 0, 34, 32)); 242 topmarkButton.setToolTipText(Messages.getString("Topmark")); 194 243 topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder()); 195 244 topmarkButton.addActionListener(alTop); 196 245 topmarkButton.setVisible(false); 197 246 this.add(topmarkButton); 247 lightButton.setBounds(new Rectangle(165, 0, 34, 32)); 248 lightButton.setToolTipText(Messages.getString("Light")); 249 lightButton.setBorder(BorderFactory.createLoweredBevelBorder()); 250 lightButton.addActionListener(alLit); 251 lightButton.setVisible(false); 252 this.add(lightButton); 198 253 } 199 254 … … 235 290 topmarkButton.setSelected(dlg.mark.getTopmark() != Top.NONE); 236 291 topmarkButton.setVisible(dlg.mark.testValid()); 292 Boolean lit = (dlg.mark.getLightAtt(Att.COL, 0) != Col.UNKNOWN) && !((String)dlg.mark.getLightAtt(Att.CHR, 0)).isEmpty(); 293 lightButton.setBorderPainted(lit); 294 lightButton.setSelected(lit); 295 lightButton.setVisible(dlg.mark.testValid()); 237 296 panelPort.syncPanel(); 238 297 panelStbd.syncPanel(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r27056 r27112 69 69 } 70 70 alTop.actionPerformed(null); 71 alLit.actionPerformed(null); 71 72 dlg.panelMain.panelMore.syncPanel(); 72 73 dlg.mark.paintSign(); … … 100 101 } 101 102 topmarkButton.setVisible(dlg.mark.testValid()); 103 lightButton.setVisible(dlg.mark.testValid()); 102 104 dlg.mark.paintSign(); 103 105 } … … 134 136 } 135 137 dlg.panelMain.panelTop.syncPanel(); 138 dlg.mark.paintSign(); 139 } 140 }; 141 public JToggleButton lightButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/DefLitButton.png"))); 142 private ActionListener alLit = new ActionListener() { 143 public void actionPerformed(java.awt.event.ActionEvent e) { 144 if (lightButton.isSelected()) { 145 dlg.mark.setLightAtt(Att.COL, 0, Col.WHITE); 146 switch (dlg.mark.getCategory()) { 147 case CAM_NORTH: 148 dlg.mark.setLightAtt(Att.CHR, 0, "Q"); 149 dlg.mark.setLightAtt(Att.GRP, 0, ""); 150 break; 151 case CAM_SOUTH: 152 dlg.mark.setLightAtt(Att.CHR, 0, "Q+LFl"); 153 dlg.mark.setLightAtt(Att.GRP, 0, "6"); 154 break; 155 case CAM_EAST: 156 dlg.mark.setLightAtt(Att.CHR, 0, "Q"); 157 dlg.mark.setLightAtt(Att.GRP, 0, "3"); 158 break; 159 case CAM_WEST: 160 dlg.mark.setLightAtt(Att.CHR, 0, "Q"); 161 dlg.mark.setLightAtt(Att.GRP, 0, "9"); 162 break; 163 default: 164 dlg.mark.setLightAtt(Att.CHR, 0, "Fl"); 165 dlg.mark.setLightAtt(Att.GRP, 0, "2"); 166 break; 167 } 168 lightButton.setBorderPainted(true); 169 } else { 170 dlg.mark.clrLight(); 171 lightButton.setBorderPainted(false); 172 } 173 dlg.panelMain.panelLit.syncPanel(); 136 174 dlg.mark.paintSign(); 137 175 } … … 157 195 158 196 topmarkButton.setBounds(new Rectangle(130, 0, 34, 32)); 197 topmarkButton.setToolTipText(Messages.getString("Topmark")); 159 198 topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder()); 160 199 topmarkButton.addActionListener(alTop); 200 topmarkButton.setVisible(false); 161 201 this.add(topmarkButton); 202 lightButton.setBounds(new Rectangle(165, 0, 34, 32)); 203 lightButton.setToolTipText(Messages.getString("Light")); 204 lightButton.setBorder(BorderFactory.createLoweredBevelBorder()); 205 lightButton.addActionListener(alLit); 206 lightButton.setVisible(false); 207 this.add(lightButton); 162 208 } 163 209 … … 175 221 topmarkButton.setSelected(dlg.mark.getTopmark() != Top.NONE); 176 222 topmarkButton.setVisible(dlg.mark.testValid()); 223 Boolean lit = (dlg.mark.getLightAtt(Att.COL, 0) != Col.UNKNOWN) && !((String)dlg.mark.getLightAtt(Att.CHR, 0)).isEmpty(); 224 lightButton.setBorderPainted(lit); 225 lightButton.setSelected(lit); 226 lightButton.setVisible(dlg.mark.testValid()); 177 227 } 178 228 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
r27061 r27112 10 10 import oseam.Messages; 11 11 import oseam.dialogs.OSeaMAction; 12 import oseam.seamarks.SeaMark;13 12 import oseam.seamarks.SeaMark.*; 14 13 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r27060 r27112 172 172 dlg = dia; 173 173 panelChan = new PanelChan(dlg); 174 panelChan.setBounds(new Rectangle(65, 0, 180, 160));174 panelChan.setBounds(new Rectangle(65, 0, 200, 160)); 175 175 panelChan.setVisible(false); 176 176 panelHaz = new PanelHaz(dlg); 177 panelHaz.setBounds(new Rectangle(65, 0, 180, 160));177 panelHaz.setBounds(new Rectangle(65, 0, 200, 160)); 178 178 panelHaz.setVisible(false); 179 179 panelSpec = new PanelSpec(dlg); 180 panelSpec.setBounds(new Rectangle(65, 0, 180, 160));180 panelSpec.setBounds(new Rectangle(65, 0, 200, 160)); 181 181 panelSpec.setVisible(false); 182 182 panelLights = new PanelLights(dlg); 183 panelLights.setBounds(new Rectangle(65, 0, 180, 160));183 panelLights.setBounds(new Rectangle(65, 0, 200, 160)); 184 184 panelLights.setVisible(false); 185 185 panelMore = new PanelMore(dlg); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r27056 r27112 39 39 if (dlg.mark.testValid()) { 40 40 dlg.panelMain.panelChan.topmarkButton.setVisible(true); 41 dlg.panelMain.panelChan.lightButton.setVisible(true); 41 42 if (dlg.mark.getCategory() == Cat.LAM_PORT) { 42 43 switch (dlg.mark.getRegion()) { … … 81 82 } else { 82 83 dlg.panelMain.panelChan.topmarkButton.setVisible(false); 84 dlg.panelMain.panelChan.lightButton.setVisible(false); 83 85 } 84 86 dlg.mark.paintSign(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r27056 r27112 39 39 if (dlg.mark.testValid()) { 40 40 dlg.panelMain.panelChan.topmarkButton.setVisible(true); 41 dlg.panelMain.panelChan.lightButton.setVisible(true); 41 42 if (dlg.mark.getCategory() == Cat.LAM_STBD) { 42 43 switch (dlg.mark.getRegion()) { … … 81 82 } else { 82 83 dlg.panelMain.panelChan.topmarkButton.setVisible(false); 84 dlg.panelMain.panelChan.lightButton.setVisible(false); 83 85 } 84 86 dlg.mark.paintSign(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r27107 r27112 452 452 ChrMAP.put(EnumSet.of(Chr.OCCULTING, Chr.FLASH), "OcFl"); 453 453 ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LFLASH), "FLFl"); 454 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc");455 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LFLASH), "Al.LFl");456 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl");457 454 ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LFLASH), "Q+LFl"); 458 455 ChrMAP.put(EnumSet.of(Chr.VQUICK, Chr.LFLASH), "VQ+LFl"); 459 456 ChrMAP.put(EnumSet.of(Chr.UQUICK, Chr.LFLASH), "UQ+LFl"); 460 457 ChrMAP.put(EnumSet.of(Chr.ALTERNATING), "Al"); 458 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc"); 459 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LFLASH), "Al.LFl"); 460 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl"); 461 461 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED), "Al.F"); 462 462 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED, Chr.FLASH), "Al.FFl"); 463 463 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.ISOPHASED), "Al.Iso"); 464 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc");465 464 } 466 465 … … 576 575 if (sectors.size() > i) 577 576 sectors.remove(i); 577 } 578 579 public void clrLight() { 580 delLight(0); 581 addLight(); 578 582 } 579 583 … … 1043 1047 setColour(Ent.TOPMARK, Col.UNKNOWN); 1044 1048 setPattern(Ent.TOPMARK, Pat.NONE); 1049 setFogSound(Fog.NONE); 1050 setRadar(Rtb.NONE); 1051 clrLight(); 1045 1052 dlg.panelMain.moreButton.setVisible(false); 1046 1053 dlg.panelMain.saveButton.setEnabled(false); … … 1360 1367 } 1361 1368 1362 sectors.clear(); 1363 sectors.add(sector.clone()); 1369 clrLight(); 1364 1370 for (int i = 0; i < 30; i++) { 1365 1371 String secStr = (i == 0) ? "" : (":" + Integer.toString(i)); … … 1371 1377 } 1372 1378 if (keys.containsKey("seamark:light" + secStr + ":character")) 1373 setLightAtt(Att.CHR, i, 1374 keys.get("seamark:light" + secStr + ":character")); 1379 setLightAtt(Att.CHR, i, keys.get("seamark:light" + secStr + ":character")); 1375 1380 if (keys.containsKey("seamark:light" + secStr + ":group")) 1376 1381 setLightAtt(Att.GRP, i, keys.get("seamark:light" + secStr + ":group")); 1377 1382 if (keys.containsKey("seamark:light" + secStr + ":sequence")) 1378 setLightAtt(Att.SEQ, i, 1379 keys.get("seamark:light" + secStr + ":sequence")); 1383 setLightAtt(Att.SEQ, i, keys.get("seamark:light" + secStr + ":sequence")); 1380 1384 if (keys.containsKey("seamark:light" + secStr + ":period")) 1381 1385 setLightAtt(Att.PER, i, keys.get("seamark:light" + secStr + ":period")); … … 1387 1391 } 1388 1392 if (keys.containsKey("seamark:light" + secStr + ":sector_start")) 1389 setLightAtt(Att.BEG, i, 1390 keys.get("seamark:light" + secStr + ":sector_start")); 1393 setLightAtt(Att.BEG, i, keys.get("seamark:light" + secStr + ":sector_start")); 1391 1394 if (keys.containsKey("seamark:light" + secStr + ":sector_end")) 1392 setLightAtt(Att.END, i, 1393 keys.get("seamark:light" + secStr + ":sector_end")); 1395 setLightAtt(Att.END, i, keys.get("seamark:light" + secStr + ":sector_end")); 1394 1396 if (keys.containsKey("seamark:light" + secStr + ":radius")) 1395 1397 setLightAtt(Att.RAD, i, keys.get("seamark:light" + secStr + ":radius")); … … 1411 1413 } 1412 1414 if (keys.containsKey("seamark:light" + secStr + ":orientation")) 1413 setLightAtt(Att.ORT, i, 1414 keys.get("seamark:light" + secStr + ":orientation")); 1415 setLightAtt(Att.ORT, i, keys.get("seamark:light" + secStr + ":orientation")); 1415 1416 if (keys.containsKey("seamark:light" + secStr + ":multiple")) 1416 setLightAtt(Att.HGT, i, 1417 keys.get("seamark:light" + secStr + ":multiple")); 1417 setLightAtt(Att.HGT, i, keys.get("seamark:light" + secStr + ":multiple")); 1418 1418 if (sectors.size() == i) 1419 1419 break; … … 1688 1688 } 1689 1689 } else { 1690 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource( 1691 colStr))); 1690 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(colStr))); 1692 1691 } 1693 1692 } else { … … 1757 1756 System.out.println("Missing image: " + imgStr); 1758 1757 } else { 1759 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource( 1760 imgStr))); 1758 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(imgStr))); 1761 1759 } 1762 1760 } else { … … 1867 1865 return; 1868 1866 } else { 1869 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource( 1870 imgStr))); 1867 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(imgStr))); 1871 1868 } 1872 1869 } else { 1873 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource( 1874 colStr))); 1870 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(colStr))); 1875 1871 } 1876 1872 } else { … … 1879 1875 1880 1876 if (getFogSound() != Fog.NONE) { 1881 dlg.panelMain.fogIcon.setIcon(new ImageIcon(getClass().getResource( 1882 "/images/Fog_Signal.png"))); 1877 dlg.panelMain.fogIcon.setIcon(new ImageIcon(getClass().getResource("/images/Fog_Signal.png"))); 1883 1878 String str = ""; 1884 1879 if (getFogSound() != Fog.UNKNOWN) … … 1917 1912 if (RaType != Rtb.NONE) { 1918 1913 if (getRadar() == Rtb.REFLECTOR) { 1919 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource( 1920 "/images/Radar_Reflector_355.png"))); 1914 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png"))); 1921 1915 } else { 1922 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource( 1923 "/images/Radar_Station.png"))); 1916 dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Station.png"))); 1924 1917 String str = ""; 1925 1918 if (getRadar() == Rtb.RAMARK) … … 1941 1934 switch ((Col) getLightAtt(Att.COL, 0)) { 1942 1935 case RED: 1943 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource( 1944 "/images/Light_Red_120.png"))); 1936 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Red_120.png"))); 1945 1937 break; 1946 1938 case GREEN: 1947 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource( 1948 "/images/Light_Green_120.png"))); 1939 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Green_120.png"))); 1949 1940 break; 1950 1941 case WHITE: 1951 1942 case YELLOW: 1952 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource( 1953 "/images/Light_White_120.png"))); 1943 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_120.png"))); 1954 1944 break; 1955 1945 default: 1956 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource( 1957 "/images/Light_Magenta_120.png"))); 1958 } 1959 } 1960 String c = (String) getLightAtt(Att.CHR, 0); 1946 dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png"))); 1947 } 1948 } 1949 String c = (String) dlg.mark.getLightAtt(Att.CHR, 0); 1961 1950 String tmp = ""; 1962 1951 if (c.contains("+")) { … … 2004 1993 if (getObject() != Obj.UNKNOWN) { 2005 1994 2006 Main.pref.put("smedplugin.IALA", getRegion() == Reg.C ? "C" 2007 : (getRegion() == Reg.B ? "B" : "A")); 1995 Main.pref.put("smedplugin.IALA", getRegion() == Reg.C ? "C" : (getRegion() == Reg.B ? "B" : "A")); 2008 1996 2009 1997 for (String str : node.getKeys().keySet()) { … … 2013 2001 2014 2002 if (!getName().isEmpty()) 2015 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:name", 2016 getName())); 2003 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:name", getName())); 2017 2004 2018 2005 String objStr = ObjSTR.get(object); 2019 2006 if (objStr != null) { 2020 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:type", 2021 objStr)); 2007 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:type", objStr)); 2022 2008 2023 2009 if (getShape() != Shp.FLOAT) { 2024 2010 String str = CatSTR.get(getCategory()); 2025 2011 if (str != null) 2026 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" 2027 + objStr + ":category", str)); 2012 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":category", str)); 2028 2013 if ((getShape() != Shp.BUOY) && (getShape() != Shp.BEACON)) 2029 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" 2030 + objStr + ":shape", ShpSTR.get(getShape()))); 2014 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":shape", ShpSTR.get(getShape()))); 2031 2015 } 2032 2016 … … 2036 2020 str += (";" + ColSTR.get(getObjColour(i))); 2037 2021 } 2038 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" 2039 + objStr + ":colour", str)); 2022 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour", str)); 2040 2023 } 2041 2024 2042 2025 if (getObjPattern() != Pat.NONE) { 2043 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" 2044 + objStr + ":colour_pattern", PatSTR.get(getObjPattern()))); 2026 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatSTR.get(getObjPattern()))); 2045 2027 } 2046 2028 … … 2049 2031 switch (region) { 2050 2032 case A: 2051 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" 2052 + objStr + ":system", "iala-a")); 2033 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-a")); 2053 2034 break; 2054 2035 case B: 2055 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" 2056 + objStr + ":system", "iala-b")); 2036 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-b")); 2057 2037 break; 2058 2038 case C: 2059 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" 2060 + objStr + ":system", "other")); 2039 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "other")); 2061 2040 break; 2062 2041 } 2063 2042 } 2064 2043 if (!getHeight().isEmpty()) { 2065 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" 2066 + objStr + ":height", getHeight())); 2044 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":height", getHeight())); 2067 2045 } 2068 2046 if (!getElevation().isEmpty()) { 2069 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" 2070 + objStr + ":elevation", getElevation())); 2047 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":elevation", getElevation())); 2071 2048 } 2072 2049 } 2073 2050 if (getTopmark() != Top.NONE) { 2074 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2075 "seamark:topmark:shape", TopSTR.get(getTopmark()))); 2051 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:shape", TopSTR.get(getTopmark()))); 2076 2052 if (getTopPattern() != Pat.NONE) 2077 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2078 "seamark:topmark:colour_pattern", PatSTR.get(getTopPattern()))); 2053 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour_pattern", PatSTR.get(getTopPattern()))); 2079 2054 if (getTopColour(0) != Col.UNKNOWN) { 2080 2055 String str = ColSTR.get(getTopColour(0)); … … 2082 2057 str += (";" + ColSTR.get(getTopColour(i))); 2083 2058 } 2084 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2085 "seamark:topmark:colour", str)); 2059 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour", str)); 2086 2060 } 2087 2061 } … … 2090 2064 String secStr = (i == 0) ? "" : (":" + Integer.toString(i)); 2091 2065 if (sectors.get(i)[0] != Col.UNKNOWN) 2092 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2093 "seamark:light" + secStr + ":colour", 2094 ColSTR.get(sectors.get(i)[0]))); 2066 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", ColSTR.get(sectors.get(i)[0]))); 2095 2067 if (!((String) sectors.get(i)[1]).isEmpty()) 2096 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2097 "seamark:light" + secStr + ":character", 2098 (String) sectors.get(i)[1])); 2068 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":character", (String) sectors.get(i)[1])); 2099 2069 if (!((String) sectors.get(i)[2]).isEmpty()) 2100 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2101 "seamark:light" + secStr + ":group", (String) sectors.get(i)[2])); 2070 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":group", (String) sectors.get(i)[2])); 2102 2071 if (!((String) sectors.get(i)[3]).isEmpty()) 2103 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2104 "seamark:light" + secStr + ":sequence", 2105 (String) sectors.get(i)[3])); 2072 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sequence", (String) sectors.get(i)[3])); 2106 2073 if (!((String) sectors.get(i)[4]).isEmpty()) 2107 Main.main.undoRedo 2108 .add(new ChangePropertyCommand(node, "seamark:light" + secStr 2109 + ":period", (String) sectors.get(i)[4])); 2074 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(i)[4])); 2110 2075 if (sectors.get(i)[5] != Lit.UNKNOWN) 2111 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2112 "seamark:light" + secStr + ":category", 2113 LitSTR.get(sectors.get(i)[5]))); 2076 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", LitSTR.get(sectors.get(i)[5]))); 2114 2077 if (!((String) sectors.get(i)[6]).isEmpty()) 2115 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2116 "seamark:light" + secStr + ":sector_start", (String) sectors 2117 .get(i)[6])); 2078 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_start", (String) sectors.get(i)[6])); 2118 2079 if (!((String) sectors.get(i)[7]).isEmpty()) 2119 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2120 "seamark:light" + secStr + ":sector_end", 2121 (String) sectors.get(i)[7])); 2080 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_end", (String) sectors.get(i)[7])); 2122 2081 if (!((String) sectors.get(i)[8]).isEmpty()) 2123 Main.main.undoRedo 2124 .add(new ChangePropertyCommand(node, "seamark:light" + secStr 2125 + ":radius", (String) sectors.get(i)[8])); 2082 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":radius", (String) sectors.get(i)[8])); 2126 2083 if (!((String) sectors.get(i)[9]).isEmpty()) 2127 Main.main.undoRedo 2128 .add(new ChangePropertyCommand(node, "seamark:light" + secStr 2129 + ":height", (String) sectors.get(i)[9])); 2084 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":height", (String) sectors.get(i)[9])); 2130 2085 if (!((String) sectors.get(i)[10]).isEmpty()) 2131 Main.main.undoRedo 2132 .add(new ChangePropertyCommand(node, "seamark:light" + secStr 2133 + ":range", (String) sectors.get(i)[10])); 2086 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(i)[10])); 2134 2087 if (sectors.get(i)[11] != Vis.UNKNOWN) 2135 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2136 "seamark:light" + secStr + ":visibility", VisSTR.get(sectors 2137 .get(i)[11]))); 2088 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", VisSTR.get(sectors.get(i)[11]))); 2138 2089 if (sectors.get(i)[12] != Exh.UNKNOWN) 2139 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2140 "seamark:light" + secStr + ":exhibition", ExhSTR.get(sectors 2141 .get(i)[12]))); 2090 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", ExhSTR.get(sectors.get(i)[12]))); 2142 2091 if (!((String) sectors.get(i)[13]).isEmpty()) 2143 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2144 "seamark:light" + secStr + ":orientation", (String) sectors 2145 .get(i)[13])); 2092 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":orientation", (String) sectors.get(i)[13])); 2146 2093 if (!((String) sectors.get(i)[14]).isEmpty()) 2147 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2148 "seamark:light" + secStr + ":multiple", 2149 (String) sectors.get(i)[14])); 2094 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String) sectors.get(i)[14])); 2150 2095 } 2151 2096 2152 2097 if (getFogSound() != Fog.NONE) { 2153 2098 if (getFogSound() == Fog.UNKNOWN) 2154 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2155 "seamark:fog_signal", "yes")); 2099 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal", "yes")); 2156 2100 else 2157 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2158 "seamark:fog_signal:category", FogSTR.get(getFogSound()))); 2101 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:category", FogSTR.get(getFogSound()))); 2159 2102 if (!getFogGroup().isEmpty()) { 2160 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2161 "seamark:fog_signal:group", getFogGroup())); 2103 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:group", getFogGroup())); 2162 2104 } 2163 2105 if (!getFogPeriod().isEmpty()) { 2164 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2165 "seamark:fog_signal:period", getFogPeriod())); 2106 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:period", getFogPeriod())); 2166 2107 } 2167 2108 if (!getFogSequence().isEmpty()) { 2168 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2169 "seamark:fog_signal:sequence", getFogSequence())); 2109 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:sequence", getFogSequence())); 2170 2110 } 2171 2111 if (!getFogRange().isEmpty()) { 2172 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2173 "seamark:fog_signal:range", getFogRange())); 2112 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:range", getFogRange())); 2174 2113 } 2175 2114 } … … 2177 2116 if (RaType != Rtb.NONE) { 2178 2117 if (getRadar() == Rtb.REFLECTOR) { 2179 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2180 "seamark:radar_reflector", "yes")); 2118 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_reflector", "yes")); 2181 2119 } else { 2182 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2183 "seamark:radar_transponder:category", RtbSTR.get(getRadar()))); 2120 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:category", RtbSTR.get(getRadar()))); 2184 2121 if (!getRaconGroup().isEmpty()) { 2185 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2186 "seamark:radar_transponder:group", getRaconGroup())); 2122 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:group", getRaconGroup())); 2187 2123 } 2188 2124 if (!getRaconPeriod().isEmpty()) { 2189 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2190 "seamark:radar_transponder:period", getRaconPeriod())); 2125 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:period", getRaconPeriod())); 2191 2126 } 2192 2127 if (!getRaconSequence().isEmpty()) { 2193 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2194 "seamark:radar_transponder:sequence", getRaconSequence())); 2128 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sequence", getRaconSequence())); 2195 2129 } 2196 2130 if (!getRaconRange().isEmpty()) { 2197 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2198 "seamark:radar_transponder:range", getRaconRange())); 2131 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:range", getRaconRange())); 2199 2132 } 2200 2133 if ((!getRaconSector1().isEmpty()) && (!getRaconSector2().isEmpty())) { 2201 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2202 "seamark:radar_transponder:sector_start", getRaconSector1())); 2203 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2204 "seamark:radar_transponder:sector_end", getRaconSector2())); 2134 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_start", getRaconSector1())); 2135 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_end", getRaconSector2())); 2205 2136 } 2206 2137 } … … 2208 2139 2209 2140 if (!getInfo().isEmpty()) { 2210 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2211 "seamark:information", getInfo())); 2141 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:information", getInfo())); 2212 2142 } 2213 2143 if (!getSource().isEmpty()) { 2214 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2215 "seamark:source", getSource())); 2144 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:source", getSource())); 2216 2145 } 2217 2146 if (getStatus() != Sts.UNKNOWN) { 2218 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2219 "seamark:status", StsSTR.get(getStatus()))); 2147 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:status", StsSTR.get(getStatus()))); 2220 2148 } 2221 2149 if (getConstr() != Cns.UNKNOWN) { 2222 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2223 "seamark:construction", CnsSTR.get(getConstr()))); 2150 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:construction", CnsSTR.get(getConstr()))); 2224 2151 } 2225 2152 if (getConsp() != Con.UNKNOWN) { 2226 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2227 "seamark:conspicuity", ConSTR.get(getConsp()))); 2153 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:conspicuity", ConSTR.get(getConsp()))); 2228 2154 } 2229 2155 if (getRefl() != Con.UNKNOWN) { 2230 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2231 "seamark:reflectivity", ConSTR.get(getRefl()))); 2156 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reflectivity", ConSTR.get(getRefl()))); 2232 2157 } 2233 2158 if (!getRef().isEmpty()) { 2234 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2235 "seamark:reference", getRef())); 2159 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reference", getRef())); 2236 2160 } 2237 2161 if (!getLightRef().isEmpty()) { 2238 Main.main.undoRedo.add(new ChangePropertyCommand(node, 2239 "seamark:light:reference", getLightRef())); 2162 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:reference", getLightRef())); 2240 2163 } 2241 2164 if (!getFixme().isEmpty()) { 2242 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fixme", 2243 getFixme())); 2165 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fixme", getFixme())); 2244 2166 } 2245 2167 }
Note:
See TracChangeset
for help on using the changeset viewer.