Ignore:
Timestamp:
2020-03-21T09:42:31+01:00 (5 years ago)
Author:
malcolmh
Message:

add new jchart utility

Location:
applications/editors/josm/plugins/seachart
Files:
5 added
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/seachart/src/render/Rules.java

    r35120 r35388  
    356356                        return false;
    357357                } catch (Exception e) {
     358                    e.printStackTrace();
    358359                        return true;
    359360                }
     
    979980                                        fncSym = Landmarks.RadioTV;
    980981                                Renderer.symbol(catSym);
    981                                 if (catSym != Landmarks.Spire)
    982                                         Renderer.symbol(fncSym);
     982                                Renderer.symbol(fncSym);
    983983                                break;
    984984                        case SILTNK:
     
    10491049                        ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(Obj.SMCFAC, Att.CATSCF);
    10501050                        for (CatSCF scf : scfs) {
    1051                                 symbols.add(Facilities.Cats.get(scf));
     1051                            Symbol sym = Facilities.Cats.get(scf);
     1052                            if (sym != null) symbols.add(sym);
    10521053                        }
    10531054                        Renderer.cluster(symbols);
     
    10591060                        switch ((CatMOR) getAttEnum(feature.type, Att.CATMOR)) {
    10601061                        case MOR_DLPN:
    1061                                 Renderer.symbol(Harbours.Dolphin);
     1062                            if (feature.geom.prim == Pflag.AREA) {
     1063                                Renderer.lineVector(new LineStyle(Color.black, 4, Symbols.Yland));
     1064                            } else {
     1065                                Renderer.symbol(Harbours.Dolphin);
     1066                            }
    10621067                    Signals.addSignals();
    10631068                                break;
     
    10791084                                Renderer.symbol(Topmarks.TopMooring, Topmarks.BuoyDeltas.get(shape));
    10801085                            Signals.addSignals();
     1086                            addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
    10811087                            }
    10821088                                break;
     
    15421548            }
    15431549        }
     1550        addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(50, 0)));
    15441551        if (Renderer.zoom >= 15) {
    15451552                Renderer.labelText("V-AIS", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
  • applications/editors/josm/plugins/seachart/src/render/Signals.java

    r35114 r35388  
    469469                    str += "." + df.format(atts.get(Att.SIGPER).val) + "s";
    470470                }
    471                 if ((s1 <= 360) && (s2 <= 360) && (s1 != s2))
     471                if ((s1 < 360) && (s2 < 360) && (s1 != s2))
    472472                    Renderer.lightSector(LightColours.get(col1), LightColours.get(col2), radius, s1, s2, dir, (Renderer.zoom >= 15) ? str : "");
    473473            }
  • applications/editors/josm/plugins/seachart/src/s57/S57osm.java

    r34652 r35388  
    112112                    for (String token : ln.split("[ ]+")) {
    113113                        if (token.matches("^minlat=.+")) {
    114                             map.bounds.minlat = Math.toRadians(Double.parseDouble(token.split("[\"\']")[1]));
     114                            map.bounds.minlat = Math.toRadians(Double.parseDouble(token.split("[\"]")[1]));
    115115                            map.nodes.get(2L).lat = map.bounds.minlat;
    116116                            map.nodes.get(3L).lat = map.bounds.minlat;
    117117                        } else if (token.matches("^minlon=.+")) {
    118                             map.bounds.minlon = Math.toRadians(Double.parseDouble(token.split("[\"\']")[1]));
     118                            map.bounds.minlon = Math.toRadians(Double.parseDouble(token.split("[\"]")[1]));
    119119                            map.nodes.get(1L).lon = map.bounds.minlon;
    120120                            map.nodes.get(2L).lon = map.bounds.minlon;
    121121                        } else if (token.matches("^maxlat=.+")) {
    122                             map.bounds.maxlat = Math.toRadians(Double.parseDouble(token.split("[\"\']")[1]));
     122                            map.bounds.maxlat = Math.toRadians(Double.parseDouble(token.split("[\"]")[1]));
    123123                            map.nodes.get(1L).lat = map.bounds.maxlat;
    124124                            map.nodes.get(4L).lat = map.bounds.maxlat;
    125125                        } else if (token.matches("^maxlon=.+")) {
    126                             map.bounds.maxlon = Math.toRadians(Double.parseDouble(token.split("[\"\']")[1]));
     126                            map.bounds.maxlon = Math.toRadians(Double.parseDouble(token.split("[\"]")[1]));
    127127                            map.nodes.get(3L).lon = map.bounds.maxlon;
    128128                            map.nodes.get(4L).lon = map.bounds.maxlon;
     
    133133                        k = v = "";
    134134                        String[] token = ln.split("k=");
    135                         k = token[1].split("[\"\']")[1];
     135                        k = token[1].split("[\"]")[1];
    136136                        token = token[1].split("v=");
    137                         v = token[1].split("[\"\']")[1];
     137                        v = token[1].split("[\"]")[1];
    138138                        if (!k.isEmpty() && !v.isEmpty()) {
    139139                            map.addTag(k, v);
     
    148148                        for (String token : ln.split("[ ]+")) {
    149149                            if (token.matches("^id=.+")) {
    150                                 id = Long.parseLong(token.split("[\"\']")[1]);
     150                                id = Long.parseLong(token.split("[\"]")[1]);
    151151                            } else if (token.matches("^lat=.+")) {
    152                                 lat = Double.parseDouble(token.split("[\"\']")[1]);
     152                                lat = Double.parseDouble(token.split("[\"]")[1]);
    153153                            } else if (token.matches("^lon=.+")) {
    154                                 lon = Double.parseDouble(token.split("[\"\']")[1]);
     154                                lon = Double.parseDouble(token.split("[\"]")[1]);
    155155                            }
    156156                        }
     
    166166                            for (String token : ln.split("[ ]+")) {
    167167                                if (token.matches("^ref=.+")) {
    168                                     ref = Long.parseLong(token.split("[\"\']")[1]);
     168                                    ref = Long.parseLong(token.split("[\"]")[1]);
    169169                                }
    170170                            }
     
    182182                        for (String token : ln.split("[ ]+")) {
    183183                            if (token.matches("^id=.+")) {
    184                                 id = Long.parseLong(token.split("[\"\']")[1]);
     184                                id = Long.parseLong(token.split("[\"]")[1]);
    185185                            }
    186186                        }
     
    202202                            for (String token : ln.split("[ ]+")) {
    203203                                if (token.matches("^ref=.+")) {
    204                                     ref = Long.parseLong(token.split("[\"\']")[1]);
     204                                    ref = Long.parseLong(token.split("[\"]")[1]);
    205205                                } else if (token.matches("^type=.+")) {
    206                                     type = token.split("[\"\']")[1];
     206                                    type = token.split("[\"]")[1];
    207207                                } else if (token.matches("^role=.+")) {
    208                                     String[] str = token.split("[\"\']");
     208                                    String[] str = token.split("[\"]");
    209209                                    if (str.length > 1) {
    210                                         role = token.split("[\"\']")[1];
     210                                        role = token.split("[\"]")[1];
    211211                                    }
    212212                                }
     
    222222                        for (String token : ln.split("[ ]+")) {
    223223                            if (token.matches("^id=.+")) {
    224                                 id = Long.parseLong(token.split("[\"\']")[1]);
     224                                id = Long.parseLong(token.split("[\"]")[1]);
    225225                            }
    226226                        }
  • applications/editors/josm/plugins/seachart/src/s57/S57val.java

    r34906 r35388  
    661661        SPM_NOTC, SPM_TSS, SPM_NANC, SPM_NBRT, SPM_NOTK, SPM_NTWT, SPM_RWAK, SPM_SPDL, SPM_STOP, SPM_WRNG, SPM_SSSN, SPM_RVCL, SPM_MVDT, SPM_RHCL, SPM_SCNT, SPM_BRTH, SPM_OHPC, SPM_CHEG, SPM_TELE, SPM_FCRS,
    662662        SPM_MTRL, SPM_PLIN, SPM_ANCH, SPM_CLRG, SPM_CTRL, SPM_DIVG, SPM_RBCN, SPM_FGND, SPM_YCHT, SPM_HPRT, SPM_GPS, SPM_SLDG, SPM_NENT, SPM_WRKP, SPM_UKPP, SPM_WELH, SPM_CHSP, SPM_MFRM, SPM_AREF,
    663         SPM_ICE, SPM_NATR, SPM_FAD, SPM_WREK, SPM_CUST, SPM_CSWY, SPM_WAVR, }
     663        SPM_ICE, SPM_NATR, SPM_FAD, SPM_WREK, SPM_CUST, SPM_CSWY, SPM_WAVR, SPM_NJET }
    664664
    665665    private static final EnumMap<CatSPM, S57enum> Catspm = new EnumMap<>(CatSPM.class); static {
     
    686686        Catspm.put(CatSPM.SPM_AREF, new S57enum(56, "artificial_reef")); Catspm.put(CatSPM.SPM_ICE, new S57enum(57, "ice")); Catspm.put(CatSPM.SPM_NATR, new S57enum(58, "nature_reserve"));
    687687        Catspm.put(CatSPM.SPM_FAD, new S57enum(59, "fish_aggregator")); Catspm.put(CatSPM.SPM_WREK, new S57enum(60, "wreck")); Catspm.put(CatSPM.SPM_CUST, new S57enum(61, "customs"));
    688         Catspm.put(CatSPM.SPM_CSWY, new S57enum(62, "causeway")); Catspm.put(CatSPM.SPM_WAVR, new S57enum(63, "wave_recorder"));
     688        Catspm.put(CatSPM.SPM_CSWY, new S57enum(62, "causeway")); Catspm.put(CatSPM.SPM_WAVR, new S57enum(63, "wave_recorder")); Catspm.put(CatSPM.SPM_NJET, new S57enum(64, "no_jetski"));
    689689    }
    690690
Note: See TracChangeset for help on using the changeset viewer.