Changeset 32907 in osm for applications/editors
- Timestamp:
- 2016-09-03T16:43:42+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/seachart
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/.settings/org.eclipse.jdt.ui.prefs
r32394 r32907 16 16 sp_cleanup.convert_functional_interfaces=false 17 17 sp_cleanup.convert_to_enhanced_for_loop=false 18 sp_cleanup.correct_indentation= true18 sp_cleanup.correct_indentation=false 19 19 sp_cleanup.format_source_code=false 20 20 sp_cleanup.format_source_code_changes_only=false -
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. 10 2 package jbasemap; 11 3 … … 22 14 import org.w3c.dom.Document; 23 15 16 import render.ChartContext; 17 import render.Renderer; 24 18 import s57.S57map; 19 import s57.S57map.Feature; 20 import s57.S57map.GeomIterator; 21 import s57.S57map.Pflag; 22 import s57.S57map.Snode; 25 23 import s57.S57obj.Obj; 26 24 import s57.S57osm; 27 import s57.S57map.*; 28 import symbols.*; 29 import render.*; 25 import symbols.Symbols; 30 26 31 public class Jbasemap { 27 /** 28 * @author Malcolm Herring 29 */ 30 public final class Jbasemap { 31 private Jbasemap() { 32 // Hide default constructor for utilities classes 33 } 32 34 33 35 static String src; … … 39 41 40 42 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() { 46 48 top = (1.0 - Math.log(Math.tan(map.bounds.maxlat) + 1.0 / Math.cos(map.bounds.maxlat)) / Math.PI) / 2.0 * 256.0 * z2; 47 49 mile = 256 / ((Math.toDegrees(map.bounds.maxlat) - Math.toDegrees(map.bounds.minlat)) * 60); 48 } 49 50 } 51 52 @Override 50 53 public Point2D getPoint(Snode coord) { 51 54 double x = (Math.toDegrees(coord.lon) - Math.toDegrees(map.bounds.minlon)) * 256.0 * (z2 / 2) / 180.0; … … 54 57 } 55 58 59 @Override 56 60 public double mile(Feature feature) { 57 61 return mile; 58 62 } 59 63 64 @Override 60 65 public boolean clip() { 61 66 return true; 62 67 } 63 68 69 @Override 64 70 public Color background(S57map map) { 65 71 if (map.features.containsKey(Obj.COALNE)) { … … 76 82 if (node == null) 77 83 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)) { 79 86 return Symbols.Bwater; 80 87 } … … 84 91 return Symbols.Yland; 85 92 } 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)) { 87 95 return Symbols.Yland; 88 96 } else { … … 92 100 } 93 101 102 @Override 94 103 public RuleSet ruleset() { 95 104 return RuleSet.BASE; 96 105 } 97 106 } 98 107 99 108 public static void main(String[] args) throws IOException { 100 109 if (args.length < 5) { -
applications/editors/josm/plugins/seachart/jicons/src/jicons/Jicons.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. 10 2 package jicons; 11 3 4 import java.awt.Color; 5 import java.awt.Dimension; 6 import java.awt.Graphics2D; 7 import java.awt.Rectangle; 8 import java.awt.geom.Point2D; 9 import java.awt.image.BufferedImage; 12 10 import java.io.BufferedReader; 13 11 import java.io.File; … … 17 15 import java.io.OutputStreamWriter; 18 16 import java.io.Writer; 19 import java.awt.Color;20 import java.awt.Dimension;21 import java.awt.Graphics2D;22 import java.awt.Rectangle;23 import java.awt.geom.Point2D;24 import java.awt.image.BufferedImage;25 17 26 18 import javax.imageio.ImageIO; 27 19 20 import org.apache.batik.dom.GenericDOMImplementation; 28 21 import org.apache.batik.svggen.SVGGraphics2D; 29 22 import org.apache.batik.svggen.SVGGraphics2DIOException; 30 import org. apache.batik.dom.GenericDOMImplementation;23 import org.w3c.dom.DOMImplementation; 31 24 import org.w3c.dom.Document; 32 import org.w3c.dom.DOMImplementation; 33 25 26 import render.ChartContext; 27 import render.Renderer; 34 28 import s57.S57map; 35 import s57.S57map.*; 36 import render.*; 37 38 public class Jicons { 39 29 import s57.S57map.Feature; 30 import s57.S57map.Snode; 31 32 /** 33 * @author Malcolm Herring 34 */ 35 public final class Jicons { 36 private Jicons() { 37 // Hide default constructor for utilities classes 38 } 39 40 40 static int x = 0; 41 41 static int y = 0; … … 58 58 boolean inIcons = false; 59 59 boolean inIcon = false; 60 60 61 61 if (args.length < 2) { 62 62 System.err.println("Usage: java -jar jicons.jar icon_definition_file icons_directory"); … … 64 64 } 65 65 in = new BufferedReader(new FileReader(args[0])); 66 66 67 67 context = new Context(); 68 68 String ln; … … 188 188 System.exit(0); 189 189 } 190 190 191 191 static class Context implements ChartContext { 192 192 193 @Override 193 194 public Point2D getPoint(Snode coord) { 194 195 return new Point2D.Double(x, y); 195 196 } 196 197 198 @Override 197 199 public double mile(Feature feature) { 198 200 return Math.min(w, h); 199 201 } 200 202 203 @Override 201 204 public boolean clip() { 202 205 return false; 203 206 } 204 207 208 @Override 205 209 public Color background(S57map map) { 206 210 return new Color(0, true); 207 211 } 208 212 213 @Override 209 214 public RuleSet ruleset() { 210 215 return RuleSet.ALL; -
applications/editors/josm/plugins/seachart/josmtos57/src/josmtos57/Josmtos57.java
r32906 r32907 1 /* Copyright 2015 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. 10 2 package josmtos57; 11 3 12 import java.io.*; 13 import java.util.*; 4 import java.io.BufferedReader; 5 import java.io.File; 6 import java.io.FileInputStream; 7 import java.io.FileOutputStream; 8 import java.io.FileReader; 9 import java.io.IOException; 10 import java.io.UnsupportedEncodingException; 11 import java.util.ArrayList; 12 import java.util.Arrays; 13 import java.util.HashMap; 14 import java.util.Scanner; 14 15 import java.util.zip.CRC32; 15 16 16 17 import s57.S57dat; 18 import s57.S57dat.Fparams; 19 import s57.S57dat.S57field; 17 20 import s57.S57enc; 18 21 import s57.S57map; 19 22 import s57.S57osm; 20 import s57.S57dat.*;21 23 22 public class Josmtos57 { 24 /** 25 * @author Malcolm Herring 26 */ 27 public final class Josmtos57 { 28 private Josmtos57() { 29 // Hide default constructor for utilities classes 30 } 23 31 24 32 // http://opendatacommons.org/licenses/odbl/1-0/ 25 33 26 34 /* 27 35 URL website = new URL("http://www.website.com/information.asp"); 28 36 try (InputStream in = website.openStream()) { Files.copy(in, target, StandardCopyOption.REPLACE_EXISTING); } 29 37 */ 30 38 31 39 /* 32 40 * To do: … … 37 45 38 46 static byte[] header = { 39 '0', '0', '2', '6', '2', '3', 'L', 'E', '1', ' ', '0', '9', '0', '0', '0', '7', '3', ' ', ' ', ' ', '6', '6', '0', '4', '0', '0', '0', '0', '0', '0', '0', '0', 40 '1', '9', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '4', '8', '0', '0', '0', '0', '1', '9', 'C', 'A', 'T', 'D', '0', '0', '0', '1', 41 '2', '2', '0', '0', '0', '0', '6', '7', 0x1e, '0', '0', '0', '0', ';', '&', ' ', ' ', ' ', 0x1f, '0', '0', '0', '1', 'C', 'A', 'T', 'D', 0x1e, '0', '1', '0', '0', 42 ';', '&', ' ', ' ', ' ', 'I', 'S', 'O', '/', 'I', 'E', 'C', ' ', '8', '2', '1', '1', ' ', 'R', 'e', 'c', 'o', 'r', 'd', ' ', 'I', 'd', 'e', 'n', 't', 'i', 'f', 43 'i', 'e', 'r', 0x1f, 0x1f, '(', 'I', '(', '5', ')', ')', 0x1e, '1', '6', '0', '0', ';', '&', ' ', ' ', ' ', 'C', 'a', 't', 'a', 'l', 'o', 'g', 'u', 'e', ' ', 'D', 44 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', ' ', 'F', 'i', 'e', 'l', 'd', 0x1f, 'R', 'C', 'N', 'M', '!', 'R', 'C', 'I', 'D', '!', 'F', 'I', 'L', 'E', '!', 'L', 'F', 45 'I', 'L', '!', 'V', 'O', 'L', 'M', '!', 'I', 'M', 'P', 'L', '!', 'S', 'L', 'A', 'T', '!', 'W', 'L', 'O', 'N', '!', 'N', 'L', 'A', 'T', '!', 'E', 'L', 'O', 'N', 46 '!', 'C', 'R', 'C', 'S', '!', 'C', 'O', 'M', 'T', 0x1f, '(', 'A', '(', '2', ')', ',', 'I', '(', '1', '0', ')', ',', '3', 'A', ',', 'A', '(', '3', ')', ',', '4', 47 'R', ',', '2', 'A', ')', 0x1e, 48 '0', '0', '1', '0', '1', ' ', 'D', ' ', ' ', ' ', ' ', ' ', '0', '0', '0', '5', '3', ' ', ' ', ' ', '5', '5', '0', '4', 49 '0', '0', '0', '1', '0', '0', '0', '0', '6', '0', '0', '0', '0', '0', 'C', 'A', 'T', 'D', '0', '0', '0', '4', '2', '0', '0', '0', '0', '6', 0x1e, 50 '0', '0', '0', '0', '0', 0x1e, 'C', 'D', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', 'C', 'A', 'T', 'A', 'L', 'O', 'G', '.', '0', '3', '1', 0x1f, 51 0x1f, 'V', '0', '1', 'X', '0', '1', 0x1f, 'A', 'S', 'C', 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1e 47 // CHECKSTYLE.OFF: LineLength 48 '0', '0', '2', '6', '2', '3', 'L', 'E', '1', ' ', '0', '9', '0', '0', '0', '7', '3', ' ', ' ', ' ', '6', '6', '0', '4', '0', '0', '0', '0', '0', '0', '0', '0', 49 '1', '9', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '4', '8', '0', '0', '0', '0', '1', '9', 'C', 'A', 'T', 'D', '0', '0', '0', '1', 50 '2', '2', '0', '0', '0', '0', '6', '7', 0x1e, '0', '0', '0', '0', ';', '&', ' ', ' ', ' ', 0x1f, '0', '0', '0', '1', 'C', 'A', 'T', 'D', 0x1e, '0', '1', '0', '0', 51 ';', '&', ' ', ' ', ' ', 'I', 'S', 'O', '/', 'I', 'E', 'C', ' ', '8', '2', '1', '1', ' ', 'R', 'e', 'c', 'o', 'r', 'd', ' ', 'I', 'd', 'e', 'n', 't', 'i', 'f', 52 'i', 'e', 'r', 0x1f, 0x1f, '(', 'I', '(', '5', ')', ')', 0x1e, '1', '6', '0', '0', ';', '&', ' ', ' ', ' ', 'C', 'a', 't', 'a', 'l', 'o', 'g', 'u', 'e', ' ', 'D', 53 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', ' ', 'F', 'i', 'e', 'l', 'd', 0x1f, 'R', 'C', 'N', 'M', '!', 'R', 'C', 'I', 'D', '!', 'F', 'I', 'L', 'E', '!', 'L', 'F', 54 'I', 'L', '!', 'V', 'O', 'L', 'M', '!', 'I', 'M', 'P', 'L', '!', 'S', 'L', 'A', 'T', '!', 'W', 'L', 'O', 'N', '!', 'N', 'L', 'A', 'T', '!', 'E', 'L', 'O', 'N', 55 '!', 'C', 'R', 'C', 'S', '!', 'C', 'O', 'M', 'T', 0x1f, '(', 'A', '(', '2', ')', ',', 'I', '(', '1', '0', ')', ',', '3', 'A', ',', 'A', '(', '3', ')', ',', '4', 56 'R', ',', '2', 'A', ')', 0x1e, 57 '0', '0', '1', '0', '1', ' ', 'D', ' ', ' ', ' ', ' ', ' ', '0', '0', '0', '5', '3', ' ', ' ', ' ', '5', '5', '0', '4', 58 '0', '0', '0', '1', '0', '0', '0', '0', '6', '0', '0', '0', '0', '0', 'C', 'A', 'T', 'D', '0', '0', '0', '4', '2', '0', '0', '0', '0', '6', 0x1e, 59 '0', '0', '0', '0', '0', 0x1e, 'C', 'D', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', 'C', 'A', 'T', 'A', 'L', 'O', 'G', '.', '0', '3', '1', 0x1f, 60 0x1f, 'V', '0', '1', 'X', '0', '1', 0x1f, 'A', 'S', 'C', 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1e 61 // CHECKSTYLE.ON: LineLength 52 62 }; 53 63 54 64 static BufferedReader in; 55 65 static FileOutputStream out; … … 59 69 static ArrayList<Fparams> fields; 60 70 static byte[] record; 61 71 62 72 public static void main(String[] args) throws IOException { 63 73 64 74 map = new S57map(false); 65 75 int idx = 0; 66 76 67 77 if (args.length < 4) { 68 78 System.err.println("Usage: java -jar josmtos57.jar OSM_filename meta_data_filename S57_ENC_ROOT_directory S57_filename"); … … 96 106 System.exit(-1); 97 107 } 98 108 99 109 try { 100 110 buf = new byte[5242880]; … … 107 117 System.exit(-1); 108 118 } 109 119 110 120 CRC32 crc = new CRC32(); 111 121 crc.update(buf, 0, idx); … … 120 130 } 121 131 out.close(); 122 132 123 133 buf = new byte[header.length]; 124 134 System.arraycopy(header, 0, buf, 0, header.length); … … 126 136 int recs = 2; 127 137 fields = new ArrayList<>(); 128 fields.add(new Fparams(S57field.CATD, new Object[]{ "CD", recs, args[3], "", "V01X01", "BIN", Math.toDegrees(map.bounds.minlat), 129 Math.toDegrees(map.bounds.minlon), Math.toDegrees(map.bounds.maxlat), Math.toDegrees(map.bounds.maxlon), String.format("%08X", crc.getValue()), "" })); 138 fields.add(new Fparams(S57field.CATD, new Object[]{"CD", recs, args[3], "", "V01X01", "BIN", Math.toDegrees(map.bounds.minlat), 139 Math.toDegrees(map.bounds.minlon), Math.toDegrees(map.bounds.maxlat), Math.toDegrees(map.bounds.maxlon), 140 String.format("%08X", crc.getValue()), ""})); 130 141 record = S57dat.encRecord(String.valueOf(recs++), fields); 131 142 buf = Arrays.copyOf(buf, (buf.length + record.length)); … … 144 155 out.close(); 145 156 146 // String[] dir = (new File(args[2]).list());147 // for (String item : dir) {148 // System.err.println(item);149 // }150 157 // String[] dir = (new File(args[2]).list()); 158 // for (String item : dir) { 159 // System.err.println(item); 160 // } 161 151 162 System.err.println("Finished"); 152 163 } -
applications/editors/josm/plugins/seachart/jplotter/src/jplotter/Jplotter.java
r32906 r32907 1 // License: GPL. For details, see LICENSE file. 1 2 package jplotter; 2 3 3 import java.awt. *;4 import java x.swing.*;4 import java.awt.BorderLayout; 5 import java.awt.Container; 5 6 6 public class Jplotter { 7 import javax.swing.BorderFactory; 8 import javax.swing.JFrame; 9 import javax.swing.JPanel; 10 11 /** 12 * @author Malcolm Herring 13 */ 14 public final class Jplotter { 15 private Jplotter() { 16 // Hide default constructor for utilities classes 17 } 7 18 8 19 public static void main(String[] args) { -
applications/editors/josm/plugins/seachart/jrender/src/jrender/Jrender.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. 10 2 package jrender; 11 3 … … 27 19 import javax.imageio.ImageIO; 28 20 21 import render.ChartContext; 22 import render.Renderer; 29 23 import s57.S57map; 24 import s57.S57map.Feature; 25 import s57.S57map.Snode; 30 26 import s57.S57osm; 31 import s57.S57map.*;32 import render.*;33 27 34 public class Jrender { 28 /** 29 * @author Malcolm Herring 30 */ 31 public final class Jrender { 32 private Jrender() { 33 // Hide default constructor for utilities classes 34 } 35 35 36 36 static String srcdir; … … 46 46 47 47 static class Context implements ChartContext { 48 49 static double top; 50 static double mile; 51 52 public Context () { 53 top = (1.0 - Math.log(Math.tan(map.bounds.maxlat) + 1.0 / Math.cos(map.bounds.maxlat)) / Math.PI) / 2.0 * 256.0 * 4096.0 * Math.pow(2, (zoom - 12)); 54 mile = (2 * ((zoom < 12) ? (256 / (int)(Math.pow(2, (11 - zoom)))) : 256) + 256) / ((Math.toDegrees(map.bounds.maxlat) - Math.toDegrees(map.bounds.minlat)) * 60); 55 } 56 48 49 static double top; 50 static double mile; 51 52 Context() { 53 top = (1.0 - Math.log(Math.tan(map.bounds.maxlat) + 1.0 / Math.cos(map.bounds.maxlat)) / Math.PI) 54 / 2.0 * 256.0 * 4096.0 * Math.pow(2, (zoom - 12)); 55 mile = (2 * ((zoom < 12) ? (256 / (int) (Math.pow(2, (11 - zoom)))) : 256) + 256) 56 / ((Math.toDegrees(map.bounds.maxlat) - Math.toDegrees(map.bounds.minlat)) * 60); 57 } 58 59 @Override 57 60 public Point2D getPoint(Snode coord) { 58 61 double x = (Math.toDegrees(coord.lon) - Math.toDegrees(map.bounds.minlon)) * 256.0 * 2048.0 * Math.pow(2, (zoom - 12)) / 180.0; 59 double y = ((1.0 - Math.log(Math.tan(coord.lat) + 1.0 / Math.cos(coord.lat)) / Math.PI) / 2.0 * 256.0 * 4096.0 * Math.pow(2, (zoom - 12))) - top; 62 double y = ((1.0 - Math.log(Math.tan(coord.lat) + 1.0 / Math.cos(coord.lat)) / Math.PI) 63 / 2.0 * 256.0 * 4096.0 * Math.pow(2, (zoom - 12))) - top; 60 64 return new Point2D.Double(x, y); 61 65 } 62 66 67 @Override 63 68 public double mile(Feature feature) { 64 69 return mile; 65 70 } 66 71 72 @Override 67 73 public boolean clip() { 68 74 return false; 69 75 } 70 76 77 @Override 71 78 public Color background(S57map map) { 72 79 return new Color(0, true); 73 80 } 74 81 82 @Override 75 83 public RuleSet ruleset() { 76 84 return RuleSet.SEAMARK; 77 85 } 78 86 } 79 87 80 88 static void tile(int z, int s, int xn, int yn) throws IOException { 81 int border = (z < 12) ? (256 / (int) (Math.pow(2, (11 - zoom)))) : 256;82 int scale = (int) Math.pow(2, z - 12);89 int border = (z < 12) ? (256 / (int) (Math.pow(2, (11 - zoom)))) : 256; 90 int scale = (int) Math.pow(2, z - 12); 83 91 int xdir = (scale > 0) ? (scale * xtile) + xn : xtile; 84 92 int ynam = (scale > 0) ? (scale * ytile) + yn : ytile; … … 116 124 } 117 125 } 118 126 119 127 static void clean(int z, int xn, int yn) throws Exception { 120 128 int scale = (int) Math.pow(2, z - 12); … … 135 143 } 136 144 } 137 145 138 146 public static void main(String[] args) throws Exception { 139 147 if (args.length < 5) { -
applications/editors/josm/plugins/seachart/js57toosm/src/js57toosm/Js57toosm.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/>. 1 // License: GPL. For details, see LICENSE file. 2 package js57toosm; 3 4 import java.io.FileInputStream; 5 import java.io.IOException; 6 import java.io.PrintStream; 7 import java.util.ArrayList; 8 import java.util.Map; 9 import java.util.Scanner; 10 11 import org.apache.commons.lang3.StringEscapeUtils; 12 13 import s57.S57att; 14 import s57.S57att.Att; 15 import s57.S57dec; 16 import s57.S57map; 17 import s57.S57map.AttMap; 18 import s57.S57map.Feature; 19 import s57.S57map.GeomIterator; 20 import s57.S57map.ObjTab; 21 import s57.S57map.Pflag; 22 import s57.S57map.Prim; 23 import s57.S57map.Rflag; 24 import s57.S57map.Snode; 25 import s57.S57obj; 26 import s57.S57obj.Obj; 27 import s57.S57val; 28 import s57.S57val.AttVal; 29 30 /** 31 * @author Malcolm Herring 8 32 */ 9 10 package js57toosm; 11 12 import java.io.*; 13 import java.util.*; 14 15 import org.apache.commons.lang3.StringEscapeUtils; 16 17 import s57.S57obj; 18 import s57.S57obj.*; 19 import s57.S57att; 20 import s57.S57att.*; 21 import s57.S57val; 22 import s57.S57val.*; 23 import s57.S57map; 24 import s57.S57map.*; 25 import s57.S57dec; 26 27 public class Js57toosm { 28 33 public final class Js57toosm { 34 private Js57toosm() { 35 // Hide default constructor for utilities classes 36 } 37 29 38 static FileInputStream in; 30 39 static PrintStream out; … … 34 43 typatts.add(Att.PEREND); typatts.add(Att.PERSTA); typatts.add(Att.CONDTN); typatts.add(Att.CONRAD); typatts.add(Att.CONVIS); 35 44 } 36 45 37 46 public static void main(String[] args) throws IOException { 38 47 … … 71 80 System.exit(-1); 72 81 } 73 82 74 83 map = new S57map(true); 75 84 S57dec.decodeChart(in, map); … … 78 87 out.format("<osm version='0.6' upload='false' generator='js57toosm'>%n"); 79 88 out.format("<bounds minlat='%.8f' minlon='%.8f' maxlat='%.8f' maxlon='%.8f'/>%n", 80 Math.toDegrees(map.bounds.minlat), Math.toDegrees(map.bounds.minlon), Math.toDegrees(map.bounds.maxlat), Math.toDegrees(map.bounds.maxlon)); 89 Math.toDegrees(map.bounds.minlat), Math.toDegrees(map.bounds.minlon), 90 Math.toDegrees(map.bounds.maxlat), Math.toDegrees(map.bounds.maxlon)); 81 91 82 92 for (long id : map.index.keySet()) { … … 91 101 while ((node = map.nodes.get(ref)) != null) { 92 102 if (!done.contains(ref)) { 93 out.format(" <node id='%d' lat='%.8f' lon='%.8f' version='1'>%n", -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon)); 103 out.format(" <node id='%d' lat='%.8f' lon='%.8f' version='1'>%n", 104 -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon)); 94 105 out.format(" <tag k='seamark:type' v=\"%s\"/>%n", type); 95 106 if ((feature.type == Obj.SOUNDG) && (node.flg == S57map.Nflag.DPTH)) 96 out.format(" <tag k='seamark:sounding:depth' v='%.1f'/>%n", ((Snode) node).val);107 out.format(" <tag k='seamark:sounding:depth' v='%.1f'/>%n", node.val); 97 108 writeAtts(feature); 98 109 out.format(" </node>%n"); … … 111 122 if (!type.isEmpty() && (types.isEmpty() || types.contains(feature.type))) { 112 123 if (feature.reln == Rflag.MASTER) { 113 if ((feature.geom.prim == Pflag.LINE) || ((feature.geom.prim == Pflag.AREA) && (feature.geom.outers == 1) && (feature.geom.inners == 0))) { 124 if ((feature.geom.prim == Pflag.LINE) || 125 ((feature.geom.prim == Pflag.AREA) && (feature.geom.outers == 1) && (feature.geom.inners == 0))) { 114 126 GeomIterator git = map.new GeomIterator(feature.geom); 115 127 while (git.hasComp()) { … … 121 133 Snode node = map.nodes.get(ref); 122 134 if (!done.contains(ref)) { 123 out.format(" <node id='%d' lat='%.8f' lon='%.8f' version='1'/>%n", -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon)); 135 out.format(" <node id='%d' lat='%.8f' lon='%.8f' version='1'/>%n", 136 -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon)); 124 137 done.add(ref); 125 138 } … … 152 165 Snode node = map.nodes.get(ref); 153 166 if (!done.contains(ref)) { 154 out.format(" <node id='%d' lat='%.8f' lon='%.8f' version='1'/>%n", -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon)); 167 out.format(" <node id='%d' lat='%.8f' lon='%.8f' version='1'/>%n", 168 -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon)); 155 169 done.add(ref); 156 170 } … … 194 208 System.err.println("Finished"); 195 209 } 196 210 197 211 static void writeAtts(Feature feature) { 198 212 for (Map.Entry<Att, AttVal<?>> item : feature.atts.entrySet()) { … … 203 217 out.format(" <tag k='seamark:%s' v='%s'/>%n", attstr, StringEscapeUtils.escapeXml10(valstr)); 204 218 } else { 205 out.format(" <tag k='seamark:%s:%s' v='%s'/>%n", S57obj.stringType(feature.type), attstr, StringEscapeUtils.escapeXml10(valstr)); 219 out.format(" <tag k='seamark:%s:%s' v='%s'/>%n", 220 S57obj.stringType(feature.type), attstr, StringEscapeUtils.escapeXml10(valstr)); 206 221 } 207 222 } … … 216 231 if (!attstr.isEmpty() && !valstr.isEmpty()) { 217 232 if ((ix == 0) && (tab.size() == 1)) { 218 out.format(" <tag k='seamark:%s:%s' v='%s'/>%n", S57obj.stringType(obj), attstr, StringEscapeUtils.escapeXml10(valstr)); 233 out.format(" <tag k='seamark:%s:%s' v='%s'/>%n", 234 S57obj.stringType(obj), attstr, StringEscapeUtils.escapeXml10(valstr)); 219 235 } else { 220 out.format(" <tag k='seamark:%s:%d:%s' v='%s'/>%n", S57obj.stringType(obj), ix + 1, attstr, StringEscapeUtils.escapeXml10(valstr)); 236 out.format(" <tag k='seamark:%s:%d:%s' v='%s'/>%n", 237 S57obj.stringType(obj), ix + 1, attstr, StringEscapeUtils.escapeXml10(valstr)); 221 238 } 222 239 } -
applications/editors/josm/plugins/seachart/src/render/ChartContext.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. 10 2 package render; 11 3 … … 17 9 import s57.S57map.Snode; 18 10 11 /** 12 * @author Malcolm Herring 13 */ 19 14 public interface ChartContext { 20 15 enum RuleSet { ALL, BASE, SEAMARK } -
applications/editors/josm/plugins/seachart/src/render/Renderer.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. 10 2 package render; 11 3 … … 49 41 import symbols.Symbols.Symbol; 50 42 51 public class Renderer { 52 53 public static final double[] symbolScale = {256.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.61, 0.372, 0.227, 0.138, 0.0843, 0.0514, 0.0313, 0.0191, 0.0117, 0.007 }; 43 /** 44 * @author Malcolm Herring 45 */ 46 public final class Renderer { 47 private Renderer() { 48 // Hide default constructor for utilities classes 49 } 50 51 public static final double[] symbolScale = { 52 256.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.61, 0.372, 0.227, 0.138, 0.0843, 0.0514, 0.0313, 0.0191, 0.0117, 0.007}; 54 53 55 54 public enum LabelStyle { NONE, RRCT, RECT, ELPS, CIRC, VCLR, PCLR, HCLR } … … 260 259 if (!gap) { 261 260 Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(), new Scheme(col), 262 new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())) + Math.toRadians(90)))); 261 new Delta(Handle.BC, AffineTransform.getRotateInstance( 262 Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())) + Math.toRadians(90)))); 263 263 } 264 264 if (space > 0) … … 462 462 double po = sw / 2; 463 463 label.add(new Instr(Form.STRK, new BasicStroke(sw, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 464 Path2D.Double p = new Path2D.Double(); p.moveTo(-height*0.2, -ly-po); p.lineTo(height*0.2, -ly-po); p.moveTo(0, -ly-po); p.lineTo(0, -ly-po-(height*0.15)); 464 Path2D.Double p = new Path2D.Double(); p.moveTo(-height*0.2, -ly-po); 465 p.lineTo(height*0.2, -ly-po); p.moveTo(0, -ly-po); p.lineTo(0, -ly-po-(height*0.15)); 465 466 p.moveTo(-height*0.2, ly+po); p.lineTo((height*0.2), ly+po); p.moveTo(0, ly+po); p.lineTo(0, ly+po+(height*0.15)); 466 467 label.add(new Instr(Form.PLIN, p)); … … 481 482 po = sw / 2; 482 483 label.add(new Instr(Form.STRK, new BasicStroke(sw, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 483 p = new Path2D.Double(); p.moveTo(-height*0.2, -ly-po); p.lineTo(height*0.2, -ly-po); p.moveTo(0, -ly-po); p.lineTo(0, -ly-po-(height*0.15)); 484 p.moveTo(-height*0.2, ly+po); p.lineTo((height*0.2), ly+po); p.moveTo(0, ly+po); p.lineTo(0, ly+po+(height*0.15)); 484 p = new Path2D.Double(); 485 p.moveTo(-height*0.2, -ly-po); 486 p.lineTo(height*0.2, -ly-po); 487 p.moveTo(0, -ly-po); 488 p.lineTo(0, -ly-po-(height*0.15)); 489 p.moveTo(-height*0.2, ly+po); 490 p.lineTo((height*0.2), ly+po); 491 p.moveTo(0, ly+po); 492 p.lineTo(0, ly+po+(height*0.15)); 485 493 label.add(new Instr(Form.PLIN, p)); 486 label.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Areas.CableFlash, 1, 0, 0, null, new Delta(Handle.CC, new AffineTransform(0, -1, 1, 0, -width/2, 0))))); 487 label.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Areas.CableFlash, 1, 0, 0, null, new Delta(Handle.CC, new AffineTransform(0, -1, 1, 0, width/2, 0))))); 494 label.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Areas.CableFlash, 1, 0, 0, null, 495 new Delta(Handle.CC, new AffineTransform(0, -1, 1, 0, -width/2, 0))))); 496 label.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Areas.CableFlash, 1, 0, 0, null, 497 new Delta(Handle.CC, new AffineTransform(0, -1, 1, 0, width/2, 0))))); 488 498 break; 489 499 case HCLR: … … 502 512 double vo = height / 4; 503 513 label.add(new Instr(Form.STRK, new BasicStroke(sw, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 504 p = new Path2D.Double(); p.moveTo(-width*0.4-sw, -ly-vo); p.lineTo(-width*0.4-sw, ly+vo); p.moveTo(-width*0.4-sw, 0); p.lineTo(-width*0.4+sw, 0); 505 p.moveTo(width*0.4+sw, -ly-vo); p.lineTo(width*0.4+sw, ly+vo); p.moveTo(width*0.4-sw, 0); p.lineTo(width*0.4+sw, 0); 514 p = new Path2D.Double(); 515 p.moveTo(-width*0.4-sw, -ly-vo); 516 p.lineTo(-width*0.4-sw, ly+vo); 517 p.moveTo(-width*0.4-sw, 0); 518 p.lineTo(-width*0.4+sw, 0); 519 p.moveTo(width*0.4+sw, -ly-vo); 520 p.lineTo(width*0.4+sw, ly+vo); 521 p.moveTo(width*0.4-sw, 0); 522 p.lineTo(width*0.4+sw, 0); 506 523 label.add(new Instr(Form.PLIN, p)); 507 524 break; … … 589 606 } 590 607 double mid = (((s1 + s2) / 2) + (s1 > s2 ? 180 : 0)) % 360; 591 g2.setStroke(new BasicStroke((float) (3.0 * sScale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 1, new float[] {20 * (float) sScale, 20 * (float) sScale}, 0)); 608 g2.setStroke(new BasicStroke((float) (3.0 * sScale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 1, 609 new float[] {20 * (float) sScale, 20 * (float) sScale}, 0)); 592 610 g2.setPaint(Color.black); 593 611 Point2D.Double centre = (Point2D.Double) context.getPoint(Rules.feature.geom.centre); 594 612 double radial = radius * context.mile(Rules.feature); 595 613 if (dir != null) { 596 g2.draw(new Line2D.Double(centre.x, centre.y, centre.x - radial * Math.sin(Math.toRadians(dir)), centre.y + radial * Math.cos(Math.toRadians(dir)))); 614 g2.draw(new Line2D.Double(centre.x, centre.y, centre.x - radial * Math.sin(Math.toRadians(dir)), 615 centre.y + radial * Math.cos(Math.toRadians(dir)))); 597 616 } else { 598 617 if ((s1 != 0.0) || (s2 != 360.0)) { 599 g2.draw(new Line2D.Double(centre.x, centre.y, centre.x - radial * Math.sin(Math.toRadians(s1)), centre.y + radial * Math.cos(Math.toRadians(s1)))); 600 g2.draw(new Line2D.Double(centre.x, centre.y, centre.x - radial * Math.sin(Math.toRadians(s2)), centre.y + radial * Math.cos(Math.toRadians(s2)))); 618 g2.draw(new Line2D.Double(centre.x, centre.y, centre.x - radial * Math.sin(Math.toRadians(s1)), 619 centre.y + radial * Math.cos(Math.toRadians(s1)))); 620 g2.draw(new Line2D.Double(centre.x, centre.y, centre.x - radial * Math.sin(Math.toRadians(s2)), 621 centre.y + radial * Math.cos(Math.toRadians(s2)))); 601 622 } 602 623 } … … 604 625 g2.setStroke(new BasicStroke((float) arcWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1)); 605 626 g2.setPaint(col1); 606 g2.draw(new Arc2D.Double(centre.x - radial, centre.y - radial, 2 * radial, 2 * radial, -(s1 + 90), ((s1 < s2) ? (s1 - s2) : (s1 - s2 - 360)), Arc2D.OPEN)); 627 g2.draw(new Arc2D.Double(centre.x - radial, centre.y - radial, 2 * radial, 2 * radial, -(s1 + 90), 628 ((s1 < s2) ? (s1 - s2) : (s1 - s2 - 360)), Arc2D.OPEN)); 607 629 if (col2 != null) { 608 630 g2.setPaint(col2); 609 g2.draw(new Arc2D.Double(centre.x - radial + arcWidth, centre.y - radial + arcWidth, 2 * (radial - arcWidth), 2 * (radial - arcWidth), -(s1 + 90), ((s1 < s2) ? (s1 - s2) : (s1 - s2 - 360)), Arc2D.OPEN)); 631 g2.draw(new Arc2D.Double(centre.x - radial + arcWidth, centre.y - radial + arcWidth, 2 * (radial - arcWidth), 632 2 * (radial - arcWidth), -(s1 + 90), ((s1 < s2) ? (s1 - s2) : (s1 - s2 - 360)), Arc2D.OPEN)); 610 633 } 611 634 if ((str != null) && (!str.isEmpty())) { -
applications/editors/josm/plugins/seachart/src/render/Rules.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. 10 2 package render; 11 3 … … 81 73 import symbols.Topmarks; 82 74 75 /** 76 * @author Malcolm Herring 77 */ 83 78 public class Rules { 84 79 … … 257 252 258 253 public static void rules() { 254 // CHECKSTYLE.OFF: NeedBraces 259 255 if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.BASE)) { 260 256 if (testObject(Obj.LNDARE)) for (Feature f : objects) if (testFeature(f)) areas(); … … 351 347 if (testObject(Obj.BCNSPP)) for (Feature f : objects) if (testFeature(f)) beacons(); 352 348 } 349 // CHECKSTYLE.ON: NeedBraces 353 350 } 354 351 … … 417 414 Renderer.symbol(Areas.MarineFarm); 418 415 } 419 if ((feature.geom.area > 0.2) || ((feature.geom.area > 0.05) && (Renderer.zoom >= 14)) || ((feature.geom.area > 0.005) && (Renderer.zoom >= 16))) { 416 if ((feature.geom.area > 0.2) || ((feature.geom.area > 0.05) && (Renderer.zoom >= 14)) || 417 ((feature.geom.area > 0.005) && (Renderer.zoom >= 16))) { 420 418 Renderer.lineVector(new LineStyle(Color.black, 4, new float[] {10, 10})); 421 419 } … … 450 448 Renderer.lineText(name, new Font("Arial", Font.PLAIN, 150), Color.black, -40); 451 449 } else { 452 Renderer.labelText(name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 450 Renderer.labelText(name, new Font("Arial", Font.PLAIN, 150), Color.black, 451 new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 453 452 } 454 453 break; … … 458 457 Renderer.lineText(name, new Font("Arial", Font.PLAIN, 150), Color.black, -40); 459 458 } else { 460 Renderer.labelText(name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 459 Renderer.labelText(name, new Font("Arial", Font.PLAIN, 150), Color.black, 460 new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 461 461 } 462 462 break; … … 466 466 Renderer.lineVector(new LineStyle(new Color(0xc480ff), 4, new float[] {25, 25})); 467 467 if (name != null) { 468 Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 468 Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, 469 new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 469 470 Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC)); 470 471 } … … 476 477 } else { 477 478 if (name != null) { 478 Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 479 Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, 480 new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 479 481 Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC)); 480 482 } … … 554 556 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0); 555 557 if (topmap.containsKey(Att.TOPSHP)) { 556 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.BeaconDelta); 558 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), 559 getScheme(Obj.TOPMAR), Topmarks.BeaconDelta); 557 560 } 558 561 } else if (feature.objs.containsKey(Obj.DAYMAR)) { 559 562 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0); 560 563 if (topmap.containsKey(Att.TOPSHP)) { 561 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.BeaconDelta); 564 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), 565 getScheme(Obj.DAYMAR), Topmarks.BeaconDelta); 562 566 } 563 567 } … … 580 584 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0); 581 585 if (topmap.containsKey(Att.TOPSHP)) { 582 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape)); 586 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), 587 getScheme(Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape)); 583 588 } 584 589 } else if (feature.objs.containsKey(Obj.DAYMAR)) { 585 590 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0); 586 591 if (topmap.containsKey(Att.TOPSHP)) { 587 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.BuoyDeltas.get(shape)); 592 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), 593 getScheme(Obj.DAYMAR), Topmarks.BuoyDeltas.get(shape)); 588 594 } 589 595 } … … 621 627 } 622 628 if (hstr.isEmpty() && !vstr.isEmpty()) { 623 Renderer.labelText(vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC)); 629 Renderer.labelText(vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, 630 new Delta(Handle.CC)); 624 631 } else if (!hstr.isEmpty() && !vstr.isEmpty()) { 625 Renderer.labelText(vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.BC)); 626 Renderer.labelText(hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.TC)); 632 Renderer.labelText(vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, 633 new Delta(Handle.BC)); 634 Renderer.labelText(hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, 635 new Delta(Handle.TC)); 627 636 } else if (!hstr.isEmpty() && vstr.isEmpty()) { 628 Renderer.labelText(hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.CC)); 637 Renderer.labelText(hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, 638 new Delta(Handle.CC)); 629 639 } 630 640 } … … 645 655 if (atts != null) { 646 656 if (atts.containsKey(Att.VERCLR)) { 647 Renderer.labelText(String.valueOf(atts.get(Att.VERCLR).val), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 25))); 657 Renderer.labelText(String.valueOf(atts.get(Att.VERCLR).val), new Font("Arial", Font.PLAIN, 50), 658 Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 25))); 648 659 } else if (atts.containsKey(Att.VERCSA)) { 649 Renderer.labelText(String.valueOf(atts.get(Att.VERCSA).val), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.PCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 25))); 660 Renderer.labelText(String.valueOf(atts.get(Att.VERCSA).val), new Font("Arial", Font.PLAIN, 50), 661 Color.black, LabelStyle.PCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 25))); 650 662 } 651 663 } … … 668 680 String chn; 669 681 if (!(chn = getAttStr(feature.type, Att.COMCHA)).isEmpty()) { 670 Renderer.labelText(("Ch." + chn), new Font("Arial", Font.PLAIN, 50), Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 50))); 682 Renderer.labelText(("Ch." + chn), new Font("Arial", Font.PLAIN, 50), Color.black, 683 new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 50))); 671 684 } 672 685 } … … 692 705 dd = (tok.length == 2) ? tok[1] : ""; 693 706 } 694 Renderer.labelText(ul, new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.RC, AffineTransform.getTranslateInstance(10, 15))); 695 Renderer.labelText(id, new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.RC, AffineTransform.getTranslateInstance(10, 0))); 696 Renderer.labelText(dd, new Font("Arial", Font.PLAIN, 20), Color.black, new Delta(Handle.LC, AffineTransform.getTranslateInstance(15, 10))); 707 Renderer.labelText(ul, new Font("Arial", Font.PLAIN, 30), Color.black, 708 new Delta(Handle.RC, AffineTransform.getTranslateInstance(10, 15))); 709 Renderer.labelText(id, new Font("Arial", Font.PLAIN, 30), Color.black, 710 new Delta(Handle.RC, AffineTransform.getTranslateInstance(10, 0))); 711 Renderer.labelText(dd, new Font("Arial", Font.PLAIN, 20), Color.black, 712 new Delta(Handle.LC, AffineTransform.getTranslateInstance(15, 10))); 697 713 } 698 714 break; … … 741 757 } 742 758 str += String.format("%1.0f", dist); 743 Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45))); 759 Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, 760 new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45))); 744 761 } 745 762 } … … 749 766 @SuppressWarnings("unchecked") 750 767 private static void floats() { 751 if ((Renderer.zoom >= 12) || ((Renderer.zoom >= 11) && ((feature.type == Obj.LITVES) || (feature.type == Obj.BOYINB) || hasObject(Obj.RTPBCN)))) { 768 if ((Renderer.zoom >= 12) || ((Renderer.zoom >= 11) && ((feature.type == Obj.LITVES) || 769 (feature.type == Obj.BOYINB) || hasObject(Obj.RTPBCN)))) { 752 770 switch (feature.type) { 753 771 case LITVES: … … 766 784 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0); 767 785 if (topmap.containsKey(Att.TOPSHP)) { 768 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.FloatDelta); 786 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), 787 getScheme(Obj.TOPMAR), Topmarks.FloatDelta); 769 788 } 770 789 } else if (feature.objs.containsKey(Obj.DAYMAR)) { 771 790 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0); 772 791 if (topmap.containsKey(Att.TOPSHP)) { 773 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.FloatDelta); 792 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), 793 getScheme(Obj.DAYMAR), Topmarks.FloatDelta); 774 794 } 775 795 } … … 795 815 Renderer.symbol(Harbours.Anchor, new Scheme(Symbols.Msymb)); 796 816 if (Renderer.zoom >= 15) { 797 Renderer.labelText(name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Symbols.Msymb, LabelStyle.RRCT, Symbols.Msymb, Color.white, new Delta(Handle.BC)); 817 Renderer.labelText(name == null ? "" : name, 818 new Font("Arial", Font.PLAIN, 30), Symbols.Msymb, LabelStyle.RRCT, Symbols.Msymb, Color.white, new Delta(Handle.BC)); 798 819 } 799 820 } … … 820 841 ArrayList<StsSTS> sts = (ArrayList<StsSTS>) getAttList(Obj.ACHARE, Att.STATUS); 821 842 if ((Renderer.zoom >= 15) && (sts.contains(StsSTS.STS_RESV))) { 822 Renderer.labelText("Reserved", new Font("Arial", Font.PLAIN, 50), Symbols.Mline, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60))); 843 Renderer.labelText("Reserved", 844 new Font("Arial", Font.PLAIN, 50), Symbols.Mline, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60))); 823 845 } 824 846 ArrayList<CatACH> cats = (ArrayList<CatACH>) getAttList(Obj.ACHARE, Att.CATACH); … … 827 849 switch (cat) { 828 850 case ACH_DEEP: 829 Renderer.labelText("DW", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 851 Renderer.labelText("DW", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, 852 new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 830 853 dy += 60; 831 854 break; 832 855 case ACH_TANK: 833 Renderer.labelText("Tanker", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 856 Renderer.labelText("Tanker", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, 857 new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 834 858 dy += 60; 835 859 break; 836 860 case ACH_H24P: 837 Renderer.labelText("24h", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 861 Renderer.labelText("24h", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, 862 new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 838 863 dy += 60; 839 864 break; 840 865 case ACH_EXPL: 841 Renderer.symbol(Harbours.Explosives, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 866 Renderer.symbol(Harbours.Explosives, new Scheme(Symbols.Msymb), 867 new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 842 868 dy += 60; 843 869 break; 844 870 case ACH_QUAR: 845 Renderer.symbol(Harbours.Hospital, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 871 Renderer.symbol(Harbours.Hospital, new Scheme(Symbols.Msymb), 872 new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 846 873 dy += 60; 847 874 break; 848 875 case ACH_SEAP: 849 Renderer.symbol(Areas.Seaplane, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 876 Renderer.symbol(Areas.Seaplane, new Scheme(Symbols.Msymb), 877 new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 850 878 dy += 60; 851 879 break; … … 858 886 if (Renderer.zoom >= 14) { 859 887 Renderer.lineVector(new LineStyle(Symbols.Mline, 6, new float[] {20, 20})); 860 Renderer.labelText(name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, LabelStyle.RRCT, Symbols.Mline, Color.white); 888 Renderer.labelText(name == null ? " " : name, 889 new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, LabelStyle.RRCT, Symbols.Mline, Color.white); 861 890 } 862 891 break; … … 1034 1063 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0); 1035 1064 if (topmap.containsKey(Att.TOPSHP)) { 1036 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.LightDelta); 1065 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), 1066 getScheme(Obj.TOPMAR), Topmarks.LightDelta); 1037 1067 } 1038 1068 } else if (feature.objs.containsKey(Obj.DAYMAR)) { 1039 1069 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0); 1040 1070 if (topmap.containsKey(Att.TOPSHP)) { 1041 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.LightDelta); 1071 Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) (topmap.get(Att.TOPSHP).val)).get(0)), 1072 getScheme(Obj.DAYMAR), Topmarks.LightDelta); 1042 1073 } 1043 1074 } … … 1215 1246 } 1216 1247 if (verclr > 0) { 1217 Renderer.labelText(String.valueOf(verclr), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 25))); 1248 Renderer.labelText(String.valueOf(verclr), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, 1249 Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 25))); 1218 1250 } 1219 1251 } … … 1400 1432 Renderer.symbol(Harbours.SignalStation); 1401 1433 Renderer.symbol(Beacons.RadarStation); 1402 Renderer.labelText("Ra", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70))); 1434 Renderer.labelText("Ra", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, 1435 new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70))); 1403 1436 break; 1404 1437 case PILBOP: 1405 1438 Renderer.symbol(Harbours.Pilot); 1406 addName(15, new Font("Arial", Font.BOLD, 40), Symbols.Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40))); 1439 addName(15, new Font("Arial", Font.BOLD, 40), Symbols.Msymb, 1440 new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40))); 1407 1441 CatPIL cat = (CatPIL) getAttEnum(feature.type, Att.CATPIL); 1408 1442 if (cat == CatPIL.PIL_HELI) { 1409 Renderer.labelText("H", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0))); 1443 Renderer.labelText("H", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, 1444 new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0))); 1410 1445 } 1411 1446 break; … … 1413 1448 Renderer.symbol(Harbours.SignalStation); 1414 1449 str = "CG"; 1415 if (feature.objs.containsKey(Obj.RSCSTA)) Renderer.symbol(Harbours.Rescue, new Delta(Handle.CC, AffineTransform.getTranslateInstance(130, 0))); 1450 if (feature.objs.containsKey(Obj.RSCSTA)) Renderer.symbol(Harbours.Rescue, 1451 new Delta(Handle.CC, AffineTransform.getTranslateInstance(130, 0))); 1416 1452 break; 1417 1453 case RSCSTA: … … 1422 1458 } 1423 1459 if ((Renderer.zoom >= 15) && !str.isEmpty()) { 1424 Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.LC, AffineTransform.getTranslateInstance(40, 0))); 1460 Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, 1461 new Delta(Handle.LC, AffineTransform.getTranslateInstance(40, 0))); 1425 1462 } 1426 1463 Signals.addSignals(); -
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. 10 2 package render; 11 3 … … 35 27 import symbols.Topmarks; 36 28 29 /** 30 * @author Malcolm Herring 31 */ 37 32 public class Signals extends Rules { 38 33 … … 194 189 } 195 190 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))); 197 193 } 198 194 } … … 241 237 } 242 238 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))); 244 241 } 245 242 } … … 358 355 if (Renderer.zoom >= 15) { 359 356 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))); 361 359 } 362 360 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))); 364 363 } 365 364 } … … 398 397 } 399 398 } 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)))); 401 401 if (Renderer.zoom >= 12) { 402 402 String str = ""; … … 438 438 } 439 439 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<>(); 441 442 if (scats.contains(CatLIT.LIT_DIR)) { 442 443 if (satts.containsKey(Att.ORIENT)) { … … 504 505 } 505 506 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 : ""); 507 509 } 508 510 if (Renderer.zoom >= 15) { … … 545 547 sect.rng = atts.containsKey(Att.VALNMR) ? (Double) atts.get(Att.VALNMR).val : 0.0; 546 548 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<>()); 548 551 sect.col = cols.size() > 0 ? cols.get(0) : ColCOL.COL_UNK; 549 552 if ((sect.chr != LitCHR.CHR_UNKN) && (sect.col != null)) … … 555 558 for (ArrayList<LitSect> group : groupings) { 556 559 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)) { 558 562 group.add(lit); 559 563 found = true; … … 630 634 str += df.format(tmp.hgt) + "m"; 631 635 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))); 634 640 y += 40; 635 641 str = ""; … … 680 686 str += (cats.contains(CatLIT.LIT_VERT)) ? "(vert)" : ""; 681 687 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(")")) ? "." : ""; 683 690 str += (atts.containsKey(Att.SIGPER)) ? df.format(atts.get(Att.SIGPER).val) + "s" : ""; 684 691 str += (atts.containsKey(Att.HEIGHT)) ? df.format(atts.get(Att.HEIGHT).val) + "m" : ""; … … 688 695 str += (cats.contains(CatLIT.LIT_UPPR)) ? "(Upper)" : ""; 689 696 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))); 691 699 } 692 700 } -
applications/editors/josm/plugins/seachart/src/s57/S57att.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. 10 2 package s57; 11 3 … … 15 7 import s57.S57obj.Obj; 16 8 17 public class S57att { // S57 Attribute lookup tables & methods 9 /** 10 * @author Malcolm Herring 11 */ 12 public final class S57att { // S57 Attribute lookup tables & methods 13 private S57att() { 14 // Hide default constructor for utilities classes 15 } 18 16 // CHECKSTYLE.OFF: LineLength 19 17 -
applications/editors/josm/plugins/seachart/src/s57/S57box.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. 10 2 package s57; 11 3 … … 19 11 import s57.S57obj.Obj; 20 12 21 public class S57box { //S57 bounding box truncation 13 /** 14 * @author Malcolm Herring 15 */ 16 public final class S57box { //S57 bounding box truncation 17 private S57box() { 18 // Hide default constructor for utilities classes 19 } 22 20 // CHECKSTYLE.OFF: LineLength 23 21 -
applications/editors/josm/plugins/seachart/src/s57/S57dat.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. 10 2 package s57; 11 3 … … 19 11 import s57.S57obj.Obj; 20 12 21 public class S57dat { // S57 ENC file fields lookup tables & methods 13 /** 14 * @author Malcolm Herring 15 */ 16 public final class S57dat { // S57 ENC file fields lookup tables & methods 17 private S57dat() { 18 // Hide default constructor for utilities classes 19 } 22 20 // CHECKSTYLE.OFF: LineLength 23 21 -
applications/editors/josm/plugins/seachart/src/s57/S57dec.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. 10 2 package s57; 11 3 … … 17 9 import s57.S57map.Nflag; 18 10 19 public class S57dec { // S57 ENC file input & map conversion 11 /** 12 * @author Malcolm Herring 13 */ 14 public final class S57dec { // S57 ENC file input & map conversion 15 private S57dec() { 16 // Hide default constructor for utilities classes 17 } 20 18 // CHECKSTYLE.OFF: LineLength 21 19 -
applications/editors/josm/plugins/seachart/src/s57/S57enc.java
r32394 r32907 1 /* Copyright 2015 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. 10 2 package s57; 11 3 … … 33 25 import s57.S57val.AttVal; 34 26 35 public class S57enc { // S57 ENC file generation 27 /** 28 * @author Malcolm Herring 29 */ 30 public final class S57enc { // S57 ENC file generation 31 private S57enc() { 32 // Hide default constructor for utilities classes 33 } 36 34 // CHECKSTYLE.OFF: LineLength 37 35 -
applications/editors/josm/plugins/seachart/src/s57/S57map.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. 10 2 package s57; 11 3 … … 20 12 import s57.S57val.AttVal; 21 13 14 /** 15 * @author Malcolm Herring 16 */ 22 17 public class S57map { // S57/OSM map generation methods 23 18 // CHECKSTYLE.OFF: LineLength -
applications/editors/josm/plugins/seachart/src/s57/S57obj.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. 10 2 package s57; 11 3 … … 14 6 import java.util.Map; 15 7 16 public class S57obj { // S57 Object lookup tables & methods 8 /** 9 * @author Malcolm Herring 10 */ 11 public final class S57obj { // S57 Object lookup tables & methods 12 private S57obj() { 13 // Hide default constructor for utilities classes 14 } 17 15 // CHECKSTYLE.OFF: LineLength 18 16 -
applications/editors/josm/plugins/seachart/src/s57/S57osm.java
r32394 r32907 1 /* Copyright 2015 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. 10 2 package s57; 11 3 … … 20 12 import s57.S57val.Conv; 21 13 22 public class S57osm { // OSM to S57 Object/Attribute and Object/Primitive conversions 14 /** 15 * @author Malcolm Herring 16 */ 17 public final class S57osm { // OSM to S57 Object/Attribute and Object/Primitive conversions 18 private S57osm() { 19 // Hide default constructor for utilities classes 20 } 21 23 22 // CHECKSTYLE.OFF: LineLength 24 23 -
applications/editors/josm/plugins/seachart/src/s57/S57val.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. 10 2 package s57; 11 3 … … 15 7 import s57.S57att.Att; 16 8 17 public class S57val { // S57 Attribute values lookup tables & methods 9 /** 10 * @author Malcolm Herring 11 */ 12 public final class S57val { // S57 Attribute values lookup tables & methods 13 private S57val() { 14 // Hide default constructor for utilities classes 15 } 16 18 17 // CHECKSTYLE.OFF: LineLength 19 18 -
applications/editors/josm/plugins/seachart/src/seachart/ChartImage.java
r32679 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. 10 2 package seachart; 11 3 … … 38 30 import symbols.Symbols; 39 31 32 /** 33 * @author Malcolm Herring 34 */ 40 35 public class ChartImage extends ImageryLayer implements ZoomChangeListener, ChartContext { 41 36 -
applications/editors/josm/plugins/seachart/src/seachart/Seachart.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. 10 2 package seachart; 11 3 … … 15 7 import org.openstreetmap.josm.plugins.PluginInformation; 16 8 9 /** 10 * @author Malcolm Herring 11 */ 17 12 public class Seachart extends Plugin { 18 13 -
applications/editors/josm/plugins/seachart/src/seachart/SeachartAction.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. 10 2 package seachart; 11 3 … … 45 37 import s57.S57map; 46 38 39 /** 40 * @author Malcolm Herring 41 */ 47 42 public class SeachartAction extends JosmAction implements ActiveLayerChangeListener, LayerChangeListener { 48 43 private static String title = "SeaChart"; … … 117 112 public void actionPerformed(ActionEvent arg0) { 118 113 SwingUtilities.invokeLater(new Runnable() { 114 @Override 119 115 public void run() { 120 116 if (!isOpen) -
applications/editors/josm/plugins/seachart/src/symbols/Areas.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. 10 2 package symbols; 11 3 … … 26 18 import symbols.Symbols.Symbol; 27 19 28 public class Areas { 20 /** 21 * @author Malcolm Herring 22 */ 23 public final class Areas { 24 private Areas() { 25 // Hide default constructor for utilities classes 26 } 27 29 28 // CHECKSTYLE.OFF: LineLength 30 29 public static final Symbol Plane = new Symbol(); -
applications/editors/josm/plugins/seachart/src/symbols/Beacons.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. 10 2 package symbols; 11 3 … … 25 17 import symbols.Symbols.Symbol; 26 18 27 public class Beacons { 19 /** 20 * @author Malcolm Herring 21 */ 22 public final class Beacons { 23 private Beacons() { 24 // Hide default constructor for utilities classes 25 } 26 28 27 // CHECKSTYLE.OFF: LineLength 29 28 public static final Symbol Beacon = new Symbol(); -
applications/editors/josm/plugins/seachart/src/symbols/Buoys.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. 10 2 package symbols; 11 3 … … 23 15 import symbols.Symbols.Symbol; 24 16 25 public class Buoys { 17 /** 18 * @author Malcolm Herring 19 */ 20 public final class Buoys { 21 private Buoys() { 22 // Hide default constructor for utilities classes 23 } 24 26 25 // CHECKSTYLE.OFF: LineLength 27 26 public static final Symbol Barrel = new Symbol(); -
applications/editors/josm/plugins/seachart/src/symbols/Facilities.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. 10 2 package symbols; 11 3 … … 26 18 import symbols.Symbols.Symbol; 27 19 28 public class Facilities { 20 /** 21 * @author Malcolm Herring 22 */ 23 public final class Facilities { 24 private Facilities() { 25 // Hide default constructor for utilities classes 26 } 27 29 28 // CHECKSTYLE.OFF: LineLength 30 29 private static final Symbol Facility = new Symbol(); -
applications/editors/josm/plugins/seachart/src/symbols/Harbours.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. 10 2 package symbols; 11 3 … … 24 16 import symbols.Symbols.Symbol; 25 17 26 public class Harbours { 18 /** 19 * @author Malcolm Herring 20 */ 21 public final class Harbours { 22 private Harbours() { 23 // Hide default constructor for utilities classes 24 } 25 27 26 // CHECKSTYLE.OFF: LineLength 28 27 public static final Symbol Anchor = new Symbol(); -
applications/editors/josm/plugins/seachart/src/symbols/Landmarks.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. 10 2 package symbols; 11 3 … … 24 16 import symbols.Symbols.Symbol; 25 17 26 public class Landmarks { 18 /** 19 * @author Malcolm Herring 20 */ 21 public final class Landmarks { 22 private Landmarks() { 23 // Hide default constructor for utilities classes 24 } 25 27 26 // CHECKSTYLE.OFF: LineLength 28 27 private static final Symbol Base = new Symbol(); -
applications/editors/josm/plugins/seachart/src/symbols/Notices.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. 10 2 package symbols; 11 3 … … 35 27 import symbols.Symbols.Symbol; 36 28 37 public class Notices { 29 /** 30 * @author Malcolm Herring 31 */ 32 public final class Notices { 33 private Notices() { 34 // Hide default constructor for utilities classes 35 } 36 38 37 // CHECKSTYLE.OFF: LineLength 39 38 private static final Symbol Bollard = new Symbol(); -
applications/editors/josm/plugins/seachart/src/symbols/Symbols.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. 10 2 package symbols; 11 3 … … 25 17 import java.util.ArrayList; 26 18 27 public class Symbols { 19 /** 20 * @author Malcolm Herring 21 */ 22 public final class Symbols { 23 private Symbols() { 24 // Hide default constructor for utilities classes 25 } 26 28 27 // CHECKSTYLE.OFF: LineLength 29 28 public static final Color Yland = new Color(0xedbc0c); -
applications/editors/josm/plugins/seachart/src/symbols/Topmarks.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. 10 2 package symbols; 11 3 … … 28 20 import symbols.Symbols.Symbol; 29 21 30 public class Topmarks { 22 /** 23 * @author Malcolm Herring 24 */ 25 public final class Topmarks { 26 27 private Topmarks() { 28 // Hide default constructor for utilities classes 29 } 30 31 31 // CHECKSTYLE.OFF: LineLength 32 32 public static final Symbol RadarReflector = new Symbol();
Note:
See TracChangeset
for help on using the changeset viewer.