Changeset 30157 in osm for applications/editors/josm/plugins/smed2/src/render/Rules.java
- Timestamp:
- 2013-12-29T12:52:10+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.
