Changeset 26978 in osm for applications/editors/josm
- Timestamp:
- 2011-10-28T22:40:07+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
r26977 r26978 128 128 topmarkButton.setBorderPainted(false); 129 129 } 130 dlg.mark.paintSign(); 130 131 } 131 132 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
r26972 r26978 58 58 syncStack(); 59 59 } 60 dlg.mark.paintSign(); 60 61 } 61 62 } else { … … 80 81 } 81 82 } 83 dlg.mark.paintSign(); 82 84 } 83 85 }; -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r26977 r26978 82 82 } 83 83 dlg.panelMain.panelMore.panelPat.panelCol.syncStack(); 84 dlg.mark.paintSign(); 84 85 } 85 86 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
r26977 r26978 95 95 dlg.panelMain.litButton.setEnabled(false); 96 96 } 97 dlg.mark.paintSign(); 97 98 } 98 99 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java
r26977 r26978 52 52 } 53 53 dlg.panelMain.panelMore.panelPat.panelCol.syncStack(); 54 dlg.mark.paintSign(); 54 55 } 55 56 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
r26977 r26978 95 95 dlg.panelMain.litButton.setEnabled(false); 96 96 } 97 dlg.mark.paintSign(); 97 98 } 98 99 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
r26970 r26978 45 45 } 46 46 mooringTopButton.setBorderPainted(mooringTopButton.isSelected()); 47 dlg.mark.paintSign(); 47 48 } 48 49 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26977 r26978 30 30 } 31 31 } 32 32 33 33 public enum Reg { 34 34 A, B, C … … 160 160 161 161 public enum Cat { 162 UNKNOWN, LAM_PORT, LAM_STBD, LAM_PPORT, LAM_PSTBD, 163 CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST, 164 ACH_URST, ACH_DEEP, ACH_TANK, ACH_EXPL, ACH_QUAR, ACH_SPLN, ACH_SCAN, ACH_SCMO, ACH_T24H, ACH_TLIM, 165 SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN, 166 SPM_MOOR, SPM_LNBY, SPM_LDNG, SPM_NOTC, SPM_TSS, SPM_FOUL, SPM_DIVE, SPM_FRRY, SPM_ANCH, 167 MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_BUOY, 168 SIS_PTCL, SIS_PTED, SIS_IPT, SIS_BRTH, SIS_DOCK, SIS_LOCK, SIS_FBAR, SIS_BRDG, SIS_DRDG, SIS_TRFC, 169 SIS_DNGR, SIS_OBST, SIS_CABL, SIS_MILY, SIS_DSTR, SIS_WTHR, SIS_STRM, SIS_ICE, SIS_TIME, SIS_TIDE, SIS_TSTM, SIS_TGAG, SIS_TSCL, SIS_DIVE, SIS_LGAG, 170 LIT_DIRF, LIT_LEDG 162 UNKNOWN, LAM_PORT, LAM_STBD, LAM_PPORT, LAM_PSTBD, CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST, ACH_URST, ACH_DEEP, ACH_TANK, ACH_EXPL, ACH_QUAR, ACH_SPLN, ACH_SCAN, ACH_SCMO, ACH_T24H, ACH_TLIM, SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN, SPM_MOOR, SPM_LNBY, SPM_LDNG, SPM_NOTC, SPM_TSS, SPM_FOUL, SPM_DIVE, SPM_FRRY, SPM_ANCH, MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_BUOY, SIS_PTCL, SIS_PTED, SIS_IPT, SIS_BRTH, SIS_DOCK, SIS_LOCK, SIS_FBAR, SIS_BRDG, SIS_DRDG, SIS_TRFC, SIS_DNGR, SIS_OBST, SIS_CABL, SIS_MILY, SIS_DSTR, SIS_WTHR, SIS_STRM, SIS_ICE, SIS_TIME, SIS_TIDE, SIS_TSTM, SIS_TGAG, SIS_TSCL, SIS_DIVE, SIS_LGAG, LIT_DIRF, LIT_LEDG 171 163 } 172 164 … … 479 471 480 472 public enum Top { 481 NONE, CAN, CONE, SPHERE, X_SHAPE, NORTH, SOUTH, EAST, WEST, SPHERES2, 482 BOARD, DIAMOND, CIRCLE, TRIANGLE, TRIANGLE_INV, SQUARE 473 NONE, CAN, CONE, SPHERE, X_SHAPE, NORTH, SOUTH, EAST, WEST, SPHERES2, BOARD, DIAMOND, CIRCLE, TRIANGLE, TRIANGLE_INV, SQUARE 483 474 } 484 475 … … 607 598 UNKNOWN, PERM, OCC, REC, NIU, INT, RESV, TEMP, PRIV, MAND, DEST, EXT, ILLUM, HIST, PUB, SYNC, WATCH, UNWAT, DOUBT 608 599 } 609 600 610 601 public static final EnumMap<Sts, String> StsSTR = new EnumMap<Sts, String>(Sts.class); 611 602 static { … … 631 622 632 623 private Sts status = Sts.UNKNOWN; 633 624 634 625 public Sts getStatus() { 635 626 return status; … … 643 634 UNKNOWN, BRICK, CONC, BOULD, HSURF, USURF, WOOD, METAL, GRP, PAINT 644 635 } 645 636 646 637 public static final EnumMap<Cns, String> CnsSTR = new EnumMap<Cns, String>(Cns.class); 647 638 static { … … 658 649 659 650 private Cns construction = Cns.UNKNOWN; 660 651 661 652 public Cns getConstr() { 662 653 return construction; … … 670 661 UNKNOWN, CONSP, NCONS, REFL 671 662 } 672 663 673 664 public static final EnumMap<Vis, String> VisSTR = new EnumMap<Vis, String>(Vis.class); 674 665 static { … … 679 670 680 671 private Vis visibility = Vis.UNKNOWN; 681 672 682 673 public Vis getVis() { 683 674 return visibility; … … 689 680 690 681 private Vis reflectivity = Vis.UNKNOWN; 691 682 692 683 public Vis getRvis() { 693 684 return reflectivity; … … 699 690 700 691 public String information = ""; 701 692 702 693 public String getInfo() { 703 694 return information; 704 695 } 705 696 706 697 public void setInfo(String str) { 707 698 information = str.trim(); 708 699 } 709 700 710 701 public String source = ""; 711 702 712 703 public String getSource() { 713 704 return source; 714 705 } 715 706 716 707 public void setSource(String str) { 717 708 source = str.trim(); 718 709 } 719 710 720 711 public String elevation = ""; 721 712 722 713 public String getElevation() { 723 714 return elevation; 724 715 } 725 716 726 717 public void setElevation(String str) { 727 718 elevation = validDecimal(str); 728 719 } 729 720 730 721 public String height = ""; 731 722 732 723 public String getHeight() { 733 724 return height; 734 725 } 735 726 736 727 public void setHeight(String str) { 737 728 height = validDecimal(str); 738 729 } 739 730 740 731 public boolean isValid() { 741 732 switch (getObject()) { … … 773 764 case SISTAT: 774 765 return true; 775 default: return false; 766 default: 767 return false; 776 768 } 777 769 return false; 778 770 } 779 771 780 772 // **********************!!!!!!!!! 781 773 public Light light = new Light(dlg); … … 919 911 break; 920 912 case GREEN: 921 if (getColour(Ent.BODY, 1) == Col.UNKNOWN) { 922 setObject(Obj.FLTLAT); 923 if (getRegion() == Reg.B) { 924 setCategory(Cat.LAM_PORT); 913 if (getColour(Ent.BODY, 1) == Col.UNKNOWN) { 914 setObject(Obj.FLTLAT); 915 if (getRegion() == Reg.B) { 916 setCategory(Cat.LAM_PORT); 917 } else { 918 setCategory(Cat.LAM_STBD); 919 } 920 } else if ((getColour(Ent.BODY, 1) == Col.RED) && (getColour(Ent.BODY, 2) == Col.GREEN)) { 921 setObject(Obj.FLTLAT); 922 if (getRegion() == Reg.B) { 923 setCategory(Cat.LAM_PPORT); 924 } else { 925 setCategory(Cat.LAM_PSTBD); 926 } 927 } else if ((getColour(Ent.BODY, 1) == Col.WHITE) && (getColour(Ent.BODY, 2) == Col.GREEN)) { 928 setObject(Obj.FLTLAT); 929 setCategory(Cat.LAM_STBD); 925 930 } else { 926 setCategory(Cat.LAM_STBD); 927 } 928 } else if ((getColour(Ent.BODY, 1) == Col.RED) && (getColour(Ent.BODY, 2) == Col.GREEN)) { 929 setObject(Obj.FLTLAT); 930 if (getRegion() == Reg.B) { 931 setCategory(Cat.LAM_PPORT); 932 } else { 933 setCategory(Cat.LAM_PSTBD); 934 } 935 } else if ((getColour(Ent.BODY, 1) == Col.WHITE) && (getColour(Ent.BODY, 2) == Col.GREEN)) { 936 setObject(Obj.FLTLAT); 937 setCategory(Cat.LAM_STBD); 938 } else { 939 setObject(Obj.FLTSPP); 940 setCategory(Cat.UNKNOWN); 941 } 931 setObject(Obj.FLTSPP); 932 setCategory(Cat.UNKNOWN); 933 } 942 934 break; 943 935 case YELLOW: … … 969 961 } 970 962 break; 971 972 973 974 } 975 } 976 963 default: 964 setObject(Obj.FLTSPP); 965 setCategory(Cat.UNKNOWN); 966 } 967 } 968 977 969 for (Obj obj : ObjSTR.keySet()) { 978 970 if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":system")) { … … 1154 1146 } 1155 1147 break; 1156 1157 1158 } 1159 break; 1160 } 1161 1148 default: 1149 dlg.panelMain.lightsButton.setSelected(true); 1150 } 1151 break; 1152 } 1153 1162 1154 dlg.panelMain.syncButtons(); 1163 1155 … … 1177 1169 dlg.panelMain.fogIcon.setIcon(null); 1178 1170 1171 String colStr; 1179 1172 String imgStr = "/images/"; 1180 1173 if (getShape() != Shp.UNKNOWN) { … … 1223 1216 break; 1224 1217 } 1225 StringcolStr = imgStr;1218 colStr = imgStr; 1226 1219 for (Col col : bodyColour) { 1227 1220 switch (col) { … … 1315 1308 } 1316 1309 } 1310 1311 if (getTopmark() != Top.NONE) { 1312 imgStr = "/images/Top_"; 1313 switch (getTopmark()) { 1314 case CAN: 1315 imgStr += "Can"; 1316 break; 1317 case CONE: 1318 imgStr += "Cone"; 1319 break; 1320 case SPHERE: 1321 imgStr += "Sphere"; 1322 break; 1323 case X_SHAPE: 1324 imgStr += "X"; 1325 break; 1326 case NORTH: 1327 imgStr += "North"; 1328 break; 1329 case SOUTH: 1330 imgStr += "South"; 1331 break; 1332 case EAST: 1333 imgStr += "East"; 1334 break; 1335 case WEST: 1336 imgStr += "West"; 1337 break; 1338 case SPHERES2: 1339 imgStr += "Isol"; 1340 break; 1341 } 1342 colStr = imgStr; 1343 for (Col col : topColour) { 1344 switch (col) { 1345 case WHITE: 1346 colStr += "_White"; 1347 break; 1348 case RED: 1349 colStr += "_Red"; 1350 break; 1351 case ORANGE: 1352 colStr += "_Orange"; 1353 break; 1354 case AMBER: 1355 colStr += "_Amber"; 1356 break; 1357 case YELLOW: 1358 colStr += "_Yellow"; 1359 break; 1360 case GREEN: 1361 colStr += "_Green"; 1362 break; 1363 case BLUE: 1364 colStr += "_Blue"; 1365 break; 1366 case VIOLET: 1367 colStr += "_Violet"; 1368 break; 1369 case BLACK: 1370 colStr += "_Black"; 1371 break; 1372 } 1373 } 1374 switch (getShape()) { 1375 case CAN: 1376 case CONE: 1377 case SPHERE: 1378 case BARREL: 1379 imgStr += "_Buoy_Small"; 1380 colStr += "_Buoy_Small"; 1381 break; 1382 case PILLAR: 1383 case SPAR: 1384 imgStr += "_Buoy"; 1385 colStr += "_Buoy"; 1386 break; 1387 case FLOAT: 1388 case SUPER: 1389 imgStr += "_Float"; 1390 colStr += "_Float"; 1391 break; 1392 case BUOYANT: 1393 case CAIRN: 1394 case PILE: 1395 case LATTICE: 1396 case TOWER: 1397 case STAKE: 1398 case POLE: 1399 case POST: 1400 case BEACON: 1401 imgStr += "_Beacon"; 1402 colStr += "_Beacon"; 1403 break; 1404 } 1405 colStr += ".png"; 1406 if (getClass().getResource(colStr) == null) { 1407 System.out.println("Missing image: " + colStr); 1408 imgStr += ".png"; 1409 if (getClass().getResource(imgStr) == null) { 1410 System.out.println("Missing image: " + imgStr); 1411 return; 1412 } else { 1413 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(imgStr))); 1414 } 1415 } else { 1416 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(colStr))); 1417 } 1418 } else { 1419 dlg.panelMain.topIcon.setIcon(null); 1420 } 1317 1421 } 1318 1422 … … 1352 1456 1353 1457 if (getPattern(Ent.BODY) != Pat.NONE) { 1354 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatSTR.get(getPattern(Ent.BODY)))); 1458 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatSTR 1459 .get(getPattern(Ent.BODY)))); 1355 1460 } 1356 1461 … … 1372 1477 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:shape", TopSTR.get(getTopmark()))); 1373 1478 if (getPattern(Ent.TOPMARK) != Pat.NONE) 1374 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour_pattern", PatSTR.get(getPattern(Ent.TOPMARK)))); 1479 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour_pattern", PatSTR 1480 .get(getPattern(Ent.TOPMARK)))); 1375 1481 if (getColour(Ent.TOPMARK, 0) != Col.UNKNOWN) { 1376 1482 String str = ColSTR.get(getColour(Ent.TOPMARK, 0));
Note:
See TracChangeset
for help on using the changeset viewer.