Ignore:
Timestamp:
2016-11-12T04:42:33+01:00 (8 years ago)
Author:
donvip
Message:

checkstyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed/src/seamarks/SeaMark.java

    r32911 r33054  
     1// License: GPL. For details, see LICENSE file.
    12package seamarks;
    23
     
    234235        NTC_B1a, NTC_B1b, NTC_B2a, NTC_B2b, NTC_B3a, NTC_B3b, NTC_B4a, NTC_B4b, NTC_B5, NTC_B6, NTC_B7, NTC_B8, NTC_B9a, NTC_B9b, NTC_B11,
    235236        NTC_C1, NTC_C2, NTC_C3, NTC_C4, NTC_C5a, NTC_C5b, NTC_D1a, NTC_D1b, NTC_D2a, NTC_D2b, NTC_D3a, NTC_D3b,
    236         NOROS, ROS_UNKN, ROS_OMNI, ROS_DIRL, ROS_ROTP, ROS_CNSL, ROS_RDF, ROS_QTG, ROS_AERO, ROS_DECA, ROS_LORN, ROS_DGPS, ROS_TORN, ROS_OMGA, ROS_SYLD, ROS_CHKA,
    237         ROS_PCOM, ROS_COMB, ROS_FACS, ROS_TIME, ROS_PAIS, ROS_SAIS, ROS_VAIS, ROS_VANC, ROS_VASC, ROS_VAEC, ROS_VAWC, ROS_VAPL, ROS_VASL, ROS_VAID, ROS_VASW, ROS_VASP, ROS_VAWK
     237        NOROS, ROS_UNKN, ROS_OMNI, ROS_DIRL, ROS_ROTP, ROS_CNSL, ROS_RDF, ROS_QTG, ROS_AERO, ROS_DECA, ROS_LORN,
     238        ROS_DGPS, ROS_TORN, ROS_OMGA, ROS_SYLD, ROS_CHKA,
     239        ROS_PCOM, ROS_COMB, ROS_FACS, ROS_TIME, ROS_PAIS, ROS_SAIS, ROS_VAIS, ROS_VANC, ROS_VASC, ROS_VAEC, ROS_VAWC,
     240        ROS_VAPL, ROS_VASL, ROS_VAID, ROS_VASW, ROS_VASP, ROS_VAWK
    238241    }
    239242
     
    322325        CatSTR.put(Cat.LMK_MNRT, "minaret");
    323326        CatSTR.put(Cat.OFP_OIL, "oil");
    324         CatSTR.put(Cat.OFP_PRD,  "production");
     327        CatSTR.put(Cat.OFP_PRD, "production");
    325328        CatSTR.put(Cat.OFP_OBS, "observation");
    326329        CatSTR.put(Cat.OFP_ALP, "alp");
     
    441444
    442445    public enum Shp {
    443         UNKSHP, PILLAR, SPAR, CAN, CONI, SPHERI, BARREL, FLOAT, SUPER, BUOYANT, CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON
     446        UNKSHP, PILLAR, SPAR, CAN, CONI, SPHERI, BARREL, FLOAT, SUPER, BUOYANT,
     447        CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON
    444448    }
    445449
     
    729733    }
    730734
    731     public Object[] sector = { Col.UNKCOL, "", "", "", "", Lit.UNKLIT, "", "",
     735    public Object[] sector = {Col.UNKCOL, "", "", "", "", Lit.UNKLIT, "", "",
    732736            "", "", "", Vis.UNKVIS, Exh.UNKEXH, "", "", Col.UNKCOL };
    733737
     
    767771            case 9:
    768772            case 10:
    769                 sectors.get(i)[att] = validDecimal((String)obj);
     773                sectors.get(i)[att] = validDecimal((String) obj);
    770774                break;
    771775            case 6:
    772776            case 7:
    773777            case 13:
    774                 sectors.get(i)[att] = validDecimal((String)obj, 360);
     778                sectors.get(i)[att] = validDecimal((String) obj, 360);
    775779                break;
    776780            default:
     
    17781782                str = keys.get("seamark:light" + secStr + ":colour");
    17791783                if (str.contains(";")) {
    1780                     String strs[] = str.split(";");
    1781                     for (Col col : ColSTR.keySet())
     1784                    String[] strs = str.split(";");
     1785                    for (Col col : ColSTR.keySet()) {
    17821786                        if ((strs.length > 1) && ColSTR.get(col).equals(strs[1])) {
    17831787                            setLightAtt(Att.ALT, i, col);
    17841788                        }
     1789                    }
    17851790                    str = strs[0];
    17861791                }
    1787                 for (Col col : ColSTR.keySet())
     1792                for (Col col : ColSTR.keySet()) {
    17881793                    if (ColSTR.get(col).equals(str)) {
    17891794                        setLightAtt(Att.COL, i, col);
    17901795                    }
     1796                }
    17911797            }
    17921798            if (keys.containsKey("seamark:light" + secStr + ":character")) {
     
    18171823                    str = "horizontal";
    18181824                }
    1819                 for (Lit lit : LitSTR.keySet())
     1825                for (Lit lit : LitSTR.keySet()) {
    18201826                    if (LitSTR.get(lit).equals(str)) {
    18211827                        setLightAtt(Att.LIT, i, lit);
    18221828                    }
     1829                }
    18231830            }
    18241831            if (keys.containsKey("seamark:light" + secStr + ":sector_start")) {
     
    18391846            if (keys.containsKey("seamark:light" + secStr + ":visibility")) {
    18401847                str = keys.get("seamark:light" + secStr + ":visibility");
    1841                 for (Vis vis : VisSTR.keySet())
     1848                for (Vis vis : VisSTR.keySet()) {
    18421849                    if (VisSTR.get(vis).equals(str)) {
    18431850                        setLightAtt(Att.VIS, i, vis);
    18441851                    }
     1852                }
    18451853            }
    18461854            if (keys.containsKey("seamark:light" + secStr + ":exhibition")) {
    18471855                str = keys.get("seamark:light" + secStr + ":exhibition");
    1848                 for (Exh exh : ExhSTR.keySet())
     1856                for (Exh exh : ExhSTR.keySet()) {
    18491857                    if (ExhSTR.get(exh).equals(str)) {
    18501858                        setLightAtt(Att.EXH, i, exh);
    18511859                    }
     1860                }
    18521861            }
    18531862            if (keys.containsKey("seamark:light" + secStr + ":orientation")) {
     
    24502459            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    24512460            g2.setStroke(new BasicStroke(6.0f));
    2452             if (!((String)getLightAtt(Att.BEG, i)).isEmpty() && !((String)getLightAtt(Att.END, i)).isEmpty()) {
     2461            if (!((String) getLightAtt(Att.BEG, i)).isEmpty() && !((String) getLightAtt(Att.END, i)).isEmpty()) {
    24532462                if (getLightAtt(Att.COL, i) != Col.UNKCOL) {
    24542463                    g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i)));
    2455                     Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.BEG, i));
    2456                     Double da = 270 - Double.parseDouble((String)getLightAtt(Att.END, i)) - a0;
     2464                    Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.BEG, i));
     2465                    Double da = 270 - Double.parseDouble((String) getLightAtt(Att.END, i)) - a0;
    24572466                    da -= da > 0 ? 360 : 0;
    24582467                    g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN));
     
    24602469                if (getLightAtt(Att.ALT, i) != Col.UNKCOL) {
    24612470                    g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i)));
    2462                     Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.BEG, i));
    2463                     Double da = 270 - Double.parseDouble((String)getLightAtt(Att.END, i)) - a0;
     2471                    Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.BEG, i));
     2472                    Double da = 270 - Double.parseDouble((String) getLightAtt(Att.END, i)) - a0;
    24642473                    da -= da > 0 ? 360 : 0;
    24652474                    g2.draw(new Arc2D.Double(17, 20, 130, 130, a0, da, Arc2D.OPEN));
    24662475                }
    2467             } else if ((getLightAtt(Att.LIT, i) == Lit.DIR) && !((String)getLightAtt(Att.ORT, i)).isEmpty()) {
     2476            } else if ((getLightAtt(Att.LIT, i) == Lit.DIR) && !((String) getLightAtt(Att.ORT, i)).isEmpty()) {
    24682477                if (getLightAtt(Att.COL, i) != Col.UNKCOL) {
    24692478                    g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i)));
    2470                     Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.ORT, i)) + 2.0;
     2479                    Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.ORT, i)) + 2.0;
    24712480                    Double da = -4.0;
    24722481                    g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN));
     
    24742483                if (getLightAtt(Att.ALT, i) != Col.UNKCOL) {
    24752484                    g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i)));
    2476                     Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.ORT, i)) + 2.0;
     2485                    Double a0 = 270 - Double.parseDouble((String) getLightAtt(Att.ORT, i)) + 2.0;
    24772486                    Double da = -4.0;
    24782487                    g2.draw(new Arc2D.Double(17, 20, 130, 130, a0, da, Arc2D.OPEN));
     
    24812490        }
    24822491        g2.setPaint(Color.BLACK);
    2483         if ((getLightAtt(Att.COL, 0) != Col.UNKCOL) || !(((String)getLightAtt(Att.CHR, 0)).isEmpty())) {
     2492        if ((getLightAtt(Att.COL, 0) != Col.UNKCOL) || !(((String) getLightAtt(Att.CHR, 0)).isEmpty())) {
    24842493            if (sectors.size() == 1) {
    24852494                if (((String) getLightAtt(Att.CHR, 0)).contains("Al")) {
     
    25742583            }
    25752584            if (getLightAtt(Att.LIT, 0) != Lit.UNKLIT) {
    2576                 switch ((Lit)getLightAtt(Att.LIT, 0)) {
     2585                switch ((Lit) getLightAtt(Att.LIT, 0)) {
    25772586                case VERT:
    25782587                    c += "(Vert)";
     
    26972706
    26982707                if (getObjPattern() != Pat.NOPAT) {
    2699                     Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatSTR.get(getObjPattern())));
     2708                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern",
     2709                            PatSTR.get(getObjPattern())));
    27002710                }
    27012711
     
    27452755                String secStr = (i == 0) ? "" : (":" + Integer.toString(i));
    27462756                if (sectors.get(i)[0] != Col.UNKCOL)
    2747                     if ((sectors.get(i)[15] != Col.UNKCOL) && ((String)sectors.get(i)[1]).contains("Al")) {
    2748                         Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", (ColSTR.get(sectors.get(i)[0])) + ";" + ColSTR.get(sectors.get(i)[15])));
     2757                    if ((sectors.get(i)[15] != Col.UNKCOL) && ((String) sectors.get(i)[1]).contains("Al")) {
     2758                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour",
     2759                                (ColSTR.get(sectors.get(i)[0])) + ";" + ColSTR.get(sectors.get(i)[15])));
    27492760                    } else {
    2750                         Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", ColSTR.get(sectors.get(i)[0])));
     2761                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour",
     2762                                ColSTR.get(sectors.get(i)[0])));
    27512763                    }
    27522764                if (!((String) sectors.get(i)[1]).isEmpty()) {
     
    27712783                }
    27722784                if (sectors.get(i)[5] != Lit.UNKLIT) {
    2773                     Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", LitSTR.get(sectors.get(i)[5])));
     2785                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category",
     2786                            LitSTR.get(sectors.get(i)[5])));
    27742787                } else if (sectors.get(0)[5] != Lit.UNKLIT) {
    2775                     Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", LitSTR.get(sectors.get(0)[5])));
     2788                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category",
     2789                            LitSTR.get(sectors.get(0)[5])));
    27762790                }
    27772791                if (!((String) sectors.get(i)[6]).isEmpty()) {
    2778                     Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_start", (String) sectors.get(i)[6]));
     2792                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_start",
     2793                            (String) sectors.get(i)[6]));
    27792794                }
    27802795                if (!((String) sectors.get(i)[7]).isEmpty()) {
    2781                     Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_end", (String) sectors.get(i)[7]));
     2796                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_end",
     2797                            (String) sectors.get(i)[7]));
    27822798                }
    27832799                if (!((String) sectors.get(i)[8]).isEmpty()) {
     
    27972813                }
    27982814                if (sectors.get(i)[11] != Vis.UNKVIS) {
    2799                     Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", VisSTR.get(sectors.get(i)[11])));
     2815                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility",
     2816                            VisSTR.get(sectors.get(i)[11])));
    28002817                } else if (sectors.get(0)[11] != Vis.UNKVIS) {
    2801                     Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", VisSTR.get(sectors.get(0)[11])));
     2818                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility",
     2819                            VisSTR.get(sectors.get(0)[11])));
    28022820                }
    28032821                if (sectors.get(i)[12] != Exh.UNKEXH) {
    2804                     Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", ExhSTR.get(sectors.get(i)[12])));
     2822                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition",
     2823                            ExhSTR.get(sectors.get(i)[12])));
    28052824                } else if (sectors.get(0)[12] != Exh.UNKEXH) {
    2806                     Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", ExhSTR.get(sectors.get(0)[12])));
     2825                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition",
     2826                            ExhSTR.get(sectors.get(0)[12])));
    28072827                }
    28082828                if (!((String) sectors.get(i)[13]).isEmpty()) {
    2809                     Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":orientation", (String) sectors.get(i)[13]));
     2829                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":orientation",
     2830                            (String) sectors.get(i)[13]));
    28102831                }
    28112832                if (!((String) sectors.get(i)[14]).isEmpty()) {
Note: See TracChangeset for help on using the changeset viewer.