Changeset 32101 in osm for applications/editors/josm/plugins/seachart/src/render
- Timestamp:
- 2016-03-08T10:10:33+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/seachart/src/render
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/render/Renderer.java
r32090 r32101 345 345 while (git.hasComp()) { 346 346 git.nextComp(); 347 boolean newComp = true; 347 348 while (git.hasEdge()) { 348 349 git.nextEdge(); 349 350 point = context.getPoint(git.next()); 350 p.moveTo(point.getX(), point.getY()); 351 if (newComp) { 352 p.moveTo(point.getX(), point.getY()); 353 newComp = false; 354 } else { 355 p.lineTo(point.getX(), point.getY()); 356 } 351 357 while (git.hasNode()) { 352 358 Snode node = git.next(); … … 357 363 } 358 364 } 359 g2.setPaint(new TexturePaint(image, new Rectangle(0, 0, 1 + (int)( 100 * sScale), 1 + (int)(100 * sScale))));365 g2.setPaint(new TexturePaint(image, new Rectangle(0, 0, 1 + (int)(300 * sScale), 1 + (int)(300 * sScale)))); 360 366 g2.fill(p); 361 367 break; -
applications/editors/josm/plugins/seachart/src/render/Rules.java
r32095 r32101 230 230 if (testObject(Obj.ISTZNE)) for (Feature f : objects) if (testFeature(f)) separation(); 231 231 if (testObject(Obj.SNDWAV)) for (Feature f : objects) if (testFeature(f)) areas(); 232 if (testObject(Obj.WEDKLP)) for (Feature f : objects) if (testFeature(f)) areas(); 232 233 if (testObject(Obj.OSPARE)) for (Feature f : objects) if (testFeature(f)) areas(); 233 234 if (testObject(Obj.FAIRWY)) for (Feature f : objects) if (testFeature(f)) areas(); … … 256 257 if (testObject(Obj.SMCFAC)) for (Feature f : objects) if (testFeature(f)) marinas(); 257 258 if (testObject(Obj.BRIDGE)) for (Feature f : objects) if (testFeature(f)) bridges(); 258 if (testObject(Obj.PILPNT)) for (Feature f : objects) if (testFeature(f)) lights(); 259 if (testObject(Obj.PILPNT)) for (Feature f : objects) if (testFeature(f)) points(); 260 if (testObject(Obj.TOPMAR)) for (Feature f : objects) if (testFeature(f)) points(); 261 if (testObject(Obj.DAYMAR)) for (Feature f : objects) if (testFeature(f)) points(); 262 if (testObject(Obj.FOGSIG)) for (Feature f : objects) if (testFeature(f)) points(); 259 263 if (testObject(Obj.RDOCAL)) for (Feature f : objects) if (testFeature(f)) callpoint(); 260 264 if (testObject(Obj.LITMIN)) for (Feature f : objects) if (testFeature(f)) lights(); … … 429 433 if (Renderer.zoom >= 12) Renderer.fillPattern(Areas.Sandwaves); 430 434 break; 435 case WEDKLP: 436 if (Renderer.zoom >= 12) { 437 switch ((CatWED) getAttEnum(feature.type, Att.CATWED)) { 438 case WED_KELP: 439 if (feature.geom.prim == Pflag.AREA) { 440 Renderer.fillPattern(Areas.KelpA); 441 } else { 442 Renderer.symbol(Areas.KelpS); 443 } 444 break; 445 default: 446 break; 447 } 448 } 449 break; 431 450 case SPLARE: 432 451 if (Renderer.zoom >= 12) { … … 605 624 String str = ""; 606 625 if (atts.containsKey(Att.HUNITS)) { 607 switch ((UniHLU) atts.get(Att.HUNITS).val) {626 switch ((UniHLU) getAttEnum(Obj.DISMAR, Att.HUNITS)) { 608 627 case HLU_METR: 609 628 str += "m "; … … 858 877 859 878 @SuppressWarnings("unchecked") 879 private static void points() { 880 boolean ok = false; 881 switch (feature.type) { 882 case FOGSIG: 883 if (Renderer.zoom >= 12) { 884 if (feature.objs.containsKey(Obj.LIGHTS)) 885 lights(); 886 else 887 Renderer.symbol(Harbours.Post); 888 ok = true; 889 } 890 break; 891 default: 892 if (Renderer.zoom >= 14) { 893 if (feature.objs.containsKey(Obj.LIGHTS)) 894 lights(); 895 else 896 Renderer.symbol(Harbours.Post); 897 ok = true; 898 } 899 break; 900 } 901 if (ok) { 902 if (feature.objs.containsKey(Obj.TOPMAR)) { 903 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0); 904 if (topmap.containsKey(Att.TOPSHP)) { 905 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), null); 906 } 907 } else if (feature.objs.containsKey(Obj.DAYMAR)) { 908 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0); 909 if (topmap.containsKey(Att.TOPSHP)) { 910 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), null); 911 } 912 } 913 Signals.addSignals(); 914 } 915 } 916 917 @SuppressWarnings("unchecked") 860 918 private static void lights() { 861 919 boolean ok = false; … … 863 921 case LITMAJ: 864 922 case LNDMRK: 865 Renderer.symbol(Beacons.LightMajor); 866 ok = true; 923 if (Renderer.zoom >= 12) { 924 Renderer.symbol(Beacons.LightMajor); 925 ok = true; 926 } 867 927 break; 868 928 case LITMIN: 869 929 case LIGHTS: 930 case PILPNT: 870 931 if (Renderer.zoom >= 14) { 871 932 Renderer.symbol(Beacons.LightMinor); 872 ok = true;873 }874 break;875 case PILPNT:876 if (Renderer.zoom >= 14) {877 if (feature.objs.containsKey(Obj.LIGHTS))878 Renderer.symbol(Beacons.LightMinor);879 else880 Renderer.symbol(Harbours.Post);881 933 ok = true; 882 934 } … … 959 1011 } 960 1012 MarSYS sys = MarSYS.SYS_CEVN; 961 //BnkWTW bnk = BnkWTW.BWW_UNKN;1013 BnkWTW bnk = BnkWTW.BWW_UNKN; 962 1014 AttVal<?> att = feature.atts.get(Att.MARSYS); 963 1015 if (att != null) sys = (MarSYS)att.val; 1016 att = feature.atts.get(Att.BNKWTW); 1017 if (att != null) bnk = (BnkWTW)att.val; 964 1018 ObjTab objs = feature.objs.get(Obj.NOTMRK); 965 1019 int n = objs.size(); … … 969 1023 int i = 0; 970 1024 for (AttMap atts : objs.values()) { 971 if (atts.get(Att.MARSYS) != null) sys = (MarSYS)(atts.get(Att.MARSYS).val); 1025 if (atts.get(Att.MARSYS) != null) sys = (MarSYS)(getAttEnum(Obj.NOTMRK, Att.MARSYS)); 1026 if (atts.get(Att.BNKWTW) != null) bnk = (BnkWTW)(getAttEnum(Obj.NOTMRK, Att.BNKWTW)); 972 1027 CatNMK cat = CatNMK.NMK_UNKN; 973 if (atts.get(Att.CATNMK) != null) cat = (CatNMK)(atts.get(Att.CATNMK).val); 974 Symbol sym = Notices.getNotice(cat, sys); 1028 if (atts.get(Att.CATNMK) != null) cat = (CatNMK)(getAttEnum(Obj.NOTMRK, Att.CATNMK)); 1029 Symbol sym = Notices.getNotice(cat, sys, bnk); 1030 Scheme sch = Notices.getScheme(sys, bnk); 975 1031 Handle h = Handle.CC; 976 1032 switch (i) { … … 1000 1056 break; 1001 1057 } 1002 if (h != null) Renderer.symbol(sym, new Delta(h, AffineTransform.getTranslateInstance(dx, dy))); 1058 if (h != null) Renderer.symbol(sym, sch, new Delta(h, AffineTransform.getTranslateInstance(dx, dy))); 1003 1059 i++; 1004 1060 }
Note:
See TracChangeset
for help on using the changeset viewer.