Changeset 32380 in osm for applications/editors/josm/plugins/seachart
- Timestamp:
- 2016-06-23T14:17:55+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/seachart
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/jicons/src/jicons/Jicons.java
r32082 r32380 208 208 209 209 public RuleSet ruleset() { 210 return RuleSet. SEAMARK;210 return RuleSet.ALL; 211 211 } 212 212 } -
applications/editors/josm/plugins/seachart/josmtos57/src/josmtos57/Josmtos57.java
r32368 r32380 86 86 in = new BufferedReader(new FileReader(new File(args[0]))); 87 87 try { 88 S57osm.OSMmap(in, map, true);88 S57osm.OSMmap(in, map, false); 89 89 } catch (Exception e) { 90 90 System.err.println("Input data error"); -
applications/editors/josm/plugins/seachart/src/render/Renderer.java
r32101 r32380 391 391 if ((str == null) || (str.isEmpty())) str = " "; 392 392 FontRenderContext frc = g2.getFontRenderContext(); 393 GlyphVector gv = font.deriveFont((float)(font.getSize())).createGlyphVector(frc, str.equals(" ") ? " !" : str);393 GlyphVector gv = font.deriveFont((float)(font.getSize())).createGlyphVector(frc, str.equals(" ") ? "M" : str); 394 394 Rectangle2D bounds = gv.getVisualBounds(); 395 395 double width = bounds.getWidth(); … … 485 485 } 486 486 487 public static void lineText(String str, Font font, Color colour, double offset, doubledy) {487 public static void lineText(String str, Font font, Color colour, double dy) { 488 488 if (!str.isEmpty()) { 489 489 g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 490 g2.setPaint(colour); 491 FontRenderContext frc = g2.getFontRenderContext(); 492 GlyphVector gv = font.deriveFont(font.getSize2D() * (float)sScale).createGlyphVector(frc, (" " + str)); 493 GeneralPath path = new GeneralPath(); 494 Point2D prev = new Point2D.Double(); 495 Point2D next = new Point2D.Double(); 496 Point2D curr = new Point2D.Double(); 497 Point2D succ = new Point2D.Double(); 498 boolean piv = false; 499 double angle = 0; 500 int index = 0; 501 double gwidth = offset * (Rules.feature.geom.length * context.mile(Rules.feature) - gv.getLogicalBounds().getWidth()) + gv.getGlyphMetrics(0).getAdvance(); 502 GeomIterator git = map.new GeomIterator(Rules.feature.geom); 503 while (git.hasComp()) { 504 git.nextComp(); 505 boolean first = true; 506 while (git.hasEdge()) { 507 git.nextEdge(); 508 while (git.hasNode()) { 509 Snode node = git.next(); 510 if (node == null) continue; 511 prev = next; 512 next = context.getPoint(node); 513 angle = Math.atan2(next.getY() - prev.getY(), next.getX() - prev.getX()); 514 piv = true; 515 if (first) { 516 curr = succ = next; 517 first = false; 518 } else { 519 while (curr.distance(next) >= gwidth) { 520 if (piv) { 521 double rem = gwidth; 522 double s = prev.distance(next); 523 double p = curr.distance(prev); 524 if ((s > 0) && (p > 0)) { 525 double n = curr.distance(next); 526 double theta = Math.acos((s * s + p * p - n * n) / 2 / s / p); 527 double phi = Math.asin(p / gwidth * Math.sin(theta)); 528 rem = gwidth * Math.sin(Math.PI - theta - phi) / Math.sin(theta); 529 } 530 succ = new Point2D.Double(prev.getX() + (rem * Math.cos(angle)), prev.getY() + (rem * Math.sin(angle))); 531 piv = false; 490 g2.setPaint(colour); 491 FontRenderContext frc = g2.getFontRenderContext(); 492 GlyphVector gv = font.deriveFont(font.getSize2D() * (float) sScale).createGlyphVector(frc, str); 493 double width = gv.getVisualBounds().getWidth(); 494 double height = gv.getVisualBounds().getHeight(); 495 double offset = (Rules.feature.geom.length * context.mile(Rules.feature) - width) / 2; 496 if (offset > 0) { 497 Point2D before = null; 498 Point2D after = null; 499 ArrayList<Point2D> between = new ArrayList<>(); 500 Point2D prev = null; 501 Point2D next = null; 502 double length = 0; 503 double lb = 0; 504 double la = 0; 505 GeomIterator git = map.new GeomIterator(Rules.feature.geom); 506 if (git.hasComp()) { 507 git.nextComp(); 508 while (git.hasEdge()) { 509 git.nextEdge(); 510 while (git.hasNode()) { 511 Snode node = git.next(); 512 if (node == null) 513 continue; 514 prev = next; 515 next = context.getPoint(node); 516 if (prev != null) 517 length += Math.sqrt(Math.pow((next.getX() - prev.getX()), 2) + Math.pow((next.getY() - prev.getY()), 2)); 518 if (length < offset) { 519 before = next; 520 lb = la = length; 521 } else if (after == null) { 522 if (length > (offset + width)) { 523 after = next; 524 la = length; 525 break; 532 526 } else { 533 succ = new Point2D.Double(curr.getX() + (gwidth * Math.cos(angle)), curr.getY() + (gwidth * Math.sin(angle))); 534 } 535 Shape shape = gv.getGlyphOutline(index); 536 Point2D point = gv.getGlyphPosition(index); 537 AffineTransform at = AffineTransform.getTranslateInstance(curr.getX(), curr.getY()); 538 at.rotate(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX()))); 539 at.translate(-point.getX(), -point.getY() + (dy * sScale)); 540 path.append(at.createTransformedShape(shape), false); 541 curr = succ; 542 if (++index < gv.getNumGlyphs()) { 543 gwidth = gv.getGlyphMetrics(index).getAdvance(); 544 } else { 545 g2.fill(path); 546 return; 527 between.add(next); 547 528 } 548 529 } 549 530 } 531 if (after != null) 532 break; 550 533 } 534 } 535 if (after != null) { 536 double angle = Math.atan2((after.getY() - before.getY()), (after.getX() - before.getX())); 537 double rotate = Math.abs(angle) < (Math.PI / 2) ? angle : angle + Math.PI; 538 Point2D mid = new Point2D.Double((before.getX() + after.getX()) / 2, (before.getY() + after.getY()) / 2); 539 Point2D centre = context.getPoint(Rules.feature.geom.centre); 540 AffineTransform pos = AffineTransform.getTranslateInstance(-dy * Math.sin(rotate), dy * Math.cos(rotate)); 541 pos.rotate(rotate); 542 pos.translate((mid.getX() - centre.getX()), (mid.getY() - centre.getY())); 543 Symbol label = new Symbol(); 544 label.add(new Instr(Form.BBOX, new Rectangle2D.Double((-width / 2), (-height), width, height))); 545 label.add(new Instr(Form.TEXT, new Caption(str, font, colour, new Delta(Handle.BC)))); 546 Symbols.drawSymbol(g2, label, sScale, centre.getX(), centre.getY(), null, new Delta(Handle.BC, pos)); 551 547 } 552 548 } … … 580 576 } 581 577 if ((str != null) && (!str.isEmpty())) { 582 FontRenderContext frc = g2.getFontRenderContext();583 578 Font font = new Font("Arial", Font.PLAIN, 40); 584 GlyphVector gv = font.deriveFont(font.getSize2D() * (float)sScale).createGlyphVector(frc, str);585 579 double arc = (s2 > s1) ? (s2 - s1) : (s2 - s1 + 360); 586 580 double awidth = (Math.toRadians(arc) * radial); … … 589 583 radial += 30 * sScale; 590 584 AffineTransform at = AffineTransform.getTranslateInstance(-radial * Math.sin(phi) / sScale, radial * Math.cos(phi) / sScale); 591 if ( gv.getLogicalBounds().getWidth() < awidth) {585 if ((font.getSize() * sScale * str.length()) < awidth) { 592 586 at.rotate(Math.toRadians(mid + (hand ? 0 : 180))); 593 Renderer.labelText(str, font, Color.black, new Delta(Handle.CC, at));594 } else if ( gv.getLogicalBounds().getHeight() < awidth) {587 labelText(str, font, Color.black, new Delta(Handle.CC, at)); 588 } else if ((font.getSize() * sScale) < awidth) { 595 589 hand = (mid < 180); 596 590 at.rotate(Math.toRadians(mid + (hand ? -90 : 90))); 597 Renderer.labelText(str, font, Color.black, hand ? new Delta(Handle.RC, at) : new Delta(Handle.LC, at));591 labelText(str, font, Color.black, hand ? new Delta(Handle.RC, at) : new Delta(Handle.LC, at)); 598 592 } 599 593 if (dir != null) { … … 605 599 at = AffineTransform.getTranslateInstance(-radial * Math.sin(phi) / sScale, radial * Math.cos(phi) / sScale); 606 600 at.rotate(Math.toRadians(dir + (hand ? 90 : -90))); 607 Renderer.labelText(str, font, Color.black, hand ? new Delta(Handle.BR, at) : new Delta(Handle.BL, at));601 labelText(str, font, Color.black, hand ? new Delta(Handle.BR, at) : new Delta(Handle.BL, at)); 608 602 } 609 603 } -
applications/editors/josm/plugins/seachart/src/render/Rules.java
r32105 r32380 215 215 if (testObject(Obj.ROADWY)) for (Feature f : objects) if (testFeature(f)) highways(); 216 216 if (testObject(Obj.RAILWY)) for (Feature f : objects) if (testFeature(f)) highways(); 217 } 218 if (Renderer.context.ruleset() == RuleSet.ALL) { 219 if (testObject(Obj.SOUNDG)) for (Feature f : objects) if (testFeature(f)) depths(); 220 if (testObject(Obj.DEPCNT)) for (Feature f : objects) if (testFeature(f)) depths(); 217 221 } 218 222 if (testObject(Obj.SLCONS)) for (Feature f : objects) if (testFeature(f)) shoreline(); … … 388 392 if ((Renderer.zoom >= 10) && (name != null)) 389 393 if (feature.geom.prim == Pflag.LINE) { 390 Renderer.lineText(name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5,-40);394 Renderer.lineText(name, new Font("Arial", Font.PLAIN, 150), Color.black, -40); 391 395 } else { 392 396 Renderer.labelText(name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); … … 396 400 if ((Renderer.zoom >= 12) && (name != null)) 397 401 if (feature.geom.prim == Pflag.LINE) { 398 Renderer.lineText(name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5,-40);402 Renderer.lineText(name, new Font("Arial", Font.PLAIN, 150), Color.black, -40); 399 403 } else { 400 404 Renderer.labelText(name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); … … 411 415 } else if (feature.geom.prim == Pflag.LINE) { 412 416 if (name != null) { 413 Renderer.lineText(name, new Font("Arial", Font.ITALIC, 75), Color.black, 0.5,-40);414 Renderer.lineText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, 0 .5, 0);417 Renderer.lineText(name, new Font("Arial", Font.ITALIC, 75), Color.black, -40); 418 Renderer.lineText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, 0); 415 419 } 416 420 } else { … … 503 507 } 504 508 } 509 if (hasObject(Obj.NOTMRK)) 510 notices(); 505 511 addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50))); 506 512 Signals.addSignals(); … … 608 614 Renderer.labelText(("Ch." + chn), new Font("Arial", Font.PLAIN, 50), Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,50))); 609 615 } 616 } 617 } 618 619 private static void depths() { 620 switch (feature.type) { 621 case SOUNDG: 622 if ((Renderer.zoom >= 14) && hasAttribute(Obj.SOUNDG, Att.VALSOU)) { 623 double depth = (double)getAttVal(Obj.SOUNDG, Att.VALSOU); 624 String dstr = df.format(depth); 625 String tok[] = dstr.split("[-.]"); 626 String ul = ""; 627 String id = tok[0]; 628 String dd = ""; 629 if (tok[0].equals("")) { 630 for (int i = 0; i < tok[1].length(); i++) 631 ul += "_"; 632 id = tok[1]; 633 dd = (tok.length == 3) ? tok[2] : ""; 634 } else { 635 dd = (tok.length == 2) ? tok[1] : ""; 636 } 637 Renderer.labelText(ul, new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.RC, AffineTransform.getTranslateInstance(10,15))); 638 Renderer.labelText(id, new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.RC, AffineTransform.getTranslateInstance(10,0))); 639 Renderer.labelText(dd, new Font("Arial", Font.PLAIN, 20), Color.black, new Delta(Handle.LC, AffineTransform.getTranslateInstance(15,10))); 640 } 641 break; 642 case DEPCNT: 643 break; 644 default: 645 break; 610 646 } 611 647 } … … 700 736 case ACHBRT: 701 737 if (Renderer.zoom >= 14) { 702 Renderer.symbol(Harbours.Anchor age, new Scheme(Symbols.Mline));738 Renderer.symbol(Harbours.Anchor, new Scheme(Symbols.Msymb)); 703 739 if (Renderer.zoom >= 15) { 704 Renderer.labelText(name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Symbols.Msymb, LabelStyle.RRCT, Symbols.M line, Color.white, new Delta(Handle.BC));740 Renderer.labelText(name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Symbols.Msymb, LabelStyle.RRCT, Symbols.Msymb, Color.white, new Delta(Handle.BC)); 705 741 } 706 742 } … … 993 1029 } 994 1030 1031 @SuppressWarnings("unchecked") 995 1032 private static void notices() { 996 1033 if (Renderer.zoom >= 14) { … … 1002 1039 case BCNSAW: 1003 1040 case BCNSPP: 1004 dy = 45.0; 1041 if (testAttribute(Obj.TOPMAR, Att.TOPSHP, TopSHP.TOP_BORD) || testAttribute(Obj.DAYMAR, Att.TOPSHP, TopSHP.TOP_BORD)) { 1042 dy = -100.0; 1043 } else { 1044 dy = -45.0; 1045 } 1005 1046 break; 1006 1047 case NOTMRK: … … 1023 1064 int i = 0; 1024 1065 for (AttMap atts : objs.values()) { 1025 if (atts.get(Att.MARSYS) != null) sys = ( MarSYS)(getAttEnum(Obj.NOTMRK,Att.MARSYS));1026 if (atts.get(Att.BNKWTW) != null) bnk = ( BnkWTW)(getAttEnum(Obj.NOTMRK,Att.BNKWTW));1066 if (atts.get(Att.MARSYS) != null) sys = ((ArrayList<MarSYS>)(atts.get(Att.MARSYS).val)).get(0); 1067 if (atts.get(Att.BNKWTW) != null) bnk = ((ArrayList<BnkWTW>)(atts.get(Att.BNKWTW).val)).get(0); 1027 1068 CatNMK cat = CatNMK.NMK_UNKN; 1028 if (atts.get(Att.CATNMK) != null) cat = ( CatNMK)(getAttEnum(Obj.NOTMRK,Att.CATNMK));1069 if (atts.get(Att.CATNMK) != null) cat = ((ArrayList<CatNMK>)(atts.get(Att.CATNMK).val)).get(0); 1029 1070 Symbol sym = Notices.getNotice(cat, sys, bnk); 1030 1071 Scheme sch = Notices.getScheme(sys, bnk); 1072 ArrayList<AddMRK> add = new ArrayList<>(); 1073 if (atts.get(Att.ADDMRK) != null) add = (ArrayList<AddMRK>)(atts.get(Att.ADDMRK).val); 1031 1074 Handle h = Handle.CC; 1075 double ax = 0.0; 1076 double ay = 0.0; 1032 1077 switch (i) { 1033 1078 case 0: … … 1035 1080 break; 1036 1081 case 1: 1037 if (n <= 3) 1082 if (n <= 3) { 1038 1083 h = Handle.RC; 1039 else 1084 ax = -30; 1085 ay = dy; 1086 } 1087 else { 1040 1088 h = Handle.BR; 1089 } 1041 1090 break; 1042 1091 case 2: … … 1056 1105 break; 1057 1106 } 1058 if (h != null) Renderer.symbol(sym, sch, new Delta(h, AffineTransform.getTranslateInstance(dx, dy))); 1107 if (h != null) { 1108 Renderer.symbol(sym, sch, new Delta(h, AffineTransform.getTranslateInstance(dx, dy))); 1109 if (!add.isEmpty()) Renderer.symbol(Notices.NoticeBoard, new Delta(Handle.BC, AffineTransform.getTranslateInstance(ax, ay - 30))); 1110 } 1059 1111 i++; 1060 1112 } … … 1069 1121 Renderer.lineVector(new LineStyle(Color.black, 5, new float[] { 20, 20 }, null)); 1070 1122 if (Renderer.zoom >= 15) { 1071 Renderer.lineText("Boom", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5,-20);1123 Renderer.lineText("Boom", new Font("Arial", Font.PLAIN, 80), Color.black, -20); 1072 1124 } 1073 1125 default: … … 1186 1238 Renderer.lineVector(new LineStyle(Color.black, 10, new float[] { 40, 40 }, null)); 1187 1239 if (Renderer.zoom >= 15) 1188 Renderer.lineText("(covers)", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5,80);1240 Renderer.lineText("(covers)", new Font("Arial", Font.PLAIN, 60), Color.black, 80); 1189 1241 } else { 1190 1242 Renderer.lineVector(new LineStyle(Color.black, 10, null, null)); 1191 1243 } 1192 1244 if (Renderer.zoom >= 15) 1193 Renderer.lineText("Training Wall", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5,-30);1245 Renderer.lineText("Training Wall", new Font("Arial", Font.PLAIN, 60), Color.black, -30); 1194 1246 break; 1195 1247 case SLC_SWAY: … … 1333 1385 str += df.format(ort) + "º"; 1334 1386 if (!str.isEmpty()) 1335 Renderer.lineText(str, new Font("Arial", Font.PLAIN, 80), Color.black, 0.5,-20);1387 Renderer.lineText(str, new Font("Arial", Font.PLAIN, 80), Color.black, -20); 1336 1388 } 1337 1389 } -
applications/editors/josm/plugins/seachart/src/s57/S57dat.java
r31846 r32380 224 224 } else { 225 225 int f = Math.abs(conv.bin); 226 if (f < 8) {226 if (f < 5) { 227 227 long val = buffer[offset + --f]; 228 228 if (conv.bin > 0) … … 253 253 return val; 254 254 } else { 255 f /= 8; 256 long val = 0; 257 for (int i = 0; i < f; i++) { 255 if (f == 5) { 256 long val = buffer[offset++] & 0xff; 257 f--; 258 while (f > 0) { 259 val = (val << 8) + (buffer[offset + --f] & 0xff); 260 } 261 offset += 4; 262 return val; 263 } else { 264 long val = buffer[offset++] & 0xff; 258 265 val = (val << 8) + (buffer[offset++] & 0xff); 259 } 260 return val; 266 f = 4; 267 while (f > 0) { 268 val = (val << 8) + (buffer[offset + --f] & 0xff); 269 } 270 offset += 4; 271 f = 2; 272 while (f > 0) { 273 val = (val << 8) + (buffer[offset + --f] & 0xff); 274 } 275 offset += 2; 276 return val; 277 } 261 278 } 262 279 } -
applications/editors/josm/plugins/seachart/src/s57/S57dec.java
r31722 r32380 21 21 S57dat.rnum = 0; 22 22 byte[] leader = new byte[24]; 23 byte[] record = new byte[0]; 23 24 boolean ddr = false; 24 25 int length = 0; … … 40 41 try { 41 42 length = Integer.parseInt(new String(leader, 0, 5)) - 24; 43 record = new byte[length]; 42 44 ddr = (leader[6] == 'L'); 43 45 fields = Integer.parseInt(new String(leader, 12, 5)) - 24; … … 50 52 mapts = leader[23] - '0'; 51 53 entry = mapfl + mapfp + mapts; 52 byte[] record = new byte[length];53 54 if (in.read(record) != length) 54 55 break; … … 61 62 case "0001": 62 63 int i8rn = ((Long) S57dat.decSubf(record, fields + pos, S57field.I8RI, S57subf.I8RN)).intValue(); 63 if (i8rn != ++S57dat.rnum) { 64 System.err.println("Out of order record ID"); 65 in.close(); 66 System.exit(-1); 67 } 64 // if (i8rn != ++S57dat.rnum) { 65 // System.err.println("Out of order record ID"); 66 // in.close(); 67 // System.exit(-1); 68 // } 68 69 break; 69 70 case "DSSI": … … 93 94 break; 94 95 case "FOID": 95 name = ( Long) S57dat.decSubf(record, fields + pos, S57field.LNAM, S57subf.LNAM);96 name = (long) S57dat.decSubf(record, fields + pos, S57field.LNAM, S57subf.LNAM); 96 97 map.newFeature(name, pflag, objl); 97 98 break; … … 109 110 S57dat.setField(record, fields + pos, S57field.FFPT, len); 110 111 do { 111 name = ( Long) S57dat.decSubf(S57subf.LNAM);112 name = (long) S57dat.decSubf(S57subf.LNAM); 112 113 int rind = ((Long) S57dat.decSubf(S57subf.RIND)).intValue(); 113 114 S57dat.decSubf(S57subf.COMT); 114 map. newObj(name, rind);115 map.refObj(name, rind); 115 116 } while (S57dat.more()); 116 117 break; … … 118 119 S57dat.setField(record, fields + pos, S57field.FSPT, len); 119 120 do { 120 name = ( Long) S57dat.decSubf(S57subf.NAME) << 16;121 name = (long) S57dat.decSubf(S57subf.NAME) << 16; 121 122 map.newPrim(name, (Long) S57dat.decSubf(S57subf.ORNT), (Long) S57dat.decSubf(S57subf.USAG)); 122 123 S57dat.decSubf(S57subf.MASK); … … 138 139 } 139 140 name <<= 32; 140 name += ( Long) S57dat.decSubf(S57subf.RCID);141 name += (long) S57dat.decSubf(S57subf.RCID); 141 142 name <<= 16; 142 143 if (nflag == Nflag.ANON) { -
applications/editors/josm/plugins/seachart/src/s57/S57map.java
r32090 r32380 273 273 } 274 274 275 public void newObj(long id, int rind) {275 public void refObj(long id, int rind) { 276 276 Rflag r = Rflag.UNKN; 277 277 switch (rind) { -
applications/editors/josm/plugins/seachart/src/s57/S57val.java
r32101 r32380 812 812 Catnmk.put(CatNMK.NMK_WEIR, new S57enum(52, "weir")); Catnmk.put(CatNMK.NMK_FERN, new S57enum(53, "ferry_non_independent")); Catnmk.put(CatNMK.NMK_FERI, new S57enum(54, "ferry_independent")); 813 813 Catnmk.put(CatNMK.NMK_BRTP, new S57enum(55, "berthing_permitted")); Catnmk.put(CatNMK.NMK_BTLL, new S57enum(56, "berthing_lateral_limit")); Catnmk.put(CatNMK.NMK_BTLS, new S57enum(57, "berthing_lateral_limits")); 814 Catnmk.put(CatNMK.NMK_BTRL, new S57enum(58, "berth ing_rafting_limit")); Catnmk.put(CatNMK.NMK_BTUP, new S57enum(59, "berthing_unmarked_pushing"));814 Catnmk.put(CatNMK.NMK_BTRL, new S57enum(58, "berth_rafting_limit")); Catnmk.put(CatNMK.NMK_BTUP, new S57enum(59, "berthing_unmarked_pushing")); 815 815 Catnmk.put(CatNMK.NMK_BTP1, new S57enum(60, "berthing_marked_pushing_1")); Catnmk.put(CatNMK.NMK_BTP2, new S57enum(61, "berthing_marked_pushing_2")); 816 816 Catnmk.put(CatNMK.NMK_BTP3, new S57enum(62, "berthing_marked_pushing_3")); Catnmk.put(CatNMK.NMK_BTUN, new S57enum(63, "berthing_unmarked_non-pushing")); -
applications/editors/josm/plugins/seachart/src/symbols/Notices.java
r32101 r32380 1037 1037 NoticeE24.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Notices.NoticeE, 1.0, 0, 0, null, null))); 1038 1038 NoticeE24.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Notices.Waterbike, 1.0, 0, 0, new Scheme(Color.white), null))); 1039 } 1040 1041 public static final Symbol NoticeBoard = new Symbol(); 1042 static { 1043 NoticeBoard.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30,-30,60,30))); 1044 NoticeBoard.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 1045 Path2D.Double p = new Path2D.Double(); p.moveTo(-20,0); p.lineTo(20,0); p.lineTo(20,-15); p.lineTo(-20,-15); p.closePath(); 1046 NoticeBoard.add(new Instr(Form.FILL, Color.white)); 1047 NoticeBoard.add(new Instr(Form.PGON, p)); 1048 NoticeBoard.add(new Instr(Form.FILL, Color.black)); 1049 NoticeBoard.add(new Instr(Form.PLIN, p)); 1050 } 1051 public static final Symbol NoticeTriangle = new Symbol(); 1052 static { 1053 NoticeTriangle.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30,-30,60,30))); 1054 NoticeTriangle.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 1055 Path2D.Double p = new Path2D.Double(); p.moveTo(-20,0); p.lineTo(20,0); p.lineTo(0,-15); p.closePath(); 1056 NoticeTriangle.add(new Instr(Form.FILL, Color.white)); 1057 NoticeTriangle.add(new Instr(Form.PGON, p)); 1058 NoticeTriangle.add(new Instr(Form.FILL, Color.black)); 1059 NoticeTriangle.add(new Instr(Form.PLIN, p)); 1039 1060 } 1040 1061 -
applications/editors/josm/plugins/seachart/src/symbols/Symbols.java
r32101 r32380 21 21 22 22 public static final Color Yland = new Color(0xedbc0c); 23 public static final Color Bwater = new Color(0x78acd2); 23 // public static final Color Bwater = new Color(0x78acd2); 24 public static final Color Bwater = new Color(0x9bc5e3); 24 25 public static final Color Gdries = new Color(0x689868); 25 26 public static final Color Mline = new Color(0x9a6078); -
applications/editors/josm/plugins/seachart/src/symbols/Topmarks.java
r32101 r32380 47 47 public static final Symbol TopBoard = new Symbol(); 48 48 static { 49 TopBoard.add(new Instr(Form.BBOX, new Rectangle2D.Double(-20,-80,40,80))); 50 Symbol colours = new Symbol(); 51 Path2D.Double p = new Path2D.Double(); p.moveTo(-19.0,-2.0); p.lineTo(-19.0,-39.0); p.lineTo(19.0,-39.0); p.lineTo(19.0,-2.0); p.closePath(); 52 colours.add(new Instr(Form.P1, p)); 49 TopBoard.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30,-60,60,60))); 50 Symbol colours = new Symbol(); 51 Path2D.Double p = new Path2D.Double(); p.moveTo(-29,-1); p.lineTo(-29,-59); p.lineTo(29,-59); p.lineTo(29,-1); p.closePath(); 52 colours.add(new Instr(Form.P1, p)); 53 p = new Path2D.Double(); p.setWindingRule(GeneralPath.WIND_EVEN_ODD); 54 p.moveTo(-29,-1); p.lineTo(-29,-59); p.lineTo(29,-59); p.lineTo(29,-1); p.closePath(); 55 p.moveTo(-19,-10); p.lineTo(-19,-49); p.lineTo(19,-49); p.lineTo(19,-10); p.closePath(); 56 colours.add(new Instr(Form.B1, p)); 57 p = new Path2D.Double(); p.setWindingRule(GeneralPath.WIND_EVEN_ODD); 58 p.moveTo(-29,-1); p.lineTo(-29,-30); p.lineTo(29,-30); p.lineTo(29,-59); p.lineTo(0,-59); p.lineTo(0,-1); p.closePath(); 59 colours.add(new Instr(Form.S2, p)); 60 p = new Path2D.Double(); p.moveTo(-29,-1); p.lineTo(-29,-30); p.lineTo(0,-30); p.lineTo(0,-1); p.closePath(); 61 colours.add(new Instr(Form.S3, p)); 62 p = new Path2D.Double(); p.moveTo(0,-1); p.lineTo(0,-30); p.lineTo(29,-30); p.lineTo(29,-1); p.closePath(); 63 colours.add(new Instr(Form.S4, p)); 53 64 TopBoard.add(new Instr(Form.COLR, colours)); 54 65 TopBoard.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 55 66 TopBoard.add(new Instr(Form.FILL, Color.black)); 56 p = new Path2D.Double(); p.moveTo(- 19.0,-2.0); p.lineTo(-19.0,-39.0); p.lineTo(19.0,-39.0); p.lineTo(19.0,-2.0); p.closePath();67 p = new Path2D.Double(); p.moveTo(-29,-1); p.lineTo(-29,-59); p.lineTo(29,-59); p.lineTo(29.0,-1); p.closePath(); 57 68 TopBoard.add(new Instr(Form.PLIN, p)); 58 69 } … … 70 81 TopCan.add(new Instr(Form.PLIN, p)); 71 82 } 83 public static final Symbol TopCanSphere = new Symbol(); 84 public static final Symbol TopCircle = new Symbol(); 85 public static final Symbol TopCircleTriangle = new Symbol(); 72 86 public static final Symbol TopCone = new Symbol(); 73 87 static { … … 82 96 p = new Path2D.Double(); p.moveTo(-15.0,-15.0); p.lineTo(0.0,-45.0); p.lineTo(15.0,-15.0); p.closePath(); 83 97 TopCone.add(new Instr(Form.PLIN, p)); 98 } 99 public static final Symbol TopConeSphere = new Symbol(); 100 static { 101 TopConeSphere.add(new Instr(Form.BBOX, new Rectangle2D.Double(-20,-80,40,80))); 102 Symbol colours = new Symbol(); 103 Path2D.Double p = new Path2D.Double(); p.moveTo(-15.0,-47.0); p.lineTo(0.0,-77.0); p.lineTo(15.0,-47.0); p.closePath(); 104 p.moveTo(-14.0,-28.0); p.curveTo(-14.0,-46.7,14.0,-46.7,14.0,-28.0); p.curveTo(14.0,-9.3,-14.0,-9.3,-14.0,-28.0); p.closePath(); 105 colours.add(new Instr(Form.P1, p)); 106 TopConeSphere.add(new Instr(Form.COLR, colours)); 107 TopConeSphere.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 108 TopConeSphere.add(new Instr(Form.FILL, Color.black)); 109 TopConeSphere.add(new Instr(Form.LINE, new Line2D.Double(0,0,0,-15))); 110 TopConeSphere.add(new Instr(Form.LINE, new Line2D.Double(0,-42,0,-47))); 111 p = new Path2D.Double(); p.moveTo(-15.0,-47.0); p.lineTo(0.0,-77.0); p.lineTo(15.0,-47.0); p.closePath(); 112 TopConeSphere.add(new Instr(Form.ELPS, new Ellipse2D.Double(-14,-42,28,28))); 113 TopConeSphere.add(new Instr(Form.PLIN, p)); 84 114 } 85 115 public static final Symbol TopCross = new Symbol(); … … 98 128 p.lineTo(5.0,-60.0); p.lineTo(5.0,-42.5); p.lineTo(22.5,-42.5); p.lineTo(22.5,-32.5); p.lineTo(5.0,-32.5); p.lineTo(5.0,-15.0); p.closePath(); 99 129 TopCross.add(new Instr(Form.PLIN, p)); 130 } 131 public static final Symbol TopCrosses = new Symbol(); 132 static { 133 134 } 135 public static final Symbol TopCrossCircle = new Symbol(); 136 static { 137 138 } 139 public static final Symbol TopCube = new Symbol(); 140 static { 141 TopCube.add(new Instr(Form.BBOX, new Rectangle2D.Double(-20,-80,40,80))); 142 Symbol colours = new Symbol(); 143 Path2D.Double p = new Path2D.Double(); p.moveTo(0,-48); p.lineTo(-15,-37); p.lineTo(-15,-20); p.lineTo(0,-9); p.lineTo(15,-20); p.lineTo(15,-37); p.closePath(); 144 colours.add(new Instr(Form.P1, p)); 145 TopCube.add(new Instr(Form.COLR, colours)); 146 TopCube.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 147 TopCube.add(new Instr(Form.FILL, Color.black)); 148 TopCube.add(new Instr(Form.LINE, new Line2D.Double(0,0,0,-15))); 149 p = new Path2D.Double(); p.moveTo(0,-48); p.lineTo(-14,-37); p.lineTo(0,-26); p.lineTo(14,-37); p.closePath(); p.moveTo(0,-26); p.lineTo(0,0); 150 p.moveTo(-15,-37); p.lineTo(-15,-20); p.lineTo(0,-9); p.lineTo(15,-20); p.lineTo(15,-37); 151 TopCube.add(new Instr(Form.PLIN, p)); 100 152 } 101 153 public static final Symbol TopEast = new Symbol(); … … 256 308 TopSquare.add(new Instr(Form.PLIN, p)); 257 309 } 310 public static final Symbol TopRectangleH = new Symbol(); 311 static { 312 TopRectangleH.add(new Instr(Form.BBOX, new Rectangle2D.Double(-20,-80,40,80))); 313 Symbol colours = new Symbol(); 314 Path2D.Double p = new Path2D.Double(); p.moveTo(-20.0,-1.0); p.lineTo(-20.0,-27.0); p.lineTo(20.0,-27.0); p.lineTo(20.0,-1.0); p.closePath(); 315 colours.add(new Instr(Form.P1, p)); 316 TopRectangleH.add(new Instr(Form.COLR, colours)); 317 TopRectangleH.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 318 TopRectangleH.add(new Instr(Form.FILL, Color.black)); 319 p = new Path2D.Double(); p.moveTo(-20.0,-1.0); p.lineTo(-20.0,-27.0); p.lineTo(20.0,-27.0); p.lineTo(20.0,-1.0); p.closePath(); 320 TopRectangleH.add(new Instr(Form.PLIN, p)); 321 } 322 public static final Symbol TopRectangleV = new Symbol(); 323 static { 324 TopRectangleV.add(new Instr(Form.BBOX, new Rectangle2D.Double(-20,-80,40,80))); 325 Symbol colours = new Symbol(); 326 Path2D.Double p = new Path2D.Double(); p.moveTo(-13.0,-1.0); p.lineTo(-13.0,-41.0); p.lineTo(13.0,-41.0); p.lineTo(13.0,-1.0); p.closePath(); 327 colours.add(new Instr(Form.P1, p)); 328 TopRectangleV.add(new Instr(Form.COLR, colours)); 329 TopRectangleV.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 330 TopRectangleV.add(new Instr(Form.FILL, Color.black)); 331 p = new Path2D.Double(); p.moveTo(-13.0,-1.0); p.lineTo(-13.0,-41.0); p.lineTo(13.0,-41.0); p.lineTo(13.0,-1.0); p.closePath(); 332 TopRectangleV.add(new Instr(Form.PLIN, p)); 333 } 258 334 public static final Symbol TopRhombus = new Symbol(); 259 335 static { … … 280 356 TopRhombus.add(new Instr(Form.PLIN, p)); 281 357 } 358 public static final Symbol TopRhombusCircle = new Symbol(); 359 static { 360 361 } 362 public static final Symbol TopSphereRhombus = new Symbol(); 363 static { 364 TopSphereRhombus.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30,-80,60,80))); 365 TopSphereRhombus.add(new Instr(Form.SYMB, new Symbols.SubSymbol(TopRhombus, 1.0, 0, 0, null, null))); 366 Symbol colours = new Symbol(); 367 Path2D.Double p = new Path2D.Double(); p.moveTo(-14.0,-44.0); p.curveTo(-14.0,-62.7,14.0,-62.7,14.0,-44.0); p.curveTo(14.0,-25.3,-14.0,-25.3,-14.0,-44.0); p.closePath(); 368 colours.add(new Instr(Form.P1, p)); 369 TopSphereRhombus.add(new Instr(Form.COLR, colours)); 370 TopSphereRhombus.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 371 TopSphereRhombus.add(new Instr(Form.FILL, Color.black)); 372 TopSphereRhombus.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 373 TopSphereRhombus.add(new Instr(Form.ELPS, new Ellipse2D.Double(-14,-58,28,28))); 374 } 375 public static final Symbol TopT = new Symbol(); 376 static { 377 378 } 379 public static final Symbol TopTrapeziumU = new Symbol(); 380 static { 381 TopTrapeziumU.add(new Instr(Form.BBOX, new Rectangle2D.Double(-20,-80,40,80))); 382 Symbol colours = new Symbol(); 383 Path2D.Double p = new Path2D.Double(); p.moveTo(-20.0,-1.0); p.lineTo(-13.0,-27.0); p.lineTo(13.0,-27.0); p.lineTo(20.0,-1.0); p.closePath(); 384 colours.add(new Instr(Form.P1, p)); 385 TopTrapeziumU.add(new Instr(Form.COLR, colours)); 386 TopTrapeziumU.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 387 TopTrapeziumU.add(new Instr(Form.FILL, Color.black)); 388 p = new Path2D.Double(); p.moveTo(-20.0,-1.0); p.lineTo(-13.0,-27.0); p.lineTo(13.0,-27.0); p.lineTo(20.0,-1.0); p.closePath(); 389 TopTrapeziumU.add(new Instr(Form.PLIN, p)); 390 } 391 public static final Symbol TopTrapeziumD = new Symbol(); 392 static { 393 TopTrapeziumD.add(new Instr(Form.BBOX, new Rectangle2D.Double(-20,-80,40,80))); 394 Symbol colours = new Symbol(); 395 Path2D.Double p = new Path2D.Double(); p.moveTo(-13.0,-1.0); p.lineTo(-20.0,-27.0); p.lineTo(20.0,-27.0); p.lineTo(13.0,-1.0); p.closePath(); 396 colours.add(new Instr(Form.P1, p)); 397 TopTrapeziumD.add(new Instr(Form.COLR, colours)); 398 TopTrapeziumD.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 399 TopTrapeziumD.add(new Instr(Form.FILL, Color.black)); 400 p = new Path2D.Double(); p.moveTo(-13.0,-1.0); p.lineTo(-20.0,-27.0); p.lineTo(20.0,-27.0); p.lineTo(13.0,-1.0); p.closePath(); 401 TopTrapeziumD.add(new Instr(Form.PLIN, p)); 402 } 282 403 public static final Symbol TopTriangle = new Symbol(); 283 404 static { … … 311 432 p = new Path2D.Double(); p.moveTo(-15.0,-29.0); p.lineTo(0.0,-1.0); p.lineTo(15.0,-29.0); p.closePath(); 312 433 TopItriangle.add(new Instr(Form.PLIN, p)); 434 } 435 public static final Symbol TopTriangleCircle = new Symbol(); 436 static { 437 313 438 } 314 439 public static final Symbol TopWest = new Symbol(); … … 345 470 TopX.add(new Instr(Form.PLIN, p)); 346 471 } 472 public static final Symbol TopOther = new Symbol(); 473 static { 474 475 } 347 476 348 477 public static final EnumMap<TopSHP, Symbol> Shapes = new EnumMap<TopSHP, Symbol>(TopSHP.class); … … 352 481 Shapes.put(TopSHP.TOP_ISD, TopIsol); Shapes.put(TopSHP.TOP_NORTH, TopNorth); Shapes.put(TopSHP.TOP_SOUTH, TopSouth); Shapes.put(TopSHP.TOP_SPHR, TopSphere); 353 482 Shapes.put(TopSHP.TOP_SQUR, TopSquare); Shapes.put(TopSHP.TOP_TRI, TopTriangle); Shapes.put(TopSHP.TOP_ITRI, TopItriangle); Shapes.put(TopSHP.TOP_WEST, TopWest); 354 Shapes.put(TopSHP.TOP_SALT, TopX); Shapes.put(TopSHP.TOP_RHOM, TopRhombus); Shapes.put(TopSHP.TOP_FLAG, TopFlag); 355 } 356 /* 357 TOP_CUBE, TOP_SPRH, TOP_HRECT, TOP_VRECT, TOP_TRAP, TOP_ITRAP, TOP_CIRC, TOP_CRSS, TOP_T, TOP_TRCL, TOP_CRCL, TOP_RHCL, TOP_CLTR, TOP_OTHR, TOP_CYSP, TOP_COSP 358 */ 483 Shapes.put(TopSHP.TOP_SALT, TopX); Shapes.put(TopSHP.TOP_RHOM, TopRhombus); Shapes.put(TopSHP.TOP_FLAG, TopFlag); Shapes.put(TopSHP.TOP_CUBE, TopCube); 484 Shapes.put(TopSHP.TOP_SPRH, TopSphereRhombus); Shapes.put(TopSHP.TOP_HRECT, TopRectangleH); Shapes.put(TopSHP.TOP_VRECT, TopRectangleV); 485 Shapes.put(TopSHP.TOP_TRAP, TopTrapeziumU); Shapes.put(TopSHP.TOP_ITRAP, TopTrapeziumD); Shapes.put(TopSHP.TOP_COSP, TopConeSphere); 486 Shapes.put(TopSHP.TOP_CIRC, TopCircle); Shapes.put(TopSHP.TOP_CRSS, TopCrosses); Shapes.put(TopSHP.TOP_T, TopT); Shapes.put(TopSHP.TOP_TRCL, TopTriangleCircle); 487 Shapes.put(TopSHP.TOP_CRCL, TopCrossCircle); Shapes.put(TopSHP.TOP_RHCL, TopRhombusCircle); Shapes.put(TopSHP.TOP_CLTR, TopCircleTriangle); 488 Shapes.put(TopSHP.TOP_CYSP, TopCanSphere); Shapes.put(TopSHP.TOP_OTHR, TopOther); 489 } 490 359 491 public static final EnumMap<BoySHP, Delta> BuoyDeltas = new EnumMap<BoySHP, Delta>(BoySHP.class); 360 492 static {
Note:
See TracChangeset
for help on using the changeset viewer.