Changeset 33943 in osm for applications/editors/josm/plugins
- Timestamp:
- 2017-12-09T13:27:26+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/seachart
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/jicons/examples.xml
r33941 r33943 21 21 <tag k="seamark:topmark:orientation" v="45" /> 22 22 </icon> 23 <icon width="100" height="100" scale="0.5" file="floodlight" format="PNG" > 24 <tag k="seamark:type" v="light" /> 25 <tag k="seamark:light:category" v="floodlight" /> 26 <tag k="seamark:topmark:shape" v="arrow" /> 27 <tag k="seamark:topmark:orientation" v="45" /> 28 </icon> 23 29 </icons> -
applications/editors/josm/plugins/seachart/src/render/Rules.java
r33941 r33943 555 555 } else { 556 556 Renderer.symbol(Beacons.Shapes.get(shape), getScheme(feature.type)); 557 AffineTransform tr = new AffineTransform(Topmarks.BeaconDelta.t); 557 558 if (feature.objs.containsKey(Obj.TOPMAR)) { 558 559 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0); 559 560 if (topmap.containsKey(Att.TOPSHP)) { 560 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.BeaconDelta); 561 if (topmap.containsKey(Att.ORIENT)) { 562 tr.rotate(Math.toRadians((Double)topmap.get(Att.ORIENT).val)); 563 } 564 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), new Delta(Handle.BC, tr)); 561 565 } 562 566 } else if (feature.objs.containsKey(Obj.DAYMAR)) { 563 567 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0); 564 568 if (topmap.containsKey(Att.TOPSHP)) { 565 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.BeaconDelta); 569 if (topmap.containsKey(Att.ORIENT)) { 570 tr.rotate(Math.toRadians((Double)topmap.get(Att.ORIENT).val)); 571 } 572 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), new Delta(Handle.BC, tr)); 566 573 } 567 574 } … … 978 985 979 986 @SuppressWarnings("unchecked") 980 private static void points() {981 boolean ok = false;982 switch (feature.type) {983 case FOGSIG:984 if (Renderer.zoom >= 12) {985 if (feature.objs.containsKey(Obj.LIGHTS))986 lights();987 else988 Renderer.symbol(Harbours.Post);989 ok = true;990 }991 break;992 default:993 if (Renderer.zoom >= 14) {994 if (feature.objs.containsKey(Obj.LIGHTS))995 lights();996 else997 Renderer.symbol(Harbours.Post);998 ok = true;999 }1000 break;1001 }1002 if (ok) {1003 if (feature.objs.containsKey(Obj.TOPMAR)) {1004 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);1005 if (topmap.containsKey(Att.TOPSHP)) {1006 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), null);1007 }1008 } else if (feature.objs.containsKey(Obj.DAYMAR)) {1009 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);1010 if (topmap.containsKey(Att.TOPSHP)) {1011 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), null);1012 }1013 }1014 Signals.addSignals();1015 }1016 }1017 1018 @SuppressWarnings("unchecked")1019 987 private static void lights() { 1020 988 boolean ok = false; … … 1051 1019 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0); 1052 1020 if (topmap.containsKey(Att.TOPSHP)) { 1053 if ( hasAttribute(Obj.TOPMAR,Att.ORIENT)) {1054 tr.rotate(Math.toRadians((Double) getAttVal(Obj.TOPMAR, Att.ORIENT)));1055 } 1056 tr. translate(0, -20);1021 if (topmap.containsKey(Att.ORIENT)) { 1022 tr.rotate(Math.toRadians((Double)topmap.get(Att.ORIENT).val)); 1023 } 1024 tr.concatenate(Topmarks.LightDelta.t); 1057 1025 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), new Delta(Handle.BC, tr)); 1058 1026 } … … 1063 1031 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0); 1064 1032 if (topmap.containsKey(Att.TOPSHP)) { 1065 if ( hasAttribute(Obj.DAYMAR,Att.ORIENT)) {1066 tr.rotate(Math.toRadians((Double) getAttVal(Obj.DAYMAR, Att.ORIENT)));1067 } 1068 tr. translate(0, -20);1033 if (topmap.containsKey(Att.ORIENT)) { 1034 tr.rotate(Math.toRadians((Double)topmap.get(Att.ORIENT).val)); 1035 } 1036 tr.concatenate(Topmarks.LightDelta.t); 1069 1037 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), new Delta(Handle.BC, tr)); 1070 1038 } … … 1265 1233 } 1266 1234 1235 @SuppressWarnings("unchecked") 1236 private static void points() { 1237 boolean ok = false; 1238 switch (feature.type) { 1239 case FOGSIG: 1240 if (Renderer.zoom >= 12) { 1241 if (feature.objs.containsKey(Obj.LIGHTS)) 1242 lights(); 1243 else 1244 Renderer.symbol(Harbours.Post); 1245 ok = true; 1246 } 1247 break; 1248 default: 1249 if (Renderer.zoom >= 14) { 1250 if (feature.objs.containsKey(Obj.LIGHTS)) 1251 lights(); 1252 else 1253 Renderer.symbol(Harbours.Post); 1254 ok = true; 1255 } 1256 break; 1257 } 1258 if (ok) { 1259 if (feature.objs.containsKey(Obj.TOPMAR)) { 1260 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0); 1261 if (topmap.containsKey(Att.TOPSHP)) { 1262 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), null); 1263 } 1264 } else if (feature.objs.containsKey(Obj.DAYMAR)) { 1265 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0); 1266 if (topmap.containsKey(Att.TOPSHP)) { 1267 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), null); 1268 } 1269 } 1270 Signals.addSignals(); 1271 } 1272 } 1273 1267 1274 private static void ports() { 1268 1275 if (Renderer.zoom >= 14) { -
applications/editors/josm/plugins/seachart/src/symbols/Topmarks.java
r33936 r33943 555 555 public static final Delta FloatDelta = new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -42.0)); 556 556 public static final Delta BeaconDelta = new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -70.0)); 557 public static final Delta LightDelta = new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -20.0)); 557 558 // CHECKSTYLE.ON: SingleSpaceSeparator 558 559 }
Note:
See TracChangeset
for help on using the changeset viewer.