Changeset 36267 in osm for applications/editors/josm/plugins/seachart
- Timestamp:
- 2024-06-03T08:28:52+02:00 (7 months ago)
- Location:
- applications/editors/josm/plugins/seachart
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/jicons/src/jicons/Jicons.java
r35392 r36267 220 220 return RuleSet.ALL; 221 221 } 222 223 @Override 224 public Chart chart() { 225 // TODO Auto-generated method stub 226 return null; 227 } 222 228 } 223 229 } -
applications/editors/josm/plugins/seachart/jrender/src/jrender/Jrender.java
r35835 r36267 125 125 } 126 126 } 127 if ((z >= 12) && (z < 1 8) && ((z < 16) || (bos.size() > empty))) {127 if ((z >= 12) && (z < 19) && ((z < 16) || (bos.size() > empty))) { 128 128 for (int x = 0; x < 2; x++) { 129 129 for (int y = 0; y < 2; y++) { … … 144 144 delfile.delete(); 145 145 } 146 if ((z < 1 8)) {146 if ((z < 19)) { 147 147 for (int x = 0; x < 2; x++) { 148 148 for (int y = 0; y < 2; y++) { -
applications/editors/josm/plugins/seachart/src/render/Renderer.java
r35794 r36267 559 559 point = context.getPoint(Rules.feature.geom.centre); 560 560 g2.drawImage(image, new AffineTransformOp(AffineTransform.getScaleInstance(sScale, sScale), AffineTransformOp.TYPE_NEAREST_NEIGHBOR), 561 (int) (point.getX() - ( 50 * sScale)), (int) (point.getY() - (50 * sScale)));561 (int) (point.getX() - (sScale * image.getWidth() / 2)), (int) (point.getY() - (sScale * image.getHeight() / 2))); 562 562 break; 563 563 case AREA: … … 583 583 } 584 584 } 585 g2.setPaint(new TexturePaint(image, new Rectangle(0, 0, 1 + (int) (300 * sScale), 1 + (int) (300 * sScale))));585 g2.setPaint(new TexturePaint(image, new Rectangle(0, 0, (1 + (int) (150 * sScale)), (1 + (int) (150 * sScale))))); 586 586 g2.fill(p); 587 587 break; -
applications/editors/josm/plugins/seachart/src/render/Rules.java
r35840 r36267 43 43 import s57.S57val.CatREA; 44 44 import s57.S57val.CatROD; 45 import s57.S57val.CatROS;46 45 import s57.S57val.CatSCF; 47 46 import s57.S57val.CatSEA; … … 50 49 import s57.S57val.CatSIW; 51 50 import s57.S57val.CatSLC; 51 import s57.S57val.CatVAN; 52 52 import s57.S57val.CatWED; 53 53 import s57.S57val.CatWRK; … … 56 56 import s57.S57val.FncFNC; 57 57 import s57.S57val.MarSYS; 58 import s57.S57val.NatQUA; 58 59 import s57.S57val.NatSUR; 59 import s57.S57val.NatQUA;60 60 import s57.S57val.StsSTS; 61 61 import s57.S57val.TecSOU; … … 64 64 import s57.S57val.UniHLU; 65 65 import s57.S57val.WatLEV; 66 import s57.S57val.CatVAN;67 66 import symbols.Areas; 68 67 import symbols.Beacons; … … 551 550 break; 552 551 case SNDWAV: 553 if (Renderer.zoom >= 1 2)552 if (Renderer.zoom >= 14) 554 553 Renderer.fillPattern(Areas.Sandwaves); 555 554 break; … … 560 559 if (hasAttribute(feature.type, Att.NATSUR)) { 561 560 ArrayList<NatSUR> surs = (ArrayList<NatSUR>) getAttList(feature.type, Att.NATSUR); 562 ArrayList<NatQUA> quas = new ArrayList< NatQUA>();561 ArrayList<NatQUA> quas = new ArrayList<>(); 563 562 if (hasAttribute(feature.type, Att.NATQUA)) { 564 563 quas = (ArrayList<NatQUA>) getAttList(feature.type, Att.NATQUA); … … 608 607 case SUR_MUD: 609 608 str += "M"; 609 610 610 break; 611 611 case SUR_CLAY: … … 617 617 case SUR_SAND: 618 618 str += "S"; 619 619 620 break; 620 621 case SUR_STON: 621 622 str += "St"; 623 622 624 break; 623 625 case SUR_GRVL: 624 626 str += "G"; 627 625 628 break; 626 629 case SUR_PBBL: … … 632 635 case SUR_ROCK: 633 636 str += "R"; 637 if (feature.geom.prim != Pflag.POINT) { 638 Renderer.lineSymbols(Areas.Rocks, 1, null, null, 0, Color.black); 639 } 634 640 break; 635 641 case SUR_LAVA: … … 638 644 case SUR_CORL: 639 645 str += "Co"; 646 if (feature.geom.prim != Pflag.POINT) { 647 Renderer.lineSymbols(Areas.Coral, 1, null, null, 0, Color.black); 648 } 640 649 break; 641 650 case SUR_SHEL: … … 661 670 switch ((CatWED) getAttEnum(feature.type, Att.CATWED)) { 662 671 case WED_KELP: 663 if (feature.geom.prim == Pflag. AREA) {664 Renderer. fillPattern(Areas.KelpA);672 if (feature.geom.prim == Pflag.POINT) { 673 Renderer.symbol(Areas.KelpP); 665 674 } else { 666 Renderer. symbol(Areas.KelpS);675 Renderer.fillPattern(Areas.Kelp); 667 676 } 668 677 break; … … 671 680 break; 672 681 case WED_SGRS: 673 Renderer.labelText("Sg", new Font("Arial", Font.ITALIC, 40), Color.black, new Delta(Handle.CC)); 682 if (feature.geom.prim == Pflag.POINT) { 683 Renderer.symbol(Areas.SeagrassP); 684 } else { 685 Renderer.fillPattern(Areas.Seagrass); 686 } 674 687 break; 675 688 case WED_SGSO: … … 681 694 break; 682 695 case SEGRAS: 683 Renderer.labelText("Sg", new Font("Arial", Font.ITALIC, 40), Color.black, new Delta(Handle.CC)); 696 if (Renderer.zoom >= 14) { 697 if (feature.geom.prim == Pflag.POINT) { 698 Renderer.symbol(Areas.SeagrassP); 699 } else { 700 Renderer.fillPattern(Areas.Seagrass); 701 } 702 } 684 703 break; 685 704 case SPRING: 686 Renderer.symbol(Areas.Spring); 705 if (Renderer.zoom >= 14) { 706 Renderer.symbol(Areas.Spring); 707 } 687 708 break; 688 709 case SPLARE: … … 1273 1294 Renderer.symbol(Harbours.Dolphin); 1274 1295 } 1275 Signals.addSignals();1276 1296 break; 1277 1297 case MOR_DDPN: 1278 1298 Renderer.symbol(Harbours.DeviationDolphin); 1279 Signals.addSignals();1280 1299 break; 1281 1300 case MOR_BLRD: … … 1291 1310 Renderer.symbol(Buoys.Shapes.get(shape), (1.0 / (1.0 + (0.25 * (18 - Renderer.zoom)))), getScheme(feature.type)); 1292 1311 Renderer.symbol(Topmarks.TopMooring, (1.0 / (1.0 + (0.25 * (18 - Renderer.zoom)))), Topmarks.BuoyDeltas.get(shape)); 1293 Signals.addSignals();1294 1312 addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50))); 1295 1313 } 1296 1314 break; 1297 1315 default: 1298 break; 1299 } 1316 Renderer.symbol(Harbours.Post); 1317 break; 1318 } 1319 Signals.addSignals(); 1300 1320 } 1301 1321 } … … 1425 1445 1426 1446 private static void pipelines() { 1427 if ((Renderer.zoom >= 14) && (feature.geom.length <20)) {1447 if ((Renderer.zoom >= 14) && (feature.geom.length < 20) || (Renderer.zoom < 12) && (feature.geom.length >= 20)) { 1428 1448 if (feature.type == Obj.PIPSOL) { 1429 1449 switch ((CatPIP) getAttEnum(feature.type, Att.CATPIP)) { … … 1776 1796 } 1777 1797 } 1778 1798 1779 1799 private static void waterways() { 1780 1800 Renderer.lineVector(new LineStyle(Symbols.Bwater, 20, (feature.geom.prim == Pflag.AREA) ? Symbols.Bwater : null)); -
applications/editors/josm/plugins/seachart/src/s57/S57obj.java
r35840 r36267 115 115 ObjStr.put(Obj.RCTLPT, "recommended_traffic_lane"); ObjStr.put(Obj.RSCSTA, "rescue_station"); ObjStr.put(Obj.RESARE, "restricted_area"); 116 116 ObjStr.put(Obj.RETRFL, "retro_reflector"); ObjStr.put(Obj.RIVERS, "river"); ObjStr.put(Obj.ROADWY, "road"); ObjStr.put(Obj.RUNWAY, "runway"); 117 ObjStr.put(Obj.SNDWAV, "sand waves"); ObjStr.put(Obj.SEAARE, "sea_area"); ObjStr.put(Obj.SPLARE, "seaplane_landing_area"); ObjStr.put(Obj.SBDARE, "seabed_area");117 ObjStr.put(Obj.SNDWAV, "sand_waves"); ObjStr.put(Obj.SEAARE, "sea_area"); ObjStr.put(Obj.SPLARE, "seaplane_landing_area"); ObjStr.put(Obj.SBDARE, "seabed_area"); 118 118 ObjStr.put(Obj.SLCONS, "shoreline_construction"); ObjStr.put(Obj.SISTAT, "signal_station_traffic"); ObjStr.put(Obj.SISTAW, "signal_station_warning"); 119 119 ObjStr.put(Obj.SILTNK, "tank"); ObjStr.put(Obj.SLOTOP, "slope_topline"); ObjStr.put(Obj.SLOGRD, "sloping_ground"); ObjStr.put(Obj.SMCFAC, "small_craft_facility"); -
applications/editors/josm/plugins/seachart/src/symbols/Areas.java
r35840 r36267 281 281 static { 282 282 Spring.add(new Instr(Form.FILL, Color.black)); 283 Spring.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND))); 284 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(0, 0, 7.5, 7.5))); 285 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(-20, 0, 7.5, 7.5))); 286 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(-40, 0, 7.5, 7.5))); 287 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(20, 0, 7.5, 7.5))); 288 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(40, 0, 7.5, 7.5))); 289 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(0, -20, 7.5, 7.5))); 290 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(0, -40, 7.5, 7.5))); 291 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(0, -60, 7.5, 7.5))); 292 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(0, -80, 7.5, 7.5))); 293 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(-15, -90, 7.5, 7.5))); 294 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(15, -90, 7.5, 7.5))); 295 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(-35, -85, 7.5, 7.5))); 296 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(35, -85, 7.5, 7.5))); 297 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(-50, -70, 7.5, 7.5))); 298 Spring.add(new Instr(Form.ELPS, new Ellipse2D.Double(50, -70, 7.5, 7.5))); 299 } 300 301 public static final Symbol KelpS = new Symbol(); 302 static { 303 KelpS.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER))); 304 Path2D.Double p = new Path2D.Double(); p.moveTo(-60, 0); p.curveTo(-20, -20, -24, 40, 24, 20); p.moveTo(-60, 0); p.quadTo(-48, 20, -32, 12); 305 p.moveTo(-36, -4); p.quadTo(-24, -24, -4, -16); p.quadTo(8, -32, 20, -24); p.moveTo(-4, -16); p.quadTo(8, 0, 20, -8); 306 p.moveTo(-8, 20); p.quadTo(12, 0, 36, 8); p.quadTo(48, 24, 60, 16); p.moveTo(36, 8); p.quadTo(48, -8, 60, 0); 307 KelpS.add(new Instr(Form.PLIN, p)); 308 } 309 310 public static final BufferedImage KelpA = new BufferedImage(240, 240, BufferedImage.TYPE_INT_ARGB); 311 static { 312 Graphics2D g2 = KelpA.createGraphics(); 283 Spring.add(new Instr(Form.STRK, new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND))); 284 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(0, 0, 10, 10))); 285 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(-20, 0, 10, 10))); 286 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(-40, 0, 10, 10))); 287 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(20, 0, 10, 10))); 288 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(40, 0, 10, 10))); 289 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(0, -20, 10, 10))); 290 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(0, -40, 10, 10))); 291 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(0, -60, 10, 10))); 292 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(0, -80, 10, 10))); 293 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(-15, -90, 10, 10))); 294 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(15, -90, 10, 10))); 295 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(-35, -85, 10, 10))); 296 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(35, -85, 10, 10))); 297 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(-50, -70, 10, 10))); 298 Spring.add(new Instr(Form.RSHP, new Ellipse2D.Double(50, -70, 10, 10))); 299 } 300 301 public static final BufferedImage Seagrass = new BufferedImage(240, 240, BufferedImage.TYPE_INT_ARGB); 302 static { 303 Graphics2D g2 = Seagrass.createGraphics(); 304 g2.setStroke(new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); 305 g2.setBackground(new Color(0, true)); 306 g2.clearRect(0, 0, 240, 240); 307 g2.setPaint(new Color(0x2E8E20)); 308 Path2D.Double p = new Path2D.Double(); 309 p.moveTo(90, 100); p.quadTo(50, 93, 29, 110); 310 p.moveTo(78, 98); p.quadTo(120, 75, 115, 50); 311 p.moveTo(45, 100); p.quadTo(65, 80, 55, 60); p.quadTo(50, 35, 60, 10); 312 p.moveTo(32, 108); p.quadTo(50, 90, 43, 70); p.quadTo(35, 40, 41, 18); 313 p.moveTo(32, 108); p.quadTo(0, 70, 16, 46); 314 p.moveTo(42, 103); p.quadTo(13, 75, 32, 31); 315 p.moveTo(23, 95); p.quadTo(35, 90, 34, 63); 316 p.moveTo(59, 99); p.quadTo(75, 75, 71, 22); 317 p.moveTo(66, 98); p.quadTo(85, 75, 82, 27); 318 p.moveTo(55, 97); p.quadTo(110, 50, 106, 30); 319 p.moveTo(90+120, 100+120); p.quadTo(50+120, 93+120, 29+120, 110+120); 320 p.moveTo(78+120, 98+120); p.quadTo(120+120, 75+120, 115+120, 50+120); 321 p.moveTo(45+120, 100+120); p.quadTo(65+120, 80+120, 55+120, 60+120); p.quadTo(50+120, 35+120, 60+120, 10+120); 322 p.moveTo(32+120, 108+120); p.quadTo(50+120, 90+120, 43+120, 70+120); p.quadTo(35+120, 40+120, 41+120, 18+120); 323 p.moveTo(32+120, 108+120); p.quadTo(0+120, 70+120, 16+120, 46+120); 324 p.moveTo(42+120, 103+120); p.quadTo(13+120, 75+120, 32+120, 31+120); 325 p.moveTo(23+120, 95+120); p.quadTo(35+120, 90+120, 34+120, 63+120); 326 p.moveTo(59+120, 99+120); p.quadTo(75+120, 75+120, 71+120, 22+120); 327 p.moveTo(66+120, 98+120); p.quadTo(85+120, 75+120, 82+120, 27+120); 328 p.moveTo(55+120, 97+120); p.quadTo(110+120, 50+120, 106+120, 30+120); 329 g2.draw(p); 330 } 331 332 public static final Symbol SeagrassP = new Symbol(); 333 static { 334 SeagrassP.add(new Instr(Form.BBOX, new Rectangle2D.Double(-60, -60, 120, 120))); 335 SeagrassP.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND))); 336 SeagrassP.add(new Instr(Form.FILL, new Color(0x2E8E20))); 337 Path2D.Double p = new Path2D.Double(); 338 p.moveTo(30, 40); p.quadTo(-10, 33, -31, 50); 339 p.moveTo(18, 38); p.quadTo(60, 15, 55, -10); 340 p.moveTo(-15, 40); p.quadTo(5, 20, -5, 0); p.quadTo(-10, -25, 0, -50); 341 p.moveTo(-28, 48); p.quadTo(-10, 30, -17, 10); p.quadTo(-25, -20, -19, -42); 342 p.moveTo(-28, 48); p.quadTo(-60, 10, -44, -14); 343 p.moveTo(-18, 43); p.quadTo(-47, 15, -28, -29); 344 p.moveTo(-37, 35); p.quadTo(-25, 30, -26, 3); 345 p.moveTo(-1, 39); p.quadTo(15, 15, 11, -38); 346 p.moveTo(6, 38); p.quadTo(25, 15, 22, -33); 347 SeagrassP.add(new Instr(Form.PLIN, p)); 348 } 349 350 public static final Symbol Rocks = new Symbol(); 351 static { 352 Rocks.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30, -60, 60, 120))); 353 Rocks.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND))); 354 Path2D.Double p = new Path2D.Double(); 355 p.moveTo(8, -50); p.quadTo(5, -58, 0, -60); p.quadTo(-15, -50, -8, -30); p.quadTo(-10, -20, 0, -15); p.quadTo(10, -10, 15, -25); 356 p.moveTo(0, -15); p.quadTo(-18, -6, -12, 10); p.quadTo(-9, 20, 0, 20); p.quadTo(8, 16, 12, 25); 357 p.moveTo(0, 20); p.quadTo(-15, 26, -10, 44); p.quadTo(-12, 55, 0, 60); 358 Rocks.add(new Instr(Form.PLIN, p)); 359 } 360 361 public static final Symbol Coral = new Symbol(); 362 static { 363 Coral.add(new Instr(Form.BBOX, new Rectangle2D.Double(-20, -60, 40, 120))); 364 Coral.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND))); 365 Path2D.Double p = new Path2D.Double(); p.moveTo(0, -60); p.lineTo(0, -50); p.moveTo(15, -48); p.lineTo(-20, -50); 366 p.lineTo(0, -30); p.lineTo(-20, -20); p.lineTo(10, 0); p.lineTo(-20, 20); p.lineTo(0, 30); p.lineTo(-20, 50); 367 p.lineTo(20, 45); p.moveTo(0, 49); p.lineTo(0, 60); 368 Coral.add(new Instr(Form.PLIN, p)); 369 } 370 371 public static final BufferedImage Kelp = new BufferedImage(240, 240, BufferedImage.TYPE_INT_ARGB); 372 static { 373 Graphics2D g2 = Kelp.createGraphics(); 313 374 g2.setStroke(new BasicStroke(6, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); 314 375 g2.setBackground(new Color(0, true)); … … 322 383 g2.draw(p); 323 384 } 385 386 public static final Symbol KelpP = new Symbol(); 387 static { 388 KelpP.add(new Instr(Form.BBOX, new Rectangle2D.Double(-60, -60, 120, 120))); 389 KelpP.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND))); 390 Path2D.Double p = new Path2D.Double(); 391 p.moveTo(-60, 0); p.curveTo(-20, -20, -16, 40, 24, 20); p.moveTo(-60, 0); p.quadTo(-48, 20, -32, 12); p.moveTo(-36, -4); p.quadTo(-24, -24, -4, -16); p.quadTo(8, -32, 20, -24); 392 p.moveTo(-4, -16); p.quadTo(8, 0, 20, -8); p.moveTo(-8, 16); p.quadTo(12, 0, 36, 8); p.quadTo(48, 24, 60, 16); p.moveTo(36, 8); p.quadTo(48, -8, 60, 0); 393 KelpP.add(new Instr(Form.PLIN, p)); 394 } 324 395 } -
applications/editors/josm/plugins/seachart/src/symbols/Symbols.java
r34652 r36267 153 153 } 154 154 155 public static class Symbol extends ArrayList<Instr> {156 155 @SuppressWarnings("serial") 156 public static class Symbol extends ArrayList<Instr> { 157 157 public Symbol() { 158 158 super();
Note:
See TracChangeset
for help on using the changeset viewer.