Changeset 32084 in osm for applications/editors/josm/plugins/seachart
- Timestamp:
- 2016-02-27T16:14:25+01:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/seachart/src/render
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/render/Renderer.java
r32082 r32084 568 568 g2.setStroke(new BasicStroke((float)arcWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1)); 569 569 g2.setPaint(col1); 570 g2.draw(new Arc2D.Double(centre.x - radial, centre.y - radial, 2 * radial, 2 * radial, -(s1 + 90), ( s1 - s2), Arc2D.OPEN));570 g2.draw(new Arc2D.Double(centre.x - radial, centre.y - radial, 2 * radial, 2 * radial, -(s1 + 90), ((s1 < s2) ? (s1 - s2) : (s1 - s2 - 360)), Arc2D.OPEN)); 571 571 if (col2 != null) { 572 572 g2.setPaint(col2); 573 g2.draw(new Arc2D.Double(centre.x - radial + arcWidth, centre.y - radial + arcWidth, 2 * (radial - arcWidth), 2 * (radial - arcWidth), -(s1 + 90), ( s1 - s2), Arc2D.OPEN));573 g2.draw(new Arc2D.Double(centre.x - radial + arcWidth, centre.y - radial + arcWidth, 2 * (radial - arcWidth), 2 * (radial - arcWidth), -(s1 + 90), ((s1 < s2) ? (s1 - s2) : (s1 - s2 - 360)), Arc2D.OPEN)); 574 574 } 575 575 if ((str != null) && (!str.isEmpty())) { … … 584 584 double offset = 0; 585 585 Point2D origin; 586 double arc = (s2 - s1);587 586 if (dir) { 588 587 radial += 10 * sScale; … … 604 603 } 605 604 } else { 605 double arc = (s2 > s1) ? (s2 - s1) : (s2 - s1 + 360); 606 606 double awidth = (Math.toRadians(arc) * radial); 607 607 if (gwidth < awidth) { -
applications/editors/josm/plugins/seachart/src/render/Rules.java
r32082 r32084 465 465 } 466 466 } 467 addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50))); 467 468 Signals.addSignals(feature); 468 469 } … … 486 487 } 487 488 } 489 addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50))); 488 490 Signals.addSignals(feature); 489 491 } … … 629 631 if (feature.objs.get(Obj.TOPMAR) != null) 630 632 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.FloatDelta); 633 addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50))); 631 634 Signals.addSignals(feature); 632 635 } … … 635 638 if (Renderer.zoom >= 14) { 636 639 Renderer.symbol(feature, Harbours.TideGauge); 640 addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50))); 637 641 Signals.addSignals(feature); 638 642 } … … 802 806 Renderer.symbol(feature, catSym); 803 807 Renderer.symbol(feature, fncSym); 804 addName(feature, 15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));808 addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50))); 805 809 Signals.addSignals(feature); 806 810 } … … 1010 1014 } else if (feature.type == Obj.HULKES) { 1011 1015 Renderer.lineVector(feature, new LineStyle(Color.black, 4, null, new Color(0xffe000))); 1012 addName(feature, 15, new Font("Arial", Font.BOLD, 80));1016 addName(feature, 15, new Font("Arial", Font.BOLD, 40)); 1013 1017 } 1014 1018 } … … 1169 1173 case PILBOP: 1170 1174 Renderer.symbol(feature, Harbours.Pilot); 1171 addName(feature, 15, new Font("Arial", Font.BOLD, 50), Symbols.Msymb , new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40)));1175 addName(feature, 15, new Font("Arial", Font.BOLD, 40), Symbols.Msymb , new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40))); 1172 1176 CatPIL cat = (CatPIL) getAttEnum(feature, feature.type, 0, Att.CATPIL); 1173 1177 if (cat == CatPIL.PIL_HELI) { -
applications/editors/josm/plugins/seachart/src/render/Signals.java
r32082 r32084 323 323 } 324 324 Renderer.symbol(feature, Beacons.LightFlare, new Scheme(LightColours.get(col)), new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.toRadians(120)))); 325 if (Renderer.zoom >= 15) {326 325 String str = ""; 327 326 if (lights.get(1) != null) { … … 375 374 str += LightLetters.get(cols.get(1)); 376 375 } 376 if (atts.containsKey(Att.SIGPER)) { 377 str += "." + df.format(atts.get(Att.SIGPER).val) + "s"; 378 } 377 379 if (dir && atts.containsKey(Att.ORIENT)) { 378 380 double orient = (Double) atts.get(Att.ORIENT).val; … … 390 392 Renderer.lightSector(feature, LightColours.get(col1), LightColours.get(col2), radius, s1, s2, dir, (Renderer.zoom >= 15) ? str : ""); 391 393 } 394 if (Renderer.zoom >= 15) { 392 395 class LitSect { 393 396 boolean dir; … … 404 407 for (AttMap atts : lights.values()) { 405 408 LitSect sect = new LitSect(); 406 litatts.add(sect);407 409 sect.dir = (atts.containsKey(Att.CATLIT)) && (atts.get(Att.CATLIT).val == CatLIT.LIT_DIR); 408 410 sect.chr = atts.containsKey(Att.LITCHR) ? ((ArrayList<LitCHR>) atts.get(Att.LITCHR).val).get(0) : LitCHR.CHR_UNKN; … … 433 435 sect.col = cols.size() > 0 ? cols.get(0) : ColCOL.COL_UNK; 434 436 sect.alt = cols.size() > 1 ? cols.get(1) : ColCOL.COL_UNK; 437 if ((sect.chr != LitCHR.CHR_UNKN) && (sect.col != null)) 438 litatts.add(sect); 435 439 } 436 440 ArrayList<ArrayList<LitSect>> groupings = new ArrayList<>(); … … 507 511 str += LightLetters.get(cr.col); 508 512 } 513 if ((tmp.per > 0) || (tmp.hgt > 0) || (colrng.get(0).rng > 0)) 514 str += "."; 509 515 if (tmp.per > 0) 510 516 str += df.format(tmp.per) + "s"; … … 517 523 str = ""; 518 524 } 519 } else { 525 } 526 } else { 527 if (Renderer.zoom >= 15) { 520 528 AttMap atts = lights.get(0); 521 529 ArrayList<CatLIT> cats = new ArrayList<>();
Note:
See TracChangeset
for help on using the changeset viewer.