Changeset 32907 in osm for applications/editors/josm/plugins/seachart/src/render/Signals.java
- Timestamp:
- 2016-09-03T16:43:42+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/render/Signals.java
r32394 r32907 1 /* Copyright 2014 Malcolm Herring 2 * 3 * This is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, version 3 of the License. 6 * 7 * For a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>. 8 */ 9 1 // License: GPL. For details, see LICENSE file. 10 2 package render; 11 3 … … 35 27 import symbols.Topmarks; 36 28 29 /** 30 * @author Malcolm Herring 31 */ 37 32 public class Signals extends Rules { 38 33 … … 194 189 } 195 190 if (!str.isEmpty()) { 196 Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-60, -30))); 191 Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, 192 new Delta(Handle.TR, AffineTransform.getTranslateInstance(-60, -30))); 197 193 } 198 194 } … … 241 237 } 242 238 if (!bstr.isEmpty()) { 243 Renderer.labelText(bstr, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70))); 239 Renderer.labelText(bstr, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, 240 new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70))); 244 241 } 245 242 } … … 358 355 if (Renderer.zoom >= 15) { 359 356 if (vais) { 360 Renderer.labelText("V-AIS", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 357 Renderer.labelText("V-AIS", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, 358 new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 361 359 } 362 360 if (!bstr.isEmpty()) { 363 Renderer.labelText(bstr, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -110))); 361 Renderer.labelText(bstr, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, 362 new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -110))); 364 363 } 365 364 } … … 398 397 } 399 398 } 400 Renderer.symbol(Beacons.LightFlare, new Scheme(LightColours.get(col)), new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.toRadians(120)))); 399 Renderer.symbol(Beacons.LightFlare, new Scheme(LightColours.get(col)), 400 new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.toRadians(120)))); 401 401 if (Renderer.zoom >= 12) { 402 402 String str = ""; … … 438 438 } 439 439 if (srad == radius) { 440 ArrayList<CatLIT> scats = (satts.containsKey(Att.CATLIT)) ? (ArrayList<CatLIT>) satts.get(Att.CATLIT).val : new ArrayList<CatLIT>(); 440 ArrayList<CatLIT> scats = (satts.containsKey(Att.CATLIT)) ? 441 (ArrayList<CatLIT>) satts.get(Att.CATLIT).val : new ArrayList<>(); 441 442 if (scats.contains(CatLIT.LIT_DIR)) { 442 443 if (satts.containsKey(Att.ORIENT)) { … … 504 505 } 505 506 if ((s1 <= 360) && (s2 <= 360) && (s1 != s2)) 506 Renderer.lightSector(LightColours.get(col1), LightColours.get(col2), radius, s1, s2, dir, (Renderer.zoom >= 15) ? str : ""); 507 Renderer.lightSector(LightColours.get(col1), LightColours.get(col2), radius, s1, s2, dir, 508 (Renderer.zoom >= 15) ? str : ""); 507 509 } 508 510 if (Renderer.zoom >= 15) { … … 545 547 sect.rng = atts.containsKey(Att.VALNMR) ? (Double) atts.get(Att.VALNMR).val : 0.0; 546 548 sect.hgt = atts.containsKey(Att.HEIGHT) ? (Double) atts.get(Att.HEIGHT).val : 0.0; 547 ArrayList<ColCOL> cols = (ArrayList<ColCOL>) (atts.containsKey(Att.COLOUR) ? atts.get(Att.COLOUR).val : new ArrayList<>()); 549 ArrayList<ColCOL> cols = (ArrayList<ColCOL>) 550 (atts.containsKey(Att.COLOUR) ? atts.get(Att.COLOUR).val : new ArrayList<>()); 548 551 sect.col = cols.size() > 0 ? cols.get(0) : ColCOL.COL_UNK; 549 552 if ((sect.chr != LitCHR.CHR_UNKN) && (sect.col != null)) … … 555 558 for (ArrayList<LitSect> group : groupings) { 556 559 LitSect mem = group.get(0); 557 if ((lit.dir == mem.dir) && (lit.chr == mem.chr) && (lit.grp.equals(mem.grp)) && (lit.per == mem.per) && (lit.hgt == mem.hgt)) { 560 if ((lit.dir == mem.dir) && (lit.chr == mem.chr) && (lit.grp.equals(mem.grp)) && 561 (lit.per == mem.per) && (lit.hgt == mem.hgt)) { 558 562 group.add(lit); 559 563 found = true; … … 630 634 str += df.format(tmp.hgt) + "m"; 631 635 if (colrng.get(0).rng > 0) 632 str += df.format(colrng.get(0).rng) + ((colrng.size() > 1) ? ((colrng.size() > 2) ? ("-" + df.format(colrng.get(colrng.size() - 1).rng)) : ("/" + df.format(colrng.get(1).rng))) : "") + "M"; 633 Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.TL, AffineTransform.getTranslateInstance(60, y))); 636 str += df.format(colrng.get(0).rng) + ((colrng.size() > 1) ? ((colrng.size() > 2) ? 637 ("-" + df.format(colrng.get(colrng.size() - 1).rng)) : ("/" + df.format(colrng.get(1).rng))) : "") + "M"; 638 Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, 639 new Delta(Handle.TL, AffineTransform.getTranslateInstance(60, y))); 634 640 y += 40; 635 641 str = ""; … … 680 686 str += (cats.contains(CatLIT.LIT_VERT)) ? "(vert)" : ""; 681 687 str += (cats.contains(CatLIT.LIT_HORI)) ? "(hor)" : ""; 682 str += (!str.isEmpty() && (atts.containsKey(Att.SIGPER) || atts.containsKey(Att.HEIGHT) || atts.containsKey(Att.VALMXR)) && !str.endsWith(")")) ? "." : ""; 688 str += (!str.isEmpty() && (atts.containsKey(Att.SIGPER) || atts.containsKey(Att.HEIGHT) || atts.containsKey(Att.VALMXR)) 689 && !str.endsWith(")")) ? "." : ""; 683 690 str += (atts.containsKey(Att.SIGPER)) ? df.format(atts.get(Att.SIGPER).val) + "s" : ""; 684 691 str += (atts.containsKey(Att.HEIGHT)) ? df.format(atts.get(Att.HEIGHT).val) + "m" : ""; … … 688 695 str += (cats.contains(CatLIT.LIT_UPPR)) ? "(Upper)" : ""; 689 696 str += (cats.contains(CatLIT.LIT_LOWR)) ? "(Lower)" : ""; 690 Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.TL, AffineTransform.getTranslateInstance(60, -30))); 697 Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, 698 new Delta(Handle.TL, AffineTransform.getTranslateInstance(60, -30))); 691 699 } 692 700 }
Note:
See TracChangeset
for help on using the changeset viewer.