Changeset 27042 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2011-11-12T19:15:36+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChr.java
r27027 r27042 119 119 } 120 120 121 public void enableAll(boolean state) { 122 for (JToggleButton button : buttons.values()) { 123 button.setEnabled(state); 121 public void syncPanel() { 122 String str = (String)dlg.mark.getLightAtt(Att.CHR, 0); 123 charBox.setText(str); 124 EnumSet<Chr> set = EnumSet.noneOf(Chr.class); 125 for (EnumSet<Chr> map : SeaMark.ChrMAP.keySet()) { 126 if (str.equals(SeaMark.ChrMAP.get(map))) { 127 set = map; 128 break; 129 } 130 } 131 for (Chr chr : buttons.keySet()) { 132 JToggleButton button = buttons.get(chr); 133 if (set.contains(chr)) { 134 button.setSelected(true); 135 button.setBorderPainted(true); 136 } else { 137 button.setSelected(false); 138 button.setBorderPainted(false); 139 } 124 140 } 125 141 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r27031 r27042 124 124 public void syncPanel() { 125 125 if (ent == Ent.LIGHT) { 126 for (Col col : colours.keySet()) { 127 JRadioButton button = colours.get(col); 128 if (dlg.mark.getLightAtt(Att.COL, 0) == col) { 129 button.setBorderPainted(true); 130 } else 131 button.setBorderPainted(false); 132 } 126 133 } else { 127 134 int idx; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
r27041 r27042 133 133 if (panelSector != null) { 134 134 panelSector.setVisible(false); 135 panelSector = null; 135 136 } 137 while (dlg.mark.getSectorCount() > 1) 138 dlg.mark.delLight(1); 136 139 } 137 140 } … … 274 277 275 278 public void syncPanel() { 279 if (panelSector != null) { 280 panelSector.setVisible(false); 281 panelSector = null; 282 } 283 singleButton.setBorderPainted(false); 284 sectorButton.setBorderPainted(false); 276 285 orientationLabel.setVisible(false); 277 286 orientationBox.setVisible(false); 278 287 multipleLabel.setVisible(false); 279 288 multipleBox.setVisible(false); 289 groupBox.setText((String)dlg.mark.getLightAtt(Att.GRP, 0)); 290 periodBox.setText((String)dlg.mark.getLightAtt(Att.PER, 0)); 291 sequenceBox.setText((String)dlg.mark.getLightAtt(Att.SEQ, 0)); 292 heightBox.setText((String)dlg.mark.getLightAtt(Att.HGT, 0)); 293 rangeBox.setText((String)dlg.mark.getLightAtt(Att.RNG, 0)); 294 orientationBox.setText((String)dlg.mark.getLightAtt(Att.ORT, 0)); 295 multipleBox.setText((String)dlg.mark.getLightAtt(Att.MLT, 0)); 296 visibilityBox.setSelectedIndex(0); 297 for (Vis vis : visibilities.keySet()) { 298 int item = visibilities.get(vis); 299 if (dlg.mark.getLightAtt(Att.VIS, 0) == vis) 300 visibilityBox.setSelectedIndex(item); 301 } 302 categoryBox.setSelectedIndex(0); 303 for (Lit lit : categories.keySet()) { 304 int item = categories.get(lit); 305 if (dlg.mark.getLightAtt(Att.LIT, 0) == lit) 306 categoryBox.setSelectedIndex(item); 307 } 308 exhibitionBox.setSelectedIndex(0); 309 for (Exh exh : exhibitions.keySet()) { 310 int item = exhibitions.get(exh); 311 if (dlg.mark.getLightAtt(Att.EXH, 0) == exh) 312 exhibitionBox.setSelectedIndex(item); 313 } 314 panelCol.syncPanel(); 315 panelChr.syncPanel(); 280 316 } 281 317 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r27041 r27042 293 293 miscButtons.clearSelection(); 294 294 topButton.setEnabled(false); 295 topButton.setBorderPainted(false); 295 296 fogButton.setEnabled(false); 297 fogButton.setBorderPainted(false); 296 298 radButton.setEnabled(false); 299 radButton.setBorderPainted(false); 297 300 litButton.setEnabled(false); 301 litButton.setBorderPainted(false); 298 302 saveButton.setEnabled(false); 299 303 moreButton.setVisible(false); … … 304 308 panelLights.setVisible(false); 305 309 panelMore.setVisible(false); 310 panelTop.setVisible(false); 311 panelFog.setVisible(false); 312 panelRadar.setVisible(false); 313 panelLit.setVisible(false); 306 314 radarLabel.setText(""); 307 315 fogLabel.setText(""); … … 355 363 break; 356 364 } 357 panelChan.syncPanel();358 panelHaz.syncPanel();359 panelSpec.syncPanel();360 panelLights.syncPanel();361 365 panelMore.syncPanel(); 362 366 panelTop.syncPanel(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMore.java
r27032 r27042 75 75 int idx = conspicuities.get(con); 76 76 if (dlg.mark != null && (idx == conBox.getSelectedIndex())) 77 dlg.mark.setCon (con);77 dlg.mark.setConsp(con); 78 78 } 79 79 } … … 321 321 for (Con con : conspicuities.keySet()) { 322 322 int item = conspicuities.get(con); 323 if (dlg.mark.getCon () == con)323 if (dlg.mark.getConsp() == con) 324 324 conBox.setSelectedIndex(item); 325 325 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSectors.java
r27031 r27042 66 66 panel.add(new JScrollPane(table)); 67 67 this.getContentPane().add(panel); 68 69 table.setSize(860, ((table.getRowCount() * 16) + 18)); 70 if (table.getRowCount() > 3) { 71 this.setSize(900, ((table.getRowCount() * 16) + 40)); 72 } 68 73 69 74 table.setDefaultRenderer(String.class, new CentreRenderer()); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r27041 r27042 629 629 TopSTR.put(Top.SOUTH, "2 cones down"); 630 630 TopSTR.put(Top.EAST, "2 cones base together"); 631 TopSTR.put(Top.WEST, "2 cones point stogether");631 TopSTR.put(Top.WEST, "2 cones point together"); 632 632 TopSTR.put(Top.SPHERES2, "2 spheres"); 633 633 TopSTR.put(Top.BOARD, "board"); … … 872 872 private Con conspicuity = Con.UNKNOWN; 873 873 874 public Con getCon () {874 public Con getConsp() { 875 875 return conspicuity; 876 876 } 877 877 878 public void setCon (Con con) {878 public void setConsp(Con con) { 879 879 conspicuity = con; 880 880 } … … 928 928 public void setHeight(String str) { 929 929 height = validDecimal(str); 930 } 931 932 public String ref = ""; 933 934 public String getRef() { 935 return ref; 936 } 937 938 public void setRef(String str) { 939 ref = str; 940 } 941 942 public String lightRef = ""; 943 944 public String getLightRef() { 945 return lightRef; 946 } 947 948 public void setLightRef(String str) { 949 lightRef = str; 950 } 951 952 public String fixme = ""; 953 954 public String getFixme() { 955 return fixme; 956 } 957 958 public void setFixme(String str) { 959 fixme = str; 930 960 } 931 961 … … 1081 1111 } 1082 1112 } 1113 1114 if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":height")) { 1115 setHeight(keys.get("seamark:" + ObjSTR.get(obj) + ":height")); 1116 } 1117 if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":elevation")) { 1118 setElevation(keys.get("seamark:" + ObjSTR.get(obj) + ":elevation")); 1119 } 1083 1120 } 1084 1121 … … 1307 1344 1308 1345 if (keys.containsKey("seamark:fog_signal")) { 1309 str = keys.get("seamark:fog_signal"); 1346 setFogSound(Fog.UNKNOWN); 1347 } 1348 if (keys.containsKey("seamark:fog_signal:category")) { 1349 str = keys.get("seamark:fog_signal:category"); 1310 1350 setFogSound(Fog.NONE); 1311 1351 for (Fog fog : FogSTR.keySet()) { … … 1391 1431 if (keys.containsKey("seamark:conspicuity")) { 1392 1432 str = keys.get("seamark:conspicuity"); 1393 setCon (Con.UNKNOWN);1433 setConsp(Con.UNKNOWN); 1394 1434 for (Con con : ConSTR.keySet()) { 1395 1435 if (ConSTR.get(con).equals(str)) { 1396 setCon (con);1436 setConsp(con); 1397 1437 } 1398 1438 } … … 1406 1446 } 1407 1447 } 1448 } 1449 1450 if (keys.containsKey("seamark:ref")) { 1451 setRef(keys.get("seamark:ref")); 1452 } 1453 if (keys.containsKey("seamark:reference")) { 1454 setRef(keys.get("seamark:reference")); 1455 } 1456 if (keys.containsKey("seamark:light:ref")) { 1457 setLightRef(keys.get("seamark:light:ref")); 1458 } 1459 if (keys.containsKey("seamark:light:reference")) { 1460 setLightRef(keys.get("seamark:light:reference")); 1461 } 1462 if (keys.containsKey("seamark:fixme")) { 1463 setFixme(keys.get("seamark:fixme")); 1408 1464 } 1409 1465 … … 1787 1843 1788 1844 if (getShape() != Shp.FLOAT) { 1789 String str = CatSTR.get( category);1845 String str = CatSTR.get(getCategory()); 1790 1846 if (str != null) 1791 1847 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":category", str)); … … 1819 1875 break; 1820 1876 } 1877 } 1878 if (!getHeight().isEmpty()) { 1879 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + "height", getHeight())); 1880 } 1881 if (!getElevation().isEmpty()) { 1882 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + "elevation", getElevation())); 1821 1883 } 1822 1884 } … … 1918 1980 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:source", getSource())); 1919 1981 } 1920 if (!getHeight().isEmpty()) {1921 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:height", getHeight()));1922 }1923 if (!getElevation().isEmpty()) {1924 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:elevation", getElevation()));1925 }1926 1982 if (getStatus() != Sts.UNKNOWN) { 1927 1983 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:status", StsSTR.get(getStatus()))); … … 1930 1986 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:construction", CnsSTR.get(getConstr()))); 1931 1987 } 1932 if (getCon () != Con.UNKNOWN) {1933 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:conspicuity", ConSTR.get(getCon ())));1988 if (getConsp() != Con.UNKNOWN) { 1989 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:conspicuity", ConSTR.get(getConsp()))); 1934 1990 } 1935 1991 if (getRefl() != Con.UNKNOWN) { 1936 1992 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reflectivity", ConSTR.get(getRefl()))); 1937 1993 } 1994 if (!getRef().isEmpty()) { 1995 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reference", getRef())); 1996 } 1997 if (!getLightRef().isEmpty()) { 1998 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:reference", getLightRef())); 1999 } 2000 if (!getFixme().isEmpty()) { 2001 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fixme", getFixme())); 2002 } 1938 2003 } 1939 2004 }
Note:
See TracChangeset
for help on using the changeset viewer.