Changeset 32095 in osm for applications/editors/josm/plugins/seachart/src/render/Rules.java
- Timestamp:
- 2016-03-05T11:40:02+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/render/Rules.java
r32093 r32095 183 183 } 184 184 return false; 185 } 186 187 static boolean hasObject(Obj obj) { 188 return (feature.objs.containsKey(obj)); 185 189 } 186 190 … … 246 250 if (testObject(Obj.CRANES)) for (Feature f : objects) if (testFeature(f)) ports(); 247 251 if (testObject(Obj.LNDMRK)) for (Feature f : objects) if (testFeature(f)) landmarks(); 252 if (testObject(Obj.SILTNK)) for (Feature f : objects) if (testFeature(f)) landmarks(); 248 253 if (testObject(Obj.BUISGL)) for (Feature f : objects) if (testFeature(f)) harbours(); 249 254 if (testObject(Obj.MORFAC)) for (Feature f : objects) if (testFeature(f)) moorings(); … … 438 443 @SuppressWarnings("unchecked") 439 444 private static void beacons() { 440 if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BCNLAT) || (feature.type == Obj.BCNCAR)))) { 445 if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BCNLAT) || (feature.type == Obj.BCNCAR))) 446 || ((Renderer.zoom >= 11) && ((feature.type == Obj.BCNSAW) || hasObject(Obj.RTPBCN)))) { 441 447 BcnSHP shape = (BcnSHP)getAttEnum(feature.type, Att.BCNSHP); 442 448 if (shape == BcnSHP.BCN_UNKN) … … 485 491 @SuppressWarnings("unchecked") 486 492 private static void buoys() { 487 if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BOYLAT) || (feature.type == Obj.BOYCAR)))) { 493 if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BOYLAT) || (feature.type == Obj.BOYCAR))) 494 || ((Renderer.zoom >= 11) && ((feature.type == Obj.BOYSAW) || hasObject(Obj.RTPBCN)))) { 488 495 BoySHP shape = (BoySHP) getAttEnum(feature.type, Att.BOYSHP); 489 496 if (shape == BoySHP.BOY_UNKN) shape = BoySHP.BOY_PILR; … … 630 637 @SuppressWarnings("unchecked") 631 638 private static void floats() { 632 if ( Renderer.zoom >= 12) {639 if ((Renderer.zoom >= 12) || ((Renderer.zoom >= 11) && ((feature.type == Obj.LITVES) || (feature.type == Obj.BOYINB) || hasObject(Obj.RTPBCN)))) { 633 640 switch (feature.type) { 634 641 case LITVES: … … 819 826 @SuppressWarnings("unchecked") 820 827 private static void landmarks() { 828 if (testAttribute(Obj.LNDMRK, Att.CATLMK, CatLMK.LMK_UNKN) 829 && (testAttribute(Obj.LNDMRK, Att.CATLMK, FncFNC.FNC_UNKN) || testAttribute(Obj.LNDMRK, Att.CATLMK, FncFNC.FNC_LGHT)) 830 && hasObject(Obj.LIGHTS)) 831 lights(); 821 832 if (Renderer.zoom >= 12) { 833 switch (feature.type) { 834 case LNDMRK: 822 835 ArrayList<CatLMK> cats = (ArrayList<CatLMK>) getAttList(feature.type, Att.CATLMK); 823 836 Symbol catSym = Landmarks.Shapes.get(cats.get(0)); … … 826 839 if ((fncs.get(0) == FncFNC.FNC_CHCH) && (cats.get(0) == CatLMK.LMK_TOWR)) 827 840 catSym = Landmarks.ChurchTower; 828 if ((cats.get(0) == CatLMK.LMK_UNKN) && (fncs.get(0) == FncFNC.FNC_UNKN) && (feature.objs.get(Obj.LIGHTS) != null))829 catSym = Beacons.LightMajor;830 841 if (cats.get(0) == CatLMK.LMK_RADR) 831 842 fncSym = Landmarks.RadioTV; 832 843 Renderer.symbol(catSym); 833 844 Renderer.symbol(fncSym); 845 break; 846 case SILTNK: 847 if (testAttribute(feature.type, Att.CATSIL, CatSIL.SIL_WTRT)) 848 Renderer.symbol(Landmarks.WaterTower); 849 break; 850 default: 851 break; 852 } 834 853 if (Renderer.zoom >= 15) 835 854 addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50))); … … 840 859 @SuppressWarnings("unchecked") 841 860 private static void lights() { 861 boolean ok = false; 842 862 switch (feature.type) { 843 863 case LITMAJ: 864 case LNDMRK: 844 865 Renderer.symbol(Beacons.LightMajor); 866 ok = true; 845 867 break; 846 868 case LITMIN: 847 869 case LIGHTS: 848 Renderer.symbol(Beacons.LightMinor); 870 if (Renderer.zoom >= 14) { 871 Renderer.symbol(Beacons.LightMinor); 872 ok = true; 873 } 849 874 break; 850 875 case PILPNT: 851 if (feature.objs.containsKey(Obj.LIGHTS)) 852 Renderer.symbol(Beacons.LightMinor); 853 else 854 Renderer.symbol(Harbours.Post); 876 if (Renderer.zoom >= 14) { 877 if (feature.objs.containsKey(Obj.LIGHTS)) 878 Renderer.symbol(Beacons.LightMinor); 879 else 880 Renderer.symbol(Harbours.Post); 881 ok = true; 882 } 855 883 break; 856 884 default: 857 885 break; 858 886 } 859 if (feature.objs.containsKey(Obj.TOPMAR)) { 860 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0); 861 if (topmap.containsKey(Att.TOPSHP)) { 862 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.LightDelta); 863 } 864 } else if (feature.objs.containsKey(Obj.DAYMAR)) { 865 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0); 866 if (topmap.containsKey(Att.TOPSHP)) { 867 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.LightDelta); 868 } 869 } 870 Signals.addSignals(); 887 if (ok) { 888 if (feature.objs.containsKey(Obj.TOPMAR)) { 889 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0); 890 if (topmap.containsKey(Att.TOPSHP)) { 891 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.LightDelta); 892 } 893 } else if (feature.objs.containsKey(Obj.DAYMAR)) { 894 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0); 895 if (topmap.containsKey(Att.TOPSHP)) { 896 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.LightDelta); 897 } 898 } 899 Signals.addSignals(); 900 } 871 901 } 872 902
Note:
See TracChangeset
for help on using the changeset viewer.