Changeset 29789 in osm for applications/editors/josm/plugins/smed2
- Timestamp:
- 2013-07-30T10:04:34+02:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
r29275 r29789 228 228 } 229 229 230 public static void lineText (Feature feature, String str, Font font, double offset, double dy) {230 public static void lineText (Feature feature, String str, Font font, Color colour, double offset, double dy) { 231 231 232 232 } -
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r29787 r29789 293 293 break; 294 294 case BOYINB: 295 Renderer.symbol(feature, Buoys.S torage, feature.type, null);295 Renderer.symbol(feature, Buoys.Super, feature.type, null); 296 296 break; 297 297 } … … 710 710 } 711 711 private static void platforms(Feature feature) { 712 Renderer.symbol(feature, Landmarks.Platform, null, null); 712 ArrayList<CatOFP> cats = (ArrayList<CatOFP>)Renderer.getAttVal(feature, Obj.OFSPLF, 0, Att.CATOFP); 713 if ((CatOFP) cats.get(0) == CatOFP.OFP_FPSO) 714 Renderer.symbol(feature, Buoys.Storage, null, null); 715 else 716 Renderer.symbol(feature, Landmarks.Platform, null, null); 717 AttItem name = feature.atts.get(Att.OBJNAM); 718 if ((zoom >= 15) && (name != null)) 719 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(60, -50))); 713 720 /*object_rules(platforms) { 714 if (has_attribute("category")) {715 attribute_switch("category")716 attribute_case("fpso") symbol("storage");717 attribute_default symbol("platform");718 end_switch719 } else {720 symbol("platform");721 }722 if ((zoom >= 15) && has_item_attribute("name"))723 text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:start", 60, -50);724 721 if (has_object("fog_signal")) object(fogs); 725 722 if (has_object("radar_transponder")) object(rtbs); … … 729 726 } 730 727 private static void ports(Feature feature) { 731 /*object_rules(ports) { 732 if (zoom>=14) { 733 if (is_type("crane")) { 734 if (attribute_test("category", "container_crane")) symbol("container_crane"); 735 else symbol("port_crane"); 736 } 737 if (is_type("hulk")) { 738 area("fill:#ffe000;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-opacity:1"); 739 if ((zoom >= 15) && (has_item_attribute("name"))) 740 text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:70; text-anchor:middle", 0, 0); 741 } 742 } 743 } 744 */ 728 if (zoom >= 14) { 729 if (feature.type == Obj.CRANES) { 730 if ((CatCRN) Renderer.getAttVal(feature, feature.type, 0, Att.CATCRN) == CatCRN.CRN_CONT) 731 Renderer.symbol(feature, Harbours.ContainerCrane, null, null); 732 else 733 Renderer.symbol(feature, Harbours.PortCrane, null, null); 734 } else if (feature.type == Obj.HULKES) { 735 Renderer.lineVector(feature, new LineStyle(Color.black, 4, null, new Color(0xffe000))); 736 AttItem name = feature.atts.get(Att.OBJNAM); 737 if ((zoom >= 15) && (name != null)) 738 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), Color.black, null); 739 } 740 } 745 741 } 746 742 private static void separation(Feature feature) { … … 779 775 Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null)); 780 776 if (zoom >= 15) 781 Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 80), 0.5, 20);777 Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, 20); 782 778 } else { 783 779 Renderer.lineVector(feature, new LineStyle(Color.black, 10, null, null)); 784 780 } 785 781 if (zoom >= 15) 786 Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 80), 0.5, -20);782 Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20); 787 783 } 788 784 } … … 799 795 Renderer.symbol(feature, Beacons.RadarStation, null, null); 800 796 ArrayList<CatROS> cats = (ArrayList<CatROS>)Renderer.getAttVal(feature, Obj.RDOSTA, 0, Att.CATROS); 797 String str = ""; 801 798 for (CatROS ros : cats) { 802 799 switch (ros) { 803 800 case ROS_OMNI: 804 Renderer.labelText(feature, " RC", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));801 str += " RC"; 805 802 break; 806 803 case ROS_DIRL: 807 Renderer.labelText(feature, " RD", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));804 str += " RD"; 808 805 break; 809 806 case ROS_ROTP: 810 Renderer.labelText(feature, " RW", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));807 str += " RW"; 811 808 break; 812 809 case ROS_CNSL: 813 Renderer.labelText(feature, " Consol", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));810 str += " Consol"; 814 811 break; 815 812 case ROS_RDF: 816 Renderer.labelText(feature, " RG", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));813 str += " RG"; 817 814 break; 818 815 case ROS_QTA: 819 Renderer.labelText(feature, " R", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));816 str += " R"; 820 817 break; 821 818 case ROS_AERO: 822 Renderer.labelText(feature, " AeroRC", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));819 str += " AeroRC"; 823 820 break; 824 821 case ROS_DECA: 825 Renderer.labelText(feature, " Decca", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));822 str += " Decca"; 826 823 break; 827 824 case ROS_LORN: 828 Renderer.labelText(feature, " Loran", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));825 str += " Loran"; 829 826 break; 830 827 case ROS_DGPS: 831 Renderer.labelText(feature, " DGPS", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));828 str += " DGPS"; 832 829 break; 833 830 case ROS_TORN: 834 Renderer.labelText(feature, " Toran", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));831 str += " Toran"; 835 832 break; 836 833 case ROS_OMGA: 837 Renderer.labelText(feature, " Omega", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));834 str += " Omega"; 838 835 break; 839 836 case ROS_SYLD: 840 Renderer.labelText(feature, " Syledis", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));837 str += " Syledis"; 841 838 break; 842 839 case ROS_CHKA: 843 Renderer.labelText(feature, " Chiaka", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));840 str += " Chiaka"; 844 841 break; 845 842 case ROS_PCOM: … … 850 847 case ROS_PAIS: 851 848 case ROS_SAIS: 852 Renderer.labelText(feature, " AIS", new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180)));849 str += " AIS"; 853 850 break; 854 851 case ROS_VAIS: … … 897 894 } 898 895 } 896 if (!str.isEmpty()) Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 70), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -180))); 899 897 break; 900 898 case RADSTA: … … 920 918 } 921 919 private static void transits(Feature feature) { 922 /*object_rules(transits) { 923 int ref; 924 if (zoom >= 12) { 925 if (is_type("recommended_track")) ref = line("stroke-width:8; stroke:#000000; stroke-linecap:butt; fill:none"); 926 else if (is_type("navigation_line")) ref = line("stroke-width:8; stroke-dasharray:20,20; stroke:#000000; stroke-linecap:butt; fill:none"); 927 } 928 if (zoom >= 15) { 929 make_string(""); 930 if (has_object("name")) { 931 add_string(item_attribute("name")); 932 add_string(" "); 933 } 934 if (has_attribute("orientation")) { 935 add_string(attribute("orientation")); 936 add_string("\u00A1"); 937 } 938 if (has_attribute("category")) { 939 add_string(" ("); 940 add_string(attribute("category")); 941 add_string(")"); 942 } 943 line_text(string, "font-family:Arial; font-weight:normal; font-size:80; text-anchor:middle", 0.5, -20, ref); 944 free_string 945 } 946 } 947 */ 920 if (zoom >= 12) { 921 if (feature.type == Obj.RECTRC) Renderer.lineVector (feature, new LineStyle(Color.black, 10, null, null)); 922 else if (feature.type == Obj.NAVLNE) Renderer.lineVector (feature, new LineStyle(Color.black, 10, new float[] { 25, 25 }, null)); 923 } 924 if (zoom >= 15) { 925 String str = ""; 926 AttItem name = feature.atts.get(Att.OBJNAM); 927 if (name != null) str += (String)name.val + " "; 928 Double ort = (Double) Renderer.getAttVal(feature, feature.type, 0, Att.ORIENT); 929 if (ort != null) str += ort.toString() + "¼"; 930 if (!str.isEmpty()) Renderer.lineText(feature, str, new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20); 931 } 948 932 } 949 933 private static void waterways(Feature feature) { 950 if ((zoom >= 14) && (feature.atts.get(Att.OBJNAM) != null)) {951 // lineText(item_attribute("name"), "font-family:Arial;font-weight:bold;font-size:80;text-anchor:middle", 0.5, 15, line("stroke:none;fill:none"));952 }953 934 } 954 935 private static void wrecks(Feature feature) { … … 966 947 Renderer.symbol(feature, Areas.WreckND, null, null); 967 948 } 968 } else {969 Renderer.symbol(feature, Areas.WreckND, null, null);970 949 } 971 950 } -
applications/editors/josm/plugins/smed2/src/symbols/Harbours.java
r29199 r29789 28 28 p.lineTo(-31.0,22.0); p.quadTo(-21.0,29.0,-7.0,31.0); p.lineTo(-6.0,-30.0); p.lineTo(-23.0,-30.0); p.lineTo(-23.0,-40.0); p.closePath(); 29 29 Anchor.add(new Instr(Prim.PGON, p)); 30 }31 public static final Symbol Yacht = new Symbol();32 static {33 Yacht.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));34 Path2D.Double p = new Path2D.Double(); p.moveTo(-65.0,50.0); p.curveTo(-36.0,97.0,36.0,97.0,65.0,50.0); p.lineTo(3.0,50.0); p.lineTo(3.0,40.0); p.lineTo(55.0,30.0);35 p.curveTo(32.0,4.0,25.0,-15.0,26.0,-52.0); p.lineTo(1.5,-40.0); p.lineTo(1.0,-64.0); p.lineTo(-2.0,-64.0); p.lineTo(-4.0,50.0); p.closePath();36 p.moveTo(-50.0,45.0); p.curveTo(-55.0,3.0,-37.0,-28.5,-7.0,-46.0); p.curveTo(-28.0,-15.0,-26.0,11.0,-20.5,30.0); p.closePath();37 Yacht.add(new Instr(Prim.PGON, p));38 30 } 39 31 public static final Symbol Anchorage = new Symbol(); … … 193 185 TideGauge.add(new Instr(Prim.LINE, new Line2D.Double(-15,-65,15,-65))); 194 186 } 187 public static final Symbol Yacht = new Symbol(); 188 static { 189 Yacht.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 190 Path2D.Double p = new Path2D.Double(); p.moveTo(-65.0,50.0); p.curveTo(-36.0,97.0,36.0,97.0,65.0,50.0); p.lineTo(3.0,50.0); p.lineTo(3.0,40.0); p.lineTo(55.0,30.0); 191 p.curveTo(32.0,4.0,25.0,-15.0,26.0,-52.0); p.lineTo(1.5,-40.0); p.lineTo(1.0,-64.0); p.lineTo(-2.0,-64.0); p.lineTo(-4.0,50.0); p.closePath(); 192 p.moveTo(-50.0,45.0); p.curveTo(-55.0,3.0,-37.0,-28.5,-7.0,-46.0); p.curveTo(-28.0,-15.0,-26.0,11.0,-20.5,30.0); p.closePath(); 193 Yacht.add(new Instr(Prim.PGON, p)); 194 } 195 195 }
Note:
See TracChangeset
for help on using the changeset viewer.