Changeset 30157 in osm
- Timestamp:
- 2013-12-29T12:52:10+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/build.xml
r29996 r30157 39 39 <!-- this is the directory where the plugin jar is copied to --> 40 40 <property name="plugin.dist.dir" value="../../dist"/> 41 <property name="ant.build.javac.target" value="1. 6"/>41 <property name="ant.build.javac.target" value="1.7"/> 42 42 <property name="plugin.dist.dir" value="../../dist"/> 43 43 <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/> -
applications/editors/josm/plugins/smed2/src/render/Renderer.java
r30150 r30157 388 388 } 389 389 390 public static void labelText(Feature feature, String str, Font font, LabelStyle style, Color fg) { 391 labelText(feature, str, font, style, fg, null, null); 392 } 393 public static void labelText(Feature feature, String str, Font font, LabelStyle style, Color fg, Color bg) { 394 labelText(feature, str, font, style, fg, bg, null); 395 } 396 public static void labelText(Feature feature, String str, Font font, LabelStyle style, Color fg, Delta delta) { 397 labelText(feature, str, font, style, fg, null, delta); 398 } 399 public static void labelText(Feature feature, String str, Font font, LabelStyle style, Color fg, Color bg, Delta delta) { 390 public static void labelText(Feature feature, String str, Font font, Color tc) { 391 labelText(feature, str, font, tc, LabelStyle.NONE, null, null, null); 392 } 393 public static void labelText(Feature feature, String str, Font font, Color tc, Delta delta) { 394 labelText(feature, str, font, tc, LabelStyle.NONE, null, null, delta); 395 } 396 public static void labelText(Feature feature, String str, Font font, Color tc, LabelStyle style, Color fg) { 397 labelText(feature, str, font, tc, style, fg, null, null); 398 } 399 public static void labelText(Feature feature, String str, Font font, Color tc, LabelStyle style, Color fg, Color bg) { 400 labelText(feature, str, font, tc, style, fg, bg, null); 401 } 402 public static void labelText(Feature feature, String str, Font font, Color tc, LabelStyle style, Color fg, Delta delta) { 403 labelText(feature, str, font, tc, style, fg, null, delta); 404 } 405 public static void labelText(Feature feature, String str, Font font, Color tc, LabelStyle style, Color fg, Color bg, Delta delta) { 400 406 if (delta == null) delta = new Delta(Handle.CC); 401 407 if (bg == null) bg = new Color(0x00000000, true); … … 491 497 break; 492 498 } 493 label.add(new Instr(Prim.TEXT, new Caption(str, font, fg, new Delta(Handle.TL, AffineTransform.getTranslateInstance(tx, ty)))));499 label.add(new Instr(Prim.TEXT, new Caption(str, font, tc, new Delta(Handle.TL, AffineTransform.getTranslateInstance(tx, ty))))); 494 500 Point2D point = context.getPoint(feature.centre); 495 501 Symbols.drawSymbol(g2, label, sScale, point.getX(), point.getY(), null, delta); -
applications/editors/josm/plugins/smed2/src/render/Rules.java
r30150 r30157 190 190 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 })); 191 191 if ((Renderer.zoom >= 12) && (name != null)) 192 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE,Color.black);192 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), Color.black); 193 193 break; 194 194 case FAIRWY: … … 218 218 Renderer.lineVector(feature, new LineStyle(Color.black, 20, new float[] { 40, 40 })); 219 219 if ((Renderer.zoom >= 15) && (name != null)) 220 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE,Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));220 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10))); 221 221 } 222 222 break; … … 236 236 Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40); 237 237 } else { 238 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), LabelStyle.NONE,Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));238 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 239 239 } 240 240 break; … … 244 244 Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40); 245 245 } else { 246 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), LabelStyle.NONE,Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));246 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 247 247 } 248 248 break; … … 252 252 Renderer.lineVector(feature, new LineStyle(new Color(0xc480ff), 4, new float[] { 25, 25 })); 253 253 if (name != null) { 254 Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), LabelStyle.NONE,Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));255 Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), LabelStyle.NONE,Color.black, new Delta(Handle.BC));254 Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 255 Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC)); 256 256 } 257 257 } else if (feature.flag == Fflag.LINE) { … … 262 262 } else { 263 263 if (name != null) { 264 Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), LabelStyle.NONE,Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));265 Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), LabelStyle.NONE,Color.black, new Delta(Handle.BC));264 Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 265 Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC)); 266 266 } 267 267 } … … 271 271 case SEA_NRRW: 272 272 if ((Renderer.zoom >= 12) && (name != null)) 273 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE,Color.black);273 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), Color.black); 274 274 break; 275 275 default: … … 286 286 } 287 287 if ((Renderer.zoom >= 15) && (name != null)) 288 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE,Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));288 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90))); 289 289 break; 290 290 default: … … 294 294 295 295 private static void beacons(Feature feature) { 296 BcnSHP shape = (BcnSHP) getAttVal(feature, feature.type, 0, Att.BCNSHP); 297 if (((shape == BcnSHP.BCN_PRCH) || (shape == BcnSHP.BCN_WTHY)) && (feature.type == Obj.BCNLAT)) { 298 CatLAM cat = (CatLAM) getAttVal(feature, feature.type, 0, Att.CATLAM); 299 switch (cat) { 300 case LAM_PORT: 301 if (shape == BcnSHP.BCN_PRCH) 302 Renderer.symbol(feature, Beacons.PerchPort); 303 else 304 Renderer.symbol(feature, Beacons.WithyPort); 305 break; 306 case LAM_STBD: 307 if (shape == BcnSHP.BCN_PRCH) 308 Renderer.symbol(feature, Beacons.PerchStarboard); 309 else 310 Renderer.symbol(feature, Beacons.WithyStarboard); 311 break; 312 default: 313 Renderer.symbol(feature, Beacons.Stake, getScheme(feature, feature.type)); 314 } 315 } else { 316 Renderer.symbol(feature, Beacons.Shapes.get(shape), getScheme(feature, feature.type)); 317 if (feature.objs.get(Obj.TOPMAR) != null) 318 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.BeaconDelta); 319 } 320 Signals.addSignals(feature); 296 if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BCNLAT) || (feature.type == Obj.BCNCAR)))) { 297 BcnSHP shape = (BcnSHP) getAttVal(feature, feature.type, 0, 298 Att.BCNSHP); 299 if (((shape == BcnSHP.BCN_PRCH) || (shape == BcnSHP.BCN_WTHY)) 300 && (feature.type == Obj.BCNLAT)) { 301 CatLAM cat = (CatLAM) getAttVal(feature, feature.type, 0, 302 Att.CATLAM); 303 switch (cat) { 304 case LAM_PORT: 305 if (shape == BcnSHP.BCN_PRCH) 306 Renderer.symbol(feature, Beacons.PerchPort); 307 else 308 Renderer.symbol(feature, Beacons.WithyPort); 309 break; 310 case LAM_STBD: 311 if (shape == BcnSHP.BCN_PRCH) 312 Renderer.symbol(feature, Beacons.PerchStarboard); 313 else 314 Renderer.symbol(feature, Beacons.WithyStarboard); 315 break; 316 default: 317 Renderer.symbol(feature, Beacons.Stake, 318 getScheme(feature, feature.type)); 319 } 320 } else { 321 Renderer.symbol(feature, Beacons.Shapes.get(shape), 322 getScheme(feature, feature.type)); 323 if (feature.objs.get(Obj.TOPMAR) != null) 324 Renderer.symbol( 325 feature, 326 Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR) 327 .get(0).get(Att.TOPSHP).val), 328 getScheme(feature, Obj.TOPMAR), 329 Topmarks.BeaconDelta); 330 } 331 Signals.addSignals(feature); 332 } 321 333 } 322 334 323 335 private static void buoys(Feature feature) { 324 BoySHP shape = (BoySHP) getAttVal(feature, feature.type, 0, Att.BOYSHP); 325 Renderer.symbol(feature, Buoys.Shapes.get(shape), getScheme(feature, feature.type)); 326 if (hasObject(feature, Obj.TOPMAR)) { 327 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape)); 328 } 329 Signals.addSignals(feature); 336 if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BOYLAT) || (feature.type == Obj.BOYCAR)))) { 337 BoySHP shape = (BoySHP) getAttVal(feature, feature.type, 0, Att.BOYSHP); 338 Renderer.symbol(feature, Buoys.Shapes.get(shape), getScheme(feature, feature.type)); 339 if (hasObject(feature, Obj.TOPMAR)) { 340 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), 341 getScheme(feature, Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape)); 342 } 343 Signals.addSignals(feature); 344 } 330 345 } 331 346 … … 358 373 } 359 374 if (hstr.isEmpty() && !vstr.isEmpty()) { 360 Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC)); 375 Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC)); 361 376 } else if (!hstr.isEmpty() && !vstr.isEmpty()) { 362 Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.BC)); 363 Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.TC)); 377 Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.BC)); 378 Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.TC)); 364 379 } else if (!hstr.isEmpty() && vstr.isEmpty()) { 365 Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.CC)); 380 Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.CC)); 366 381 } 367 382 } … … 382 397 if (atts != null) { 383 398 if (atts.containsKey(Att.VERCLR)) { 384 Renderer.labelText(feature, String.valueOf((Double) atts.get(Att.VERCLR).val), new Font("Arial", Font.PLAIN, 50), LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25))); 399 Renderer.labelText(feature, String.valueOf((Double) atts.get(Att.VERCLR).val), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25))); 385 400 } else if (atts.containsKey(Att.VERCSA)) { 386 Renderer.labelText(feature, String.valueOf((Double) atts.get(Att.VERCSA).val), new Font("Arial", Font.PLAIN, 50), LabelStyle.PCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25))); 401 Renderer.labelText(feature, String.valueOf((Double) atts.get(Att.VERCSA).val), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.PCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25))); 387 402 } 388 403 } … … 427 442 } 428 443 str += String.format("%1.0f", dist); 429 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE,Color.black, null, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45)));444 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45))); 430 445 } 431 446 } … … 464 479 if (Renderer.zoom >= 14) { 465 480 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Mline)); 466 Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC)); 481 Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Msymb, LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC)); 467 482 } 468 483 double radius = (Double)getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS); … … 481 496 } 482 497 if ((Renderer.zoom >= 15) && ((name) != null)) { 483 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));498 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 60), Mline, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0))); 484 499 } 485 500 ArrayList<StsSTS> sts = (ArrayList<StsSTS>)getAttVal(feature, Obj.ACHARE, 0, Att.STATUS); 486 501 if ((Renderer.zoom >= 15) && (sts != null) && (sts.contains(StsSTS.STS_RESV))) { 487 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));502 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), Mline, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60))); 488 503 } 489 504 } … … 493 508 switch (cat) { 494 509 case ACH_DEEP: 495 Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));510 Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 496 511 dy += 60; 497 512 break; 498 513 case ACH_TANK: 499 Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));514 Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 500 515 dy += 60; 501 516 break; 502 517 case ACH_H24P: 503 Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));518 Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 504 519 dy += 60; 505 520 break; 506 521 case ACH_EXPL: 507 Renderer.symbol(feature, Harbours.Explosives, new Scheme(M line), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));522 Renderer.symbol(feature, Harbours.Explosives, new Scheme(Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 508 523 dy += 60; 509 524 break; 510 525 case ACH_QUAR: 511 Renderer.symbol(feature, Harbours.Hospital, new Scheme(M line), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));526 Renderer.symbol(feature, Harbours.Hospital, new Scheme(Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 512 527 dy += 60; 513 528 break; 514 529 case ACH_SEAP: 515 Renderer.symbol(feature, Areas.Seaplane, new Scheme(M line), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));530 Renderer.symbol(feature, Areas.Seaplane, new Scheme(Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 516 531 dy += 60; 517 532 break; 533 default: 518 534 } 519 535 } … … 521 537 case BERTHS: 522 538 if (Renderer.zoom >= 14) { 523 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Mline, Color.white, null); 539 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), Msymb, LabelStyle.RRCT, Mline, Color.white, null); 524 540 } 525 541 break; … … 896 912 } 897 913 if (verclr > 0) { 898 Renderer.labelText(feature, String.valueOf(verclr), new Font("Arial", Font.PLAIN, 50), LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25))); 914 Renderer.labelText(feature, String.valueOf(verclr), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25))); 899 915 } 900 916 } … … 911 927 String name = getName(feature); 912 928 if ((Renderer.zoom >= 15) && (name != null)) 913 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 40), LabelStyle.NONE,Color.black, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));929 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 40), Color.black, new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50))); 914 930 Signals.addSignals(feature); 915 931 } … … 926 942 String name = getName(feature); 927 943 if ((Renderer.zoom >= 15) && (name != null)) 928 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE,Color.black, null, null);944 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), Color.black); 929 945 } 930 946 } … … 942 958 String name = getName(feature); 943 959 if ((Renderer.zoom >= 10) && (name != null)) 944 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE,new Color(0x80c48080, true), null, null);960 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 150), new Color(0x80c48080, true)); 945 961 break; 946 962 case TSELNE: … … 1007 1023 } 1008 1024 if ((Renderer.zoom >= 15) && !str.isEmpty()) { 1009 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE,Color.black, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0)));1010 } 1011 }1012 Signals.addSignals(feature);1025 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0))); 1026 } 1027 Signals.addSignals(feature); 1028 } 1013 1029 } 1014 1030 -
applications/editors/josm/plugins/smed2/src/render/Signals.java
r30150 r30157 64 64 } 65 65 if ((Renderer.zoom >= 15) && !bstr.isEmpty()) { 66 Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE,Color.black, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -30)));66 Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40),Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -30))); 67 67 } 68 68 } … … 175 175 if (Renderer.zoom >= 15) { 176 176 if (vais) { 177 Renderer.labelText(feature, "V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE,Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));177 Renderer.labelText(feature, "V-AIS", new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 178 178 } 179 179 if (!bstr.isEmpty()) { 180 Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE,Color.black, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -70)));180 Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -70))); 181 181 } 182 182 } -
applications/editors/josm/plugins/smed2/src/s57/S57map.java
r30150 r30157 13 13 14 14 import s57.S57att; 15 import s57.S57val.AttVal; 15 16 import s57.S57att.*; 16 17 import s57.S57obj; … … 351 352 items.put(idx, atts); 352 353 } 353 AttVal attval = S57val.convertValue(val, att); 354 AttVal<?> attval = S57val.convertValue(val, att); 354 355 if (attval.val != null) 355 356 atts.put(att, new AttItem(attval.conv, attval.val)); … … 363 364 Att att = S57att.enumAttribute(subkeys[1], Obj.UNKOBJ); 364 365 if (att != Att.UNKATT) { 365 AttVal attval = S57val.convertValue(val, att); 366 AttVal<?> attval = S57val.convertValue(val, att); 366 367 if (attval.val != null) 367 368 feature.atts.put(att, new AttItem(attval.conv, attval.val)); … … 436 437 areas.put(id, area); 437 438 break; 439 case UNKN: 440 default: 441 break; 438 442 } 439 443 if ((feature.type != Obj.UNKOBJ) && !((edge != null) && (edge.last == 0))) { … … 556 560 } 557 561 return new Snode((sarc > 0.0 ? slat / sarc : 0.0), (sarc > 0.0 ? slon / sarc : 0.0)); 562 default: 558 563 } 559 564 return null; -
applications/editors/josm/plugins/smed2/src/s57/S57val.java
r30046 r30157 26 26 } 27 27 28 public static class AttVal { 28 public static class AttVal<V> { 29 29 public Att att; 30 30 public Conv conv; 31 public Objectval;32 AttVal(Att a, Conv c, Objectv) {31 public V val; 32 AttVal(Att a, Conv c, V v) { 33 33 att = a; conv = c; val = v; 34 34 } … … 1141 1141 1142 1142 1143 public static String stringValue(AttVal attval) { // Convert OSeaM value object to OSeaM attribute value string 1143 public static String stringValue(AttVal<?> attval) { // Convert OSeaM value object to OSeaM attribute value string 1144 1144 switch (attval.conv) { 1145 1145 case A: … … 1177 1177 } 1178 1178 1179 public static AttVal convertValue(String val, Att att) { // Convert OSeaM attribute value string to OSeaM value object 1179 public static AttVal<?> convertValue(String val, Att att) { // Convert OSeaM attribute value string to OSeaM value object 1180 1180 switch (keys.get(att).conv) { 1181 1181 case A: 1182 1182 case S: 1183 return new AttVal(att, Conv.S, val); 1183 return new AttVal<String>(att, Conv.S, val); 1184 1184 case E: 1185 return new AttVal(att, Conv.E, enumValue(val, att)); 1185 return new AttVal<Enum<?>>(att, Conv.E, enumValue(val, att)); 1186 1186 case L: 1187 1187 ArrayList<Enum<?>> list = new ArrayList<Enum<?>>(); … … 1189 1189 list.add(enumValue(item, att)); 1190 1190 } 1191 return new AttVal(att, Conv.L, list); 1191 return new AttVal<ArrayList<?>>(att, Conv.L, list); 1192 1192 case I: 1193 1193 try { 1194 1194 long i = Long.parseLong(val); 1195 return new AttVal(att, Conv.I, i); 1195 return new AttVal<Long>(att, Conv.I, i); 1196 1196 } catch (Exception e) { 1197 1197 break; … … 1200 1200 try { 1201 1201 double f = Double.parseDouble(val); 1202 return new AttVal(att, Conv.F, f); 1202 return new AttVal<Double>(att, Conv.F, f); 1203 1203 } catch (Exception e) { 1204 1204 break; 1205 1205 } 1206 1206 } 1207 return new AttVal(att, keys.get(att).conv, null); 1207 return new AttVal<>(att, keys.get(att).conv, null); 1208 1208 } 1209 1209 -
applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
r30150 r30157 29 29 import org.openstreetmap.josm.Main; 30 30 31 import s57.S57dat;32 31 import s57.S57map; 33 32 import s57.S57map.*; -
applications/editors/josm/plugins/smed2/src/symbols/Facilities.java
r30033 r30157 15 15 import java.util.EnumMap; 16 16 17 import s57.S57val.CatLMK; 18 import s57.S57val.CatSCF; 17 import s57.S57val.*; 19 18 import symbols.Symbols.*; 20 19
Note:
See TracChangeset
for help on using the changeset viewer.