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

fix some error-prone warnings

Location:
applications/editors/josm/plugins/seachart/src
Files:
7 edited

Legend:

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

    r32907 r32909  
    6868        if (map != null) {
    6969            if (context.clip()) {
    70                 Point2D tl = context.getPoint(map.new Snode(map.bounds.maxlat, map.bounds.minlon));
    71                 Point2D br = context.getPoint(map.new Snode(map.bounds.minlat, map.bounds.maxlon));
     70                Point2D tl = context.getPoint(new Snode(map.bounds.maxlat, map.bounds.minlon));
     71                Point2D br = context.getPoint(new Snode(map.bounds.minlat, map.bounds.maxlon));
    7272                g2.clip(new Rectangle2D.Double(tl.getX(), tl.getY(), (br.getX() - tl.getX()), (br.getY() - tl.getY())));
    7373            }
  • applications/editors/josm/plugins/seachart/src/render/Signals.java

    r32907 r32909  
    365365    }
    366366
    367     class Sect {
     367    static class Sect {
    368368        int dir;
    369369        LitCHR chr;
  • applications/editors/josm/plugins/seachart/src/s57/S57box.java

    r32907 r32909  
    44import java.util.ArrayList;
    55
     6import s57.S57map.AttMap;
    67import s57.S57map.Edge;
    78import s57.S57map.Feature;
     9import s57.S57map.ObjTab;
    810import s57.S57map.Pflag;
     11import s57.S57map.Prim;
    912import s57.S57map.Rflag;
    1013import s57.S57map.Snode;
     
    6770            }
    6871            for (Feature feature : map.features.get(Obj.COALNE)) {
    69                 Feature land = map.new Feature();
     72                Feature land = new Feature();
    7073                land.id = ++map.xref;
    7174                land.type = Obj.LNDARE;
    7275                land.reln = Rflag.MASTER;
    73                 land.objs.put(Obj.LNDARE, map.new ObjTab());
    74                 land.objs.get(Obj.LNDARE).put(0, map.new AttMap());
     76                land.objs.put(Obj.LNDARE, new ObjTab());
     77                land.objs.get(Obj.LNDARE).put(0, new AttMap());
    7578                if (feature.geom.prim == Pflag.AREA) {
    7679                    land.geom = feature.geom;
     
    139142            }
    140143            for (Land land : lands) {
    141                 Edge nedge = map.new Edge();
     144                Edge nedge = new Edge();
    142145                nedge.first = land.last;
    143146                nedge.last = land.first;
     
    166169                }
    167170                map.edges.put(++map.xref, nedge);
    168                 land.land.geom.elems.add(map.new Prim(map.xref));
     171                land.land.geom.elems.add(new Prim(map.xref));
    169172                land.land.geom.comps.get(0).size++;
    170173                land.land.geom.prim = Pflag.AREA;
     
    173176        }
    174177        return;
    175 
    176178    }
    177 
    178179}
  • applications/editors/josm/plugins/seachart/src/s57/S57dat.java

    r32907 r32909  
    33
    44import java.io.UnsupportedEncodingException;
     5import java.nio.charset.StandardCharsets;
    56import java.util.ArrayList;
    67import java.util.Arrays;
     
    378379            buf[buf.length-1] = 0x1e;
    379380            int flen = buf.length - offset;
    380             index.add(new Index(sfparams.field.toString().getBytes(), flen, offset));
     381            index.add(new Index(sfparams.field.toString().getBytes(StandardCharsets.UTF_8), flen, offset));
    381382            maxlen = (flen > maxlen) ? flen : maxlen;
    382383            offset += flen;
  • applications/editors/josm/plugins/seachart/src/s57/S57enc.java

    r32907 r32909  
    315315                        Object[] attf = new Object[0];
    316316                        Object[] natf = new Object[0];
    317                         AttMap atts = map.new AttMap();
     317                        AttMap atts = new AttMap();
    318318                        atts.putAll(object.getValue());
    319319                        if (master) {
  • applications/editors/josm/plugins/seachart/src/s57/S57map.java

    r32907 r32909  
    1818    // CHECKSTYLE.OFF: LineLength
    1919
    20     public class MapBounds {
     20    public static class MapBounds {
    2121        public double minlat;
    2222        public double minlon;
     
    3939    }
    4040
    41     public class Snode {    // All coordinates in map
     41    public static class Snode {    // All coordinates in map
    4242        public double lat;    // Latitude in radians
    4343        public double lon;    // Longitude in radians
     
    7474    }
    7575
    76     public class Edge {        // A polyline segment
     76    public static class Edge {        // A polyline segment
    7777        public long first;    // First CONN node
    7878        public long last;        // Last CONN node
     
    9090    }
    9191
    92     public class Reln {
     92    public static class Reln {
    9393        public long id;
    9494        public Rflag reln;
     
    9999    }
    100100
    101     public class RelTab extends ArrayList<Reln> {
     101    public static class RelTab extends ArrayList<Reln> {
    102102        public RelTab() {
    103103            super();
     
    105105    }
    106106
    107     public class ObjTab extends HashMap<Integer, AttMap> {
     107    public static class ObjTab extends HashMap<Integer, AttMap> {
    108108        public ObjTab() {
    109109            super();
     
    111111    }
    112112
    113     public class ObjMap extends EnumMap<Obj, ObjTab> {
     113    public static class ObjMap extends EnumMap<Obj, ObjTab> {
    114114        public ObjMap() {
    115115            super(Obj.class);
     
    117117    }
    118118
    119     public class AttMap extends HashMap<Att, AttVal<?>> {
     119    public static class AttMap extends HashMap<Att, AttVal<?>> {
    120120        public AttMap() {
    121121            super();
     
    123123    }
    124124
    125     public class NodeTab extends HashMap<Long, Snode> {
     125    public static class NodeTab extends HashMap<Long, Snode> {
    126126        public NodeTab() {
    127127            super();
     
    129129    }
    130130
    131     public class EdgeTab extends HashMap<Long, Edge> {
     131    public static class EdgeTab extends HashMap<Long, Edge> {
    132132        public EdgeTab() {
    133133            super();
     
    135135    }
    136136
    137     public class FtrMap extends EnumMap<Obj, ArrayList<Feature>> {
     137    public static class FtrMap extends EnumMap<Obj, ArrayList<Feature>> {
    138138        public FtrMap() {
    139139            super(Obj.class);
     
    141141    }
    142142
    143     public class FtrTab extends HashMap<Long, Feature> {
     143    public static class FtrTab extends HashMap<Long, Feature> {
    144144        public FtrTab() {
    145145            super();
     
    147147    }
    148148
    149     public class Prim {                // Spatial element
     149    public static class Prim {                // Spatial element
    150150        public long id;                    // Snode ID for POINTs, Edge ID for LINEs & AREAs)
    151151        public boolean forward;    // Direction of vector used (LINEs & AREAs)
     
    173173    }
    174174
    175     public class Comp {            // Composite spatial element
     175    public static class Comp {            // Composite spatial element
    176176        public long ref;            // ID of Comp
    177177        public int size;            // Number of Prims in this Comp
     
    186186    }
    187187
    188     public class Geom {                            // Geometric structure of feature
     188    public static class Geom {                            // Geometric structure of feature
    189189        public Pflag prim;                        // Geometry type
    190190        public ArrayList<Prim> elems;    // Ordered list of elements
     
    206206    }
    207207
    208     public class Feature {
     208    public static class Feature {
    209209        public long id;                // Ref for this feature
    210210        public Rflag reln;        // Relationship status
  • applications/editors/josm/plugins/seachart/src/s57/S57osm.java

    r32907 r32909  
    77
    88import s57.S57att.Att;
     9import s57.S57map.Snode;
    910import s57.S57obj.Obj;
    1011import s57.S57val.CatBUA;
     
    103104        boolean inWay = false;
    104105        boolean inRel = false;
    105         map.nodes.put(1L, map.new Snode());
    106         map.nodes.put(2L, map.new Snode());
    107         map.nodes.put(3L, map.new Snode());
    108         map.nodes.put(4L, map.new Snode());
     106        map.nodes.put(1L, new Snode());
     107        map.nodes.put(2L, new Snode());
     108        map.nodes.put(3L, new Snode());
     109        map.nodes.put(4L, new Snode());
    109110
    110111        String ln;
Note: See TracChangeset for help on using the changeset viewer.