Changeset 34906 in osm for applications/editors/josm/plugins/seachart/src/render
- Timestamp:
- 2019-02-25T09:55:19+01:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/seachart/src/render
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/render/Rules.java
r34896 r34906 38 38 import s57.S57val.CatOBS; 39 39 import s57.S57val.CatOFP; 40 import s57.S57val.CatOPA; 40 41 import s57.S57val.CatPIL; 41 import s57.S57val.CatPRA;42 42 import s57.S57val.CatREA; 43 43 import s57.S57val.CatROD; 44 import s57.S57val.CatROS; 44 45 import s57.S57val.CatSCF; 45 46 import s57.S57val.CatSEA; … … 59 60 import s57.S57val.UniHLU; 60 61 import s57.S57val.WatLEV; 62 import s57.S57val.CatVAN; 61 63 import symbols.Areas; 62 64 import symbols.Beacons; … … 348 350 if (testObject(Obj.BCNISD)) for (Feature f : objects) if (testFeature(f)) beacons(); 349 351 if (testObject(Obj.BCNSAW)) for (Feature f : objects) if (testFeature(f)) beacons(); 350 if (testObject(Obj.BCNSPP)) for (Feature f : objects) if (testFeature(f)) beacons(); 352 if (testObject(Obj.BCNSPP)) for (Feature f : objects) if (testFeature(f)) beacons(); 353 if (testObject(Obj.VAATON)) for (Feature f : objects) if (testFeature(f)) virtual(); 351 354 } 352 355 } catch (ConcurrentModificationException e) { … … 386 389 break; 387 390 case FAIRWY: 388 if (feature.geom.area > 2.0) { 389 if (Renderer.zoom < 16) 390 Renderer.lineVector(new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true))); 391 else 392 Renderer.lineVector(new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 })); 393 } else { 394 if (Renderer.zoom >= 14) 395 Renderer.lineVector(new LineStyle(new Color(0x40ffffff, true))); 396 } 391 if (Renderer.zoom >= 12) { 392 if (feature.geom.area > 1.0) { 393 if (Renderer.zoom < 16) 394 Renderer.lineVector(new LineStyle(new Color(0x20ffffff, true))); 395 else 396 Renderer.lineVector(new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 })); 397 } else { 398 if (Renderer.zoom >= 14) 399 Renderer.lineVector(new LineStyle(new Color(0x20ffffff, true))); 400 } 401 } 397 402 break; 398 403 case LKBSPT: … … 428 433 break; 429 434 case OSPARE: 430 if (testAttribute(feature.type, Att.CAT PRA, CatPRA.PRA_WFRM)) {435 if (testAttribute(feature.type, Att.CATOPA, CatOPA.OPA_WIND)) { 431 436 Renderer.symbol(Areas.WindFarm); 432 437 Renderer.lineVector(new LineStyle(Color.black, 12, new float[] { 40, 40 })); … … 473 478 if (name != null) { 474 479 Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 475 Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC)); 480 Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 20))); 476 481 } 477 482 } else if (feature.geom.prim == Pflag.LINE) { 478 483 if (name != null) { 479 484 Renderer.lineText(name, new Font("Arial", Font.ITALIC, 75), Color.black, -40); 480 Renderer.lineText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, 0); 485 Renderer.lineText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, 20); 481 486 } 482 487 } else { 483 488 if (name != null) { 484 489 Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 485 Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC)); 490 Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 20))); 486 491 } 487 492 } … … 874 879 } 875 880 break; 876 case BUISGL: 877 if (Renderer.zoom >= 16) { 878 if (testAttribute(Obj.BUISGL, Att.STATUS, StsSTS.STS_ILLD)) { 879 Renderer.symbol(Beacons.Floodlight); 880 } 881 ArrayList<Symbol> symbols = new ArrayList<>(); 882 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttList(Obj.BUISGL, Att.FUNCTN); 883 for (FncFNC fnc : fncs) { 884 symbols.add(Landmarks.Funcs.get(fnc)); 885 } 886 if (feature.objs.containsKey(Obj.SMCFAC)) { 887 ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(Obj.SMCFAC, Att.CATSCF); 888 for (CatSCF scf : scfs) { 889 symbols.add(Facilities.Cats.get(scf)); 890 } 891 } 892 Renderer.cluster(symbols); 893 } 894 break; 881 case BUISGL: 882 if (Renderer.zoom >= 16) { 883 Renderer.lineVector(new LineStyle(Color.black, 8, new Color(0xffc0c0c0, true))); 884 if (testAttribute(Obj.BUISGL, Att.STATUS, StsSTS.STS_ILLD)) { 885 Renderer.symbol(Beacons.Floodlight); 886 } 887 ArrayList<Symbol> symbols = new ArrayList<>(); 888 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttList(Obj.BUISGL, Att.FUNCTN); 889 for (FncFNC fnc : fncs) { 890 symbols.add(Landmarks.Funcs.get(fnc)); 891 } 892 if (feature.objs.containsKey(Obj.SMCFAC)) { 893 ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(Obj.SMCFAC, Att.CATSCF); 894 for (CatSCF scf : scfs) { 895 symbols.add(Facilities.Cats.get(scf)); 896 } 897 } 898 Renderer.cluster(symbols); 899 Signals.addSignals(); 900 } 901 break; 895 902 case HRBFAC: 896 903 if (Renderer.zoom >= 12) { … … 1172 1179 Renderer.lineVector(new LineStyle(Color.black, 5, new float[] { 20, 20 }, null)); 1173 1180 if (Renderer.zoom >= 15) { 1174 Renderer.lineText("Boom", new Font("Arial", Font.PLAIN, 80), Color.black, -20);1181 Renderer.lineText("Boom", new Font("Arial", Font.PLAIN, 40), Color.black, -20); 1175 1182 } 1176 1183 } … … 1485 1492 } 1486 1493 1494 @SuppressWarnings("unchecked") 1495 private static void virtual() { 1496 if (Renderer.zoom >= 12) { 1497 Renderer.symbol(Harbours.SignalStation, new Scheme(Symbols.Msymb)); 1498 Renderer.symbol(Beacons.RadarStation, new Scheme(Symbols.Msymb)); 1499 ArrayList<CatVAN> cats = (ArrayList<CatVAN>) getAttList(Obj.VAATON, Att.CATVAN); 1500 for (CatVAN van : cats) { 1501 switch (van) { 1502 case VAN_NCAR: 1503 Renderer.symbol(Topmarks.TopNorth, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 1504 break; 1505 case VAN_SCAR: 1506 Renderer.symbol(Topmarks.TopSouth, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 1507 break; 1508 case VAN_ECAR: 1509 Renderer.symbol(Topmarks.TopEast, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 1510 break; 1511 case VAN_WCAR: 1512 Renderer.symbol(Topmarks.TopWest, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 1513 break; 1514 case VAN_PLAT: 1515 case VAN_PCHS: 1516 Renderer.symbol(Topmarks.TopCan, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 1517 break; 1518 case VAN_SLAT: 1519 case VAN_PCHP: 1520 Renderer.symbol(Topmarks.TopCone, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 1521 break; 1522 case VAN_IDGR: 1523 Renderer.symbol(Topmarks.TopIsol, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 1524 break; 1525 case VAN_SAFW: 1526 Renderer.symbol(Topmarks.TopSphere, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 1527 break; 1528 case VAN_SPPM: 1529 Renderer.symbol(Topmarks.TopX, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 1530 break; 1531 case VAN_WREK: 1532 Renderer.symbol(Topmarks.TopCross, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 1533 break; 1534 default: 1535 break; 1536 } 1537 } 1538 } 1539 if (Renderer.zoom >= 15) { 1540 Renderer.labelText("V-AIS", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 1541 } 1542 } 1543 1487 1544 private static void waterways() { 1488 1545 Renderer.lineVector(new LineStyle(Symbols.Bwater, 20, (feature.geom.prim == Pflag.AREA) ? Symbols.Bwater : null)); -
applications/editors/josm/plugins/seachart/src/render/Signals.java
r34896 r34906 249 249 @SuppressWarnings("unchecked") 250 250 public static void radioStations() { 251 boolean vais = false;252 251 String bstr = ""; 253 252 if (Renderer.zoom >= 11) { … … 302 301 case ROS_TIME: 303 302 break; 304 PAIS:305 SAIS:303 case ROS_AISB: 304 case ROS_PAIS: 306 305 bstr += " AIS"; 307 306 break; 308 case ROS_VAIS:309 vais = true;310 break;311 case ROS_VANC:312 vais = true;313 Renderer.symbol(Topmarks.TopNorth, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));314 break;315 case ROS_VASC:316 vais = true;317 Renderer.symbol(Topmarks.TopSouth, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));318 break;319 case ROS_VAEC:320 vais = true;321 Renderer.symbol(Topmarks.TopEast, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));322 break;323 case ROS_VAWC:324 vais = true;325 Renderer.symbol(Topmarks.TopWest, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));326 break;327 case ROS_VAPL:328 vais = true;329 Renderer.symbol(Topmarks.TopCan, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));330 break;331 case ROS_VASL:332 vais = true;333 Renderer.symbol(Topmarks.TopCone, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));334 break;335 case ROS_VAID:336 vais = true;337 Renderer.symbol(Topmarks.TopIsol, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));338 break;339 case ROS_VASW:340 vais = true;341 Renderer.symbol(Topmarks.TopSphere, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));342 break;343 case ROS_VASP:344 vais = true;345 Renderer.symbol(Topmarks.TopX, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));346 break;347 case ROS_VAWK:348 vais = true;349 Renderer.symbol(Topmarks.TopCross, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));350 break;351 307 default: 352 308 break; 353 309 } 354 310 } 355 if (!vais) { 356 Renderer.symbol(Beacons.RadarStation); 357 } 311 Renderer.symbol(Beacons.RadarStation); 358 312 } 359 313 if (Renderer.zoom >= 15) { 360 if (vais) {361 Renderer.labelText("V-AIS", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));362 }363 314 if (!bstr.isEmpty()) { 364 315 Renderer.labelText(bstr, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -110)));
Note:
See TracChangeset
for help on using the changeset viewer.