Ignore:
Timestamp:
2016-09-03T16:43:42+02:00 (8 years ago)
Author:
donvip
Message:

checkstyle

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.
    102package render;
    113
     
    3527import symbols.Topmarks;
    3628
     29/**
     30 * @author Malcolm Herring
     31 */
    3732public class Signals extends Rules {
    3833
     
    194189                }
    195190                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)));
    197193                }
    198194            }
     
    241237            }
    242238            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)));
    244241            }
    245242        }
     
    358355        if (Renderer.zoom >= 15) {
    359356            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)));
    361359            }
    362360            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)));
    364363            }
    365364        }
     
    398397            }
    399398        }
    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))));
    401401        if (Renderer.zoom >= 12) {
    402402            String str = "";
     
    438438                                    }
    439439                                    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<>();
    441442                                        if (scats.contains(CatLIT.LIT_DIR)) {
    442443                                            if (satts.containsKey(Att.ORIENT)) {
     
    504505                    }
    505506                    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 : "");
    507509                }
    508510                if (Renderer.zoom >= 15) {
     
    545547                        sect.rng = atts.containsKey(Att.VALNMR) ? (Double) atts.get(Att.VALNMR).val : 0.0;
    546548                        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<>());
    548551                        sect.col = cols.size() > 0 ? cols.get(0) : ColCOL.COL_UNK;
    549552                        if ((sect.chr != LitCHR.CHR_UNKN) && (sect.col != null))
     
    555558                        for (ArrayList<LitSect> group : groupings) {
    556559                            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)) {
    558562                                group.add(lit);
    559563                                found = true;
     
    630634                            str += df.format(tmp.hgt) + "m";
    631635                        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)));
    634640                        y += 40;
    635641                        str = "";
     
    680686                    str += (cats.contains(CatLIT.LIT_VERT)) ? "(vert)" : "";
    681687                    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(")")) ? "." : "";
    683690                    str += (atts.containsKey(Att.SIGPER)) ? df.format(atts.get(Att.SIGPER).val) + "s" : "";
    684691                    str += (atts.containsKey(Att.HEIGHT)) ? df.format(atts.get(Att.HEIGHT).val) + "m" : "";
     
    688695                    str += (cats.contains(CatLIT.LIT_UPPR)) ? "(Upper)" : "";
    689696                    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)));
    691699                }
    692700            }
Note: See TracChangeset for help on using the changeset viewer.