Changeset 30119 in osm for applications/editors/josm/plugins/smed2/src/seamap/Rules.java
- Timestamp:
- 2013-12-08T20:52:05+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r30046 r30119 33 33 AttItem name = feature.atts.get(Att.OBJNAM); 34 34 if (name == null) { 35 name = feature.objs.get(feature.type).get(0).get(Att.OBJNAM); 36 } 37 if (name != null) return (String)name.val; 38 return null; 35 AttMap atts = feature.objs.get(feature.type).get(0); 36 if (atts != null) { 37 name = atts.get(Att.OBJNAM); 38 } 39 } 40 return (name != null) ? (String)name.val: null; 39 41 } 40 42 … … 203 205 break; 204 206 case MARCUL: 205 if (zoom >= 14) 206 Renderer.symbol(feature, Areas.MarineFarm); 207 if (zoom >= 16) 208 Renderer.lineVector(feature, new LineStyle(Color.black, 4, new float[] { 10, 10 })); 207 if (zoom >= 12) { 208 if (zoom >= 14) { 209 Renderer.symbol(feature, Areas.MarineFarm); 210 } 211 if ((feature.area > 0.2) || ((feature.area > 0.05) && (zoom >= 14)) || ((feature.area > 0.005) && (zoom >= 16))) { 212 Renderer.lineVector(feature, new LineStyle(Color.black, 4, new float[] { 10, 10 })); 213 } 214 } 209 215 break; 210 216 case OSPARE: … … 219 225 if (zoom >= 12) { 220 226 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Renderer.Mline); 221 if (testAttribute(feature, feature.type, Att.CAT PRA, CatREA.REA_NWAK)) {227 if (testAttribute(feature, feature.type, Att.CATREA, CatREA.REA_NWAK)) { 222 228 Renderer.symbol(feature, Areas.NoWake); 223 229 } … … 277 283 case SPLARE: 278 284 if (zoom >= 12) { 279 Renderer.symbol(feature, Areas.Plane); 285 Renderer.symbol(feature, Areas.Plane, new Scheme(Renderer.Msymb)); 280 286 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Renderer.Mline); 281 287 } … … 327 333 private static void bridges(Feature feature) { 328 334 if (zoom >= 16) { 329 double verclr, verccl, vercop; 335 double verclr, verccl, vercop, horclr; 330 336 AttMap atts = feature.objs.get(Obj.BRIDGE).get(0); 331 String str = ""; 337 String vstr = ""; 338 String hstr = ""; 332 339 if (atts != null) { 333 if (atts.containsKey(Att.VERCLR)) { 334 verclr = (Double) atts.get(Att.VERCLR).val; 340 if (atts.containsKey(Att.HORCLR)) { 341 horclr = (Double) atts.get(Att.HORCLR).val; 342 hstr = String.valueOf(horclr); 343 } 344 if (atts.containsKey(Att.VERCLR)) { 345 verclr = (Double) atts.get(Att.VERCLR).val; 335 346 } else { 336 347 verclr = atts.containsKey(Att.VERCSA) ? (Double) atts.get(Att.VERCSA).val : 0; … … 339 350 vercop = atts.containsKey(Att.VERCOP) ? (Double) atts.get(Att.VERCOP).val : 0; 340 351 if (verclr > 0) { 341 str += String.valueOf(verclr); 352 vstr += String.valueOf(verclr); 342 353 } else if (verccl > 0) { 343 354 if (vercop == 0) { 344 str += String.valueOf(verccl) + "/-"; 355 vstr += String.valueOf(verccl) + "/-"; 345 356 } else { 346 str += String.valueOf(verccl) + "/" + String.valueOf(vercop); 357 vstr += String.valueOf(verccl) + "/" + String.valueOf(vercop); 347 358 } 348 359 } 349 if (!str.isEmpty()) 350 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC)); 360 if (hstr.isEmpty() && !vstr.isEmpty()) { 361 Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC)); 362 } else if (!hstr.isEmpty() && !vstr.isEmpty()) { 363 Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.BC)); 364 Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.TC)); 365 } else if (!hstr.isEmpty() && vstr.isEmpty()) { 366 Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.CC)); 367 } 351 368 } 352 369 }
Note:
See TracChangeset
for help on using the changeset viewer.
