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

checkstyle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/seachart/jbasemap/src/jbasemap/Jbasemap.java

    r32906 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 jbasemap;
    113
     
    2214import org.w3c.dom.Document;
    2315
     16import render.ChartContext;
     17import render.Renderer;
    2418import s57.S57map;
     19import s57.S57map.Feature;
     20import s57.S57map.GeomIterator;
     21import s57.S57map.Pflag;
     22import s57.S57map.Snode;
    2523import s57.S57obj.Obj;
    2624import s57.S57osm;
    27 import s57.S57map.*;
    28 import symbols.*;
    29 import render.*;
     25import symbols.Symbols;
    3026
    31 public class Jbasemap {
     27/**
     28 * @author Malcolm Herring
     29 */
     30public final class Jbasemap {
     31    private Jbasemap() {
     32        // Hide default constructor for utilities classes
     33    }
    3234
    3335    static String src;
     
    3941
    4042    static class Context implements ChartContext {
    41        
    42       static double top = 0;
    43       static double mile = 0;
    44      
    45       public Context () {
     43
     44        static double top = 0;
     45        static double mile = 0;
     46
     47        Context() {
    4648            top = (1.0 - Math.log(Math.tan(map.bounds.maxlat) + 1.0 / Math.cos(map.bounds.maxlat)) / Math.PI) / 2.0 * 256.0 * z2;
    4749            mile = 256 / ((Math.toDegrees(map.bounds.maxlat) - Math.toDegrees(map.bounds.minlat)) * 60);
    48       }
    49      
     50        }
     51
     52        @Override
    5053        public Point2D getPoint(Snode coord) {
    5154            double x = (Math.toDegrees(coord.lon) - Math.toDegrees(map.bounds.minlon)) * 256.0 * (z2 / 2) / 180.0;
     
    5457        }
    5558
     59        @Override
    5660        public double mile(Feature feature) {
    5761            return mile;
    5862        }
    5963
     64        @Override
    6065        public boolean clip() {
    6166            return true;
    6267        }
    6368
     69        @Override
    6470        public Color background(S57map map) {
    6571            if (map.features.containsKey(Obj.COALNE)) {
     
    7682                            if (node == null)
    7783                                continue;
    78                             if ((node.lat >= map.bounds.minlat) && (node.lat <= map.bounds.maxlat) && (node.lon >= map.bounds.minlon) && (node.lon <= map.bounds.maxlon)) {
     84                            if ((node.lat >= map.bounds.minlat) && (node.lat <= map.bounds.maxlat)
     85                             && (node.lon >= map.bounds.minlon) && (node.lon <= map.bounds.maxlon)) {
    7986                                return Symbols.Bwater;
    8087                            }
     
    8491                return Symbols.Yland;
    8592            } else {
    86                 if (map.features.containsKey(Obj.ROADWY) || map.features.containsKey(Obj.RAILWY) || map.features.containsKey(Obj.LAKARE) || map.features.containsKey(Obj.RIVERS) || map.features.containsKey(Obj.CANALS)) {
     93                if (map.features.containsKey(Obj.ROADWY) || map.features.containsKey(Obj.RAILWY) || map.features.containsKey(Obj.LAKARE) ||
     94                    map.features.containsKey(Obj.RIVERS) || map.features.containsKey(Obj.CANALS)) {
    8795                    return Symbols.Yland;
    8896                } else {
     
    92100        }
    93101
     102        @Override
    94103        public RuleSet ruleset() {
    95104            return RuleSet.BASE;
    96105        }
    97106    }
    98    
     107
    99108    public static void main(String[] args) throws IOException {
    100109        if (args.length < 5) {
Note: See TracChangeset for help on using the changeset viewer.