Changeset 30026 in osm for applications/editors/josm/plugins/smed2
- Timestamp:
- 2013-10-18T12:28:00+02:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src/seamap
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r30025 r30026 233 233 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Beacons, null); 234 234 } 235 } 235 Signals.addSignals(feature); 236 } 237 236 238 private static void buoys(Feature feature) { 237 239 BoySHP shape = (BoySHP) Renderer.getAttVal(feature, feature.type, 0, Att.BOYSHP); … … 240 242 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Buoys.get(shape), null); 241 243 } 242 } 244 Signals.addSignals(feature); 245 } 246 243 247 private static void bridges(Feature feature) { 244 248 if (zoom >= 16) { … … 281 285 } 282 286 } 287 283 288 private static void distances(Feature feature) { 284 289 /*object_rules(distances) { … … 292 297 */ 293 298 } 299 294 300 private static void floats(Feature feature) { 295 301 switch (feature.type) { … … 306 312 if (feature.objs.get(Obj.TOPMAR) != null) 307 313 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Floats, null); 308 } 314 Signals.addSignals(feature); 315 } 316 309 317 private static void gauges(Feature feature) { 310 318 /*object_rules(gauge) { … … 312 320 } 313 321 */ 314 } 322 Signals.addSignals(feature); 323 } 324 315 325 private static void harbours(Feature feature) { 316 326 AttItem name = feature.atts.get(Att.OBJNAM); … … 395 405 } 396 406 */ 407 397 408 private static void landmarks(Feature feature) { 398 409 ArrayList<CatLMK> cats = (ArrayList<CatLMK>) Renderer.getAttVal(feature, feature.type, 0, Att.CATLMK); … … 416 427 text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:start", 60, -50); 417 428 } 418 if (has_object("fog_signal")) object(fogs);419 if (has_object("radar_transponder")) object(rtbs);420 if (has_object("radar_station") && (zoom >= 12)) symbol("radar_station");421 if (has_object("light")) object(lights);422 429 } 423 430 */ 424 } 431 Signals.addSignals(feature); 432 } 433 425 434 private static void lights(Feature feature) { 426 435 switch (feature.type) { … … 433 442 break; 434 443 } 435 } 444 Signals.addSignals(feature); 445 } 446 436 447 private static void locks(Feature feature) { 437 448 /*object_rules(locks) { … … 496 507 */ 497 508 } 509 498 510 private static void moorings(Feature feature) { 499 511 CatMOR cat = (CatMOR) Renderer.getAttVal(feature, feature.type, 0, Att.CATMOR); … … 516 528 break; 517 529 } 518 /* if (has_object("fog_signal")) object(fogs); 519 if (has_object("radar_transponder")) object(rtbs); 520 if (has_object("light")) object(lights); 521 } 522 */ 530 Signals.addSignals(feature); 523 531 } 524 532 … … 840 848 } 841 849 } 850 842 851 private static void signals(Feature feature) { 843 852 if (zoom >= 14) { … … 850 859 Renderer.symbol(feature, Harbours.SignalStation, null, null, null); 851 860 Renderer.symbol(feature, Beacons.RadarStation, null, null, null); 852 ArrayList<CatROS> cats = (ArrayList<CatROS>)Renderer.getAttVal(feature, Obj.RDOSTA, 0, Att.CATROS);853 String str = "";854 for (CatROS ros : cats) {855 switch (ros) {856 case ROS_OMNI:857 str += " RC";858 break;859 case ROS_DIRL:860 str += " RD";861 break;862 case ROS_ROTP:863 str += " RW";864 break;865 case ROS_CNSL:866 str += " Consol";867 break;868 case ROS_RDF:869 str += " RG";870 break;871 case ROS_QTA:872 str += " R";873 break;874 case ROS_AERO:875 str += " AeroRC";876 break;877 case ROS_DECA:878 str += " Decca";879 break;880 case ROS_LORN:881 str += " Loran";882 break;883 case ROS_DGPS:884 str += " DGPS";885 break;886 case ROS_TORN:887 str += " Toran";888 break;889 case ROS_OMGA:890 str += " Omega";891 break;892 case ROS_SYLD:893 str += " Syledis";894 break;895 case ROS_CHKA:896 str += " Chiaka";897 break;898 case ROS_PCOM:899 case ROS_COMB:900 case ROS_FACS:901 case ROS_TIME:902 break;903 case ROS_PAIS:904 case ROS_SAIS:905 str += " AIS";906 break;907 case ROS_VAIS:908 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));909 break;910 case ROS_VANC:911 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));912 Renderer.symbol(feature, Topmarks.TopNorth, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);913 break;914 case ROS_VASC:915 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));916 Renderer.symbol(feature, Topmarks.TopSouth, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);917 break;918 case ROS_VAEC:919 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));920 Renderer.symbol(feature, Topmarks.TopEast, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);921 break;922 case ROS_VAWC:923 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));924 Renderer.symbol(feature, Topmarks.TopWest, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);925 break;926 case ROS_VAPL:927 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));928 Renderer.symbol(feature, Topmarks.TopCan, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);929 break;930 case ROS_VASL:931 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));932 Renderer.symbol(feature, Topmarks.TopCone, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);933 break;934 case ROS_VAID:935 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));936 Renderer.symbol(feature, Topmarks.TopIsol, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);937 break;938 case ROS_VASW:939 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));940 Renderer.symbol(feature, Topmarks.TopSphere, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);941 break;942 case ROS_VASP:943 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));944 Renderer.symbol(feature, Topmarks.TopX, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);945 break;946 case ROS_VAWK:947 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));948 Renderer.symbol(feature, Topmarks.TopCross, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);949 break;950 }951 }952 if (!str.isEmpty()) Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -70)));953 861 break; 954 862 case RADSTA: … … 967 875 } 968 876 } 969 /* if (has_object("fog_signal")) object(fogs); 970 if (has_object("radar_transponder")) object(rtbs); 971 if (has_object("light")) object(lights); 972 } 973 */ 974 } 877 Signals.addSignals(feature); 878 } 879 975 880 private static void transits(Feature feature) { 976 881 if (zoom >= 12) { … … 989 894 private static void waterways(Feature feature) { 990 895 } 896 991 897 private static void wrecks(Feature feature) { 992 898 if (zoom >= 14) { -
applications/editors/josm/plugins/smed2/src/seamap/Signals.java
r30025 r30026 10 10 package seamap; 11 11 12 import java.awt.Color; 13 import java.awt.Font; 12 14 import java.awt.geom.*; 13 15 import java.util.ArrayList; 16 17 import s57.S57att.Att; 18 import s57.S57obj.Obj; 19 import s57.S57val.CatROS; 20 import seamap.Renderer.LabelStyle; 14 21 import seamap.SeaMap.*; 15 16 public class Lights { 17 22 import symbols.Beacons; 23 import symbols.Topmarks; 24 import symbols.Symbols.Delta; 25 import symbols.Symbols.Handle; 26 27 public class Signals { 28 29 public static void addSignals(Feature feature) { 30 if (feature.objs.containsKey(Obj.FOGSIG)) Signals.fogSignals(feature); 31 if (feature.objs.containsKey(Obj.RTPBCN)) Signals.radarStations(feature); 32 if (feature.objs.containsKey(Obj.RADSTA)) Signals.radarStations(feature); 33 if (feature.objs.containsKey(Obj.RDOSTA)) Signals.radioStations(feature); 34 if (feature.objs.containsKey(Obj.LIGHTS)) Signals.lights(feature); 35 } 36 37 public static void fogSignals(Feature feature) { 38 39 } 40 41 public static void radarStations(Feature feature) { 42 Renderer.symbol(feature, Beacons.RadarStation, null, null, null); 43 ArrayList<CatROS> cats = (ArrayList<CatROS>)Renderer.getAttVal(feature, Obj.RDOSTA, 0, Att.CATROS); 44 String str = ""; 45 for (CatROS ros : cats) { 46 switch (ros) { 47 case ROS_OMNI: 48 str += " RC"; 49 break; 50 case ROS_DIRL: 51 str += " RD"; 52 break; 53 case ROS_ROTP: 54 str += " RW"; 55 break; 56 case ROS_CNSL: 57 str += " Consol"; 58 break; 59 case ROS_RDF: 60 str += " RG"; 61 break; 62 case ROS_QTA: 63 str += " R"; 64 break; 65 case ROS_AERO: 66 str += " AeroRC"; 67 break; 68 case ROS_DECA: 69 str += " Decca"; 70 break; 71 case ROS_LORN: 72 str += " Loran"; 73 break; 74 case ROS_DGPS: 75 str += " DGPS"; 76 break; 77 case ROS_TORN: 78 str += " Toran"; 79 break; 80 case ROS_OMGA: 81 str += " Omega"; 82 break; 83 case ROS_SYLD: 84 str += " Syledis"; 85 break; 86 case ROS_CHKA: 87 str += " Chiaka"; 88 break; 89 case ROS_PCOM: 90 case ROS_COMB: 91 case ROS_FACS: 92 case ROS_TIME: 93 break; 94 case ROS_PAIS: 95 case ROS_SAIS: 96 str += " AIS"; 97 break; 98 case ROS_VAIS: 99 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 100 break; 101 case ROS_VANC: 102 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 103 Renderer.symbol(feature, Topmarks.TopNorth, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null); 104 break; 105 case ROS_VASC: 106 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 107 Renderer.symbol(feature, Topmarks.TopSouth, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null); 108 break; 109 case ROS_VAEC: 110 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 111 Renderer.symbol(feature, Topmarks.TopEast, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null); 112 break; 113 case ROS_VAWC: 114 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 115 Renderer.symbol(feature, Topmarks.TopWest, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null); 116 break; 117 case ROS_VAPL: 118 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 119 Renderer.symbol(feature, Topmarks.TopCan, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null); 120 break; 121 case ROS_VASL: 122 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 123 Renderer.symbol(feature, Topmarks.TopCone, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null); 124 break; 125 case ROS_VAID: 126 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 127 Renderer.symbol(feature, Topmarks.TopIsol, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null); 128 break; 129 case ROS_VASW: 130 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 131 Renderer.symbol(feature, Topmarks.TopSphere, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null); 132 break; 133 case ROS_VASP: 134 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 135 Renderer.symbol(feature, Topmarks.TopX, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null); 136 break; 137 case ROS_VAWK: 138 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 139 Renderer.symbol(feature, Topmarks.TopCross, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null); 140 break; 141 } 142 } 143 if (!str.isEmpty()) Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -70))); 144 } 145 146 public static void radioStations(Feature feature) { 147 148 } 149 150 public static void lights(Feature feature) { 151 152 } 153 18 154 private static Point2D.Double radial(Snode centre, double radius, double angle) { 19 155 Point2D origin = Renderer.context.getPoint(centre);
Note:
See TracChangeset
for help on using the changeset viewer.