diff --git a/niord-core/src/main/java/org/niord/core/aton/vo/AtonNodeVo.java b/niord-core/src/main/java/org/niord/core/aton/vo/AtonNodeVo.java
index 24d22005f..c421af9e5 100644
--- a/niord-core/src/main/java/org/niord/core/aton/vo/AtonNodeVo.java
+++ b/niord-core/src/main/java/org/niord/core/aton/vo/AtonNodeVo.java
@@ -27,6 +27,8 @@
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Arrays;
import java.util.Date;
+import java.util.Optional;
+import java.util.stream.Stream;
/**
* An AtoN OSM seamark node.
@@ -151,6 +153,20 @@ public int hashCode() {
return result;
}
+ /**
+ * Checks whether the current node is for a virtual AtoN.
+ * @return
+ */
+ public boolean isVAtoN() {
+ if(tags == null) {
+ return false;
+ }
+ return Stream.of(Optional.of(tags).orElse(new AtonTagVo[0]))
+ .filter(tag -> tag.k.equals("seamark:type") && tag.v.equals("virtual_aton"))
+ .findAny()
+ .isPresent();
+ }
+
/*************************/
/** Matcher functions **/
/*************************/
diff --git a/niord-core/src/main/resources/aton/INT-1-preset.xml b/niord-core/src/main/resources/aton/INT-1-preset.xml
index 83750756b..dbc0ec745 100644
--- a/niord-core/src/main/resources/aton/INT-1-preset.xml
+++ b/niord-core/src/main/resources/aton/INT-1-preset.xml
@@ -1,6 +1,6 @@
-
-
+
+
@@ -44,7 +44,7 @@
-
+
@@ -82,7 +82,7 @@
-
+
@@ -94,7 +94,7 @@
-
+
@@ -119,7 +119,7 @@
-
+
@@ -131,14 +131,14 @@
-
+
-
+
@@ -147,7 +147,7 @@
-
+
@@ -156,7 +156,7 @@
-
+
@@ -165,7 +165,7 @@
-
+
@@ -193,7 +193,7 @@
-
+
@@ -214,7 +214,7 @@
-
+
@@ -223,7 +223,7 @@
-
+
@@ -234,7 +234,7 @@
-
+
@@ -245,7 +245,7 @@
-
+
@@ -254,7 +254,7 @@
-
+
@@ -270,15 +270,15 @@
-
+
-
+
-
+
-
+
-
+
-
@@ -292,9 +292,9 @@
-
+
-
+
-
@@ -307,25 +307,25 @@
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
- -
+
+
-
@@ -341,10 +341,10 @@
-
+
-
- -
+
+
-
@@ -365,10 +365,10 @@
-
+
-
- -
+
+
-
@@ -377,7 +377,7 @@
-
+
-
@@ -388,9 +388,9 @@
-
+
-
+
-
@@ -404,9 +404,9 @@
-
+
-
+
-
@@ -416,12 +416,12 @@
-
-
-
+
+
+
-
- -
+
+
-
@@ -434,12 +434,12 @@
-
+
-
+
-
- -
+
+
-
@@ -453,15 +453,15 @@
-
+
-
+
-
+
-
+
-
+
-
@@ -509,9 +509,9 @@
-
+
-
+
-
@@ -520,9 +520,9 @@
-
+
-
+
-
@@ -534,82 +534,82 @@
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
@@ -621,33 +621,33 @@
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
@@ -659,40 +659,40 @@
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
-
+
-
+
-
@@ -702,9 +702,9 @@
-
+
-
+
-
@@ -714,68 +714,68 @@
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
-
- -
+
+
-
@@ -788,35 +788,35 @@
-
+
-
+
-
-
+
-
-
+
-
+
-
+
-
+
-
+
-
-
+
@@ -878,28 +878,28 @@
-
+
-
+
-
- -
+
+
-
-
-
-
+
+
+
-
+
-
+
-
+
-
@@ -940,10 +940,10 @@
-
+
-
- -
+
+
-
@@ -966,21 +966,21 @@
-
+
-
-
+
-
-
+
-
@@ -988,14 +988,14 @@
-
+
-
-
+
-
@@ -1006,8 +1006,8 @@
-
- -
+
+
-
@@ -1016,15 +1016,15 @@
-
- -
+
+
-
-
- -
+
+
-
@@ -1033,14 +1033,14 @@
-
+
-
-
- -
+
+
-
@@ -1049,8 +1049,8 @@
-
- -
+
+
-
@@ -1064,107 +1064,107 @@
-
- -
+
+
-
-
+
-
+
-
- -
+
+
-
-
- -
+
+
-
-
- -
+
+
-
-
+
-
+
-
+
-
+
-
-
+
-
-
+
-
-
+
-
-
+
-
-
+
-
+
-
+
-
-
-
- -
+
+
+
+
-
-
- -
+
+
-
-
+
-
+
-
+
-
+
-
@@ -1227,11 +1227,11 @@
-
+
-
+
-
+
-
@@ -1242,7 +1242,7 @@
-
+
-
@@ -1261,14 +1261,14 @@
-
+
-
-
+
-
@@ -1299,8 +1299,8 @@
-
- -
+
+
-
@@ -1312,14 +1312,14 @@
-
- -
+
+
-
-
+
-
@@ -1329,7 +1329,7 @@
-
+
-
@@ -1342,14 +1342,14 @@
-
+
-
+
-
+
-
- -
+
+
-
@@ -1362,7 +1362,7 @@
-
+
-
@@ -1383,16 +1383,16 @@
-
- -
+
+
-
-
- -
+
+
-
@@ -1402,7 +1402,7 @@
-
+
-
@@ -1411,7 +1411,7 @@
-
+
-
@@ -1419,22 +1419,22 @@
-
+
-
-
+
-
-
- -
+
+
-
@@ -1444,16 +1444,16 @@
-
- -
+
+
-
-
- -
+
+
-
@@ -1461,15 +1461,15 @@
-
- -
+
+
-
-
+
-
@@ -1480,19 +1480,19 @@
-
+
-
-
+
-
+
-
- -
+
+
-
@@ -1514,14 +1514,14 @@
-
- -
+
+
-
-
+
-
@@ -1533,7 +1533,7 @@
-
+
-
@@ -1549,7 +1549,7 @@
-
+
-
@@ -1566,14 +1566,14 @@
-
+
-
+
-
+
-
- -
+
+
-
@@ -1581,11 +1581,12 @@
+
-
+
-
- -
+
+
-
@@ -1601,30 +1602,30 @@
-
+
-
+
-
-
+
-
-
- -
+
+
-
-
- -
+
+
-
@@ -1633,67 +1634,67 @@
-
- -
+
+
-
-
- -
+
+
-
-
- -
+
+
-
-
+
-
- -
+
+
-
-
- -
+
+
-
-
- -
+
+
-
-
- -
+
+
-
-
- -
+
+
-
-
- -
+
+
-
-
+
-
@@ -1708,8 +1709,8 @@
-
- -
+
+
-
@@ -1720,13 +1721,13 @@
-
+
-
+
-
+
-
+
-
@@ -1759,7 +1760,7 @@
-
+
-
@@ -1786,9 +1787,9 @@
-
+
-
+
-
@@ -1816,37 +1817,37 @@
-
+
-
+
-
-
+
-
-
+
-
+
-
-
+
-
-
+
-
@@ -1866,8 +1867,8 @@
-
- -
+
+
-
@@ -1876,8 +1877,8 @@
-
- -
+
+
-
@@ -1886,8 +1887,8 @@
-
- -
+
+
-
@@ -1896,8 +1897,8 @@
-
- -
+
+
-
@@ -1906,7 +1907,7 @@
-
+
-
@@ -1914,8 +1915,8 @@
-
- -
+
+
-
@@ -1924,16 +1925,16 @@
-
- -
+
+
-
-
- -
+
+
-
@@ -1942,8 +1943,8 @@
-
- -
+
+
-
@@ -1952,8 +1953,8 @@
-
- -
+
+
-
@@ -1962,27 +1963,27 @@
-
- -
+
+
-
-
- -
+
+
-
-
+
-
+
-
+
-
+
-
@@ -2009,9 +2010,9 @@
-
+
-
+
-
@@ -2020,13 +2021,13 @@
-
+
-
+
-
+
-
+
-
@@ -2049,9 +2050,9 @@
-
+
-
+
-
@@ -2074,9 +2075,9 @@
-
+
-
+
-
@@ -2099,9 +2100,9 @@
-
+
-
+
-
@@ -2124,9 +2125,9 @@
-
+
-
+
-
@@ -2149,13 +2150,13 @@
-
+
-
+
-
+
-
+
-
@@ -2181,9 +2182,9 @@
-
+
-
+
-
@@ -2209,9 +2210,9 @@
-
+
-
+
-
@@ -2237,9 +2238,9 @@
-
+
-
+
-
@@ -2265,9 +2266,9 @@
-
+
-
+
-
@@ -2293,9 +2294,9 @@
-
+
-
+
-
@@ -2321,11 +2322,11 @@
-
+
-
+
-
+
-
@@ -2354,15 +2355,15 @@
-
+
-
+
-
+
-
+
-
+
@@ -2370,7 +2371,7 @@
-
+
@@ -2378,38 +2379,38 @@
-
+
-
+
-
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
@@ -2418,9 +2419,9 @@
-
+
-
+
@@ -2433,7 +2434,7 @@
-
+
@@ -2450,16 +2451,16 @@
-
+
-
+
-
+
@@ -2481,19 +2482,19 @@
-
+
-
+
-
+
@@ -2552,17 +2553,17 @@
-
+
-
+
-
-
+
-
+
-
+
-
@@ -2570,15 +2571,15 @@
-
+
-
-
+
-
+
-
@@ -2586,19 +2587,19 @@
-
+
-
-
+
-
+
-
+
-
+
-
@@ -2606,15 +2607,15 @@
-
+
-
-
+
-
+
-
@@ -2622,19 +2623,19 @@
-
+
-
-
+
-
+
-
+
-
+
-
@@ -2642,7 +2643,7 @@
-
+
-
@@ -2650,7 +2651,7 @@
-
+
-
@@ -2658,7 +2659,7 @@
-
+
-
@@ -2666,9 +2667,9 @@
-
+
-
+
-
@@ -2676,7 +2677,7 @@
-
+
-
@@ -2684,7 +2685,7 @@
-
+
-
@@ -2692,7 +2693,7 @@
-
+
-
@@ -2700,13 +2701,13 @@
-
+
-
+
-
+
-
+
-
@@ -2714,7 +2715,7 @@
-
+
-
@@ -2722,21 +2723,21 @@
-
+
-
+
-
-
+
-
+
-
+
-
+
-
@@ -2744,7 +2745,7 @@
-
+
-
@@ -2752,11 +2753,11 @@
-
+
-
+
-
+
-
@@ -2764,7 +2765,7 @@
-
+
-
@@ -2772,11 +2773,11 @@
-
+
-
+
-
+
-
@@ -2784,7 +2785,7 @@
-
+
-
@@ -2792,11 +2793,11 @@
-
+
-
+
-
+
-
@@ -2804,7 +2805,7 @@
-
+
-
@@ -2812,15 +2813,15 @@
-
+
-
+
-
+
-
+
-
+
-
@@ -2828,7 +2829,7 @@
-
+
-
@@ -2836,11 +2837,11 @@
-
+
-
+
-
+
-
@@ -2848,7 +2849,7 @@
-
+
-
@@ -2856,25 +2857,25 @@
-
+
-
+
-
+
-
+
-
+
-
-
+
-
+
-
+
-
@@ -2893,9 +2894,9 @@
-
+
-
+
-
@@ -2913,9 +2914,9 @@
-
+
-
+
-
@@ -2931,9 +2932,9 @@
-
+
-
+
-
@@ -2948,9 +2949,9 @@
-
+
-
+
-
@@ -2969,15 +2970,15 @@
-
+
-
+
-
+
-
+
-
+
-
@@ -2990,9 +2991,9 @@
-
+
-
+
-
@@ -3005,9 +3006,9 @@
-
+
-
+
-
@@ -3020,9 +3021,9 @@
-
+
-
+
-
@@ -3035,13 +3036,13 @@
-
+
-
+
-
+
-
+
-
@@ -3054,9 +3055,9 @@
-
+
-
+
-
@@ -3069,9 +3070,9 @@
-
+
-
+
-
@@ -3084,9 +3085,9 @@
-
+
-
+
-
@@ -3099,17 +3100,17 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
@@ -3125,9 +3126,9 @@
-
+
-
+
-
@@ -3145,13 +3146,13 @@
-
+
-
+
-
+
-
+
-
@@ -3167,9 +3168,9 @@
-
+
-
+
-
@@ -3187,11 +3188,11 @@
-
+
-
+
-
+
-
@@ -3207,9 +3208,9 @@
-
+
-
+
-
@@ -3222,13 +3223,13 @@
-
+
-
+
-
+
-
+
-
@@ -3240,9 +3241,9 @@
-
+
-
+
-
@@ -3254,9 +3255,9 @@
-
+
-
+
-
@@ -3268,9 +3269,9 @@
-
+
-
+
-
@@ -3282,11 +3283,11 @@
-
+
-
+
-
+
-
@@ -3297,9 +3298,9 @@
-
+
-
+
-
@@ -3310,9 +3311,9 @@
-
+
-
+
-
@@ -3326,9 +3327,9 @@
-
+
-
+
-
@@ -3340,9 +3341,9 @@
-
+
-
+
-
@@ -3365,9 +3366,9 @@
-
+
-
+
-
@@ -3387,9 +3388,9 @@
-
+
-
+
-
@@ -3420,15 +3421,15 @@
-
+
-
+
-
+
-
+
-
+
-
@@ -3447,9 +3448,9 @@
-
+
-
+
-
@@ -3467,9 +3468,9 @@
-
+
-
+
-
@@ -3485,9 +3486,9 @@
-
+
-
+
-
@@ -3502,9 +3503,9 @@
-
+
-
+
-
@@ -3523,15 +3524,15 @@
-
+
-
+
-
+
-
+
-
+
-
@@ -3544,9 +3545,9 @@
-
+
-
+
-
@@ -3559,9 +3560,9 @@
-
+
-
+
-
@@ -3574,9 +3575,9 @@
-
+
-
+
-
@@ -3589,13 +3590,13 @@
-
+
-
+
-
+
-
+
-
@@ -3608,9 +3609,9 @@
-
+
-
+
-
@@ -3623,9 +3624,9 @@
-
+
-
+
-
@@ -3638,9 +3639,9 @@
-
+
-
+
-
@@ -3653,17 +3654,17 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
@@ -3677,9 +3678,9 @@
-
+
-
+
-
@@ -3695,13 +3696,13 @@
-
+
-
+
-
+
-
+
-
@@ -3715,9 +3716,9 @@
-
+
-
+
-
@@ -3733,11 +3734,11 @@
-
+
-
+
-
+
-
@@ -3748,16 +3749,16 @@
-
+
-
+
-
+
-
+
-
+
-
@@ -3768,9 +3769,9 @@
-
+
-
+
-
@@ -3781,13 +3782,13 @@
-
+
-
+
-
+
-
+
-
@@ -3798,9 +3799,9 @@
-
+
-
+
-
@@ -3811,13 +3812,13 @@
-
+
-
+
-
+
-
+
-
@@ -3828,9 +3829,9 @@
-
+
-
+
-
@@ -3841,13 +3842,13 @@
-
+
-
+
-
+
-
+
-
@@ -3858,9 +3859,9 @@
-
+
-
+
-
@@ -3871,13 +3872,13 @@
-
+
-
+
-
+
-
+
-
@@ -3889,13 +3890,13 @@
-
+
-
+
-
+
-
+
-
@@ -3907,9 +3908,9 @@
-
+
-
+
-
@@ -3921,9 +3922,9 @@
-
+
-
+
-
@@ -3935,9 +3936,9 @@
-
+
-
+
-
@@ -3949,11 +3950,11 @@
-
+
-
+
-
+
-
@@ -3964,9 +3965,9 @@
-
+
-
+
-
@@ -3977,9 +3978,9 @@
-
+
-
+
-
@@ -3993,18 +3994,18 @@
-
+
-
+
-
+
-
+
-
+
-
-
+
@@ -4039,15 +4040,15 @@
-
+
-
+
-
-
+
@@ -4071,13 +4072,13 @@
-
+
-
+
-
@@ -4096,13 +4097,13 @@
-
-
+
+
-
+
-
@@ -4121,13 +4122,13 @@
-
+
-
+
-
@@ -4193,15 +4194,15 @@
-
+
-
+
-
+
-
@@ -4324,7 +4325,7 @@
-
+
-
@@ -4408,7 +4409,7 @@
-
+
-
@@ -4464,19 +4465,19 @@
-
+
-
+
-
+
-
+
-
+
-
-
+
@@ -4500,21 +4501,21 @@
-
+
-
+
-
+
-
+
-
-
+
-
+
-
@@ -4529,9 +4530,9 @@
-
+
-
+
-
@@ -4545,22 +4546,22 @@
-
+
-
+
-
-
+
-
-
- -
+
+
-
@@ -4583,60 +4584,63 @@
+
+
+
-
+
-
- -
+
+
-
-
+
-
+
-
- -
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
- -
+
+
-
-
-
+
-
+
-
+
-
+
-
+
-
@@ -4650,7 +4654,7 @@
-
+
-
@@ -4661,12 +4665,12 @@
-
+
-
-
+
-
@@ -4685,7 +4689,7 @@
-
+
-
@@ -4704,12 +4708,12 @@
-
+
-
-
+
@@ -4725,9 +4729,9 @@
-
+
-
+
-
@@ -4754,17 +4758,17 @@
-
+
-
+
-
+
-
+
-
- -
-
+
+
-
+
@@ -4815,18 +4819,18 @@
-
+
-
- -
-
+
+
-
+
-
-
+
+
@@ -4838,30 +4842,30 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
@@ -4901,12 +4905,12 @@
-
+
-
+
-
- -
+
+
-
@@ -4940,8 +4944,8 @@
-
- -
+
+
-
@@ -4960,23 +4964,23 @@
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
+
+
\ No newline at end of file
diff --git a/niord-josm-seachart/src/main/java/render/ChartContext.java b/niord-josm-seachart/src/main/java/render/ChartContext.java
index 735fa47ec..caa84bc5c 100644
--- a/niord-josm-seachart/src/main/java/render/ChartContext.java
+++ b/niord-josm-seachart/src/main/java/render/ChartContext.java
@@ -13,14 +13,24 @@
import java.awt.geom.Point2D;
import s57.S57map;
-import s57.S57map.*;
+import s57.S57map.Feature;
+import s57.S57map.Snode;
+/**
+ * @author Malcolm Herring
+ */
public interface ChartContext {
- public enum RuleSet { ALL, BASE, SEAMARK }
+ enum RuleSet { ALL, BASE, SEAMARK }
Point2D getPoint(Snode coord);
+
double mile(Feature feature);
+
boolean clip();
+
+ int grid();
+
Color background(S57map map);
+
RuleSet ruleset();
}
diff --git a/niord-josm-seachart/src/main/java/render/Renderer.java b/niord-josm-seachart/src/main/java/render/Renderer.java
index d4d8aa219..e7e1ec09d 100644
--- a/niord-josm-seachart/src/main/java/render/Renderer.java
+++ b/niord-josm-seachart/src/main/java/render/Renderer.java
@@ -9,22 +9,55 @@
package render;
-import java.awt.*;
-import java.awt.font.*;
-import java.awt.geom.*;
-import java.awt.image.*;
-import java.util.*;
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.TexturePaint;
+import java.awt.font.FontRenderContext;
+import java.awt.font.GlyphVector;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Arc2D;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Line2D;
+import java.awt.geom.Path2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
+import java.awt.image.AffineTransformOp;
+import java.awt.image.BufferedImage;
+import java.util.ArrayList;
-import s57.S57val.*;
import s57.S57map;
-import s57.S57map.*;
+import s57.S57map.GeomIterator;
+import s57.S57map.Pflag;
+import s57.S57map.Snode;
+import s57.S57val.UniHLU;
import symbols.Areas;
import symbols.Symbols;
-import symbols.Symbols.*;
+import symbols.Symbols.Caption;
+import symbols.Symbols.Delta;
+import symbols.Symbols.Form;
+import symbols.Symbols.Handle;
+import symbols.Symbols.Instr;
+import symbols.Symbols.LineStyle;
+import symbols.Symbols.Scheme;
+import symbols.Symbols.SubSymbol;
+import symbols.Symbols.Symbol;
-public class Renderer {
+/**
+ * @author Malcolm Herring
+ */
+public final class Renderer {
+ private Renderer() {
+ // Hide default constructor for utilities classes
+ }
- 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 };
+ 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};
public enum LabelStyle { NONE, RRCT, RECT, ELPS, CIRC, VCLR, PCLR, HCLR }
@@ -42,8 +75,8 @@ public static void reRender(Graphics2D g, Rectangle rect, int z, double factor,
sScale = symbolScale[zoom] * factor;
if (map != null) {
if (context.clip()) {
- Point2D tl = context.getPoint(map.new Snode(map.bounds.maxlat, map.bounds.minlon));
- Point2D br = context.getPoint(map.new Snode(map.bounds.minlat, map.bounds.maxlon));
+ Point2D tl = context.getPoint(new Snode(map.bounds.maxlat, map.bounds.minlon));
+ Point2D br = context.getPoint(new Snode(map.bounds.minlat, map.bounds.maxlon));
g2.clip(new Rectangle2D.Double(tl.getX(), tl.getY(), (br.getX() - tl.getX()), (br.getY() - tl.getY())));
}
g2.setBackground(context.background(map));
@@ -51,27 +84,39 @@ public static void reRender(Graphics2D g, Rectangle rect, int z, double factor,
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
g2.setStroke(new BasicStroke(0, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER));
- Rules.rules();
+ do {} while (!Rules.rules());
}
+ grid();
}
public static void symbol(Symbol symbol) {
Point2D point = context.getPoint(Rules.feature.geom.centre);
Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), null, null);
}
+
public static void symbol(Symbol symbol, Scheme scheme) {
Point2D point = context.getPoint(Rules.feature.geom.centre);
Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, null);
}
+
public static void symbol(Symbol symbol, Delta delta) {
Point2D point = context.getPoint(Rules.feature.geom.centre);
Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), null, delta);
}
+
public static void symbol(Symbol symbol, Scheme scheme, Delta delta) {
Point2D point = context.getPoint(Rules.feature.geom.centre);
Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, delta);
}
-
+
+ public static void colLetters(ArrayList> cols) {
+ String str = "";
+ for (int i = 0; (i < cols.size()) && (i < 4); i++) {
+ str = str.concat(Rules.colourLetters.get(cols.get(i)));
+ }
+ labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 40)));
+ }
+
public static void cluster(ArrayList symbols) {
Rectangle2D.Double bbox = null;
if (symbols.size() > 4) {
@@ -84,69 +129,69 @@ public static void cluster(ArrayList symbols) {
if (bbox == null) return;
}
switch (symbols.size()) {
- case 1:
- symbol(symbols.get(0), new Delta(Handle.CC, new AffineTransform()));
- break;
- case 2:
- symbol(symbols.get(0), new Delta(Handle.RC, new AffineTransform()));
- symbol(symbols.get(1), new Delta(Handle.LC, new AffineTransform()));
- break;
- case 3:
- symbol(symbols.get(0), new Delta(Handle.BC, new AffineTransform()));
- symbol(symbols.get(1), new Delta(Handle.TR, new AffineTransform()));
- symbol(symbols.get(2), new Delta(Handle.TL, new AffineTransform()));
- break;
- case 4:
- symbol(symbols.get(0), new Delta(Handle.BR, new AffineTransform()));
- symbol(symbols.get(1), new Delta(Handle.BL, new AffineTransform()));
- symbol(symbols.get(2), new Delta(Handle.TR, new AffineTransform()));
- symbol(symbols.get(3), new Delta(Handle.TL, new AffineTransform()));
- break;
- case 5:
- symbol(symbols.get(0), new Delta(Handle.BR, new AffineTransform()));
- symbol(symbols.get(1), new Delta(Handle.BL, new AffineTransform()));
- symbol(symbols.get(2), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
- symbol(symbols.get(3), new Delta(Handle.TC, new AffineTransform()));
- symbol(symbols.get(4), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
- break;
- case 6:
- symbol(symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
- symbol(symbols.get(1), new Delta(Handle.BC, new AffineTransform()));
- symbol(symbols.get(2), new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
- symbol(symbols.get(3), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
- symbol(symbols.get(4), new Delta(Handle.TC, new AffineTransform()));
- symbol(symbols.get(5), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
- break;
- case 7:
- symbol(symbols.get(0), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
- symbol(symbols.get(1), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
- symbol(symbols.get(2), new Delta(Handle.CC, new AffineTransform()));
- symbol(symbols.get(3), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
- symbol(symbols.get(4), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
- symbol(symbols.get(5), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
- symbol(symbols.get(6), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
- break;
- case 8:
- symbol(symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
- symbol(symbols.get(1), new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
- symbol(symbols.get(2), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
- symbol(symbols.get(3), new Delta(Handle.CC, new AffineTransform()));
- symbol(symbols.get(4), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
- symbol(symbols.get(5), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
- symbol(symbols.get(6), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
- symbol(symbols.get(7), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
- break;
- case 9:
- symbol(symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, -bbox.height/2)));
- symbol(symbols.get(1), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
- symbol(symbols.get(2), new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, -bbox.height/2)));
- symbol(symbols.get(3), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
- symbol(symbols.get(4), new Delta(Handle.CC, new AffineTransform()));
- symbol(symbols.get(5), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
- symbol(symbols.get(6), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
- symbol(symbols.get(7), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
- symbol(symbols.get(8), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
- break;
+ case 1:
+ symbol(symbols.get(0), new Delta(Handle.CC, new AffineTransform()));
+ break;
+ case 2:
+ symbol(symbols.get(0), new Delta(Handle.RC, new AffineTransform()));
+ symbol(symbols.get(1), new Delta(Handle.LC, new AffineTransform()));
+ break;
+ case 3:
+ symbol(symbols.get(0), new Delta(Handle.BC, new AffineTransform()));
+ symbol(symbols.get(1), new Delta(Handle.TR, new AffineTransform()));
+ symbol(symbols.get(2), new Delta(Handle.TL, new AffineTransform()));
+ break;
+ case 4:
+ symbol(symbols.get(0), new Delta(Handle.BR, new AffineTransform()));
+ symbol(symbols.get(1), new Delta(Handle.BL, new AffineTransform()));
+ symbol(symbols.get(2), new Delta(Handle.TR, new AffineTransform()));
+ symbol(symbols.get(3), new Delta(Handle.TL, new AffineTransform()));
+ break;
+ case 5:
+ symbol(symbols.get(0), new Delta(Handle.BR, new AffineTransform()));
+ symbol(symbols.get(1), new Delta(Handle.BL, new AffineTransform()));
+ symbol(symbols.get(2), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
+ symbol(symbols.get(3), new Delta(Handle.TC, new AffineTransform()));
+ symbol(symbols.get(4), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
+ break;
+ case 6:
+ symbol(symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
+ symbol(symbols.get(1), new Delta(Handle.BC, new AffineTransform()));
+ symbol(symbols.get(2), new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
+ symbol(symbols.get(3), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
+ symbol(symbols.get(4), new Delta(Handle.TC, new AffineTransform()));
+ symbol(symbols.get(5), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
+ break;
+ case 7:
+ symbol(symbols.get(0), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
+ symbol(symbols.get(1), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
+ symbol(symbols.get(2), new Delta(Handle.CC, new AffineTransform()));
+ symbol(symbols.get(3), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
+ symbol(symbols.get(4), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
+ symbol(symbols.get(5), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
+ symbol(symbols.get(6), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
+ break;
+ case 8:
+ symbol(symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
+ symbol(symbols.get(1), new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
+ symbol(symbols.get(2), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
+ symbol(symbols.get(3), new Delta(Handle.CC, new AffineTransform()));
+ symbol(symbols.get(4), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
+ symbol(symbols.get(5), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
+ symbol(symbols.get(6), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
+ symbol(symbols.get(7), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
+ break;
+ case 9:
+ symbol(symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, -bbox.height/2)));
+ symbol(symbols.get(1), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
+ symbol(symbols.get(2), new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, -bbox.height/2)));
+ symbol(symbols.get(3), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
+ symbol(symbols.get(4), new Delta(Handle.CC, new AffineTransform()));
+ symbol(symbols.get(5), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
+ symbol(symbols.get(6), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
+ symbol(symbols.get(7), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
+ symbol(symbols.get(8), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
+ break;
}
}
@@ -230,7 +275,8 @@ public static void lineSymbols(Symbol prisymb, double space, Symbol secsymb, Sym
}
if (!gap) {
Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(), new Scheme(col),
- new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())) + Math.toRadians(90))));
+ new Delta(Handle.BC, AffineTransform.getRotateInstance(
+ Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())) + Math.toRadians(90))));
}
if (space > 0)
gap = !gap;
@@ -296,36 +342,141 @@ public static void lineVector(LineStyle style) {
g2.draw(p);
}
}
-
+
+ public static void grid() {
+ if ((context.grid() > 0) && (map != null)) {
+ LineStyle style = new LineStyle(Color.black, (float)2.0);
+ Point2D point = context.getPoint(new Snode(map.bounds.minlat, map.bounds.maxlon));
+ double ratio = point.getX() / point.getY();
+ double nspan = 60 * Math.toDegrees(map.bounds.maxlon - map.bounds.minlon) / (context.grid() * (ratio > 1.0 ? ratio : 1.0));
+ double mult = 1.0;
+ if (nspan < 1.0) {
+ do {
+ nspan *= 10.0;
+ mult *= 10.0;
+ } while (nspan < 1.0);
+ } else if (nspan > 10.0){
+ do {
+ nspan /= 10.0;
+ mult /= 10.0;
+ } while (nspan > 10.0);
+ }
+ if (nspan < 2.0) nspan = 1.0;
+ else if (nspan < 5.0) nspan = 2.0;
+ else nspan = 5.0;
+ nspan = nspan / mult / 60.0;
+ double left = Math.toDegrees(map.bounds.minlon) + 180.0;
+ left = Math.ceil(left / nspan);
+ left = Math.toRadians((left * nspan) - 180.0);
+ g2.setStroke(new BasicStroke((float) (style.width * sScale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
+ Path2D.Double p = new Path2D.Double();
+ for (double lon = left; lon < map.bounds.maxlon; lon += Math.toRadians(nspan)) {
+ point = context.getPoint(new Snode(map.bounds.maxlat, lon));
+ p.moveTo(point.getX(), point.getY());
+ point = context.getPoint(new Snode(map.bounds.minlat, lon));
+ p.lineTo(point.getX(), point.getY());
+ double deg = Math.toDegrees(lon);
+ String ew = (deg < -0.001) ? "W" : (deg > 0.001) ? "E" : "";
+ deg = Math.abs(deg);
+ String dstr = String.format("%03d°", (int)Math.floor(deg));
+ double min = (deg - Math.floor(deg)) * 60.0;
+ String mstr = String.format("%05.2f'%s", min, ew);
+ Symbol label = new Symbol();
+ if (point.getX() > 600.0) {
+ label.add(new Instr(Form.TEXT, new Caption(dstr, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-10, -20)))));
+ label.add(new Instr(Form.TEXT, new Caption(mstr, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, 0)))));
+ Symbols.drawSymbol(g2, label, sScale, point.getX(), point.getY(), null, null);
+ }
+ }
+ g2.setPaint(style.line);
+ g2.draw(p);
+ double tspan = 60 * Math.toDegrees(map.bounds.maxlat - map.bounds.minlat) / (context.grid() / (ratio < 1.0 ? ratio : 1.0));
+ mult = 1.0;
+ if (tspan < 1.0) {
+ do {
+ tspan *= 10.0;
+ mult *= 10.0;
+ } while (tspan < 1.0);
+ } else if (tspan > 10.0){
+ do {
+ tspan /= 10.0;
+ mult /= 10.0;
+ } while (tspan > 10.0);
+ }
+ if (tspan < 2.0) tspan = 1.0;
+ else if (tspan < 5.0) tspan = 2.0;
+ else tspan = 5.0;
+ tspan = tspan / mult / 60.0;
+ double bottom = Math.toDegrees(map.bounds.minlat) + 90.0;
+ bottom = Math.ceil(bottom / tspan);
+ bottom = Math.toRadians((bottom * tspan) - 90.0);
+ g2.setStroke(new BasicStroke((float) (style.width * sScale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
+ p = new Path2D.Double();
+ for (double lat = bottom; lat < map.bounds.maxlat; lat += Math.toRadians(tspan)) {
+ point = context.getPoint(new Snode(lat, map.bounds.maxlon));
+ p.moveTo(point.getX(), point.getY());
+ point = context.getPoint(new Snode(lat, map.bounds.minlon));
+ p.lineTo(point.getX(), point.getY());
+ double deg = Math.toDegrees(lat);
+ String ns = (deg < -0.001) ? "S" : (deg > 0.001) ? "N" : "";
+ deg = Math.abs(deg);
+ String dstr = String.format("%02d°%s", (int)Math.floor(deg), ns);
+ double min = (deg - Math.floor(deg)) * 60.0;
+ String mstr = String.format("%05.2f'", min);
+ Symbol label = new Symbol();
+ if (point.getY() < (context.getPoint(new Snode(map.bounds.minlat, map.bounds.minlon)).getY() - 200.0)) {
+ label.add(new Instr(Form.TEXT, new Caption(dstr, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.BL, AffineTransform.getTranslateInstance(10, -10)))));
+ label.add(new Instr(Form.TEXT, new Caption(mstr, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, 50)))));
+ Symbols.drawSymbol(g2, label, sScale, point.getX(), point.getY(), null, null);
+ }
+ }
+ g2.setPaint(style.line);
+ g2.draw(p);
+ Symbol legend = new Symbol();
+ legend.add(new Instr(Form.BBOX, new Rectangle2D.Double(0, 0, 500, 100)));
+ Path2D.Double path = new Path2D.Double(); path.moveTo(0, 0); path.lineTo(500, 0); path.lineTo(500, 100); path.lineTo(0, 100); path.closePath();
+ legend.add(new Instr(Form.FILL, Color.white));
+ legend.add(new Instr(Form.PGON, path));
+ legend.add(new Instr(Form.TEXT, new Caption("Mercator Projection", new Font("Arial", Font.PLAIN, 50), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(250, 60)))));
+ point = context.getPoint(new Snode(map.bounds.minlat, map.bounds.minlon));
+ Symbols.drawSymbol(g2, legend, sScale, point.getX(), point.getY(), null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, 0)));
+ legend = new Symbol();
+ legend.add(new Instr(Form.BBOX, new Rectangle2D.Double(0, 0, 500, 100)));
+ legend.add(new Instr(Form.TEXT, new Caption("© OpenStreetMap contributors", new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(250, 100)))));
+ point = context.getPoint(new Snode(map.bounds.minlat, map.bounds.minlon));
+ Symbols.drawSymbol(g2, legend, sScale, point.getX(), point.getY(), null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, 0)));
+ }
+ }
+
public static void lineCircle(LineStyle style, double radius, UniHLU units) {
switch (units) {
- case HLU_FEET:
- radius /= 6076;
- break;
- case HLU_KMTR:
- radius /= 1.852;
- break;
- case HLU_HMTR:
- radius /= 18.52;
- break;
- case HLU_SMIL:
- radius /= 1.15078;
- break;
- case HLU_NMIL:
- break;
- default:
- radius /= 1852;
- break;
+ case HLU_FEET:
+ radius /= 6076;
+ break;
+ case HLU_KMTR:
+ radius /= 1.852;
+ break;
+ case HLU_HMTR:
+ radius /= 18.52;
+ break;
+ case HLU_SMIL:
+ radius /= 1.15078;
+ break;
+ case HLU_NMIL:
+ break;
+ default:
+ radius /= 1852;
+ break;
}
radius *= context.mile(Rules.feature);
Symbol circle = new Symbol();
if (style.fill != null) {
circle.add(new Instr(Form.FILL, style.fill));
- circle.add(new Instr(Form.RSHP, new Ellipse2D.Double(-radius,-radius,radius*2,radius*2)));
+ circle.add(new Instr(Form.RSHP, new Ellipse2D.Double(-radius, -radius, radius*2, radius*2)));
}
circle.add(new Instr(Form.FILL, style.line));
circle.add(new Instr(Form.STRK, new BasicStroke(style.width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, style.dash, 0)));
- circle.add(new Instr(Form.ELPS, new Ellipse2D.Double(-radius,-radius,radius*2,radius*2)));
+ circle.add(new Instr(Form.ELPS, new Ellipse2D.Double(-radius, -radius, radius*2, radius*2)));
Point2D point = context.getPoint(Rules.feature.geom.centre);
Symbols.drawSymbol(g2, circle, 1, point.getX(), point.getY(), null, null);
}
@@ -335,260 +486,285 @@ public static void fillPattern(BufferedImage image) {
p.setWindingRule(GeneralPath.WIND_EVEN_ODD);
Point2D point;
switch (Rules.feature.geom.prim) {
- case POINT:
- point = context.getPoint(Rules.feature.geom.centre);
- g2.drawImage(image, new AffineTransformOp(AffineTransform.getScaleInstance(sScale, sScale), AffineTransformOp.TYPE_NEAREST_NEIGHBOR),
- (int)(point.getX() - (50 * sScale)), (int)(point.getY() - (50 * sScale)));
- break;
- case AREA:
- GeomIterator git = map.new GeomIterator(Rules.feature.geom);
- while (git.hasComp()) {
- git.nextComp();
- while (git.hasEdge()) {
- git.nextEdge();
- point = context.getPoint(git.next());
- p.moveTo(point.getX(), point.getY());
- while (git.hasNode()) {
- Snode node = git.next();
- if (node == null) continue;
- point = context.getPoint(node);
- p.lineTo(point.getX(), point.getY());
+ case POINT:
+ point = context.getPoint(Rules.feature.geom.centre);
+ g2.drawImage(image, new AffineTransformOp(AffineTransform.getScaleInstance(sScale, sScale), AffineTransformOp.TYPE_NEAREST_NEIGHBOR),
+ (int) (point.getX() - (50 * sScale)), (int) (point.getY() - (50 * sScale)));
+ break;
+ case AREA:
+ GeomIterator git = map.new GeomIterator(Rules.feature.geom);
+ while (git.hasComp()) {
+ git.nextComp();
+ boolean newComp = true;
+ while (git.hasEdge()) {
+ git.nextEdge();
+ point = context.getPoint(git.next());
+ if (newComp) {
+ p.moveTo(point.getX(), point.getY());
+ newComp = false;
+ } else {
+ p.lineTo(point.getX(), point.getY());
+ }
+ while (git.hasNode()) {
+ Snode node = git.next();
+ if (node == null) continue;
+ point = context.getPoint(node);
+ p.lineTo(point.getX(), point.getY());
+ }
}
}
- }
- g2.setPaint(new TexturePaint(image, new Rectangle(0, 0, 1 + (int)(100 * sScale), 1 + (int)(100 * sScale))));
- g2.fill(p);
- break;
- default:
- break;
+ g2.setPaint(new TexturePaint(image, new Rectangle(0, 0, 1 + (int) (300 * sScale), 1 + (int) (300 * sScale))));
+ g2.fill(p);
+ break;
+ default:
+ break;
}
}
-
+
public static void labelText(String str, Font font, Color tc) {
labelText(str, font, tc, LabelStyle.NONE, null, null, null);
}
+
public static void labelText(String str, Font font, Color tc, Delta delta) {
labelText(str, font, tc, LabelStyle.NONE, null, null, delta);
}
+
public static void labelText(String str, Font font, Color tc, LabelStyle style, Color fg) {
labelText(str, font, tc, style, fg, null, null);
}
+
public static void labelText(String str, Font font, Color tc, LabelStyle style, Color fg, Color bg) {
labelText(str, font, tc, style, fg, bg, null);
}
+
public static void labelText(String str, Font font, Color tc, LabelStyle style, Color fg, Delta delta) {
labelText(str, font, tc, style, fg, null, delta);
}
+
public static void labelText(String str, Font font, Color tc, LabelStyle style, Color fg, Color bg, Delta delta) {
if (delta == null) delta = new Delta(Handle.CC);
if (bg == null) bg = new Color(0x00000000, true);
- if ((str == null) || (str.isEmpty())) str = " ";
- FontRenderContext frc = g2.getFontRenderContext();
- GlyphVector gv = font.deriveFont((float)(font.getSize())).createGlyphVector(frc, str.equals(" ") ? "!" : str);
- Rectangle2D bounds = gv.getVisualBounds();
- double width = bounds.getWidth();
- double height = bounds.getHeight();
+ if (str == null || str.isEmpty()) str = " ";
+ FontRenderContext frc = g2.getFontRenderContext();
+ GlyphVector gv = font.deriveFont((float) font.getSize()).createGlyphVector(frc, str.equals(" ") ? "M" : str);
+ Rectangle2D bounds = gv.getVisualBounds();
+ double width = bounds.getWidth();
+ double height = bounds.getHeight();
Symbol label = new Symbol();
double lx, ly, tx, ty;
switch (style) {
- case RRCT:
- width += height * 1.0;
- height *= 1.5;
- if (width < height) width = height;
- lx = -width / 2;
- ly = -height / 2;
- tx = lx + (height * 0.34);
- ty = ly + (height * 0.17);
- label.add(new Instr(Form.BBOX, new Rectangle2D.Double(lx,ly,width,height)));
- label.add(new Instr(Form.FILL, bg));
- label.add(new Instr(Form.RSHP, new RoundRectangle2D.Double(lx,ly,width,height,height,height)));
- label.add(new Instr(Form.FILL, fg));
- label.add(new Instr(Form.STRK, new BasicStroke(1 + (int)(height/10), BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
- label.add(new Instr(Form.RRCT, new RoundRectangle2D.Double(lx,ly,width,height,height,height)));
- break;
- case VCLR:
- width += height * 1.0;
- height *= 2.0;
- if (width < height) width = height;
- lx = -width / 2;
- ly = -height / 2;
- tx = lx + (height * 0.27);
- ty = ly + (height * 0.25);
- label.add(new Instr(Form.BBOX, new Rectangle2D.Double(lx,ly,width,height)));
- label.add(new Instr(Form.FILL, bg));
- label.add(new Instr(Form.RSHP, new RoundRectangle2D.Double(lx,ly,width,height,height,height)));
- label.add(new Instr(Form.FILL, fg));
- int sw = 1 + (int)(height/10);
- double po = sw / 2;
- label.add(new Instr(Form.STRK, new BasicStroke(sw, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
- 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));
- 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));
- label.add(new Instr(Form.PLIN, p));
- break;
- case PCLR:
- width += height * 1.0;
- height *= 2.0;
- if (width < height) width = height;
- lx = -width / 2;
- ly = -height / 2;
- tx = lx + (height * 0.27);
- ty = ly + (height * 0.25);
- label.add(new Instr(Form.BBOX, new Rectangle2D.Double(lx,ly,width,height)));
- label.add(new Instr(Form.FILL, bg));
- label.add(new Instr(Form.RSHP, new RoundRectangle2D.Double(lx,ly,width,height,height,height)));
- label.add(new Instr(Form.FILL, fg));
- sw = 1 + (int)(height/10);
- po = sw / 2;
- label.add(new Instr(Form.STRK, new BasicStroke(sw, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
- 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));
- 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));
- label.add(new Instr(Form.PLIN, p));
- 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)))));
- 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)))));
- break;
- case HCLR:
- width += height * 1.5;
- height *= 1.5;
- if (width < height) width = height;
- lx = -width / 2;
- ly = -height / 2;
- tx = lx + (height * 0.5);
- ty = ly + (height * 0.17);
- label.add(new Instr(Form.BBOX, new Rectangle2D.Double(lx,ly,width,height)));
- label.add(new Instr(Form.FILL, bg));
- label.add(new Instr(Form.RSHP, new RoundRectangle2D.Double(lx,ly,width,height,height,height)));
- label.add(new Instr(Form.FILL, fg));
- sw = 1 + (int)(height/10);
- double vo = height / 4;
- label.add(new Instr(Form.STRK, new BasicStroke(sw, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
- 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);
- 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);
- label.add(new Instr(Form.PLIN, p));
- break;
- default:
- lx = -width / 2;
- ly = -height / 2;
- tx = lx;
- ty = ly;
- label.add(new Instr(Form.BBOX, new Rectangle2D.Double(lx,ly,width,height)));
- break;
+ case RRCT:
+ width += height * 1.0;
+ height *= 1.5;
+ if (width < height) width = height;
+ lx = -width / 2;
+ ly = -height / 2;
+ tx = lx + (height * 0.34);
+ ty = ly + (height * 0.17);
+ label.add(new Instr(Form.BBOX, new Rectangle2D.Double(lx, ly, width, height)));
+ label.add(new Instr(Form.FILL, bg));
+ label.add(new Instr(Form.RSHP, new RoundRectangle2D.Double(lx, ly, width, height, height, height)));
+ label.add(new Instr(Form.FILL, fg));
+ label.add(new Instr(Form.STRK, new BasicStroke(1 + (int) (height/10), BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
+ label.add(new Instr(Form.RRCT, new RoundRectangle2D.Double(lx, ly, width, height, height, height)));
+ break;
+ case VCLR:
+ width += height * 1.0;
+ height *= 2.0;
+ if (width < height) width = height;
+ lx = -width / 2;
+ ly = -height / 2;
+ tx = lx + (height * 0.27);
+ ty = ly + (height * 0.25);
+ label.add(new Instr(Form.BBOX, new Rectangle2D.Double(lx, ly, width, height)));
+ label.add(new Instr(Form.FILL, bg));
+ label.add(new Instr(Form.RSHP, new RoundRectangle2D.Double(lx, ly, width, height, height, height)));
+ label.add(new Instr(Form.FILL, fg));
+ int sw = 1 + (int) (height/10);
+ double po = sw / 2;
+ label.add(new Instr(Form.STRK, new BasicStroke(sw, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
+ 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));
+ 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));
+ label.add(new Instr(Form.PLIN, p));
+ break;
+ case PCLR:
+ width += height * 1.0;
+ height *= 2.0;
+ if (width < height) width = height;
+ lx = -width / 2;
+ ly = -height / 2;
+ tx = lx + (height * 0.27);
+ ty = ly + (height * 0.25);
+ label.add(new Instr(Form.BBOX, new Rectangle2D.Double(lx, ly, width, height)));
+ label.add(new Instr(Form.FILL, bg));
+ label.add(new Instr(Form.RSHP, new RoundRectangle2D.Double(lx, ly, width, height, height, height)));
+ label.add(new Instr(Form.FILL, fg));
+ sw = 1 + (int) (height/10);
+ po = sw / 2;
+ label.add(new Instr(Form.STRK, new BasicStroke(sw, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
+ 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));
+ 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));
+ label.add(new Instr(Form.PLIN, p));
+ 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)))));
+ 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)))));
+ break;
+ case HCLR:
+ width += height * 1.5;
+ height *= 1.5;
+ if (width < height) width = height;
+ lx = -width / 2;
+ ly = -height / 2;
+ tx = lx + (height * 0.5);
+ ty = ly + (height * 0.17);
+ label.add(new Instr(Form.BBOX, new Rectangle2D.Double(lx, ly, width, height)));
+ label.add(new Instr(Form.FILL, bg));
+ label.add(new Instr(Form.RSHP, new RoundRectangle2D.Double(lx, ly, width, height, height, height)));
+ label.add(new Instr(Form.FILL, fg));
+ sw = 1 + (int) (height/10);
+ double vo = height / 4;
+ label.add(new Instr(Form.STRK, new BasicStroke(sw, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
+ 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);
+ 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);
+ label.add(new Instr(Form.PLIN, p));
+ break;
+ default:
+ lx = -width / 2;
+ ly = -height / 2;
+ tx = lx;
+ ty = ly;
+ label.add(new Instr(Form.BBOX, new Rectangle2D.Double(lx, ly, width, height)));
+ break;
}
label.add(new Instr(Form.TEXT, new Caption(str, font, tc, new Delta(Handle.TL, AffineTransform.getTranslateInstance(tx, ty)))));
Point2D point = context.getPoint(Rules.feature.geom.centre);
Symbols.drawSymbol(g2, label, sScale, point.getX(), point.getY(), null, delta);
}
- public static void lineText(String str, Font font, Color colour, double offset, double dy) {
+ public static void lineText(String str, Font font, Color colour, double dy) {
if (!str.isEmpty()) {
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- g2.setPaint(colour);
- FontRenderContext frc = g2.getFontRenderContext();
- GlyphVector gv = font.deriveFont(font.getSize2D() * (float)sScale).createGlyphVector(frc, (" " + str));
- GeneralPath path = new GeneralPath();
- Point2D prev = new Point2D.Double();
- Point2D next = new Point2D.Double();
- Point2D curr = new Point2D.Double();
- Point2D succ = new Point2D.Double();
- boolean piv = false;
- double angle = 0;
- int index = 0;
- double gwidth = offset * (Rules.feature.geom.length * context.mile(Rules.feature) - gv.getLogicalBounds().getWidth()) + gv.getGlyphMetrics(0).getAdvance();
- GeomIterator git = map.new GeomIterator(Rules.feature.geom);
- while (git.hasComp()) {
- git.nextComp();
- boolean first = true;
- while (git.hasEdge()) {
- git.nextEdge();
- while (git.hasNode()) {
- Snode node = git.next();
- if (node == null) continue;
- prev = next;
- next = context.getPoint(node);
- angle = Math.atan2(next.getY() - prev.getY(), next.getX() - prev.getX());
- piv = true;
- if (first) {
- curr = succ = next;
- first = false;
- } else {
- while (curr.distance(next) >= gwidth) {
- if (piv) {
- double rem = gwidth;
- double s = prev.distance(next);
- double p = curr.distance(prev);
- if ((s > 0) && (p > 0)) {
- double n = curr.distance(next);
- double theta = Math.acos((s * s + p * p - n * n) / 2 / s / p);
- double phi = Math.asin(p / gwidth * Math.sin(theta));
- rem = gwidth * Math.sin(Math.PI - theta - phi) / Math.sin(theta);
- }
- succ = new Point2D.Double(prev.getX() + (rem * Math.cos(angle)), prev.getY() + (rem * Math.sin(angle)));
- piv = false;
- } else {
- succ = new Point2D.Double(curr.getX() + (gwidth * Math.cos(angle)), curr.getY() + (gwidth * Math.sin(angle)));
- }
- Shape shape = gv.getGlyphOutline(index);
- Point2D point = gv.getGlyphPosition(index);
- AffineTransform at = AffineTransform.getTranslateInstance(curr.getX(), curr.getY());
- at.rotate(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())));
- at.translate(-point.getX(), -point.getY() + (dy * sScale));
- path.append(at.createTransformedShape(shape), false);
- curr = succ;
- if (++index < gv.getNumGlyphs()) {
- gwidth = gv.getGlyphMetrics(index).getAdvance();
+ g2.setPaint(colour);
+ FontRenderContext frc = g2.getFontRenderContext();
+ GlyphVector gv = font.deriveFont(font.getSize2D() * (float) sScale).createGlyphVector(frc, str);
+ double width = gv.getVisualBounds().getWidth();
+ double height = gv.getVisualBounds().getHeight();
+ double offset = (Rules.feature.geom.length * context.mile(Rules.feature) - width) / 2;
+ if (offset > 0) {
+ Point2D before = null;
+ Point2D after = null;
+ ArrayList between = new ArrayList<>();
+ Point2D prev = null;
+ Point2D next = null;
+ double length = 0;
+ double lb = 0;
+ double la = 0;
+ GeomIterator git = map.new GeomIterator(Rules.feature.geom);
+ if (git.hasComp()) {
+ git.nextComp();
+ while (git.hasEdge()) {
+ git.nextEdge();
+ while (git.hasNode()) {
+ Snode node = git.next();
+ if (node == null)
+ continue;
+ prev = next;
+ next = context.getPoint(node);
+ if (prev != null)
+ length += Math.sqrt(Math.pow((next.getX() - prev.getX()), 2) + Math.pow((next.getY() - prev.getY()), 2));
+ if (length < offset) {
+ before = next;
+ lb = la = length;
+ } else if (after == null) {
+ if (length > (offset + width)) {
+ after = next;
+ la = length;
+ break;
} else {
- g2.fill(path);
- return;
+ between.add(next);
}
}
}
+ if (after != null)
+ break;
}
}
+ if (after != null) {
+ double angle = Math.atan2((after.getY() - before.getY()), (after.getX() - before.getX()));
+ double rotate = Math.abs(angle) < (Math.PI / 2) ? angle : angle + Math.PI;
+ Point2D mid = new Point2D.Double((before.getX() + after.getX()) / 2, (before.getY() + after.getY()) / 2);
+ Point2D centre = context.getPoint(Rules.feature.geom.centre);
+ AffineTransform pos = AffineTransform.getTranslateInstance(-dy * Math.sin(rotate), dy * Math.cos(rotate));
+ pos.rotate(rotate);
+ pos.translate((mid.getX() - centre.getX()), (mid.getY() - centre.getY()));
+ Symbol label = new Symbol();
+ label.add(new Instr(Form.BBOX, new Rectangle2D.Double((-width / 2), -height, width, height)));
+ label.add(new Instr(Form.TEXT, new Caption(str, font, colour, new Delta(Handle.BC))));
+ Symbols.drawSymbol(g2, label, sScale, centre.getX(), centre.getY(), null, new Delta(Handle.BC, pos));
+ }
}
}
}
-
+
public static void lightSector(Color col1, Color col2, double radius, double s1, double s2, Double dir, String str) {
- if ((zoom >= 16) && (radius > 0.2)) {
- radius /= (Math.pow(2, zoom-15));
- }
- double mid = (((s1 + s2) / 2) + (s1 > s2 ? 180 : 0)) % 360;
- g2.setStroke(new BasicStroke((float) (3.0 * sScale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 1, new float[] {20 * (float)sScale, 20 * (float)sScale}, 0));
+ double mid = (((s1 + s2) / 2) + (s1 > s2 ? 180 : 0)) % 360;
+ g2.setStroke(new BasicStroke((float) (3.0 * sScale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 1,
+ new float[] {20 * (float) sScale, 20 * (float) sScale}, 0));
g2.setPaint(Color.black);
Point2D.Double centre = (Point2D.Double) context.getPoint(Rules.feature.geom.centre);
double radial = radius * context.mile(Rules.feature);
if (dir != null) {
- 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))));
+ 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))));
} else {
if ((s1 != 0.0) || (s2 != 360.0)) {
- 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))));
- 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))));
+ 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))));
+ 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))));
}
}
- double arcWidth = 10.0 * sScale;
- g2.setStroke(new BasicStroke((float)arcWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1));
+ double arcWidth = 10.0 * sScale;
+ g2.setStroke(new BasicStroke((float) arcWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1));
g2.setPaint(col1);
- 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));
+ 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));
if (col2 != null) {
g2.setPaint(col2);
- 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));
+ 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));
}
- if ((str != null) && (!str.isEmpty())) {
- FontRenderContext frc = g2.getFontRenderContext();
+ if (str != null && !str.isEmpty()) {
Font font = new Font("Arial", Font.PLAIN, 40);
- GlyphVector gv = font.deriveFont(font.getSize2D() * (float)sScale).createGlyphVector(frc, str);
double arc = (s2 > s1) ? (s2 - s1) : (s2 - s1 + 360);
double awidth = (Math.toRadians(arc) * radial);
boolean hand = ((mid > 270) || (mid < 90));
double phi = Math.toRadians(mid);
radial += 30 * sScale;
AffineTransform at = AffineTransform.getTranslateInstance(-radial * Math.sin(phi) / sScale, radial * Math.cos(phi) / sScale);
- if (gv.getLogicalBounds().getWidth() < awidth) {
+ if ((font.getSize() * sScale * str.length()) < awidth) {
at.rotate(Math.toRadians(mid + (hand ? 0 : 180)));
- Renderer.labelText(str, font, Color.black, new Delta(Handle.CC, at));
- } else if (gv.getLogicalBounds().getHeight() < awidth) {
+ labelText(str, font, Color.black, new Delta(Handle.CC, at));
+ } else if ((font.getSize() * sScale) < awidth) {
hand = (mid < 180);
at.rotate(Math.toRadians(mid + (hand ? -90 : 90)));
- Renderer.labelText(str, font, Color.black, hand ? new Delta(Handle.RC, at) : new Delta(Handle.LC, at));
+ labelText(str, font, Color.black, hand ? new Delta(Handle.RC, at) : new Delta(Handle.LC, at));
}
if (dir != null) {
font = new Font("Arial", Font.PLAIN, 30);
@@ -598,8 +774,25 @@ public static void lightSector(Color col1, Color col2, double radius, double s1,
radial -= 70 * sScale;
at = AffineTransform.getTranslateInstance(-radial * Math.sin(phi) / sScale, radial * Math.cos(phi) / sScale);
at.rotate(Math.toRadians(dir + (hand ? 90 : -90)));
- Renderer.labelText(str, font, Color.black, hand ? new Delta(Handle.BR, at) : new Delta(Handle.BL, at));
+ labelText(str, font, Color.black, hand ? new Delta(Handle.BR, at) : new Delta(Handle.BL, at));
}
}
}
+
+ public static void rasterPixel(double size, Color col) {
+ double s = Rules.feature.geom.centre.lat - (size / 2.0);
+ double w = Rules.feature.geom.centre.lon - (size / 2.0);
+ double n = Rules.feature.geom.centre.lat + (size / 2.0);
+ double e = Rules.feature.geom.centre.lon + (size / 2.0);
+ Point2D sw = context.getPoint(new Snode(s, w));
+ Point2D nw = context.getPoint(new Snode(n, w));
+ Point2D ne = context.getPoint(new Snode(n, e));
+ Point2D se = context.getPoint(new Snode(s, e));
+ Symbol pixel = new Symbol();
+ Path2D.Double path = new Path2D.Double(); path.moveTo(sw.getX(), sw.getY()); path.lineTo(nw.getX(), nw.getY());
+ path.lineTo(ne.getX(), ne.getY()); path.lineTo(se.getX(), se.getY()); path.closePath();
+ pixel.add(new Instr(Form.FILL, col));
+ pixel.add(new Instr(Form.PGON, path));
+ Symbols.drawSymbol(g2, pixel, 1.0, 0, 0, null, null);
+ }
}
diff --git a/niord-josm-seachart/src/main/java/render/Rules.java b/niord-josm-seachart/src/main/java/render/Rules.java
index 4a50b00ad..fe533cb83 100644
--- a/niord-josm-seachart/src/main/java/render/Rules.java
+++ b/niord-josm-seachart/src/main/java/render/Rules.java
@@ -14,24 +14,86 @@
import java.awt.geom.AffineTransform;
import java.text.DecimalFormat;
import java.util.ArrayList;
+import java.util.ConcurrentModificationException;
import java.util.EnumMap;
import java.util.HashMap;
-import s57.S57val;
-import s57.S57val.*;
-import s57.S57att.*;
-import s57.S57obj.*;
-import s57.S57map.*;
import render.ChartContext.RuleSet;
-import render.Renderer.*;
-import symbols.*;
-import symbols.Symbols.*;
+import render.Renderer.LabelStyle;
+import s57.S57att.Att;
+import s57.S57map.AttMap;
+import s57.S57map.Feature;
+import s57.S57map.ObjTab;
+import s57.S57map.Pflag;
+import s57.S57map.Rflag;
+import s57.S57obj.Obj;
+import s57.S57val;
+import s57.S57val.AddMRK;
+import s57.S57val.AttVal;
+import s57.S57val.BcnSHP;
+import s57.S57val.BnkWTW;
+import s57.S57val.BoySHP;
+import s57.S57val.CatACH;
+import s57.S57val.CatCBL;
+import s57.S57val.CatCRN;
+import s57.S57val.CatDIS;
+import s57.S57val.CatHAF;
+import s57.S57val.CatLAM;
+import s57.S57val.CatLIT;
+import s57.S57val.CatLMK;
+import s57.S57val.CatMOR;
+import s57.S57val.CatNMK;
+import s57.S57val.CatOBS;
+import s57.S57val.CatOFP;
+import s57.S57val.CatOPA;
+import s57.S57val.CatPIL;
+import s57.S57val.CatPIP;
+import s57.S57val.CatREA;
+import s57.S57val.CatROD;
+import s57.S57val.CatROS;
+import s57.S57val.CatSCF;
+import s57.S57val.CatSEA;
+import s57.S57val.CatSIL;
+import s57.S57val.CatSIT;
+import s57.S57val.CatSIW;
+import s57.S57val.CatSLC;
+import s57.S57val.CatWED;
+import s57.S57val.CatWRK;
+import s57.S57val.ColCOL;
+import s57.S57val.ColPAT;
+import s57.S57val.FncFNC;
+import s57.S57val.MarSYS;
+import s57.S57val.StsSTS;
+import s57.S57val.TecSOU;
+import s57.S57val.TopSHP;
+import s57.S57val.TrfTRF;
+import s57.S57val.UniHLU;
+import s57.S57val.WatLEV;
+import s57.S57val.CatVAN;
+import symbols.Areas;
+import symbols.Beacons;
+import symbols.Buoys;
+import symbols.Facilities;
+import symbols.Harbours;
+import symbols.Landmarks;
+import symbols.Notices;
+import symbols.Symbols;
+import symbols.Symbols.Delta;
+import symbols.Symbols.Handle;
+import symbols.Symbols.LineStyle;
+import symbols.Symbols.Patt;
+import symbols.Symbols.Scheme;
+import symbols.Symbols.Symbol;
+import symbols.Topmarks;
+/**
+ * @author Malcolm Herring
+ */
public class Rules {
-
+
static final DecimalFormat df = new DecimalFormat("#.#");
- static final EnumMap bodyColours = new EnumMap(ColCOL.class);
+ static final EnumMap bodyColours = new EnumMap<>(ColCOL.class);
static {
bodyColours.put(ColCOL.COL_UNK, new Color(0, true));
bodyColours.put(ColCOL.COL_WHT, new Color(0xffffff));
@@ -49,7 +111,25 @@ public class Rules {
bodyColours.put(ColCOL.COL_PNK, Color.pink);
}
- static final EnumMap pattMap = new EnumMap(ColPAT.class);
+ static final EnumMap colourLetters = new EnumMap<>(ColCOL.class);
+ static {
+ colourLetters.put(ColCOL.COL_UNK, "");
+ colourLetters.put(ColCOL.COL_WHT, "W");
+ colourLetters.put(ColCOL.COL_BLK, "B");
+ colourLetters.put(ColCOL.COL_RED, "R");
+ colourLetters.put(ColCOL.COL_GRN, "G");
+ colourLetters.put(ColCOL.COL_BLU, "Bu");
+ colourLetters.put(ColCOL.COL_YEL, "Y");
+ colourLetters.put(ColCOL.COL_GRY, "Gr");
+ colourLetters.put(ColCOL.COL_BRN, "Bn");
+ colourLetters.put(ColCOL.COL_AMB, "Am");
+ colourLetters.put(ColCOL.COL_VIO, "Vi");
+ colourLetters.put(ColCOL.COL_ORG, "Or");
+ colourLetters.put(ColCOL.COL_MAG, "Mg");
+ colourLetters.put(ColCOL.COL_PNK, "Pk");
+ }
+
+ static final EnumMap pattMap = new EnumMap<>(ColPAT.class);
static {
pattMap.put(ColPAT.PAT_UNKN, Patt.Z);
pattMap.put(ColPAT.PAT_HORI, Patt.H);
@@ -61,7 +141,7 @@ public class Rules {
pattMap.put(ColPAT.PAT_SALT, Patt.X);
pattMap.put(ColPAT.PAT_STRP, Patt.H);
}
-
+
static String getName() {
AttVal> name = feature.atts.get(Att.OBJNAM);
if (name == null) {
@@ -70,23 +150,26 @@ static String getName() {
name = atts.get(Att.OBJNAM);
}
}
- return (name != null) ? (String)name.val: null;
+ return (name != null) ? ((String) name.val).replace(""", "\"") : null;
}
public static void addName(int z, Font font) {
addName(z, font, Color.black, new Delta(Handle.CC, new AffineTransform()));
}
+
public static void addName(int z, Font font, Color colour) {
addName(z, font, colour, new Delta(Handle.CC, new AffineTransform()));
}
+
public static void addName(int z, Font font, Delta delta) {
addName(z, font, Color.black, delta);
}
+
public static void addName(int z, Font font, Color colour, Delta delta) {
if (Renderer.zoom >= z) {
String name = getName();
if (name != null) {
- Renderer.labelText(name, font, colour, delta);
+ Renderer.labelText(name, font, colour, delta);
}
}
}
@@ -112,398 +195,452 @@ public static Object getAttVal(Obj obj, Att att) {
else
return item.val;
}
-
+
public static String getAttStr(Obj obj, Att att) {
- String str = (String)getAttVal(obj, att);
+ String str = (String) getAttVal(obj, att);
if (str != null) {
return str;
}
- return "";
+ return "";
}
@SuppressWarnings("unchecked")
public static Enum> getAttEnum(Obj obj, Att att) {
- ArrayList> list = (ArrayList>)getAttVal(obj, att);
+ ArrayList> list = (ArrayList>) getAttVal(obj, att);
if (list != null) {
- return ((ArrayList>)list).get(0);
+ return ((ArrayList>) list).get(0);
}
return S57val.unknAtt(att);
}
-
+
@SuppressWarnings("unchecked")
public static ArrayList> getAttList(Obj obj, Att att) {
- ArrayList> list = (ArrayList>)getAttVal(obj, att);
+ ArrayList> list = (ArrayList>) getAttVal(obj, att);
if (list != null) {
return list;
}
list = new ArrayList<>();
list.add(S57val.unknAtt(att));
- return list;
+ return list;
}
-
+
@SuppressWarnings("unchecked")
static Scheme getScheme(Obj obj) {
- ArrayList colours = new ArrayList();
+ ArrayList colours = new ArrayList<>();
for (ColCOL col : (ArrayList) getAttList(obj, Att.COLOUR)) {
colours.add(bodyColours.get(col));
}
- ArrayList patterns = new ArrayList();
+ ArrayList patterns = new ArrayList<>();
for (ColPAT pat : (ArrayList) getAttList(obj, Att.COLPAT)) {
patterns.add(pattMap.get(pat));
}
return new Scheme(patterns, colours);
}
- static boolean hasAttribute(Obj obj, int idx, Att att) {
+ static boolean hasAttribute(Obj obj, Att att) {
AttMap atts;
- if ((atts = getAtts(obj, idx)) != null) {
+ if ((atts = getAtts(obj, 0)) != null) {
AttVal> item = atts.get(att);
return item != null;
}
return false;
}
-
+
static boolean testAttribute(Obj obj, Att att, Object val) {
AttMap atts;
if ((atts = getAtts(obj, 0)) != null) {
AttVal> item = atts.get(att);
if (item != null) {
switch (item.conv) {
- case S:
- case A:
- return ((String)item.val).equals(val);
- case E:
- case L:
- return ((ArrayList>)item.val).contains(val);
- case F:
- case I:
- return item.val == val;
+ case S:
+ case A:
+ return ((String) item.val).equals(val);
+ case E:
+ case L:
+ return ((ArrayList>) item.val).contains(val);
+ case F:
+ case I:
+ return item.val == val;
}
}
}
return false;
}
-
+
+ static boolean hasObject(Obj obj) {
+ return (feature.objs.containsKey(obj));
+ }
+
public static Feature feature;
static ArrayList objects;
-
+
static boolean testObject(Obj obj) {
return ((objects = Renderer.map.features.get(obj)) != null);
}
-
+
static boolean testFeature(Feature f) {
return ((feature = f).reln == Rflag.MASTER);
}
-
- public static void rules () {
- if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.BASE)) {
- if (testObject(Obj.LNDARE)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.BUAARE)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.HRBFAC)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.HRBBSN)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.LOKBSN)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.LKBSPT)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.LAKARE)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.RIVERS)) for (Feature f : objects) if (testFeature(f)) waterways();
- if (testObject(Obj.CANALS)) for (Feature f : objects) if (testFeature(f)) waterways();
- if (testObject(Obj.DEPARE)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.COALNE)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.ROADWY)) for (Feature f : objects) if (testFeature(f)) highways();
- if (testObject(Obj.RAILWY)) for (Feature f : objects) if (testFeature(f)) highways();
- }
- if (testObject(Obj.SLCONS)) for (Feature f : objects) if (testFeature(f)) shoreline();
- if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.SEAMARK)) {
- if (testObject(Obj.PIPSOL)) for (Feature f : objects) if (testFeature(f)) pipelines();
- if (testObject(Obj.CBLSUB)) for (Feature f : objects) if (testFeature(f)) cables();
- if (testObject(Obj.PIPOHD)) for (Feature f : objects) if (testFeature(f)) pipelines();
- if (testObject(Obj.CBLOHD)) for (Feature f : objects) if (testFeature(f)) cables();
- if (testObject(Obj.TSEZNE)) for (Feature f : objects) if (testFeature(f)) separation();
- if (testObject(Obj.TSSCRS)) for (Feature f : objects) if (testFeature(f)) separation();
- if (testObject(Obj.TSSRON)) for (Feature f : objects) if (testFeature(f)) separation();
- if (testObject(Obj.TSELNE)) for (Feature f : objects) if (testFeature(f)) separation();
- if (testObject(Obj.TSSLPT)) for (Feature f : objects) if (testFeature(f)) separation();
- if (testObject(Obj.TSSBND)) for (Feature f : objects) if (testFeature(f)) separation();
- if (testObject(Obj.ISTZNE)) for (Feature f : objects) if (testFeature(f)) separation();
- if (testObject(Obj.SNDWAV)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.OSPARE)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.FAIRWY)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.DRGARE)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.RESARE)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.PRCARE)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.SPLARE)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.SEAARE)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.OBSTRN)) for (Feature f : objects) if (testFeature(f)) obstructions();
- if (testObject(Obj.UWTROC)) for (Feature f : objects) if (testFeature(f)) obstructions();
- if (testObject(Obj.MARCUL)) for (Feature f : objects) if (testFeature(f)) areas();
- if (testObject(Obj.RECTRC)) for (Feature f : objects) if (testFeature(f)) transits();
- if (testObject(Obj.NAVLNE)) for (Feature f : objects) if (testFeature(f)) transits();
- if (testObject(Obj.HRBFAC)) for (Feature f : objects) if (testFeature(f)) harbours();
- if (testObject(Obj.ACHARE)) for (Feature f : objects) if (testFeature(f)) harbours();
- if (testObject(Obj.ACHBRT)) for (Feature f : objects) if (testFeature(f)) harbours();
- if (testObject(Obj.BERTHS)) for (Feature f : objects) if (testFeature(f)) harbours();
- if (testObject(Obj.DISMAR)) for (Feature f : objects) if (testFeature(f)) distances();
- if (testObject(Obj.HULKES)) for (Feature f : objects) if (testFeature(f)) ports();
- if (testObject(Obj.CRANES)) for (Feature f : objects) if (testFeature(f)) ports();
- if (testObject(Obj.LNDMRK)) for (Feature f : objects) if (testFeature(f)) landmarks();
- if (testObject(Obj.BUISGL)) for (Feature f : objects) if (testFeature(f)) harbours();
- if (testObject(Obj.MORFAC)) for (Feature f : objects) if (testFeature(f)) moorings();
- if (testObject(Obj.NOTMRK)) for (Feature f : objects) if (testFeature(f)) notices();
- if (testObject(Obj.SMCFAC)) for (Feature f : objects) if (testFeature(f)) marinas();
- if (testObject(Obj.BRIDGE)) for (Feature f : objects) if (testFeature(f)) bridges();
- if (testObject(Obj.PILPNT)) for (Feature f : objects) if (testFeature(f)) lights();
- if (testObject(Obj.RDOCAL)) for (Feature f : objects) if (testFeature(f)) callpoint();
- if (testObject(Obj.LITMIN)) for (Feature f : objects) if (testFeature(f)) lights();
- if (testObject(Obj.LITMAJ)) for (Feature f : objects) if (testFeature(f)) lights();
- if (testObject(Obj.LIGHTS)) for (Feature f : objects) if (testFeature(f)) lights();
- if (testObject(Obj.SISTAT)) for (Feature f : objects) if (testFeature(f)) stations();
- if (testObject(Obj.SISTAW)) for (Feature f : objects) if (testFeature(f)) stations();
- if (testObject(Obj.CGUSTA)) for (Feature f : objects) if (testFeature(f)) stations();
- if (testObject(Obj.RDOSTA)) for (Feature f : objects) if (testFeature(f)) stations();
- if (testObject(Obj.RADRFL)) for (Feature f : objects) if (testFeature(f)) stations();
- if (testObject(Obj.RADSTA)) for (Feature f : objects) if (testFeature(f)) stations();
- if (testObject(Obj.RTPBCN)) for (Feature f : objects) if (testFeature(f)) stations();
- if (testObject(Obj.RSCSTA)) for (Feature f : objects) if (testFeature(f)) stations();
- if (testObject(Obj.PILBOP)) for (Feature f : objects) if (testFeature(f)) stations();
- if (testObject(Obj.WTWGAG)) for (Feature f : objects) if (testFeature(f)) gauges();
- if (testObject(Obj.OFSPLF)) for (Feature f : objects) if (testFeature(f)) platforms();
- if (testObject(Obj.WRECKS)) for (Feature f : objects) if (testFeature(f)) wrecks();
- if (testObject(Obj.LITVES)) for (Feature f : objects) if (testFeature(f)) floats();
- if (testObject(Obj.LITFLT)) for (Feature f : objects) if (testFeature(f)) floats();
- if (testObject(Obj.BOYINB)) for (Feature f : objects) if (testFeature(f)) floats();
- if (testObject(Obj.BOYLAT)) for (Feature f : objects) if (testFeature(f)) buoys();
- if (testObject(Obj.BOYCAR)) for (Feature f : objects) if (testFeature(f)) buoys();
- if (testObject(Obj.BOYISD)) for (Feature f : objects) if (testFeature(f)) buoys();
- if (testObject(Obj.BOYSAW)) for (Feature f : objects) if (testFeature(f)) buoys();
- if (testObject(Obj.BOYSPP)) for (Feature f : objects) if (testFeature(f)) buoys();
- if (testObject(Obj.BCNLAT)) for (Feature f : objects) if (testFeature(f)) beacons();
- if (testObject(Obj.BCNCAR)) for (Feature f : objects) if (testFeature(f)) beacons();
- if (testObject(Obj.BCNISD)) for (Feature f : objects) if (testFeature(f)) beacons();
- if (testObject(Obj.BCNSAW)) for (Feature f : objects) if (testFeature(f)) beacons();
- if (testObject(Obj.BCNSPP)) for (Feature f : objects) if (testFeature(f)) beacons();
+
+ public static boolean rules() {
+ try {
+ if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.BASE)) {
+ if (testObject(Obj.LNDARE)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.SOUNDG)) for (Feature f : objects) if (testFeature(f)) depths();
+ if (testObject(Obj.DEPCNT)) for (Feature f : objects) if (testFeature(f)) depths();
+ if (testObject(Obj.TESARE)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.BUAARE)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.HRBFAC)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.HRBBSN)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.LOKBSN)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.LKBSPT)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.LAKARE)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.RIVERS)) for (Feature f : objects) if (testFeature(f)) waterways();
+ if (testObject(Obj.CANALS)) for (Feature f : objects) if (testFeature(f)) waterways();
+ if (testObject(Obj.DEPARE)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.COALNE)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.ROADWY)) for (Feature f : objects) if (testFeature(f)) highways();
+ if (testObject(Obj.RAILWY)) for (Feature f : objects) if (testFeature(f)) highways();
+ }
+ if (testObject(Obj.SLCONS)) for (Feature f : objects) if (testFeature(f)) shoreline();
+ if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.SEAMARK)) {
+ if (testObject(Obj.PIPSOL)) for (Feature f : objects) if (testFeature(f)) pipelines();
+ if (testObject(Obj.CBLSUB)) for (Feature f : objects) if (testFeature(f)) cables();
+ if (testObject(Obj.PIPOHD)) for (Feature f : objects) if (testFeature(f)) pipelines();
+ if (testObject(Obj.CBLOHD)) for (Feature f : objects) if (testFeature(f)) cables();
+ if (testObject(Obj.TSEZNE)) for (Feature f : objects) if (testFeature(f)) separation();
+ if (testObject(Obj.TSSCRS)) for (Feature f : objects) if (testFeature(f)) separation();
+ if (testObject(Obj.TSSRON)) for (Feature f : objects) if (testFeature(f)) separation();
+ if (testObject(Obj.TSELNE)) for (Feature f : objects) if (testFeature(f)) separation();
+ if (testObject(Obj.TSSLPT)) for (Feature f : objects) if (testFeature(f)) separation();
+ if (testObject(Obj.TSSBND)) for (Feature f : objects) if (testFeature(f)) separation();
+ if (testObject(Obj.ISTZNE)) for (Feature f : objects) if (testFeature(f)) separation();
+ if (testObject(Obj.SNDWAV)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.WEDKLP)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.OSPARE)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.FAIRWY)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.DRGARE)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.RESARE)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.PRCARE)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.SPLARE)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.SEAARE)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.DMPGRD)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.OBSTRN)) for (Feature f : objects) if (testFeature(f)) obstructions();
+ if (testObject(Obj.UWTROC)) for (Feature f : objects) if (testFeature(f)) obstructions();
+ if (testObject(Obj.MARCUL)) for (Feature f : objects) if (testFeature(f)) areas();
+ if (testObject(Obj.RECTRC)) for (Feature f : objects) if (testFeature(f)) transits();
+ if (testObject(Obj.NAVLNE)) for (Feature f : objects) if (testFeature(f)) transits();
+ if (testObject(Obj.HRBFAC)) for (Feature f : objects) if (testFeature(f)) harbours();
+ if (testObject(Obj.ACHARE)) for (Feature f : objects) if (testFeature(f)) harbours();
+ if (testObject(Obj.ACHBRT)) for (Feature f : objects) if (testFeature(f)) harbours();
+ if (testObject(Obj.BERTHS)) for (Feature f : objects) if (testFeature(f)) harbours();
+ if (testObject(Obj.DISMAR)) for (Feature f : objects) if (testFeature(f)) distances();
+ if (testObject(Obj.HULKES)) for (Feature f : objects) if (testFeature(f)) ports();
+ if (testObject(Obj.CRANES)) for (Feature f : objects) if (testFeature(f)) ports();
+ if (testObject(Obj.LNDMRK)) for (Feature f : objects) if (testFeature(f)) landmarks();
+ if (testObject(Obj.SILTNK)) for (Feature f : objects) if (testFeature(f)) landmarks();
+ if (testObject(Obj.BUISGL)) for (Feature f : objects) if (testFeature(f)) harbours();
+ if (testObject(Obj.MORFAC)) for (Feature f : objects) if (testFeature(f)) moorings();
+ if (testObject(Obj.NOTMRK)) for (Feature f : objects) if (testFeature(f)) notices();
+ if (testObject(Obj.SMCFAC)) for (Feature f : objects) if (testFeature(f)) marinas();
+ if (testObject(Obj.BRIDGE)) for (Feature f : objects) if (testFeature(f)) bridges();
+ if (testObject(Obj.PILPNT)) for (Feature f : objects) if (testFeature(f)) points();
+ if (testObject(Obj.TOPMAR)) for (Feature f : objects) if (testFeature(f)) points();
+ if (testObject(Obj.DAYMAR)) for (Feature f : objects) if (testFeature(f)) points();
+ if (testObject(Obj.FOGSIG)) for (Feature f : objects) if (testFeature(f)) points();
+ if (testObject(Obj.RDOCAL)) for (Feature f : objects) if (testFeature(f)) callpoint();
+ if (testObject(Obj.LITMIN)) for (Feature f : objects) if (testFeature(f)) lights();
+ if (testObject(Obj.LITMAJ)) for (Feature f : objects) if (testFeature(f)) lights();
+ if (testObject(Obj.LIGHTS)) for (Feature f : objects) if (testFeature(f)) lights();
+ if (testObject(Obj.SISTAT)) for (Feature f : objects) if (testFeature(f)) stations();
+ if (testObject(Obj.SISTAW)) for (Feature f : objects) if (testFeature(f)) stations();
+ if (testObject(Obj.CGUSTA)) for (Feature f : objects) if (testFeature(f)) stations();
+ if (testObject(Obj.RDOSTA)) for (Feature f : objects) if (testFeature(f)) stations();
+ if (testObject(Obj.RADRFL)) for (Feature f : objects) if (testFeature(f)) stations();
+ if (testObject(Obj.RADSTA)) for (Feature f : objects) if (testFeature(f)) stations();
+ if (testObject(Obj.RTPBCN)) for (Feature f : objects) if (testFeature(f)) stations();
+ if (testObject(Obj.RSCSTA)) for (Feature f : objects) if (testFeature(f)) stations();
+ if (testObject(Obj.PILBOP)) for (Feature f : objects) if (testFeature(f)) stations();
+ if (testObject(Obj.WTWGAG)) for (Feature f : objects) if (testFeature(f)) gauges();
+ if (testObject(Obj.OFSPLF)) for (Feature f : objects) if (testFeature(f)) platforms();
+ if (testObject(Obj.WRECKS)) for (Feature f : objects) if (testFeature(f)) wrecks();
+ if (testObject(Obj.LITVES)) for (Feature f : objects) if (testFeature(f)) floats();
+ if (testObject(Obj.LITFLT)) for (Feature f : objects) if (testFeature(f)) floats();
+ if (testObject(Obj.BOYINB)) for (Feature f : objects) if (testFeature(f)) floats();
+ if (testObject(Obj.BOYLAT)) for (Feature f : objects) if (testFeature(f)) buoys();
+ if (testObject(Obj.BOYCAR)) for (Feature f : objects) if (testFeature(f)) buoys();
+ if (testObject(Obj.BOYISD)) for (Feature f : objects) if (testFeature(f)) buoys();
+ if (testObject(Obj.BOYSAW)) for (Feature f : objects) if (testFeature(f)) buoys();
+ if (testObject(Obj.BOYSPP)) for (Feature f : objects) if (testFeature(f)) buoys();
+ if (testObject(Obj.BCNLAT)) for (Feature f : objects) if (testFeature(f)) beacons();
+ if (testObject(Obj.BCNCAR)) for (Feature f : objects) if (testFeature(f)) beacons();
+ if (testObject(Obj.BCNISD)) for (Feature f : objects) if (testFeature(f)) beacons();
+ if (testObject(Obj.BCNSAW)) for (Feature f : objects) if (testFeature(f)) beacons();
+ if (testObject(Obj.BCNSPP)) for (Feature f : objects) if (testFeature(f)) beacons();
+ if (testObject(Obj.VAATON)) for (Feature f : objects) if (testFeature(f)) virtual();
+ }
+ } catch (ConcurrentModificationException e) {
+ return false;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return true;
}
+ return true;
}
-
+
private static void areas() {
String name = getName();
switch (feature.type) {
- case BUAARE:
- Renderer.lineVector(new LineStyle(new Color(0x20000000, true)));
- break;
- case COALNE:
- if (Renderer.zoom >= 12)
- Renderer.lineVector(new LineStyle(Color.black, 10));
- break;
- case DEPARE:
- Double depmax = 0.0;
- if (((depmax = (Double) getAttVal(Obj.DEPARE, Att.DRVAL2)) != null) && (depmax <= 0.0)) {
- Renderer.lineVector(new LineStyle(Symbols.Gdries));
- }
- break;
- case LAKARE:
- if ((Renderer.zoom >= 12) || (feature.geom.area > 10.0))
- Renderer.lineVector(new LineStyle(Symbols.Bwater));
- break;
- case DRGARE:
- if (Renderer.zoom < 16)
- Renderer.lineVector(new LineStyle(Color.black, 8, new float[] { 25, 25 }, new Color(0x40ffffff, true)));
- else
- Renderer.lineVector(new LineStyle(Color.black, 8, new float[] { 25, 25 }));
- addName(12, new Font("Arial", Font.PLAIN, 100), new Delta(Handle.CC, new AffineTransform()));
- break;
- case FAIRWY:
- if (feature.geom.area > 2.0) {
+ case TESARE:
+ Renderer.lineSymbols(Areas.LimitDash, 0.0, Areas.LimitCC, null, 30, Symbols.Mline);
+ break;
+ case BUAARE:
+ Renderer.lineVector(new LineStyle(new Color(0x20000000, true)));
+ break;
+ case COALNE:
+ if (Renderer.zoom >= 12)
+ Renderer.lineVector(new LineStyle(Color.black, 10));
+ break;
+ case DEPARE:
+ Double depmax = 0.0;
+ if (((depmax = (Double) getAttVal(Obj.DEPARE, Att.DRVAL2)) != null) && (depmax <= 0.0)) {
+ Renderer.lineVector(new LineStyle(Symbols.Gdries));
+ }
+ break;
+ case LAKARE:
+ if ((Renderer.zoom >= 12) || (feature.geom.area > 10.0))
+ Renderer.lineVector(new LineStyle(Symbols.Bwater));
+ break;
+ case DRGARE:
if (Renderer.zoom < 16)
- Renderer.lineVector(new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true)));
+ Renderer.lineVector(new LineStyle(Color.black, 8, new float[] { 25, 25 }, new Color(0x40ffffff, true)));
else
- Renderer.lineVector(new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 }));
- } else {
- if (Renderer.zoom >= 14)
- Renderer.lineVector(new LineStyle(new Color(0x40ffffff, true)));
- }
- break;
- case LKBSPT:
- case LOKBSN:
- case HRBBSN:
- if (Renderer.zoom >= 12) {
- Renderer.lineVector(new LineStyle(Color.black, 10, Symbols.Bwater));
- } else {
- Renderer.lineVector(new LineStyle(Symbols.Bwater));
- }
- break;
- case HRBFAC:
- if (feature.objs.get(Obj.HRBBSN) != null) {
+ Renderer.lineVector(new LineStyle(Color.black, 8, new float[] { 25, 25 }));
+ addName(12, new Font("Arial", Font.PLAIN, 100), new Delta(Handle.CC, new AffineTransform()));
+ break;
+ case FAIRWY:
+ if (Renderer.zoom >= 12) {
+ if (feature.geom.area > 1.0) {
+ if (Renderer.zoom < 16)
+ Renderer.lineVector(new LineStyle(new Color(0x20ffffff, true)));
+ else
+ Renderer.lineVector(new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 }));
+ } else {
+ if (Renderer.zoom >= 14)
+ Renderer.lineVector(new LineStyle(new Color(0x20ffffff, true)));
+ }
+ }
+ break;
+ case LKBSPT:
+ case LOKBSN:
+ case HRBBSN:
if (Renderer.zoom >= 12) {
Renderer.lineVector(new LineStyle(Color.black, 10, Symbols.Bwater));
} else {
Renderer.lineVector(new LineStyle(Symbols.Bwater));
}
- }
- break;
- case LNDARE:
- Renderer.lineVector(new LineStyle(Symbols.Yland));
- break;
- case MARCUL:
- if (Renderer.zoom >= 12) {
- if (Renderer.zoom >= 14) {
- Renderer.symbol(Areas.MarineFarm);
+ break;
+ case HRBFAC:
+ if (feature.objs.get(Obj.HRBBSN) != null) {
+ if (Renderer.zoom >= 12) {
+ Renderer.lineVector(new LineStyle(Color.black, 10, Symbols.Bwater));
+ } else {
+ Renderer.lineVector(new LineStyle(Symbols.Bwater));
+ }
}
- if ((feature.geom.area > 0.2) || ((feature.geom.area > 0.05) && (Renderer.zoom >= 14)) || ((feature.geom.area > 0.005) && (Renderer.zoom >= 16))) {
- Renderer.lineVector(new LineStyle(Color.black, 4, new float[] { 10, 10 }));
+ break;
+ case LNDARE:
+ Renderer.lineVector(new LineStyle(Symbols.Yland));
+ break;
+ case MARCUL:
+ if (Renderer.zoom >= 12) {
+ if (Renderer.zoom >= 14) {
+ Renderer.symbol(Areas.MarineFarm);
+ }
+ if ((feature.geom.area > 0.2) || ((feature.geom.area > 0.05) && (Renderer.zoom >= 14)) || ((feature.geom.area > 0.005) && (Renderer.zoom >= 16))) {
+ Renderer.lineVector(new LineStyle(Color.black, 4, new float[] { 10, 10 }));
+ }
}
- }
- break;
- case OSPARE:
- if (testAttribute(feature.type, Att.CATPRA, CatPRA.PRA_WFRM)) {
- Renderer.symbol(Areas.WindFarm);
- Renderer.lineVector(new LineStyle(Color.black, 20, new float[] { 40, 40 }));
- addName(15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));
- }
- break;
- case RESARE:
- case MIPARE:
- if (Renderer.zoom >= 12) {
- Renderer.lineSymbols(Areas.Restricted, 1.0, null, null, 0, Symbols.Mline);
- if (testAttribute(feature.type, Att.CATREA, CatREA.REA_NWAK)) {
- Renderer.symbol(Areas.NoWake);
+ break;
+ case OSPARE:
+ if (testAttribute(feature.type, Att.CATOPA, CatOPA.OPA_WIND)) {
+ Renderer.symbol(Areas.WindFarm);
+ Renderer.lineVector(new LineStyle(Color.black, 12, new float[] { 40, 40 }));
+ addName(15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 120)));
}
- }
- break;
- case PRCARE:
- if (Renderer.zoom >= 12) {
- Renderer.lineVector(new LineStyle(Symbols.Mline, 10, new float[] { 40, 40 }));
- }
- break;
- case SEAARE:
- switch ((CatSEA) getAttEnum(feature.type, Att.CATSEA)) {
- case SEA_RECH:
- if ((Renderer.zoom >= 10) && (name != null))
- if (feature.geom.prim == Pflag.LINE) {
- Renderer.lineText(name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40);
- } else {
- Renderer.labelText(name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
- }
break;
- case SEA_BAY:
- if ((Renderer.zoom >= 12) && (name != null))
- if (feature.geom.prim == Pflag.LINE) {
- Renderer.lineText(name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40);
- } else {
- Renderer.labelText(name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
+ case RESARE:
+ case MIPARE:
+ case DMPGRD:
+ if (Renderer.zoom >= 12) {
+ Renderer.lineSymbols(Areas.Restricted, 1.0, null, null, 0, Symbols.Mline);
+ if (testAttribute(feature.type, Att.CATREA, CatREA.REA_NWAK)) {
+ Renderer.symbol(Areas.NoWake);
}
+ }
break;
- case SEA_SHOL:
- if (Renderer.zoom >= 14) {
- if (feature.geom.prim == Pflag.AREA) {
- Renderer.lineVector(new LineStyle(new Color(0xc480ff), 4, new float[] { 25, 25 }));
- if (name != null) {
- Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
- Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC));
- }
- } else if (feature.geom.prim == Pflag.LINE) {
- if (name != null) {
- Renderer.lineText(name, new Font("Arial", Font.ITALIC, 75), Color.black, 0.5, -40);
- Renderer.lineText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5, 0);
- }
- } else {
- if (name != null) {
- Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
- Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC));
+ case PRCARE:
+ if (Renderer.zoom >= 12) {
+ Renderer.lineVector(new LineStyle(Symbols.Mline, 10, new float[] { 40, 40 }));
+ }
+ break;
+ case SEAARE:
+ switch ((CatSEA) getAttEnum(feature.type, Att.CATSEA)) {
+ case SEA_RECH:
+ if ((Renderer.zoom >= 15) && (name != null))
+ if (feature.geom.prim == Pflag.LINE) {
+ Renderer.lineText(name, new Font("Arial", Font.PLAIN, 60), Color.black, -40);
+ } else {
+ Renderer.labelText(name, new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 0)));
+ }
+ break;
+ case SEA_BAY:
+ if ((Renderer.zoom >= 15) && (name != null))
+ if (feature.geom.prim == Pflag.LINE) {
+ Renderer.lineText(name, new Font("Arial", Font.PLAIN, 60), Color.black, -40);
+ } else {
+ Renderer.labelText(name, new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 0)));
+ }
+ break;
+ case SEA_SHOL:
+ if (Renderer.zoom >= 14) {
+ if (feature.geom.prim == Pflag.AREA) {
+ Renderer.lineVector(new LineStyle(new Color(0xc480ff), 4, new float[] { 25, 25 }));
+ if (name != null) {
+ Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
+ Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 20)));
+ }
+ } else if (feature.geom.prim == Pflag.LINE) {
+ if (name != null) {
+ Renderer.lineText(name, new Font("Arial", Font.ITALIC, 75), Color.black, -40);
+ Renderer.lineText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, 20);
+ }
+ } else {
+ if (name != null) {
+ Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
+ Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 20)));
+ }
+ }
}
+ break;
+ case SEA_GAT:
+ case SEA_NRRW:
+ addName(12, new Font("Arial", Font.PLAIN, 100));
+ break;
+ default:
+ break;
+ }
+ break;
+ case SNDWAV:
+ if (Renderer.zoom >= 12)
+ Renderer.fillPattern(Areas.Sandwaves);
+ break;
+ case WEDKLP:
+ if (Renderer.zoom >= 12) {
+ switch ((CatWED) getAttEnum(feature.type, Att.CATWED)) {
+ case WED_KELP:
+ if (feature.geom.prim == Pflag.AREA) {
+ Renderer.fillPattern(Areas.KelpA);
+ } else {
+ Renderer.symbol(Areas.KelpS);
+ }
+ break;
+ default:
+ break;
}
}
break;
- case SEA_GAT:
- case SEA_NRRW:
- addName(12, new Font("Arial", Font.PLAIN, 100));
+ case SPLARE:
+ if (Renderer.zoom >= 12) {
+ Renderer.symbol(Areas.Plane, new Scheme(Symbols.Msymb));
+ Renderer.lineSymbols(Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Symbols.Mline);
+ }
+ addName(15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
break;
default:
break;
- }
- break;
- case SNDWAV:
- if (Renderer.zoom >= 12) Renderer.fillPattern(Areas.Sandwaves);
- break;
- case SPLARE:
- if (Renderer.zoom >= 12) {
- Renderer.symbol(Areas.Plane, new Scheme(Symbols.Msymb));
- Renderer.lineSymbols(Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Symbols.Mline);
- }
- addName(15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
- break;
- default:
- break;
}
}
-
+
@SuppressWarnings("unchecked")
private static void beacons() {
- if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BCNLAT) || (feature.type == Obj.BCNCAR)))) {
- BcnSHP shape = (BcnSHP)getAttEnum(feature.type, Att.BCNSHP);
+ if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BCNLAT) || (feature.type == Obj.BCNCAR)))
+ || ((Renderer.zoom >= 11) && ((feature.type == Obj.BCNSAW) || hasObject(Obj.RTPBCN)))) {
+ if (testAttribute(feature.type, Att.STATUS, StsSTS.STS_ILLD)) {
+ Renderer.symbol(Beacons.Floodlight);
+ }
+ BcnSHP shape = (BcnSHP) getAttEnum(feature.type, Att.BCNSHP);
if (shape == BcnSHP.BCN_UNKN)
shape = BcnSHP.BCN_PILE;
if ((shape == BcnSHP.BCN_WTHY) && (feature.type == Obj.BCNLAT)) {
switch ((CatLAM) getAttEnum(feature.type, Att.CATLAM)) {
- case LAM_PORT:
- Renderer.symbol(Beacons.WithyPort);
- break;
- case LAM_STBD:
- Renderer.symbol(Beacons.WithyStarboard);
- break;
- default:
- Renderer.symbol(Beacons.Stake, getScheme(feature.type));
+ case LAM_PORT:
+ Renderer.symbol(Beacons.WithyPort);
+ break;
+ case LAM_STBD:
+ Renderer.symbol(Beacons.WithyStarboard);
+ break;
+ default:
+ Renderer.symbol(Beacons.Stake, getScheme(feature.type));
}
- } else if ((shape == BcnSHP.BCN_PRCH) && (feature.type == Obj.BCNLAT) && !(feature.objs.containsKey(Obj.TOPMAR))) {
+ } else if (shape == BcnSHP.BCN_PRCH && feature.type == Obj.BCNLAT && !feature.objs.containsKey(Obj.TOPMAR)) {
switch ((CatLAM) getAttEnum(feature.type, Att.CATLAM)) {
- case LAM_PORT:
- Renderer.symbol(Beacons.PerchPort);
- break;
- case LAM_STBD:
- Renderer.symbol(Beacons.PerchStarboard);
- break;
- default:
- Renderer.symbol(Beacons.Stake, getScheme(feature.type));
+ case LAM_PORT:
+ Renderer.symbol(Beacons.PerchPort);
+ break;
+ case LAM_STBD:
+ Renderer.symbol(Beacons.PerchStarboard);
+ break;
+ default:
+ Renderer.symbol(Beacons.Stake, getScheme(feature.type));
}
} else {
Renderer.symbol(Beacons.Shapes.get(shape), getScheme(feature.type));
if (feature.objs.containsKey(Obj.TOPMAR)) {
AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
+ if (testAttribute(Obj.TOPMAR, Att.STATUS, StsSTS.STS_ILLD)) {
+ Renderer.symbol(Beacons.Floodlight);
+ }
if (topmap.containsKey(Att.TOPSHP)) {
- Renderer.symbol(Topmarks.Shapes.get(((ArrayList)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.BeaconDelta);
+ Renderer.symbol(Topmarks.Shapes.get(((ArrayList) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.TOPMAR), Topmarks.BeaconDelta);
}
} else if (feature.objs.containsKey(Obj.DAYMAR)) {
AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
if (topmap.containsKey(Att.TOPSHP)) {
- Renderer.symbol(Topmarks.Shapes.get(((ArrayList)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.BeaconDelta);
+ Renderer.symbol(Topmarks.Shapes.get(((ArrayList) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.DAYMAR), Topmarks.BeaconDelta);
}
}
}
+ if (hasObject(Obj.NOTMRK))
+ notices();
addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
Signals.addSignals();
}
}
-
+
@SuppressWarnings("unchecked")
private static void buoys() {
- if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BOYLAT) || (feature.type == Obj.BOYCAR)))) {
+ if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BOYLAT) || (feature.type == Obj.BOYCAR))) || ((Renderer.zoom >= 11) && ((feature.type == Obj.BOYSAW) || hasObject(Obj.RTPBCN)))) {
BoySHP shape = (BoySHP) getAttEnum(feature.type, Att.BOYSHP);
- if (shape == BoySHP.BOY_UNKN) shape = BoySHP.BOY_PILR;
+ if (shape == BoySHP.BOY_UNKN)
+ shape = BoySHP.BOY_PILR;
Renderer.symbol(Buoys.Shapes.get(shape), getScheme(feature.type));
if (feature.objs.containsKey(Obj.TOPMAR)) {
AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
if (topmap.containsKey(Att.TOPSHP)) {
- Renderer.symbol(Topmarks.Shapes.get(((ArrayList)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape));
+ Renderer.symbol(Topmarks.Shapes.get(((ArrayList) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape));
}
} else if (feature.objs.containsKey(Obj.DAYMAR)) {
AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
if (topmap.containsKey(Att.TOPSHP)) {
- Renderer.symbol(Topmarks.Shapes.get(((ArrayList)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.BuoyDeltas.get(shape));
+ Renderer.symbol(Topmarks.Shapes.get(((ArrayList) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.DAYMAR), Topmarks.BuoyDeltas.get(shape));
}
}
addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
Signals.addSignals();
}
}
-
+
private static void bridges() {
if (Renderer.zoom >= 16) {
double verclr, verccl, vercop, horclr;
@@ -515,8 +652,8 @@ private static void bridges() {
horclr = (Double) atts.get(Att.HORCLR).val;
hstr = String.valueOf(horclr);
}
- if (atts.containsKey(Att.VERCLR)) {
- verclr = (Double) atts.get(Att.VERCLR).val;
+ if (atts.containsKey(Att.VERCLR)) {
+ verclr = (Double) atts.get(Att.VERCLR).val;
} else {
verclr = atts.containsKey(Att.VERCSA) ? (Double) atts.get(Att.VERCSA).val : 0;
}
@@ -540,31 +677,32 @@ private static void bridges() {
Renderer.labelText(hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.CC));
}
}
+ Signals.addSignals();
}
}
-
+
private static void cables() {
if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) {
if (feature.type == Obj.CBLSUB) {
Renderer.lineSymbols(Areas.Cable, 0.0, null, null, 0, Symbols.Mline);
} else if (feature.type == Obj.CBLOHD) {
AttMap atts = feature.objs.get(Obj.CBLOHD).get(0);
- if ((atts != null) && (atts.containsKey(Att.CATCBL)) && (atts.get(Att.CATCBL).val == CatCBL.CBL_POWR)) {
+ if (atts != null && atts.containsKey(Att.CATCBL) && atts.get(Att.CATCBL).val == CatCBL.CBL_POWR) {
Renderer.lineSymbols(Areas.CableDash, 0, Areas.CableDot, Areas.CableFlash, 2, Color.black);
} else {
Renderer.lineSymbols(Areas.CableDash, 0, Areas.CableDot, null, 2, Color.black);
}
if (atts != null) {
if (atts.containsKey(Att.VERCLR)) {
- Renderer.labelText(String.valueOf((Double) 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)));
+ 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)));
} else if (atts.containsKey(Att.VERCSA)) {
- Renderer.labelText(String.valueOf((Double) 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)));
+ 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)));
}
}
}
}
}
-
+
private static void callpoint() {
if (Renderer.zoom >= 14) {
Symbol symb = Harbours.CallPoint2;
@@ -579,11 +717,51 @@ private static void callpoint() {
Renderer.symbol(symb, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(orient))));
String chn;
if (!(chn = getAttStr(feature.type, Att.COMCHA)).isEmpty()) {
- Renderer.labelText(("Ch." + chn), new Font("Arial", Font.PLAIN, 50), Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,50)));
+ Renderer.labelText(("Ch." + chn), new Font("Arial", Font.PLAIN, 50), Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 50)));
}
}
}
-
+
+ private static void depths() {
+ switch (feature.type) {
+ case SOUNDG:
+ if (testAttribute(Obj.SOUNDG, Att.TECSOU, TecSOU.SOU_COMP) && hasAttribute(Obj.SOUNDG, Att.VALSOU)) {
+ double depth = (double) getAttVal(Obj.SOUNDG, Att.VALSOU);
+ Color col = new Color(0x00ffffff, true);
+ if (depth > 0.0) col = Symbols.Bwater;
+ if (depth > 5.0) col = new Color(0xcde2f1);
+ if (depth > 20.0) col = new Color(0xe6eff8);
+ if (depth > 50.0) col = new Color(0xf3f8fc);
+ Renderer.rasterPixel(Math.toRadians(1.0/60.0/16.0), col);
+ } else if ((Renderer.zoom >= 14) && hasAttribute(Obj.SOUNDG, Att.VALSOU)) {
+ double depth = (double) getAttVal(Obj.SOUNDG, Att.VALSOU);
+ String dstr = df.format(depth);
+ String[] tok = dstr.split("[-.]");
+ String ul = "";
+ String id = tok[0];
+ String dd = "";
+ if (tok[0].equals("")) {
+ for (int i = 0; i < tok[1].length(); i++) {
+ ul += "_";
+ }
+ id = tok[1];
+ dd = (tok.length == 3) ? tok[2] : "";
+ } else {
+ dd = (tok.length == 2) ? tok[1] : "";
+ }
+ Renderer.labelText(ul, new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.RC, AffineTransform.getTranslateInstance(10, 15)));
+ Renderer.labelText(id, new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.RC, AffineTransform.getTranslateInstance(10, 0)));
+ Renderer.labelText(dd, new Font("Arial", Font.PLAIN, 20), Color.black, new Delta(Handle.LC, AffineTransform.getTranslateInstance(15, 10)));
+ }
+ break;
+ case DEPCNT:
+ Renderer.lineVector(new LineStyle(Color.blue, 2));
+ break;
+ default:
+ break;
+ }
+ }
+
private static void distances() {
if (Renderer.zoom >= 14) {
if (!testAttribute(Obj.DISMAR, Att.CATDIS, CatDIS.DIS_NONI)) {
@@ -593,72 +771,72 @@ private static void distances() {
}
if (Renderer.zoom >= 15) {
AttMap atts = getAtts(Obj.DISMAR, 0);
- if ((atts != null) && (atts.containsKey(Att.WTWDIS))) {
+ if (atts != null && atts.containsKey(Att.WTWDIS)) {
Double dist = (Double) atts.get(Att.WTWDIS).val;
String str = "";
if (atts.containsKey(Att.HUNITS)) {
- switch ((UniHLU) atts.get(Att.HUNITS).val) {
- case HLU_METR:
- str += "m ";
- break;
- case HLU_FEET:
- str += "ft ";
- break;
- case HLU_HMTR:
- str += "hm ";
- break;
- case HLU_KMTR:
- str += "km ";
- break;
- case HLU_SMIL:
- str += "M ";
- break;
- case HLU_NMIL:
- str += "NM ";
- break;
- default:
- break;
+ switch ((UniHLU) getAttEnum(Obj.DISMAR, Att.HUNITS)) {
+ case HLU_METR:
+ str += "m ";
+ break;
+ case HLU_FEET:
+ str += "ft ";
+ break;
+ case HLU_HMTR:
+ str += "hm ";
+ break;
+ case HLU_KMTR:
+ str += "km ";
+ break;
+ case HLU_SMIL:
+ str += "M ";
+ break;
+ case HLU_NMIL:
+ str += "NM ";
+ break;
+ default:
+ break;
}
}
- str += String.format("%1.0f", dist);
+ str += String.format("%3.1f", dist);
Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45)));
}
}
}
}
-
+
@SuppressWarnings("unchecked")
private static void floats() {
- if (Renderer.zoom >= 12) {
+ if ((Renderer.zoom >= 12) || ((Renderer.zoom >= 11) && ((feature.type == Obj.LITVES) || (feature.type == Obj.BOYINB) || hasObject(Obj.RTPBCN)))) {
switch (feature.type) {
- case LITVES:
- Renderer.symbol(Buoys.Super, getScheme(feature.type));
- break;
- case LITFLT:
- Renderer.symbol(Buoys.Float, getScheme(feature.type));
- break;
- case BOYINB:
- Renderer.symbol(Buoys.Super, getScheme(feature.type));
- break;
- default:
- break;
+ case LITVES:
+ Renderer.symbol(Buoys.Super, getScheme(feature.type));
+ break;
+ case LITFLT:
+ Renderer.symbol(Buoys.Float, getScheme(feature.type));
+ break;
+ case BOYINB:
+ Renderer.symbol(Buoys.Super, getScheme(feature.type));
+ break;
+ default:
+ break;
}
if (feature.objs.containsKey(Obj.TOPMAR)) {
AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
if (topmap.containsKey(Att.TOPSHP)) {
- Renderer.symbol(Topmarks.Shapes.get(((ArrayList)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.FloatDelta);
+ Renderer.symbol(Topmarks.Shapes.get(((ArrayList) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.TOPMAR), Topmarks.FloatDelta);
}
} else if (feature.objs.containsKey(Obj.DAYMAR)) {
AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
if (topmap.containsKey(Att.TOPSHP)) {
- Renderer.symbol(Topmarks.Shapes.get(((ArrayList)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.FloatDelta);
+ Renderer.symbol(Topmarks.Shapes.get(((ArrayList) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.DAYMAR), Topmarks.FloatDelta);
}
}
addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
Signals.addSignals();
}
}
-
+
private static void gauges() {
if (Renderer.zoom >= 14) {
Renderer.symbol(Harbours.TideGauge);
@@ -666,271 +844,333 @@ private static void gauges() {
Signals.addSignals();
}
}
-
+
@SuppressWarnings("unchecked")
private static void harbours() {
String name = getName();
switch (feature.type) {
- case ACHBRT:
- if (Renderer.zoom >= 14) {
- Renderer.symbol(Harbours.Anchorage, new Scheme(Symbols.Mline));
- if (Renderer.zoom >= 15) {
- Renderer.labelText(name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Symbols.Msymb, LabelStyle.RRCT, Symbols.Mline, Color.white, new Delta(Handle.BC));
- }
- }
- if (getAttVal(Obj.ACHBRT, Att.RADIUS) != null) {
- double radius;
- if ((radius = (Double) getAttVal(Obj.ACHBRT, Att.RADIUS)) != 0) {
- UniHLU units = (UniHLU) getAttEnum(Obj.ACHBRT, Att.HUNITS);
- if (units == UniHLU.HLU_UNKN) {
- units = UniHLU.HLU_METR;
+ case ACHBRT:
+ if (Renderer.zoom >= 14) {
+ Renderer.symbol(Harbours.Anchor, new Scheme(Symbols.Msymb));
+ if (Renderer.zoom >= 15) {
+ Renderer.labelText(name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Symbols.Msymb, LabelStyle.RRCT, Symbols.Msymb, Color.white, new Delta(Handle.BC));
}
- Renderer.lineCircle(new LineStyle(Symbols.Mline, 4, new float[] { 10, 10 }, null), radius, units);
- }
- }
- break;
- case ACHARE:
- if (Renderer.zoom >= 12) {
- if (feature.geom.prim != Pflag.AREA) {
- Renderer.symbol(Harbours.Anchorage, new Scheme(Color.black));
- } else {
- Renderer.symbol(Harbours.Anchorage, new Scheme(Symbols.Mline));
- Renderer.lineSymbols(Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Symbols.Mline);
}
- addName(15, new Font("Arial", Font.BOLD, 60), Symbols.Mline, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
- ArrayList sts = (ArrayList) getAttList(Obj.ACHARE, Att.STATUS);
- if ((Renderer.zoom >= 15) && (sts.contains(StsSTS.STS_RESV))) {
- Renderer.labelText("Reserved", new Font("Arial", Font.PLAIN, 50), Symbols.Mline, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));
+ if (getAttVal(Obj.ACHBRT, Att.RADIUS) != null) {
+ double radius;
+ if ((radius = (Double) getAttVal(Obj.ACHBRT, Att.RADIUS)) != 0) {
+ UniHLU units = (UniHLU) getAttEnum(Obj.ACHBRT, Att.HUNITS);
+ if (units == UniHLU.HLU_UNKN) {
+ units = UniHLU.HLU_METR;
+ }
+ Renderer.lineCircle(new LineStyle(Symbols.Mline, 4, new float[] { 10, 10 }, null), radius, units);
+ }
}
- ArrayList cats = (ArrayList) getAttList(Obj.ACHARE, Att.CATACH);
- int dy = (cats.size() - 1) * -30;
- for (CatACH cat : cats) {
- switch (cat) {
- case ACH_DEEP:
- Renderer.labelText("DW", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
- dy += 60;
- break;
- case ACH_TANK:
- Renderer.labelText("Tanker", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
- dy += 60;
- break;
- case ACH_H24P:
- Renderer.labelText("24h", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
- dy += 60;
- break;
- case ACH_EXPL:
- Renderer.symbol(Harbours.Explosives, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
- dy += 60;
- break;
- case ACH_QUAR:
- Renderer.symbol(Harbours.Hospital, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
- dy += 60;
- break;
- case ACH_SEAP:
- Renderer.symbol(Areas.Seaplane, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
- dy += 60;
- break;
- default:
+ break;
+ case ACHARE:
+ if (Renderer.zoom >= 12) {
+ if (feature.geom.prim != Pflag.AREA) {
+ Renderer.symbol(Harbours.Anchorage, new Scheme(Color.black));
+ } else {
+ Renderer.symbol(Harbours.Anchorage, new Scheme(Symbols.Mline));
+ Renderer.lineSymbols(Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Symbols.Mline);
+ }
+ addName(15, new Font("Arial", Font.BOLD, 60), Symbols.Mline, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
+ ArrayList sts = (ArrayList) getAttList(Obj.ACHARE, Att.STATUS);
+ if (Renderer.zoom >= 15 && sts.contains(StsSTS.STS_RESV)) {
+ Renderer.labelText("Reserved", new Font("Arial", Font.PLAIN, 50), Symbols.Mline, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));
+ }
+ ArrayList cats = (ArrayList) getAttList(Obj.ACHARE, Att.CATACH);
+ int dy = (cats.size() - 1) * -30;
+ for (CatACH cat : cats) {
+ switch (cat) {
+ case ACH_DEEP:
+ Renderer.labelText("DW", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
+ dy += 60;
+ break;
+ case ACH_TANK:
+ Renderer.labelText("Tanker", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
+ dy += 60;
+ break;
+ case ACH_H24P:
+ Renderer.labelText("24h", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
+ dy += 60;
+ break;
+ case ACH_EXPL:
+ Renderer.symbol(Harbours.Explosives, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
+ dy += 60;
+ break;
+ case ACH_QUAR:
+ Renderer.symbol(Harbours.Hospital, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
+ dy += 60;
+ break;
+ case ACH_SEAP:
+ Renderer.symbol(Areas.Seaplane, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
+ dy += 60;
+ break;
+ default:
+ }
}
}
- }
- break;
- case BERTHS:
- if (Renderer.zoom >= 14) {
- Renderer.lineVector(new LineStyle(Symbols.Mline, 6, new float[] { 20, 20 }));
- Renderer.labelText(name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, LabelStyle.RRCT, Symbols.Mline, Color.white);
- }
- break;
- case BUISGL:
- if (Renderer.zoom >= 16) {
- ArrayList symbols = new ArrayList();
- ArrayList fncs = (ArrayList) getAttList(Obj.BUISGL, Att.FUNCTN);
- for (FncFNC fnc : fncs) {
- symbols.add(Landmarks.Funcs.get(fnc));
+ break;
+ case BERTHS:
+ if (Renderer.zoom >= 14) {
+ Renderer.lineVector(new LineStyle(Symbols.Mline, 6, new float[] { 20, 20 }));
+ Renderer.labelText(name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, LabelStyle.RRCT, Symbols.Mline, Color.white);
}
- if (feature.objs.containsKey(Obj.SMCFAC)) {
- ArrayList scfs = (ArrayList) getAttList(Obj.SMCFAC, Att.CATSCF);
- for (CatSCF scf : scfs) {
- symbols.add(Facilities.Cats.get(scf));
+ break;
+ case BUISGL:
+ if (Renderer.zoom >= 15) {
+ Renderer.lineVector(new LineStyle(Color.black, 8, new Color(0xffc0c0c0, true)));
+ if (testAttribute(Obj.BUISGL, Att.FUNCTN, FncFNC.FNC_LOOK)) {
+ Renderer.labelText("Lookout", new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 50)));
+ addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, -50)));
+ }
+ if (Renderer.zoom >= 16) {
+ if (testAttribute(Obj.BUISGL, Att.STATUS, StsSTS.STS_ILLD)) {
+ Renderer.symbol(Beacons.Floodlight);
+ }
+ ArrayList symbols = new ArrayList<>();
+ ArrayList fncs = (ArrayList) getAttList(Obj.BUISGL, Att.FUNCTN);
+ for (FncFNC fnc : fncs) {
+ symbols.add(Landmarks.Funcs.get(fnc));
+ }
+ if (feature.objs.containsKey(Obj.SMCFAC)) {
+ ArrayList scfs = (ArrayList) getAttList(Obj.SMCFAC, Att.CATSCF);
+ for (CatSCF scf : scfs) {
+ symbols.add(Facilities.Cats.get(scf));
+ }
+ }
+ Renderer.cluster(symbols);
+ Signals.addSignals();
}
}
- Renderer.cluster(symbols);
- }
- break;
- case HRBFAC:
- if (Renderer.zoom >= 12) {
- ArrayList cathaf = (ArrayList) getAttList(Obj.HRBFAC, Att.CATHAF);
- if (cathaf.size() == 1) {
- switch (cathaf.get(0)) {
- case HAF_MRNA:
- Renderer.symbol(Harbours.Marina);
- break;
- case HAF_MANF:
- Renderer.symbol(Harbours.MarinaNF);
- break;
- case HAF_FISH:
- Renderer.symbol(Harbours.Fishing);
- break;
- default:
+ break;
+ case HRBFAC:
+ if (Renderer.zoom >= 12) {
+ ArrayList cathaf = (ArrayList) getAttList(Obj.HRBFAC, Att.CATHAF);
+ if (cathaf.size() == 1) {
+ switch (cathaf.get(0)) {
+ case HAF_MRNA:
+ Renderer.symbol(Harbours.Marina);
+ break;
+ case HAF_MANF:
+ Renderer.symbol(Harbours.MarinaNF);
+ break;
+ case HAF_FISH:
+ Renderer.symbol(Harbours.Fishing);
+ break;
+ default:
+ Renderer.symbol(Harbours.Harbour);
+ break;
+ }
+ } else {
Renderer.symbol(Harbours.Harbour);
- break;
}
- } else {
- Renderer.symbol(Harbours.Harbour);
+ addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, -80)));
}
- }
- break;
- default:
- break;
+ break;
+ default:
+ break;
}
}
-
+
@SuppressWarnings("unchecked")
private static void highways() {
switch (feature.type) {
- case ROADWY:
- ArrayList cat = (ArrayList) (getAttList(Obj.ROADWY, Att.CATROD));
- if (cat.size() > 0) {
- switch (cat.get(0)) {
- case ROD_MWAY:
- Renderer.lineVector(new LineStyle(Color.black, 20));
- break;
- case ROD_MAJR:
- Renderer.lineVector(new LineStyle(Color.black, 15));
- break;
- case ROD_MINR:
- Renderer.lineVector(new LineStyle(Color.black, 10));
- break;
- default:
+ case ROADWY:
+ ArrayList cat = (ArrayList) getAttList(Obj.ROADWY, Att.CATROD);
+ if (cat.size() > 0) {
+ switch (cat.get(0)) {
+ case ROD_MWAY:
+ Renderer.lineVector(new LineStyle(Color.black, 20));
+ break;
+ case ROD_MAJR:
+ Renderer.lineVector(new LineStyle(Color.black, 15));
+ break;
+ case ROD_MINR:
+ Renderer.lineVector(new LineStyle(Color.black, 10));
+ break;
+ default:
+ Renderer.lineVector(new LineStyle(Color.black, 5));
+ }
+ } else {
Renderer.lineVector(new LineStyle(Color.black, 5));
}
- } else {
- Renderer.lineVector(new LineStyle(Color.black, 5));
- }
- break;
- case RAILWY:
- Renderer.lineVector(new LineStyle(Color.gray, 10));
- Renderer.lineVector(new LineStyle(Color.black, 10, new float[] { 30, 30 }));
- break;
- default:
+ break;
+ case RAILWY:
+ Renderer.lineVector(new LineStyle(Color.gray, 10));
+ Renderer.lineVector(new LineStyle(Color.black, 10, new float[] { 30, 30 }));
+ break;
+ default:
}
}
-
+
@SuppressWarnings("unchecked")
private static void landmarks() {
- if (Renderer.zoom >= 12) {
- ArrayList cats = (ArrayList) getAttList(feature.type, Att.CATLMK);
- Symbol catSym = Landmarks.Shapes.get(cats.get(0));
- ArrayList fncs = (ArrayList) getAttList(feature.type, Att.FUNCTN);
- Symbol fncSym = Landmarks.Funcs.get(fncs.get(0));
- if ((fncs.get(0) == FncFNC.FNC_CHCH) && (cats.get(0) == CatLMK.LMK_TOWR))
- catSym = Landmarks.ChurchTower;
- if ((cats.get(0) == CatLMK.LMK_UNKN) && (fncs.get(0) == FncFNC.FNC_UNKN) && (feature.objs.get(Obj.LIGHTS) != null))
- catSym = Beacons.LightMajor;
- if (cats.get(0) == CatLMK.LMK_RADR)
- fncSym = Landmarks.RadioTV;
- Renderer.symbol(catSym);
- Renderer.symbol(fncSym);
- if (Renderer.zoom >= 15)
- addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
+ if (!hasAttribute(Obj.LNDMRK, Att.CATLMK) && (!hasAttribute(Obj.LNDMRK, Att.FUNCTN) || testAttribute(Obj.LNDMRK, Att.FUNCTN, FncFNC.FNC_LGHT)) && hasObject(Obj.LIGHTS)) {
+ lights();
+ } else if (Renderer.zoom >= 12) {
+ switch (feature.type) {
+ case LNDMRK:
+ if (testAttribute(Obj.LNDMRK, Att.STATUS, StsSTS.STS_ILLD)) {
+ Renderer.symbol(Beacons.Floodlight);
+ }
+ ArrayList cats = (ArrayList) getAttList(feature.type, Att.CATLMK);
+ Symbol catSym = Landmarks.Shapes.get(cats.get(0));
+ ArrayList fncs = (ArrayList) getAttList(feature.type, Att.FUNCTN);
+ Symbol fncSym = Landmarks.Funcs.get(fncs.get(0));
+ if ((fncs.get(0) == FncFNC.FNC_CHCH) && (cats.get(0) == CatLMK.LMK_TOWR))
+ catSym = Landmarks.ChurchTower;
+ if (cats.get(0) == CatLMK.LMK_RADR)
+ fncSym = Landmarks.RadioTV;
+ Renderer.symbol(catSym);
+ Renderer.symbol(fncSym);
+ break;
+ case SILTNK:
+ if (testAttribute(feature.type, Att.CATSIL, CatSIL.SIL_WTRT))
+ Renderer.symbol(Landmarks.WaterTower);
+ break;
+ default:
+ break;
+ }
+ if (Renderer.zoom >= 15) {
+ Renderer.colLetters(getAttList(feature.type, Att.COLOUR));
+ }
Signals.addSignals();
+ addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
}
}
-
+
@SuppressWarnings("unchecked")
private static void lights() {
+ boolean ok = false;
switch (feature.type) {
- case LITMAJ:
- Renderer.symbol(Beacons.LightMajor);
- break;
- case LITMIN:
- case LIGHTS:
- Renderer.symbol(Beacons.LightMinor);
- break;
- case PILPNT:
- if (feature.objs.containsKey(Obj.LIGHTS))
- Renderer.symbol(Beacons.LightMinor);
- else
- Renderer.symbol(Harbours.Post);
- break;
- default:
- break;
+ case LITMAJ:
+ case LNDMRK:
+ Renderer.symbol(Beacons.LightMajor);
+ if (Renderer.zoom >= 12) {
+ ok = true;
+ } else {
+ Signals.lights();
+ }
+ break;
+ case LITMIN:
+ case LIGHTS:
+ case PILPNT:
+ if (Renderer.zoom >= 14) {
+ if (testAttribute(Obj.LIGHTS, Att.CATLIT, CatLIT.LIT_FLDL)) {
+ Renderer.symbol(Beacons.Floodlight, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(90))));
+ Renderer.symbol(Harbours.SignalStation);
+ } else {
+ Renderer.symbol(Beacons.LightMinor);
+ }
+ ok = true;
+ }
+ break;
+ default:
+ break;
}
- if (feature.objs.containsKey(Obj.TOPMAR)) {
- AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
- if (topmap.containsKey(Att.TOPSHP)) {
- Renderer.symbol(Topmarks.Shapes.get(((ArrayList)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.LightDelta);
- }
- } else if (feature.objs.containsKey(Obj.DAYMAR)) {
- AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
- if (topmap.containsKey(Att.TOPSHP)) {
- Renderer.symbol(Topmarks.Shapes.get(((ArrayList)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.LightDelta);
+ if (ok) {
+ if (feature.objs.containsKey(Obj.TOPMAR)) {
+ if (testAttribute(Obj.TOPMAR, Att.STATUS, StsSTS.STS_ILLD)) {
+ Renderer.symbol(Beacons.Floodlight);
+ }
+ AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
+ if (topmap.containsKey(Att.TOPSHP)) {
+ Renderer.symbol(Topmarks.Shapes.get(((ArrayList) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.TOPMAR), Topmarks.LightDelta);
+ }
+ } else if (feature.objs.containsKey(Obj.DAYMAR)) {
+ AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
+ if (topmap.containsKey(Att.TOPSHP)) {
+ Renderer.symbol(Topmarks.Shapes.get(((ArrayList) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.DAYMAR), Topmarks.LightDelta);
+ }
}
+ Signals.addSignals();
+ addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, -50)));
}
- Signals.addSignals();
}
@SuppressWarnings("unchecked")
private static void marinas() {
if (Renderer.zoom >= 16) {
- ArrayList symbols = new ArrayList();
+ ArrayList symbols = new ArrayList<>();
ArrayList scfs = (ArrayList) getAttList(Obj.SMCFAC, Att.CATSCF);
for (CatSCF scf : scfs) {
- symbols.add(Facilities.Cats.get(scf));
+ Symbol sym = Facilities.Cats.get(scf);
+ if (sym != null) symbols.add(sym);
}
Renderer.cluster(symbols);
}
}
-
+
private static void moorings() {
if (Renderer.zoom >= 14) {
switch ((CatMOR) getAttEnum(feature.type, Att.CATMOR)) {
- case MOR_DLPN:
- Renderer.symbol(Harbours.Dolphin);
- break;
- case MOR_DDPN:
- Renderer.symbol(Harbours.DeviationDolphin);
- break;
- case MOR_BLRD:
- case MOR_POST:
- Renderer.symbol(Harbours.Bollard);
- break;
- case MOR_BUOY:
- BoySHP shape = (BoySHP) getAttEnum(feature.type, Att.BOYSHP);
- if (shape == BoySHP.BOY_UNKN) {
- shape = BoySHP.BOY_SPHR;
- }
- Renderer.symbol(Buoys.Shapes.get(shape), getScheme(feature.type));
- Renderer.symbol(Topmarks.TopMooring, Topmarks.BuoyDeltas.get(shape));
- break;
- default:
- break;
+ case MOR_DLPN:
+ if (feature.geom.prim == Pflag.AREA) {
+ Renderer.lineVector(new LineStyle(Color.black, 4, Symbols.Yland));
+ } else {
+ Renderer.symbol(Harbours.Dolphin);
+ }
+ Signals.addSignals();
+ break;
+ case MOR_DDPN:
+ Renderer.symbol(Harbours.DeviationDolphin);
+ Signals.addSignals();
+ break;
+ case MOR_BLRD:
+ case MOR_POST:
+ Renderer.symbol(Harbours.Bollard);
+ break;
+ case MOR_BUOY:
+ if (Renderer.zoom >= 17) {
+ BoySHP shape = (BoySHP) getAttEnum(feature.type, Att.BOYSHP);
+ if (shape == BoySHP.BOY_UNKN) {
+ shape = BoySHP.BOY_SPHR;
+ }
+ Renderer.symbol(Buoys.Shapes.get(shape), getScheme(feature.type));
+ Renderer.symbol(Topmarks.TopMooring, Topmarks.BuoyDeltas.get(shape));
+ Signals.addSignals();
+ addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
+ }
+ break;
+ default:
+ break;
}
- Signals.addSignals();
}
}
+ @SuppressWarnings("unchecked")
private static void notices() {
if (Renderer.zoom >= 14) {
double dx = 0.0, dy = 0.0;
switch (feature.type) {
- case BCNCAR:
- case BCNISD:
- case BCNLAT:
- case BCNSAW:
- case BCNSPP:
- dy = 45.0;
- break;
- case NOTMRK:
- dy = 0.0;
- break;
- default:
- return;
+ case BCNCAR:
+ case BCNISD:
+ case BCNLAT:
+ case BCNSAW:
+ case BCNSPP:
+ if (testAttribute(Obj.TOPMAR, Att.TOPSHP, TopSHP.TOP_BORD) || testAttribute(Obj.DAYMAR, Att.TOPSHP, TopSHP.TOP_BORD)) {
+ dy = -100.0;
+ } else {
+ dy = -45.0;
+ }
+ break;
+ case NOTMRK:
+ dy = 0.0;
+ break;
+ default:
+ return;
}
MarSYS sys = MarSYS.SYS_CEVN;
-// BnkWTW bnk = BnkWTW.BWW_UNKN;
+ BnkWTW bnk = BnkWTW.BWW_UNKN;
AttVal> att = feature.atts.get(Att.MARSYS);
- if (att != null) sys = (MarSYS)att.val;
+ if (att != null)
+ sys = (MarSYS) att.val;
+ att = feature.atts.get(Att.BNKWTW);
+ if (att != null)
+ bnk = (BnkWTW) att.val;
ObjTab objs = feature.objs.get(Obj.NOTMRK);
int n = objs.size();
if (n > 5) {
@@ -938,38 +1178,56 @@ private static void notices() {
} else {
int i = 0;
for (AttMap atts : objs.values()) {
- if (atts.get(Att.MARSYS) != null) sys = (MarSYS)(atts.get(Att.MARSYS).val);
+ if (atts.get(Att.MARSYS) != null)
+ sys = ((ArrayList) atts.get(Att.MARSYS).val).get(0);
+ if (atts.get(Att.BNKWTW) != null)
+ bnk = ((ArrayList) atts.get(Att.BNKWTW).val).get(0);
CatNMK cat = CatNMK.NMK_UNKN;
- if (atts.get(Att.CATNMK) != null) cat = (CatNMK)(atts.get(Att.CATNMK).val);
- Symbol sym = Notices.getNotice(cat, sys);
+ if (atts.get(Att.CATNMK) != null)
+ cat = ((ArrayList) atts.get(Att.CATNMK).val).get(0);
+ Symbol sym = Notices.getNotice(cat, sys, bnk);
+ Scheme sch = Notices.getScheme(sys, bnk);
+ ArrayList add = new ArrayList<>();
+ if (atts.get(Att.ADDMRK) != null)
+ add = (ArrayList) atts.get(Att.ADDMRK).val;
Handle h = Handle.CC;
+ double ax = 0.0;
+ double ay = 0.0;
switch (i) {
- case 0:
- if (n != 1) h = null;
- break;
- case 1:
- if (n <= 3)
- h = Handle.RC;
- else
- h = Handle.BR;
- break;
- case 2:
- if (n <= 3)
- h = Handle.LC;
- else
- h = Handle.BL;
- break;
- case 3:
- if (n == 4)
- h = Handle.TC;
- else
- h = Handle.TR;
- break;
- case 4:
- h = Handle.TL;
- break;
+ case 0:
+ if (n != 1)
+ h = null;
+ break;
+ case 1:
+ if (n <= 3) {
+ h = Handle.RC;
+ ax = -30;
+ ay = dy;
+ } else {
+ h = Handle.BR;
+ }
+ break;
+ case 2:
+ if (n <= 3)
+ h = Handle.LC;
+ else
+ h = Handle.BL;
+ break;
+ case 3:
+ if (n == 4)
+ h = Handle.TC;
+ else
+ h = Handle.TR;
+ break;
+ case 4:
+ h = Handle.TL;
+ break;
+ }
+ if (h != null) {
+ Renderer.symbol(sym, sch, new Delta(h, AffineTransform.getTranslateInstance(dx, dy)));
+ if (!add.isEmpty())
+ Renderer.symbol(Notices.NoticeBoard, new Delta(Handle.BC, AffineTransform.getTranslateInstance(ax, ay - 30)));
}
- if (h != null) Renderer.symbol(sym, new Delta(h, AffineTransform.getTranslateInstance(dx, dy)));
i++;
}
}
@@ -978,36 +1236,39 @@ private static void notices() {
private static void obstructions() {
if ((Renderer.zoom >= 12) && (feature.type == Obj.OBSTRN)) {
- switch ((CatOBS) getAttEnum(feature.type, Att.CATOBS)) {
- case OBS_BOOM:
+ if (getAttEnum(feature.type, Att.CATOBS) == CatOBS.OBS_BOOM) {
Renderer.lineVector(new LineStyle(Color.black, 5, new float[] { 20, 20 }, null));
if (Renderer.zoom >= 15) {
- Renderer.lineText("Boom", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20);
+ Renderer.lineText("Boom", new Font("Arial", Font.PLAIN, 40), Color.black, -20);
}
- default:
- break;
}
}
if ((Renderer.zoom >= 14) && (feature.type == Obj.UWTROC)) {
switch ((WatLEV) getAttEnum(feature.type, Att.WATLEV)) {
- case LEV_CVRS:
- Renderer.symbol(Areas.RockC);
- break;
- case LEV_AWSH:
- Renderer.symbol(Areas.RockA);
- break;
- default:
- Renderer.symbol(Areas.Rock);
+ case LEV_CVRS:
+ Renderer.symbol(Areas.RockC);
+ break;
+ case LEV_AWSH:
+ Renderer.symbol(Areas.RockA);
+ break;
+ default:
+ Renderer.symbol(Areas.Rock);
}
- } else {
- Renderer.symbol(Areas.Rock);
}
}
private static void pipelines() {
if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) {
if (feature.type == Obj.PIPSOL) {
- Renderer.lineSymbols(Areas.Pipeline, 1.0, null, null, 0, Symbols.Mline);
+ switch ((CatPIP) getAttEnum(feature.type, Att.CATPIP)) {
+ case PIP_ITAK:
+ case PIP_OFAL:
+ case PIP_SEWR:
+ Renderer.lineSymbols(Areas.Pipeline, 0.33, null, null, 0, Color.black);
+ break;
+ default:
+ Renderer.lineSymbols(Areas.Pipeline, 0.33, null, null, 0, Symbols.Msymb);
+ }
} else if (feature.type == Obj.PIPOHD) {
Renderer.lineVector(new LineStyle(Color.black, 8));
AttMap atts = feature.atts;
@@ -1019,7 +1280,7 @@ private static void pipelines() {
verclr = atts.containsKey(Att.VERCSA) ? (Double) atts.get(Att.VERCSA).val : 0;
}
if (verclr > 0) {
- 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)));
+ 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)));
}
}
}
@@ -1029,14 +1290,59 @@ private static void pipelines() {
@SuppressWarnings("unchecked")
private static void platforms() {
ArrayList cats = (ArrayList) getAttList(Obj.OFSPLF, Att.CATOFP);
- if ((CatOFP) cats.get(0) == CatOFP.OFP_FPSO)
+ if (cats.get(0) == CatOFP.OFP_FPSO)
Renderer.symbol(Buoys.Storage);
else
Renderer.symbol(Landmarks.Platform);
+ if (testAttribute(feature.type, Att.STATUS, StsSTS.STS_ILLD)) {
+ Renderer.symbol(Beacons.Floodlight);
+ }
addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
Signals.addSignals();
}
+ @SuppressWarnings("unchecked")
+ private static void points() {
+ boolean ok = false;
+ switch (feature.type) {
+ case FOGSIG:
+ if (Renderer.zoom >= 12) {
+ if (feature.objs.containsKey(Obj.LIGHTS))
+ lights();
+ else
+ Renderer.symbol(Harbours.Post);
+ ok = true;
+ }
+ break;
+ default:
+ if (Renderer.zoom >= 14) {
+ if (testAttribute(feature.type, Att.STATUS, StsSTS.STS_ILLD)) {
+ Renderer.symbol(Beacons.Floodlight);
+ }
+ if (feature.objs.containsKey(Obj.LIGHTS))
+ lights();
+ else
+ Renderer.symbol(Harbours.Post);
+ ok = true;
+ }
+ break;
+ }
+ if (ok) {
+ if (feature.objs.containsKey(Obj.TOPMAR)) {
+ AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
+ if (topmap.containsKey(Att.TOPSHP)) {
+ Renderer.symbol(Topmarks.Shapes.get(((ArrayList) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.TOPMAR), null);
+ }
+ } else if (feature.objs.containsKey(Obj.DAYMAR)) {
+ AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
+ if (topmap.containsKey(Att.TOPSHP)) {
+ Renderer.symbol(Topmarks.Shapes.get(((ArrayList) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.DAYMAR), null);
+ }
+ }
+ Signals.addSignals();
+ }
+ }
+
private static void ports() {
if (Renderer.zoom >= 14) {
if (feature.type == Obj.CRANES) {
@@ -1053,29 +1359,29 @@ private static void ports() {
private static void separation() {
switch (feature.type) {
- case TSEZNE:
- case TSSCRS:
- case TSSRON:
- if (Renderer.zoom <= 15)
- Renderer.lineVector(new LineStyle(Symbols.Mtss));
- else
+ case TSEZNE:
+ case TSSCRS:
+ case TSSRON:
+ if (Renderer.zoom <= 15)
+ Renderer.lineVector(new LineStyle(Symbols.Mtss));
+ else
+ Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, null, null));
+ addName(10, new Font("Arial", Font.BOLD, 150), Symbols.Mline);
+ break;
+ case TSELNE:
Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, null, null));
- addName(10, new Font("Arial", Font.BOLD, 150), Symbols.Mline);
- break;
- case TSELNE:
- Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, null, null));
- break;
- case TSSLPT:
- Renderer.lineSymbols(Areas.LaneArrow, 0.5, null, null, 0, Symbols.Mtss);
- break;
- case TSSBND:
- Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, new float[] { 40, 40 }, null));
- break;
- case ISTZNE:
- Renderer.lineSymbols(Areas.Restricted, 1.0, null, null, 0, Symbols.Mtss);
- break;
- default:
- break;
+ break;
+ case TSSLPT:
+ Renderer.lineSymbols(Areas.LaneArrow, 0.5, null, null, 0, Symbols.Mtss);
+ break;
+ case TSSBND:
+ Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, new float[] { 40, 40 }, null));
+ break;
+ case ISTZNE:
+ Renderer.lineSymbols(Areas.Restricted, 1.0, null, null, 0, Symbols.Mtss);
+ break;
+ default:
+ break;
}
}
@@ -1094,31 +1400,31 @@ private static void shoreline() {
if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.SEAMARK)) {
if (Renderer.zoom >= 12) {
switch (cat) {
- case SLC_TWAL:
- WatLEV lev = (WatLEV) getAttEnum(feature.type, Att.WATLEV);
- if (lev == WatLEV.LEV_CVRS) {
- Renderer.lineVector(new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
+ case SLC_TWAL:
+ WatLEV lev = (WatLEV) getAttEnum(feature.type, Att.WATLEV);
+ if (lev == WatLEV.LEV_CVRS) {
+ Renderer.lineVector(new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
+ if (Renderer.zoom >= 15)
+ Renderer.lineText("(covers)", new Font("Arial", Font.PLAIN, 40), Color.black, 80);
+ } else {
+ Renderer.lineVector(new LineStyle(Color.black, 10, null, null));
+ }
if (Renderer.zoom >= 15)
- Renderer.lineText("(covers)", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5, 80);
- } else {
- Renderer.lineVector(new LineStyle(Color.black, 10, null, null));
- }
- if (Renderer.zoom >= 15)
- Renderer.lineText("Training Wall", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5, -30);
- break;
- case SLC_SWAY:
- Renderer.lineVector(new LineStyle(Color.black, 2, null, new Color(0xffe000)));
- if ((Renderer.zoom >= 16) && feature.objs.containsKey(Obj.SMCFAC)) {
- ArrayList symbols = new ArrayList();
- ArrayList scfs = (ArrayList) getAttList(Obj.SMCFAC, Att.CATSCF);
- for (CatSCF scf : scfs) {
- symbols.add(Facilities.Cats.get(scf));
+ Renderer.lineText("Training Wall", new Font("Arial", Font.PLAIN, 40), Color.black, -30);
+ break;
+ case SLC_SWAY:
+ Renderer.lineVector(new LineStyle(Color.black, 2, null, new Color(0xffe000)));
+ if ((Renderer.zoom >= 16) && feature.objs.containsKey(Obj.SMCFAC)) {
+ ArrayList symbols = new ArrayList<>();
+ ArrayList scfs = (ArrayList) getAttList(Obj.SMCFAC, Att.CATSCF);
+ for (CatSCF scf : scfs) {
+ symbols.add(Facilities.Cats.get(scf));
+ }
+ Renderer.cluster(symbols);
}
- Renderer.cluster(symbols);
- }
- break;
- default:
- break;
+ break;
+ default:
+ break;
}
}
}
@@ -1129,114 +1435,116 @@ private static void stations() {
if (Renderer.zoom >= 14) {
String str = "";
switch (feature.type) {
- case SISTAT:
- Renderer.symbol(Harbours.SignalStation);
- str = "SS";
- ArrayList tcats = (ArrayList) getAttList(Obj.SISTAT, Att.CATSIT);
- switch (tcats.get(0)) {
- case SIT_IPT:
- str += "(INT)";
- break;
- case SIT_PRTE:
- str += "(Traffic)";
- break;
- case SIT_PRTC:
- str += "(Port Control)";
- break;
- case SIT_LOCK:
- str += "(Lock)";
- break;
- case SIT_BRDG:
- str += "(Bridge)";
- break;
- default:
- break;
- }
- break;
- case SISTAW:
- Renderer.symbol(Harbours.SignalStation);
- str = "SS";
- str = "SS";
- ArrayList wcats = (ArrayList) getAttList(Obj.SISTAW, Att.CATSIW);
- switch (wcats.get(0)) {
- case SIW_STRM:
- str += "(Storm)";
- break;
- case SIW_WTHR:
- str += "(Weather)";
- break;
- case SIW_ICE:
- str += "(Ice)";
+ case SISTAT:
+ Renderer.symbol(Harbours.SignalStation);
+ str = "SS";
+ ArrayList tcats = (ArrayList) getAttList(Obj.SISTAT, Att.CATSIT);
+ switch (tcats.get(0)) {
+ case SIT_IPT:
+ str += "(INT)";
+ break;
+ case SIT_PRTE:
+ str += "(Traffic)";
+ break;
+ case SIT_PRTC:
+ str += "(Port Control)";
+ break;
+ case SIT_LOCK:
+ str += "(Lock)";
+ break;
+ case SIT_BRDG:
+ str += "(Bridge)";
+ break;
+ default:
+ break;
+ }
break;
- case SIW_TIDG:
- str = "Tide gauge";
+ case SISTAW:
+ Renderer.symbol(Harbours.SignalStation);
+ str = "SS";
+ str = "SS";
+ ArrayList wcats = (ArrayList) getAttList(Obj.SISTAW, Att.CATSIW);
+ switch (wcats.get(0)) {
+ case SIW_STRM:
+ str += "(Storm)";
+ break;
+ case SIW_WTHR:
+ str += "(Weather)";
+ break;
+ case SIW_ICE:
+ str += "(Ice)";
+ break;
+ case SIW_TIDG:
+ str = "Tide gauge";
+ break;
+ case SIW_TIDS:
+ str = "Tide scale";
+ break;
+ case SIW_TIDE:
+ str += "(Tide)";
+ break;
+ case SIW_TSTR:
+ str += "(Stream)";
+ break;
+ case SIW_DNGR:
+ str += "(Danger)";
+ break;
+ case SIW_MILY:
+ str += "(Firing)";
+ break;
+ case SIW_TIME:
+ str += "(Time)";
+ break;
+ default:
+ break;
+ }
break;
- case SIW_TIDS:
- str = "Tide scale";
+ case RDOSTA:
+ case RTPBCN:
+ Renderer.symbol(Harbours.SignalStation);
+ Renderer.symbol(Beacons.RadarStation);
break;
- case SIW_TIDE:
- str += "(Tide)";
+ case RADRFL:
+ Renderer.symbol(Topmarks.RadarReflector);
break;
- case SIW_TSTR:
- str += "(Stream)";
+ case RADSTA:
+ Renderer.symbol(Harbours.SignalStation);
+ Renderer.symbol(Beacons.RadarStation);
break;
- case SIW_DNGR:
- str += "(Danger)";
+ case PILBOP:
+ Renderer.symbol(Harbours.Pilot);
+ addName(15, new Font("Arial", Font.BOLD, 40), Symbols.Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40)));
+ CatPIL cat = (CatPIL) getAttEnum(feature.type, Att.CATPIL);
+ if (cat == CatPIL.PIL_HELI) {
+ Renderer.labelText("H", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
+ }
break;
- case SIW_MILY:
- str += "(Firing)";
+ case CGUSTA:
+ Renderer.symbol(Harbours.SignalStation);
+ str = "CG";
+ if (feature.objs.containsKey(Obj.RSCSTA))
+ Renderer.symbol(Harbours.Rescue, new Delta(Handle.CC, AffineTransform.getTranslateInstance(130, 0)));
break;
- case SIW_TIME:
- str += "(Time)";
+ case RSCSTA:
+ Renderer.symbol(Harbours.Rescue);
break;
default:
break;
- }
- break;
- case RDOSTA:
- case RTPBCN:
- Renderer.symbol(Harbours.SignalStation);
- Renderer.symbol(Beacons.RadarStation);
- break;
- case RADRFL:
- Renderer.symbol(Topmarks.RadarReflector);
- break;
- case RADSTA:
- Renderer.symbol(Harbours.SignalStation);
- Renderer.symbol(Beacons.RadarStation);
- Renderer.labelText("Ra", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70)));
- break;
- case PILBOP:
- Renderer.symbol(Harbours.Pilot);
- addName(15, new Font("Arial", Font.BOLD, 40), Symbols.Msymb , new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40)));
- CatPIL cat = (CatPIL) getAttEnum(feature.type, Att.CATPIL);
- if (cat == CatPIL.PIL_HELI) {
- Renderer.labelText("H", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
- }
- break;
- case CGUSTA:
- Renderer.symbol(Harbours.SignalStation);
- str = "CG";
- if (feature.objs.containsKey(Obj.RSCSTA)) Renderer.symbol(Harbours.Rescue, new Delta(Handle.CC, AffineTransform.getTranslateInstance(130, 0)));
- break;
- case RSCSTA:
- Renderer.symbol(Harbours.Rescue);
- break;
- default:
- break;
}
if ((Renderer.zoom >= 15) && !str.isEmpty()) {
- Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.LC, AffineTransform.getTranslateInstance(40, 0)));
+ Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, -50)));
}
Signals.addSignals();
}
}
private static void transits() {
- if (Renderer.zoom >= 14) {
- if (feature.type == Obj.RECTRC) Renderer.lineVector (new LineStyle(Color.black, 10, null, null));
- else if (feature.type == Obj.NAVLNE) Renderer.lineVector (new LineStyle(Color.black, 10, new float[] { 25, 25 }, null));
- }
+ if (Renderer.zoom >= 14) {
+ if (feature.type == Obj.RECTRC)
+ Renderer.lineVector(new LineStyle(Color.black, 5, null, null));
+ else if (feature.type == Obj.NAVLNE)
+ Renderer.lineVector(new LineStyle(Color.black, 5, new float[] { 25, 25 }, null));
+ }
if (Renderer.zoom >= 15) {
String str = "";
String name = getName();
@@ -1246,11 +1554,62 @@ private static void transits() {
if ((ort = (Double) getAttVal(feature.type, Att.ORIENT)) != null) {
str += df.format(ort) + "º";
if (!str.isEmpty())
- Renderer.lineText(str, new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20);
+ Renderer.lineText(str, new Font("Arial", Font.PLAIN, 40), Color.black, -20);
}
}
}
+ @SuppressWarnings("unchecked")
+ private static void virtual() {
+ if (Renderer.zoom >= 12) {
+ Renderer.symbol(Harbours.SignalStation, new Scheme(Symbols.Msymb));
+ Renderer.symbol(Beacons.RadarStation, new Scheme(Symbols.Msymb));
+ ArrayList cats = (ArrayList) getAttList(Obj.VAATON, Att.CATVAN);
+ for (CatVAN van : cats) {
+ switch (van) {
+ case VAN_NCAR:
+ Renderer.symbol(Topmarks.TopNorth, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
+ break;
+ case VAN_SCAR:
+ Renderer.symbol(Topmarks.TopSouth, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
+ break;
+ case VAN_ECAR:
+ Renderer.symbol(Topmarks.TopEast, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
+ break;
+ case VAN_WCAR:
+ Renderer.symbol(Topmarks.TopWest, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
+ break;
+ case VAN_PLAT:
+ case VAN_PCHS:
+ Renderer.symbol(Topmarks.TopCan, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
+ break;
+ case VAN_SLAT:
+ case VAN_PCHP:
+ Renderer.symbol(Topmarks.TopCone, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
+ break;
+ case VAN_IDGR:
+ Renderer.symbol(Topmarks.TopIsol, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
+ break;
+ case VAN_SAFW:
+ Renderer.symbol(Topmarks.TopSphere, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
+ break;
+ case VAN_SPPM:
+ Renderer.symbol(Topmarks.TopX, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
+ break;
+ case VAN_WREK:
+ Renderer.symbol(Topmarks.TopCross, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(50, 0)));
+ if (Renderer.zoom >= 15) {
+ Renderer.labelText("V-AIS", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
+ }
+ }
+
private static void waterways() {
Renderer.lineVector(new LineStyle(Symbols.Bwater, 20, (feature.geom.prim == Pflag.AREA) ? Symbols.Bwater : null));
}
@@ -1258,15 +1617,15 @@ private static void waterways() {
private static void wrecks() {
if (Renderer.zoom >= 14) {
switch ((CatWRK) getAttEnum(feature.type, Att.CATWRK)) {
- case WRK_DNGR:
- case WRK_MSTS:
- Renderer.symbol(Areas.WreckD);
- break;
- case WRK_HULS:
- Renderer.symbol(Areas.WreckS);
- break;
- default:
- Renderer.symbol(Areas.WreckND);
+ case WRK_DNGR:
+ case WRK_MSTS:
+ Renderer.symbol(Areas.WreckD);
+ break;
+ case WRK_HULS:
+ Renderer.symbol(Areas.WreckS);
+ break;
+ default:
+ Renderer.symbol(Areas.WreckND);
}
}
}
diff --git a/niord-josm-seachart/src/main/java/render/Signals.java b/niord-josm-seachart/src/main/java/render/Signals.java
index c21d7a0d5..a106457bc 100644
--- a/niord-josm-seachart/src/main/java/render/Signals.java
+++ b/niord-josm-seachart/src/main/java/render/Signals.java
@@ -11,25 +11,36 @@
import java.awt.Color;
import java.awt.Font;
-import java.awt.geom.*;
+import java.awt.geom.AffineTransform;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.EnumMap;
+import s57.S57att.Att;
+import s57.S57map.AttMap;
+import s57.S57map.ObjTab;
+import s57.S57obj.Obj;
+import s57.S57val.BoySHP;
+import s57.S57val.CatFOG;
import s57.S57val.CatLIT;
+import s57.S57val.CatROS;
+import s57.S57val.CatRTB;
+import s57.S57val.CatRAS;
import s57.S57val.ColCOL;
-import s57.S57att.*;
-import s57.S57obj.*;
-import s57.S57val.*;
-import s57.S57map.*;
+import s57.S57val.LitCHR;
import symbols.Beacons;
import symbols.Symbols;
+import symbols.Symbols.Delta;
+import symbols.Symbols.Handle;
+import symbols.Symbols.Scheme;
import symbols.Topmarks;
-import symbols.Symbols.*;
-public class Signals {
+/**
+ * @author Malcolm Herring
+ */
+public class Signals extends Rules {
- static final EnumMap LightColours = new EnumMap(ColCOL.class);
+ static final EnumMap LightColours = new EnumMap<>(ColCOL.class);
static {
LightColours.put(ColCOL.COL_WHT, new Color(0xffff00));
LightColours.put(ColCOL.COL_RED, new Color(0xff0000));
@@ -42,7 +53,7 @@ public class Signals {
LightColours.put(ColCOL.COL_MAG, Color.magenta);
}
- static final EnumMap LightLetters = new EnumMap(ColCOL.class);
+ static final EnumMap LightLetters = new EnumMap<>(ColCOL.class);
static {
LightLetters.put(ColCOL.COL_WHT, "W");
LightLetters.put(ColCOL.COL_RED, "R");
@@ -54,7 +65,7 @@ public class Signals {
LightLetters.put(ColCOL.COL_ORG, "Or");
}
- static final EnumMap LightCharacters = new EnumMap(LitCHR.class);
+ static final EnumMap LightCharacters = new EnumMap<>(LitCHR.class);
static {
LightCharacters.put(LitCHR.CHR_F, "F");
LightCharacters.put(LitCHR.CHR_FL, "Fl");
@@ -82,8 +93,8 @@ public class Signals {
LightCharacters.put(LitCHR.CHR_AL, "Al");
LightCharacters.put(LitCHR.CHR_ALFFL, "Al.FFl");
}
-
- static final EnumMap fogSignals = new EnumMap(CatFOG.class);
+
+ static final EnumMap fogSignals = new EnumMap<>(CatFOG.class);
static {
fogSignals.put(CatFOG.FOG_EXPL, "Explos");
fogSignals.put(CatFOG.FOG_DIA, "Dia");
@@ -98,81 +109,87 @@ public class Signals {
}
static final DecimalFormat df = new DecimalFormat("#.#");
-
+
public static void addSignals() {
- if (Rules.feature.objs.containsKey(Obj.RADRFL)) reflectors();
- if (Rules.feature.objs.containsKey(Obj.FOGSIG)) fogSignals();
- if (Rules.feature.objs.containsKey(Obj.RTPBCN)) radarStations();
- if (Rules.feature.objs.containsKey(Obj.RADSTA)) radarStations();
- if (Rules.feature.objs.containsKey(Obj.RDOSTA)) radioStations();
- if (Rules.feature.objs.containsKey(Obj.LIGHTS)) lights();
+ if (feature.objs.containsKey(Obj.RADRFL))
+ reflectors();
+ if (feature.objs.containsKey(Obj.FOGSIG))
+ fogSignals();
+ if (feature.objs.containsKey(Obj.RTPBCN))
+ radarTransponders();
+ if (feature.objs.containsKey(Obj.RADSTA))
+ radarStations();
+ if (feature.objs.containsKey(Obj.RDOSTA))
+ radioStations();
+ if (feature.objs.containsKey(Obj.LIGHTS))
+ lights();
}
public static void reflectors() {
if (Renderer.zoom >= 14) {
- switch (Rules.feature.type) {
- case BCNLAT:
- case BCNCAR:
- case BCNISD:
- case BCNSAW:
- case BCNSPP:
- if ((Rules.feature.objs.containsKey(Obj.TOPMAR)) || (Rules.feature.objs.containsKey(Obj.DAYMAR))) {
- Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -140)));
- } else {
- Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -80)));
- }
- break;
- case LITFLT:
- case LITVES:
- case BOYINB:
- if ((Rules.feature.objs.containsKey(Obj.TOPMAR)) || (Rules.feature.objs.containsKey(Obj.DAYMAR))) {
- Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -110)));
- } else {
- Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -60)));
- }
- break;
- case LITMAJ:
- case LITMIN:
- if ((Rules.feature.objs.containsKey(Obj.TOPMAR)) || (Rules.feature.objs.containsKey(Obj.DAYMAR))) {
- Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
- } else {
- Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -30)));
- }
- break;
- case BOYLAT:
- case BOYCAR:
- case BOYISD:
- case BOYSAW:
- case BOYSPP:
- if ((Rules.feature.objs.containsKey(Obj.TOPMAR)) || (Rules.feature.objs.containsKey(Obj.DAYMAR))) {
- if (Rules.testAttribute(Rules.feature.type, Att.BOYSHP, BoySHP.BOY_PILR) || Rules.testAttribute(Rules.feature.type, Att.BOYSHP, BoySHP.BOY_SPAR)) {
- Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(50, -160)));
+ switch (feature.type) {
+ case BCNLAT:
+ case BCNCAR:
+ case BCNISD:
+ case BCNSAW:
+ case BCNSPP:
+ if (feature.objs.containsKey(Obj.TOPMAR) || feature.objs.containsKey(Obj.DAYMAR)) {
+ Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -140)));
} else {
- Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(25, -80)));
+ Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -80)));
}
- } else {
- if (Rules.testAttribute(Rules.feature.type, Att.BOYSHP, BoySHP.BOY_PILR) || Rules.testAttribute(Rules.feature.type, Att.BOYSHP, BoySHP.BOY_SPAR)) {
- Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(30, -100)));
+ break;
+ case LITFLT:
+ case LITVES:
+ case BOYINB:
+ if (feature.objs.containsKey(Obj.TOPMAR) || feature.objs.containsKey(Obj.DAYMAR)) {
+ Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -110)));
} else {
- Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(10, -50)));
+ Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -60)));
}
- }
- break;
- default:
- break;
+ break;
+ case LITMAJ:
+ case LITMIN:
+ if (feature.objs.containsKey(Obj.TOPMAR) || feature.objs.containsKey(Obj.DAYMAR)) {
+ Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
+ } else {
+ Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -30)));
+ }
+ break;
+ case BOYLAT:
+ case BOYCAR:
+ case BOYISD:
+ case BOYSAW:
+ case BOYSPP:
+ if (feature.objs.containsKey(Obj.TOPMAR) || feature.objs.containsKey(Obj.DAYMAR)) {
+ if (testAttribute(feature.type, Att.BOYSHP, BoySHP.BOY_PILR) || testAttribute(feature.type, Att.BOYSHP, BoySHP.BOY_SPAR)) {
+ Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(50, -160)));
+ } else {
+ Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(25, -80)));
+ }
+ } else {
+ if (testAttribute(feature.type, Att.BOYSHP, BoySHP.BOY_PILR) || testAttribute(feature.type, Att.BOYSHP, BoySHP.BOY_SPAR)) {
+ Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(30, -100)));
+ } else {
+ Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(10, -50)));
+ }
+ }
+ break;
+ default:
+ break;
}
}
}
-
+
public static void fogSignals() {
if (Renderer.zoom >= 11)
Renderer.symbol(Beacons.FogSignal);
if (Renderer.zoom >= 15) {
- AttMap atts = Rules.feature.objs.get(Obj.FOGSIG).get(0);
+ AttMap atts = feature.objs.get(Obj.FOGSIG).get(0);
if (atts != null) {
String str = "";
if (atts.containsKey(Att.CATFOG)) {
- str += fogSignals.get(((ArrayList>) (atts.get(Att.CATFOG).val)).get(0));
+ str += fogSignals.get(((ArrayList>) atts.get(Att.CATFOG).val).get(0));
}
if (atts.containsKey(Att.SIGGRP)) {
str += "(" + atts.get(Att.SIGGRP).val + ")";
@@ -193,24 +210,40 @@ public static void fogSignals() {
}
public static void radarStations() {
+ if (Renderer.zoom >= 11)
+ Renderer.symbol(Beacons.RadarStation);
+ if (Renderer.zoom >= 15) {
+ CatRAS cat = (CatRAS) getAttEnum(Obj.RADSTA, Att.CATRAS);
+ if (cat == CatRAS.RAS_COST) {
+ Renderer.labelText("Ra", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-60, -70)));
+ }
+ }
+ }
+
+ public static void radarTransponders() {
if (Renderer.zoom >= 11)
Renderer.symbol(Beacons.RadarStation);
if (Renderer.zoom >= 15) {
String bstr = "";
- CatRTB cat = (CatRTB) Rules.getAttEnum(Obj.RTPBCN, Att.CATRTB);
- String wal = Rules.getAttStr(Obj.RTPBCN, Att.RADWAL);
- switch (cat) {
- case RTB_RAMK:
- bstr += " Ramark";
- break;
- case RTB_RACN:
- bstr += " Racon";
- String astr = Rules.getAttStr(Obj.RTPBCN, Att.SIGGRP);
+ CatRTB cat = (CatRTB) getAttEnum(Obj.RTPBCN, Att.CATRTB);
+ String wal = getAttStr(Obj.RTPBCN, Att.RADWAL);
+ if ((cat == CatRTB.RTB_RAMK) || (cat == CatRTB.RTB_RACN)) {
+ switch (cat) {
+ case RTB_RAMK:
+ bstr += " Ramark";
+ break;
+ case RTB_RACN:
+ bstr += " Racon";
+ break;
+ default:
+ break;
+ }
+ String astr = getAttStr(Obj.RTPBCN, Att.SIGGRP);
if (!astr.isEmpty()) {
bstr += "(" + astr + ")";
}
- Double per = (Double) Rules.getAttVal(Obj.RTPBCN, Att.SIGPER);
- Double mxr = (Double) Rules.getAttVal(Obj.RTPBCN, Att.VALMXR);
+ Double per = (Double) getAttVal(Obj.RTPBCN, Att.SIGPER);
+ Double mxr = (Double) getAttVal(Obj.RTPBCN, Att.VALMXR);
if ((per != null) || (mxr != null)) {
bstr += (astr.isEmpty() ? " " : "");
if (per != null)
@@ -218,18 +251,15 @@ public static void radarStations() {
if (mxr != null)
bstr += (mxr != 0) ? mxr.toString() + "M" : "";
}
- break;
- default:
- break;
}
if (!wal.isEmpty()) {
switch (wal) {
- case "0.03-X":
- bstr += "(3cm)";
- break;
- case "0.10-S":
- bstr += "(10cm)";
- break;
+ case "0.03-X":
+ bstr += "(3cm)";
+ break;
+ case "0.10-S":
+ bstr += "(10cm)";
+ break;
}
}
if (!bstr.isEmpty()) {
@@ -240,149 +270,104 @@ public static void radarStations() {
@SuppressWarnings("unchecked")
public static void radioStations() {
- boolean vais = false;
String bstr = "";
if (Renderer.zoom >= 11) {
- ArrayList cats = (ArrayList) Rules.getAttList(Obj.RDOSTA, Att.CATROS);
+ ArrayList cats = (ArrayList) getAttList(Obj.RDOSTA, Att.CATROS);
for (CatROS ros : cats) {
switch (ros) {
- case ROS_OMNI:
- bstr += " RC";
- break;
- case ROS_DIRL:
- bstr += " RD";
- break;
- case ROS_ROTP:
- bstr += " RW";
- break;
- case ROS_CNSL:
- bstr += " Consol";
- break;
- case ROS_RDF:
- bstr += " RG";
- break;
- case ROS_QTA:
- bstr += " R";
- break;
- case ROS_AERO:
- bstr += " AeroRC";
- break;
- case ROS_DECA:
- bstr += " Decca";
- break;
- case ROS_LORN:
- bstr += " Loran";
- break;
- case ROS_DGPS:
- bstr += " DGPS";
- break;
- case ROS_TORN:
- bstr += " Toran";
- break;
- case ROS_OMGA:
- bstr += " Omega";
- break;
- case ROS_SYLD:
- bstr += " Syledis";
- break;
- case ROS_CHKA:
- bstr += " Chiaka";
- break;
- case ROS_PCOM:
- case ROS_COMB:
- case ROS_FACS:
- case ROS_TIME:
- break;
- case ROS_PAIS:
- case ROS_SAIS:
- bstr += " AIS";
- break;
- case ROS_VAIS:
- vais = true;
- break;
- case ROS_VANC:
- vais = true;
- Renderer.symbol(Topmarks.TopNorth, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
- break;
- case ROS_VASC:
- vais = true;
- Renderer.symbol(Topmarks.TopSouth, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
- break;
- case ROS_VAEC:
- vais = true;
- Renderer.symbol(Topmarks.TopEast, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
- break;
- case ROS_VAWC:
- vais = true;
- Renderer.symbol(Topmarks.TopWest, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
- break;
- case ROS_VAPL:
- vais = true;
- Renderer.symbol(Topmarks.TopCan, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
- break;
- case ROS_VASL:
- vais = true;
- Renderer.symbol(Topmarks.TopCone, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
- break;
- case ROS_VAID:
- vais = true;
- Renderer.symbol(Topmarks.TopIsol, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
- break;
- case ROS_VASW:
- vais = true;
- Renderer.symbol(Topmarks.TopSphere, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
- break;
- case ROS_VASP:
- vais = true;
- Renderer.symbol(Topmarks.TopX, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
- break;
- case ROS_VAWK:
- vais = true;
- Renderer.symbol(Topmarks.TopCross, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
- break;
- default:
- break;
+ case ROS_OMNI:
+ bstr += " RC";
+ break;
+ case ROS_DIRL:
+ bstr += " RD";
+ break;
+ case ROS_ROTP:
+ bstr += " RW";
+ break;
+ case ROS_CNSL:
+ bstr += " Consol";
+ break;
+ case ROS_RDF:
+ bstr += " RG";
+ break;
+ case ROS_QTA:
+ bstr += " R";
+ break;
+ case ROS_AERO:
+ bstr += " AeroRC";
+ break;
+ case ROS_DECA:
+ bstr += " Decca";
+ break;
+ case ROS_LORN:
+ bstr += " Loran";
+ break;
+ case ROS_DGPS:
+ bstr += " DGPS";
+ break;
+ case ROS_TORN:
+ bstr += " Toran";
+ break;
+ case ROS_OMGA:
+ bstr += " Omega";
+ break;
+ case ROS_SYLD:
+ bstr += " Syledis";
+ break;
+ case ROS_CHKA:
+ bstr += " Chiaka";
+ break;
+ case ROS_PCOM:
+ case ROS_COMB:
+ case ROS_FACS:
+ case ROS_TIME:
+ break;
+ case ROS_AISB:
+ case ROS_PAIS:
+ bstr += " AIS";
+ break;
+ default:
+ break;
}
}
- if (!vais) {
- Renderer.symbol(Beacons.RadarStation);
- }
+ Renderer.symbol(Beacons.RadarStation);
}
if (Renderer.zoom >= 15) {
- if (vais) {
- Renderer.labelText("V-AIS", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
- }
if (!bstr.isEmpty()) {
Renderer.labelText(bstr, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -110)));
}
}
}
- class Sect {
- int dir;
- LitCHR chr;
- ColCOL col;
- ColCOL alt;
- String grp;
- double per;
- double rng;
+ static class Sect {
+ int dir;
+ LitCHR chr;
+ ColCOL col;
+ ColCOL alt;
+ String grp;
+ double per;
+ double rng;
}
-
+
@SuppressWarnings("unchecked")
public static void lights() {
Enum col = null;
Enum tcol = null;
- ObjTab lights = Rules.feature.objs.get(Obj.LIGHTS);
+ ObjTab lights = feature.objs.get(Obj.LIGHTS);
for (AttMap atts : lights.values()) {
if (atts.containsKey(Att.COLOUR)) {
ArrayList> cols = (ArrayList>) atts.get(Att.COLOUR).val;
if (cols.size() == 1) {
- tcol = cols.get(0);
- if (col == null) {
- col = tcol;
- } else if (tcol != col) {
- col = ColCOL.COL_MAG;
- break;
+ if (atts.containsKey(Att.CATLIT) && ((ArrayList>) atts.get(Att.CATLIT).val).contains(CatLIT.LIT_FLDL)) {
+ Renderer.symbol(Beacons.Floodlight, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(90))));
+ } else {
+ tcol = cols.get(0);
+ if (col == null) {
+ col = tcol;
+ } else if (tcol != col) {
+ col = ColCOL.COL_MAG;
+ break;
+ }
}
} else {
col = ColCOL.COL_MAG;
@@ -390,111 +375,110 @@ public static void lights() {
}
}
}
- Renderer.symbol(Beacons.LightFlare, new Scheme(LightColours.get(col)), new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.toRadians(120))));
- String str = "";
- if (lights.get(1) != null) {
- for (AttMap atts : lights.values()) {
- Enum col1 = null;
- Enum col2 = null;
- double radius = 0.2;
- double s1 = 361;
- double s2 = 361;
- Double dir = null;
- if (atts.containsKey(Att.COLOUR)) {
- ArrayList> cols = (ArrayList>) atts.get(Att.COLOUR).val;
- col1 = cols.get(0);
- if (cols.size() > 1)
- col2 = cols.get(1);
- } else {
- continue;
- }
- if (atts.containsKey(Att.LITRAD)) {
- radius = (Double) atts.get(Att.LITRAD).val;
- }
- if (atts.containsKey(Att.CATLIT)) {
- ArrayList cats = (ArrayList) atts.get(Att.CATLIT).val;
- if (cats.contains(CatLIT.LIT_DIR)) {
- if (atts.containsKey(Att.ORIENT)) {
- dir = (Double) atts.get(Att.ORIENT).val;
- s1 = ((dir - 4) + 360) % 360;
- s2 = (dir + 4) % 360;
- for (AttMap satts : lights.values()) {
- double srad = 0.2;
- double ss1 = 361;
- double ss2 = 361;
- Double sdir = null;
- if (satts == atts) continue;
- if (satts.containsKey(Att.LITRAD)) {
- srad = (Double) satts.get(Att.LITRAD).val;
+ if (col != null) {
+ Renderer.symbol(Beacons.LightFlare, new Scheme(LightColours.get(col)), new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.toRadians(120))));
+ }
+ String str = "";
+ if ((lights.get(1) != null) && (Renderer.zoom >= 12)) {
+ for (AttMap atts : lights.values()) {
+ Enum col1 = null;
+ Enum col2 = null;
+ double radius = 0.5;
+ if (atts.containsKey(Att.VALNMR)) {
+ radius += Math.log10((Double) atts.get(Att.VALNMR).val) * 2.0;
+ }
+ radius /= Math.pow(Renderer.zoom, 4) / 5000;
+ double s1 = 361;
+ double s2 = 361;
+ Double dir = null;
+ if (atts.containsKey(Att.COLOUR)) {
+ ArrayList> cols = (ArrayList>) atts.get(Att.COLOUR).val;
+ col1 = cols.get(0);
+ if (cols.size() > 1)
+ col2 = cols.get(1);
+ } else {
+ continue;
+ }
+ if (atts.containsKey(Att.CATLIT)) {
+ ArrayList cats = (ArrayList) atts.get(Att.CATLIT).val;
+ if (cats.contains(CatLIT.LIT_DIR)) {
+ if (atts.containsKey(Att.ORIENT)) {
+ dir = (Double) atts.get(Att.ORIENT).val;
+ s1 = ((dir - 4) + 360) % 360;
+ s2 = (dir + 4) % 360;
+ for (AttMap satts : lights.values()) {
+ double ss1 = 361;
+ double ss2 = 361;
+ Double sdir = null;
+ if (satts == atts)
+ continue;
+ ArrayList scats = (ArrayList) (satts.containsKey(Att.CATLIT) ? (ArrayList) satts.get(Att.CATLIT).val : new ArrayList<>());
+ if (scats.contains(CatLIT.LIT_DIR)) {
+ if (satts.containsKey(Att.ORIENT)) {
+ sdir = (Double) satts.get(Att.ORIENT).val;
+ ss1 = sdir;
+ ss2 = sdir;
+ }
+ } else {
+ if (satts.containsKey(Att.SECTR1)) {
+ ss1 = (Double) satts.get(Att.SECTR1).val;
}
- if (srad == radius) {
- ArrayList scats = (satts.containsKey(Att.CATLIT)) ? (ArrayList) satts.get(Att.CATLIT).val : new ArrayList();
- if (scats.contains(CatLIT.LIT_DIR)) {
- if (satts.containsKey(Att.ORIENT)) {
- sdir = (Double) satts.get(Att.ORIENT).val;
- ss1 = sdir;
- ss2 = sdir;
- }
- } else {
- if (satts.containsKey(Att.SECTR1)) {
- ss1 = (Double) satts.get(Att.SECTR1).val;
- }
- if (satts.containsKey(Att.SECTR2)) {
- ss2 = (Double) satts.get(Att.SECTR2).val;
- }
- }
- if ((ss1 > 360) || (ss2 > 360)) continue;
- if (sdir != null) {
- if (((dir - sdir + 360) % 360) < 8) {
- s1 = ((((sdir > dir) ? 360 : 0) + sdir + dir) / 2) % 360;
- }
- if (((sdir - dir + 360) % 360) < 8) {
- s2 = ((((dir > sdir) ? 360 : 0) + sdir + dir) / 2) % 360;
- }
- } else {
- if (((dir - ss2 + 360) % 360) < 4) {
- s1 = ss2;
- }
- if (((ss1 - dir + 360) % 360) < 4) {
- s2 = ss1;
- }
- }
+ if (satts.containsKey(Att.SECTR2)) {
+ ss2 = (Double) satts.get(Att.SECTR2).val;
+ }
+ }
+ if ((ss1 > 360) || (ss2 > 360))
+ continue;
+ if (sdir != null) {
+ if (((dir - sdir + 360) % 360) < 8) {
+ s1 = ((((sdir > dir) ? 360 : 0) + sdir + dir) / 2) % 360;
+ }
+ if (((sdir - dir + 360) % 360) < 8) {
+ s2 = ((((dir > sdir) ? 360 : 0) + sdir + dir) / 2) % 360;
+ }
+ } else {
+ if (((dir - ss2 + 360) % 360) < 4) {
+ s1 = ss2;
+ }
+ if (((ss1 - dir + 360) % 360) < 4) {
+ s2 = ss1;
}
}
}
}
}
- if ((s1 > 360) && atts.containsKey(Att.SECTR1)) {
- s1 = (Double) atts.get(Att.SECTR1).val;
- } else if (dir == null) {
- continue;
- }
- if ((s2 > 360) && atts.containsKey(Att.SECTR2)) {
- s2 = (Double) atts.get(Att.SECTR2).val;
- } else if (dir == null) {
- continue;
- }
- str = "";
- if (atts.containsKey(Att.LITCHR)) {
- str += LightCharacters.get(((ArrayList) atts.get(Att.LITCHR).val).get(0));
- }
- if (atts.containsKey(Att.SIGGRP)) {
- str += "(" + atts.get(Att.SIGGRP).val + ")";
- } else if (!str.isEmpty()) {
- str += ".";
- }
- if (atts.containsKey(Att.COLOUR)) {
- ArrayList> cols = (ArrayList>) atts.get(Att.COLOUR).val;
- str += LightLetters.get(cols.get(0));
- if (cols.size() > 1)
- str += LightLetters.get(cols.get(1));
- }
- if (atts.containsKey(Att.SIGPER)) {
- str += "." + df.format(atts.get(Att.SIGPER).val) + "s";
- }
- if ((s1 <= 360) && (s2 <= 360) && (s1 != s2))
- Renderer.lightSector(LightColours.get(col1), LightColours.get(col2), radius, s1, s2, dir, (Renderer.zoom >= 15) ? str : "");
}
+ if ((s1 > 360) && atts.containsKey(Att.SECTR1)) {
+ s1 = (Double) atts.get(Att.SECTR1).val;
+ } else if (dir == null) {
+ continue;
+ }
+ if ((s2 > 360) && atts.containsKey(Att.SECTR2)) {
+ s2 = (Double) atts.get(Att.SECTR2).val;
+ } else if (dir == null) {
+ continue;
+ }
+ str = "";
+ if (atts.containsKey(Att.LITCHR)) {
+ str += LightCharacters.get(((ArrayList) atts.get(Att.LITCHR).val).get(0));
+ }
+ if (atts.containsKey(Att.SIGGRP)) {
+ str += "(" + atts.get(Att.SIGGRP).val + ")";
+ } else if (!str.isEmpty()) {
+ str += ".";
+ }
+ if (atts.containsKey(Att.COLOUR)) {
+ ArrayList> cols = (ArrayList>) atts.get(Att.COLOUR).val;
+ str += LightLetters.get(cols.get(0));
+ if (cols.size() > 1)
+ str += LightLetters.get(cols.get(1));
+ }
+ if (atts.containsKey(Att.SIGPER)) {
+ str += "." + df.format(atts.get(Att.SIGPER).val) + "s";
+ }
+ if ((s1 < 360) && (s2 < 360) && (s1 != s2))
+ Renderer.lightSector(LightColours.get(col1), LightColours.get(col2), radius, s1, s2, dir, (Renderer.zoom >= 15) ? str : "");
+ }
if (Renderer.zoom >= 15) {
class LitSect {
boolean dir;
@@ -505,29 +489,30 @@ class LitSect {
double rng;
double hgt;
}
+
ArrayList litatts = new ArrayList<>();
for (AttMap atts : lights.values()) {
LitSect sect = new LitSect();
- sect.dir = (atts.containsKey(Att.CATLIT) && ((ArrayList)atts.get(Att.CATLIT).val).contains(CatLIT.LIT_DIR));
+ sect.dir = (atts.containsKey(Att.CATLIT) && ((ArrayList) atts.get(Att.CATLIT).val).contains(CatLIT.LIT_DIR));
sect.chr = atts.containsKey(Att.LITCHR) ? ((ArrayList) atts.get(Att.LITCHR).val).get(0) : LitCHR.CHR_UNKN;
switch (sect.chr) {
- case CHR_AL:
- sect.chr = LitCHR.CHR_F;
- break;
- case CHR_ALOC:
- sect.chr = LitCHR.CHR_OC;
- break;
- case CHR_ALLFL:
- sect.chr = LitCHR.CHR_LFL;
- break;
- case CHR_ALFL:
- sect.chr = LitCHR.CHR_FL;
- break;
- case CHR_ALFFL:
- sect.chr = LitCHR.CHR_FFL;
- break;
- default:
- break;
+ case CHR_AL:
+ sect.chr = LitCHR.CHR_F;
+ break;
+ case CHR_ALOC:
+ sect.chr = LitCHR.CHR_OC;
+ break;
+ case CHR_ALLFL:
+ sect.chr = LitCHR.CHR_LFL;
+ break;
+ case CHR_ALFL:
+ sect.chr = LitCHR.CHR_FL;
+ break;
+ case CHR_ALFFL:
+ sect.chr = LitCHR.CHR_FFL;
+ break;
+ default:
+ break;
}
sect.grp = atts.containsKey(Att.SIGGRP) ? (String) atts.get(Att.SIGGRP).val : "";
sect.per = atts.containsKey(Att.SIGPER) ? (Double) atts.get(Att.SIGPER).val : 0.0;
@@ -543,13 +528,13 @@ class LitSect {
boolean found = false;
for (ArrayList group : groupings) {
LitSect mem = group.get(0);
- if ((lit.dir == mem.dir) && (lit.chr == mem.chr) && (lit.grp.equals(mem.grp)) && (lit.per == mem.per) && (lit.hgt == mem.hgt)) {
+ if (lit.dir == mem.dir && lit.chr == mem.chr && lit.grp.equals(mem.grp) && lit.per == mem.per && lit.hgt == mem.hgt) {
group.add(lit);
found = true;
}
}
if (!found) {
- ArrayList tmp = new ArrayList();
+ ArrayList tmp = new ArrayList<>();
tmp.add(lit);
groupings.add(tmp);
}
@@ -568,11 +553,12 @@ class ColRng {
ColCOL col;
double rng;
- public ColRng(ColCOL c, double r) {
+ ColRng(ColCOL c, double r) {
col = c;
rng = r;
}
}
+
int y = -30;
for (ArrayList group : groupings) {
ArrayList colrng = new ArrayList<>();
@@ -601,7 +587,7 @@ public ColRng(ColCOL c, double r) {
}
}
LitSect tmp = group.get(0);
- str = (tmp.dir) ? "Dir" : "";
+ str = tmp.dir ? "Dir" : "";
str += LightCharacters.get(tmp.chr);
if (!tmp.grp.isEmpty())
str += "(" + tmp.grp + ")";
@@ -630,25 +616,25 @@ public ColRng(ColCOL c, double r) {
if (atts.containsKey(Att.CATLIT)) {
cats = (ArrayList) atts.get(Att.CATLIT).val;
}
- str = (cats.contains(CatLIT.LIT_DIR)) ? "Dir" : "";
- str += (atts.containsKey(Att.MLTYLT)) ? atts.get(Att.MLTYLT).val : "";
+ str = (cats.contains(CatLIT.LIT_AIR) || cats.contains(CatLIT.LIT_AERO)) ? "Aero" : cats.contains(CatLIT.LIT_DIR) ? "Dir" : "";
+ str += atts.containsKey(Att.MLTYLT) ? atts.get(Att.MLTYLT).val : "";
if (atts.containsKey(Att.LITCHR)) {
LitCHR chr = ((ArrayList) atts.get(Att.LITCHR).val).get(0);
if (atts.containsKey(Att.SIGGRP)) {
String grp = (String) atts.get(Att.SIGGRP).val;
switch (chr) {
- case CHR_QLFL:
- str += String.format("Q(%s)+LFl", grp);
- break;
- case CHR_VQLFL:
- str += String.format("VQ(%s)+LFl", grp);
- break;
- case CHR_UQLFL:
- str += String.format("UQ(%s)+LFl", grp);
- break;
- default:
- str += String.format("%s(%s)", LightCharacters.get(chr), grp);
- break;
+ case CHR_QLFL:
+ str += String.format("Q(%s)+LFl", grp);
+ break;
+ case CHR_VQLFL:
+ str += String.format("VQ(%s)+LFl", grp);
+ break;
+ case CHR_UQLFL:
+ str += String.format("UQ(%s)+LFl", grp);
+ break;
+ default:
+ str += String.format("%s(%s)", LightCharacters.get(chr), grp);
+ break;
}
} else {
str += LightCharacters.get(chr);
@@ -665,16 +651,16 @@ public ColRng(ColCOL c, double r) {
}
}
}
- str += (cats.contains(CatLIT.LIT_VERT)) ? "(vert)" : "";
- str += (cats.contains(CatLIT.LIT_HORI)) ? "(hor)" : "";
+ str += cats.contains(CatLIT.LIT_VERT) ? "(vert)" : "";
+ str += cats.contains(CatLIT.LIT_HORI) ? "(hor)" : "";
str += (!str.isEmpty() && (atts.containsKey(Att.SIGPER) || atts.containsKey(Att.HEIGHT) || atts.containsKey(Att.VALMXR)) && !str.endsWith(")")) ? "." : "";
- str += (atts.containsKey(Att.SIGPER)) ? df.format(atts.get(Att.SIGPER).val) + "s" : "";
- str += (atts.containsKey(Att.HEIGHT)) ? df.format(atts.get(Att.HEIGHT).val) + "m" : "";
- str += (atts.containsKey(Att.VALNMR)) ? df.format(atts.get(Att.VALNMR).val) + "M" : "";
- str += (cats.contains(CatLIT.LIT_FRNT)) ? "(Front)" : "";
- str += (cats.contains(CatLIT.LIT_REAR)) ? "(Rear)" : "";
- str += (cats.contains(CatLIT.LIT_UPPR)) ? "(Upper)" : "";
- str += (cats.contains(CatLIT.LIT_LOWR)) ? "(Lower)" : "";
+ str += atts.containsKey(Att.SIGPER) ? df.format(atts.get(Att.SIGPER).val) + "s" : "";
+ str += atts.containsKey(Att.HEIGHT) ? df.format(atts.get(Att.HEIGHT).val) + "m" : "";
+ str += atts.containsKey(Att.VALNMR) ? df.format(atts.get(Att.VALNMR).val) + "M" : "";
+ str += cats.contains(CatLIT.LIT_FRNT) ? "(Front)" : "";
+ str += cats.contains(CatLIT.LIT_REAR) ? "(Rear)" : "";
+ str += cats.contains(CatLIT.LIT_UPPR) ? "(Upper)" : "";
+ str += cats.contains(CatLIT.LIT_LOWR) ? "(Lower)" : "";
Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.TL, AffineTransform.getTranslateInstance(60, -30)));
}
}
diff --git a/niord-josm-seachart/src/main/java/s57/S57att.java b/niord-josm-seachart/src/main/java/s57/S57att.java
index 003d88baa..03f4e1e7e 100644
--- a/niord-josm-seachart/src/main/java/s57/S57att.java
+++ b/niord-josm-seachart/src/main/java/s57/S57att.java
@@ -9,29 +9,38 @@
package s57;
-import java.util.*;
+import java.util.EnumMap;
+import java.util.HashMap;
-import s57.S57obj.*;
+import s57.S57obj.Obj;
+
+/**
+ * @author Malcolm Herring
+ */
+public final class S57att { // S57 Attribute lookup tables & methods
+ private S57att() {
+ // Hide default constructor for utilities classes
+ }
+ // CHECKSTYLE.OFF: LineLength
-public class S57att { // S57 Attribute lookup tables & methods
-
public enum Att {
- UNKATT, AGENCY, BCNSHP, BUISHP, BOYSHP, BURDEP, CALSGN, CATAIR, CATACH, CATBRG, CATBUA, CATCBL, CATCAN, CATCAM, CATCHP, CATCOA, CATCTR, CATCON, CATCRN, CATDAM,
- CATDIS, CATDOC, CATDPG, CATFNC, CATFRY, CATFIF, CATFOG, CATFOR, CATGAT, CATHAF, CATHLK, CATICE, CATINB, CATLND, CATLMK, CATLAM, CATLIT, CATMFA, CATMPA, CATMOR,
- CATNAV, CATOBS, CATOFP, CATOLB, CATPLE, CATPIL, CATPIP, CATPRA, CATPYL, CATRAS, CATRTB, CATROS, CATTRK, CATRSC, CATREA, CATROD, CATRUN, CATSEA, CATSLC, CATSIT,
- CATSIW, CATSIL, CATSLO, CATSCF, CATSPM, CATTSS, CATVEG, CATWAT, CATWED, CATWRK, COLOUR, COLPAT, COMCHA, CPDATE, CSCALE, CONDTN, CONRAD, CONVIS, CURVEL, DATEND,
- DATSTA, DRVAL1, DRVAL2, ELEVAT, ESTRNG, EXCLIT, EXPSOU, FUNCTN, HEIGHT, HORACC, HORCLR, HORLEN, HORWID, ICEFAC, INFORM, JRSDTN, LIFCAP, LITCHR, LITVIS, MARSYS,
- MLTYLT, NATION, NATCON, NATSUR, NATQUA, NMDATE, OBJNAM, ORIENT, PEREND, PERSTA, PICREP, PILDST, PRCTRY, PRODCT, PUBREF, QUASOU, RADWAL, RADIUS, RYRMGV, RESTRN,
- SCAMIN, SCVAL1, SCVAL2, SECTR1, SECTR2, SHIPAM, SIGFRQ, SIGGEN, SIGGRP, SIGPER, SIGSEQ, SOUACC, SDISMX, SDISMN, SORDAT, SORIND, STATUS, SURATH, SUREND, SURSTA,
- SURTYP, TECSOU, TXTDSC, TS_TSP, TS_TSV, T_ACWL, T_HWLW, T_MTOD, T_THDF, T_TINT, T_TSVL, T_VAHC, TIMEND, TIMSTA, TOPSHP, TRAFIC, VALACM, VALDCO, VALLMA, VALMAG,
- VALMXR, VALNMR, VALSOU, VERACC, VERCLR, VERCCL, VERCOP, VERCSA, VERDAT, VERLEN, WATLEV, CAT_TS, NINFOM, NOBJNM, NPLDST, NTXTDS, HORDAT, POSACC, QUAPOS, CLSDNG,
- DIRIMP, DISBK1, DISBK2, DISIPU, DISIPD, ELEVA1, ELEVA2, FNCTNM, WTWDIS, BUNVES, BNKWTW, COMCTN, HORCLL, HORCLW, TRSHGD, UNLOCD, HIGWAT, HIGNAM, LOWWAT, LOWNAM,
- MEAWAT, MEANAM, OTHWAT, OTHNAM, REFLEV, SDRLEV, VCRLEV, SCHREF, USESHP, CURVHW, CURVLW, CURVMW, CURVOW, APTREF, SHPTYP, UPDMSG, ADDMRK, CATNMK, CATBRT, CATBUN,
- CATCCL, CATCOM, CATHBR, CATRFD, CATTML, CATGAG, CATVTR, CATTAB, CATEXS, LG_SPD, LG_SPR, LG_BME, LG_LGS, LG_DRT, LG_WDP, LG_WDU, LG_REL, LG_FNC, LG_DES, LG_PBR,
- LC_CSI, LC_CSE, LC_ASI, LC_ASE, LC_CCI, LC_CCE, LC_BM1, LC_BM2, LC_LG1, LC_LG2, LC_DR1, LC_DR2, LC_SP1, LC_SP2, LC_WD1, LC_WD2, LITRAD, CATCVR, HUNITS
+ UNKATT, AGENCY, BCNSHP, BUISHP, BOYSHP, BURDEP, CALSGN, CATAIR, CATACH, CATBRG, CATBUA, CATCBL, CATCAN, CATCAM, CATCHP, CATCOA, CATCTR, CATCON, CATCRN, CATDAM,
+ CATDIS, CATDOC, CATDPG, CATFNC, CATFRY, CATFIF, CATFOG, CATFOR, CATGAT, CATHAF, CATHLK, CATICE, CATINB, CATLND, CATLMK, CATLAM, CATLIT, CATMFA, CATMPA, CATMOR,
+ CATNAV, CATOBS, CATOFP, CATOLB, CATPLE, CATPIL, CATPIP, CATPRA, CATPYL, CATRAS, CATRTB, CATROS, CATTRK, CATRSC, CATREA, CATROD, CATRUN, CATSEA, CATSLC, CATSIT,
+ CATSIW, CATSIL, CATSLO, CATSCF, CATSPM, CATTSS, CATVEG, CATWAT, CATWED, CATWRK, COLOUR, COLPAT, COMCHA, CPDATE, CSCALE, CONDTN, CONRAD, CONVIS, CURVEL, DATEND,
+ DATSTA, DRVAL1, DRVAL2, ELEVAT, ESTRNG, EXCLIT, EXPSOU, FUNCTN, HEIGHT, HORACC, HORCLR, HORLEN, HORWID, ICEFAC, INFORM, JRSDTN, LIFCAP, LITCHR, LITVIS, MARSYS,
+ MLTYLT, NATION, NATCON, NATSUR, NATQUA, NMDATE, OBJNAM, ORIENT, PEREND, PERSTA, PICREP, PILDST, PRCTRY, PRODCT, PUBREF, QUASOU, RADWAL, RADIUS, RYRMGV, RESTRN,
+ SCAMIN, SCVAL1, SCVAL2, SECTR1, SECTR2, SHIPAM, SIGFRQ, SIGGEN, SIGGRP, SIGPER, SIGSEQ, SOUACC, SDISMX, SDISMN, SORDAT, SORIND, STATUS, SURATH, SUREND, SURSTA,
+ SURTYP, TECSOU, TXTDSC, TS_TSP, TS_TSV, T_ACWL, T_HWLW, T_MTOD, T_THDF, T_TINT, T_TSVL, T_VAHC, TIMEND, TIMSTA, TOPSHP, TRAFIC, VALACM, VALDCO, VALLMA, VALMAG,
+ VALMXR, VALNMR, VALSOU, VERACC, VERCLR, VERCCL, VERCOP, VERCSA, VERDAT, VERLEN, WATLEV, CAT_TS, NINFOM, NOBJNM, NPLDST, NTXTDS, HORDAT, POSACC, QUAPOS, CLSDNG,
+ DIRIMP, DISBK1, DISBK2, DISIPU, DISIPD, ELEVA1, ELEVA2, FNCTNM, WTWDIS, BUNVES, BNKWTW, COMCTN, HORCLL, HORCLW, TRSHGD, UNLOCD, HIGWAT, HIGNAM, LOWWAT, LOWNAM,
+ MEAWAT, MEANAM, OTHWAT, OTHNAM, REFLEV, SDRLEV, VCRLEV, SCHREF, USESHP, CURVHW, CURVLW, CURVMW, CURVOW, APTREF, SHPTYP, UPDMSG, ADDMRK, CATNMK, CATBRT, CATBUN,
+ CATCCL, CATCOM, CATHBR, CATRFD, CATTML, CATGAG, CATVTR, CATTAB, CATEXS, LG_SPD, LG_SPR, LG_BME, LG_LGS, LG_DRT, LG_WDP, LG_WDU, LG_REL, LG_FNC, LG_DES, LG_PBR,
+ LC_CSI, LC_CSE, LC_ASI, LC_ASE, LC_CCI, LC_CCE, LC_BM1, LC_BM2, LC_LG1, LC_LG2, LC_DR1, LC_DR2, LC_SP1, LC_SP2, LC_WD1, LC_WD2, CATCVR, HUNITS, CATOPA, CATSCH,
+ CATVAN
}
- private static final EnumMap AttS57 = new EnumMap(Att.class);
+ private static final EnumMap AttS57 = new EnumMap<>(Att.class);
static {
AttS57.put(Att.UNKATT, 0); AttS57.put(Att.AGENCY, 1); AttS57.put(Att.BCNSHP, 2); AttS57.put(Att.BUISHP, 3); AttS57.put(Att.BOYSHP, 4); AttS57.put(Att.BURDEP, 5);
AttS57.put(Att.CALSGN, 6); AttS57.put(Att.CATAIR, 7); AttS57.put(Att.CATACH, 8); AttS57.put(Att.CATBRG, 9); AttS57.put(Att.CATBUA, 10); AttS57.put(Att.CATCBL, 11);
@@ -61,10 +70,10 @@ public enum Att {
AttS57.put(Att.VALMAG, 176); AttS57.put(Att.VALMXR, 177); AttS57.put(Att.VALNMR, 178); AttS57.put(Att.VALSOU, 179); AttS57.put(Att.VERACC, 180); AttS57.put(Att.VERCLR, 181);
AttS57.put(Att.VERCCL, 182); AttS57.put(Att.VERCOP, 183); AttS57.put(Att.VERCSA, 184); AttS57.put(Att.VERDAT, 185); AttS57.put(Att.VERLEN, 186); AttS57.put(Att.WATLEV, 187);
AttS57.put(Att.CAT_TS, 188); AttS57.put(Att.NINFOM, 300); AttS57.put(Att.NOBJNM, 301); AttS57.put(Att.NPLDST, 302); AttS57.put(Att.NTXTDS, 304); AttS57.put(Att.HORDAT, 400);
- AttS57.put(Att.POSACC, 401); AttS57.put(Att.QUAPOS, 402);
+ AttS57.put(Att.POSACC, 401); AttS57.put(Att.QUAPOS, 402); AttS57.put(Att.CATOPA, 900); AttS57.put(Att.CATSCH, 901); AttS57.put(Att.CATVAN, 902);
}
- private static final EnumMap AttIENC = new EnumMap(Att.class);
+ private static final EnumMap AttIENC = new EnumMap<>(Att.class);
static {
AttIENC.put(Att.CATACH, 17000); AttIENC.put(Att.CATDIS, 17001); AttIENC.put(Att.CATSIT, 17002); AttIENC.put(Att.CATSIW, 17003); AttIENC.put(Att.RESTRN, 17004);
AttIENC.put(Att.VERDAT, 17005); AttIENC.put(Att.CATBRG, 17006); AttIENC.put(Att.CATFRY, 17007); AttIENC.put(Att.CATHAF, 17008); AttIENC.put(Att.MARSYS, 17009);
@@ -86,8 +95,8 @@ public enum Att {
AttIENC.put(Att.LC_DR2, 18023); AttIENC.put(Att.LC_SP1, 18024); AttIENC.put(Att.LC_SP2, 18025); AttIENC.put(Att.LC_WD1, 18026); AttIENC.put(Att.LC_WD2, 18027);
AttIENC.put(Att.SHPTYP, 33066); AttIENC.put(Att.UPDMSG, 40000); AttIENC.put(Att.BNKWTW, 17999);
}
-
- private static final EnumMap AttStr = new EnumMap(Att.class);
+
+ private static final EnumMap AttStr = new EnumMap<>(Att.class);
static {
AttStr.put(Att.UNKATT, ""); AttStr.put(Att.AGENCY, "agency"); AttStr.put(Att.BCNSHP, "shape"); AttStr.put(Att.BUISHP, "shape"); AttStr.put(Att.BOYSHP, "shape");
AttStr.put(Att.BURDEP, "depth_buried"); AttStr.put(Att.CALSGN, "callsign"); AttStr.put(Att.CATAIR, "category"); AttStr.put(Att.CATACH, "category");
@@ -113,7 +122,7 @@ public enum Att {
AttStr.put(Att.FUNCTN, "function"); AttStr.put(Att.HEIGHT, "height"); AttStr.put(Att.HUNITS, "units"); AttStr.put(Att.HORACC, "accuracy");
AttStr.put(Att.HORCLR, "clearance_width"); AttStr.put(Att.HORLEN, "length"); AttStr.put(Att.HORWID, "width"); AttStr.put(Att.ICEFAC, "factor");
AttStr.put(Att.INFORM, "information"); AttStr.put(Att.JRSDTN, "jurisdiction"); AttStr.put(Att.LIFCAP, "maximum_load"); AttStr.put(Att.LITCHR, "character");
- AttStr.put(Att.LITVIS, "visibility"); AttStr.put(Att.MARSYS, "system"); AttStr.put(Att.MLTYLT, "multiple"); AttStr.put(Att.NATION, "nationality");
+ AttStr.put(Att.LITVIS, "visibility"); AttStr.put(Att.MARSYS, "system"); AttStr.put(Att.MLTYLT, "multiple"); AttStr.put(Att.NATION, "nation");
AttStr.put(Att.NATCON, "construction"); AttStr.put(Att.NATSUR, "surface"); AttStr.put(Att.NATQUA, "surface_qualification"); AttStr.put(Att.NMDATE, "nm_date");
AttStr.put(Att.OBJNAM, "name"); AttStr.put(Att.ORIENT, "orientation"); AttStr.put(Att.PEREND, "period_end"); AttStr.put(Att.PERSTA, "period_start");
AttStr.put(Att.PICREP, "picture"); AttStr.put(Att.PILDST, "pilot_district"); AttStr.put(Att.PRCTRY, "producing_country"); AttStr.put(Att.PRODCT, "product");
@@ -144,17 +153,35 @@ public enum Att {
AttStr.put(Att.CATTAB, "operation"); AttStr.put(Att.SCHREF, "schedule"); AttStr.put(Att.USESHP, "use"); AttStr.put(Att.CURVHW, "high_velocity");
AttStr.put(Att.CURVLW, "low_velocity"); AttStr.put(Att.CURVMW, "mean_velocity"); AttStr.put(Att.CURVOW, "other_velocity"); AttStr.put(Att.APTREF, "passing_time");
AttStr.put(Att.CATCOM, "category"); AttStr.put(Att.CATCVR, "category"); AttStr.put(Att.CATEXS, "category"); AttStr.put(Att.SHPTYP, "ship");
- AttStr.put(Att.UPDMSG, "message"); AttStr.put(Att.LITRAD, "radius");
+ AttStr.put(Att.UPDMSG, "message"); AttStr.put(Att.CATOPA, "category"); AttStr.put(Att.CATSCH, "category"); AttStr.put(Att.CATVAN, "category");
}
- private static final EnumMap Accuracy = new EnumMap<>(Obj.class); static { Accuracy.put(Obj.UNKOBJ, Att.HORACC); }
- private static final EnumMap Addition = new EnumMap<>(Obj.class); static { Addition.put(Obj.UNKOBJ, Att.ADDMRK); }
- private static final EnumMap Agency = new EnumMap<>(Obj.class); static { Agency.put(Obj.UNKOBJ, Att.AGENCY); }
- private static final EnumMap Anomaly = new EnumMap<>(Obj.class); static { Anomaly.put(Obj.UNKOBJ, Att.VALLMA); }
- private static final EnumMap Authority = new EnumMap<>(Obj.class); static { Authority.put(Obj.UNKOBJ, Att.SURATH); }
- private static final EnumMap Availability = new EnumMap<>(Obj.class); static { Availability.put(Obj.UNKOBJ, Att.BUNVES); }
- private static final EnumMap Bank = new EnumMap<>(Obj.class); static { Bank.put(Obj.UNKOBJ, Att.BNKWTW); }
- private static final EnumMap Callsign = new EnumMap<>(Obj.class); static { Callsign.put(Obj.UNKOBJ, Att.CALSGN); }
- private static final EnumMap Category = new EnumMap<>(Obj.class); static {
+
+ private static final EnumMap Accuracy = new EnumMap<>(Obj.class); static {
+ Accuracy.put(Obj.UNKOBJ, Att.HORACC); }
+
+ private static final EnumMap Addition = new EnumMap<>(Obj.class); static {
+ Addition.put(Obj.UNKOBJ, Att.ADDMRK); }
+
+ private static final EnumMap Agency = new EnumMap<>(Obj.class); static {
+ Agency.put(Obj.UNKOBJ, Att.AGENCY); }
+
+ private static final EnumMap Anomaly = new EnumMap<>(Obj.class); static {
+ Anomaly.put(Obj.UNKOBJ, Att.VALLMA); }
+
+ private static final EnumMap Authority = new EnumMap<>(Obj.class); static {
+ Authority.put(Obj.UNKOBJ, Att.SURATH); }
+
+ private static final EnumMap Availability = new EnumMap<>(Obj.class); static {
+ Availability.put(Obj.UNKOBJ, Att.BUNVES); }
+
+ private static final EnumMap Bank = new EnumMap<>(Obj.class); static {
+ Bank.put(Obj.UNKOBJ, Att.BNKWTW); }
+
+ private static final EnumMap Callsign = new EnumMap<>(Obj.class); static {
+ Callsign.put(Obj.UNKOBJ, Att.CALSGN); }
+
+ private static final EnumMap Category = new EnumMap<>(Obj.class);
+ static {
Category.put(Obj.ACHARE, Att.CATACH); Category.put(Obj.ACHBRT, Att.CATACH); Category.put(Obj.AIRARE, Att.CATAIR); Category.put(Obj.BCNCAR, Att.CATCAM); Category.put(Obj.BCNLAT, Att.CATLAM);
Category.put(Obj.BCNSPP, Att.CATSPM); Category.put(Obj.BOYLAT, Att.CATLAM); Category.put(Obj.BOYINB, Att.CATINB); Category.put(Obj.BOYSPP, Att.CATSPM); Category.put(Obj.DAYMAR, Att.CATSPM);
Category.put(Obj.BRIDGE, Att.CATBRG); Category.put(Obj.BUAARE, Att.CATBUA); Category.put(Obj.BUNSTA, Att.CATBUN); Category.put(Obj.CANALS, Att.CATCAN);
@@ -165,7 +192,7 @@ public enum Att {
Category.put(Obj.HRBFAC, Att.CATHAF); Category.put(Obj.HRBARE, Att.CATHBR); Category.put(Obj.HRBBSN, Att.CATHBR); Category.put(Obj.HULKES, Att.CATHLK); Category.put(Obj.ICEARE, Att.CATICE);
Category.put(Obj.LNDRGN, Att.CATLND); Category.put(Obj.LNDMRK, Att.CATLMK); Category.put(Obj.LIGHTS, Att.CATLIT); Category.put(Obj.M_COVR, Att.CATCVR); Category.put(Obj.MARCUL, Att.CATMFA);
Category.put(Obj.MIPARE, Att.CATMPA); Category.put(Obj.MORFAC, Att.CATMOR); Category.put(Obj.NAVLNE, Att.CATNAV); Category.put(Obj.NOTMRK, Att.CATNMK); Category.put(Obj.OBSTRN, Att.CATOBS);
- Category.put(Obj.OFSPLF, Att.CATOFP); Category.put(Obj.OILBAR, Att.CATOLB); Category.put(Obj.OSPARE, Att.CATPRA); Category.put(Obj.PILPNT, Att.CATPLE); Category.put(Obj.PILBOP, Att.CATPIL);
+ Category.put(Obj.OFSPLF, Att.CATOFP); Category.put(Obj.OILBAR, Att.CATOLB); Category.put(Obj.OSPARE, Att.CATOPA); Category.put(Obj.PILPNT, Att.CATPLE); Category.put(Obj.PILBOP, Att.CATPIL);
Category.put(Obj.PIPARE, Att.CATPIP); Category.put(Obj.PIPOHD, Att.CATPIP); Category.put(Obj.PIPSOL, Att.CATPIP); Category.put(Obj.PRDARE, Att.CATPRA); Category.put(Obj.PYLONS, Att.CATPYL);
Category.put(Obj.RADSTA, Att.CATRAS); Category.put(Obj.RCRTCL, Att.CATTRK); Category.put(Obj.RCTLPT, Att.CATTRK); Category.put(Obj.RDOSTA, Att.CATROS); Category.put(Obj.RDOCAL, Att.CATCOM);
Category.put(Obj.RECTRC, Att.CATTRK); Category.put(Obj.REFDMP, Att.CATRFD); Category.put(Obj.RESARE, Att.CATREA); Category.put(Obj.RSCSTA, Att.CATRSC);
@@ -174,139 +201,381 @@ public enum Att {
Category.put(Obj.SMCFAC, Att.CATSCF); Category.put(Obj.TERMNL, Att.CATTML); Category.put(Obj.TS_FEB, Att.CAT_TS); Category.put(Obj.TSELNE, Att.CATTSS); Category.put(Obj.TSEZNE, Att.CATTSS);
Category.put(Obj.TSSBND, Att.CATTSS); Category.put(Obj.TSSCRS, Att.CATTSS); Category.put(Obj.TSSLPT, Att.CATTSS); Category.put(Obj.TSSRON, Att.CATTSS); Category.put(Obj.TWRTPT, Att.CATTRK);
Category.put(Obj.VEGATN, Att.CATVEG); Category.put(Obj.VEHTRF, Att.CATVTR); Category.put(Obj.WATTUR, Att.CATWAT); Category.put(Obj.WEDKLP, Att.CATWED); Category.put(Obj.WRECKS, Att.CATWRK);
- Category.put(Obj.WTWAXS, Att.CATCCL); Category.put(Obj.WTWARE, Att.CATCCL); Category.put(Obj.WTWGAG, Att.CATGAG); Category.put(Obj.BERTHS, Att.CATBRT);
+ Category.put(Obj.WTWAXS, Att.CATCCL); Category.put(Obj.WTWARE, Att.CATCCL); Category.put(Obj.WTWGAG, Att.CATGAG); Category.put(Obj.BERTHS, Att.CATBRT); Category.put(Obj.VAATON, Att.CATVAN);
}
-
- private static final EnumMap Channel = new EnumMap<>(Obj.class); static { Channel.put(Obj.UNKOBJ, Att.COMCHA); }
- private static final EnumMap Character = new EnumMap<>(Obj.class); static { Character.put(Obj.UNKOBJ, Att.LITCHR); }
- private static final EnumMap Clearance_height = new EnumMap<>(Obj.class); static { Clearance_height.put(Obj.UNKOBJ, Att.VERCLR); }
- private static final EnumMap Clearance_height_closed = new EnumMap<>(Obj.class); static { Clearance_height_closed.put(Obj.UNKOBJ, Att.VERCCL); }
- private static final EnumMap Clearance_height_open = new EnumMap<>(Obj.class); static { Clearance_height_open.put(Obj.UNKOBJ, Att.VERCOP); }
- private static final EnumMap Clearance_height_safe = new EnumMap<>(Obj.class); static { Clearance_height_safe.put(Obj.UNKOBJ, Att.VERCSA); }
- private static final EnumMap Clearance_width = new EnumMap<>(Obj.class); static { Clearance_width.put(Obj.UNKOBJ, Att.HORCLR); }
- private static final EnumMap Colour = new EnumMap<>(Obj.class); static { Colour.put(Obj.UNKOBJ, Att.COLOUR); }
- private static final EnumMap Colour_pattern = new EnumMap<>(Obj.class); static { Colour_pattern.put(Obj.UNKOBJ, Att.COLPAT); }
- private static final EnumMap Communication = new EnumMap<>(Obj.class); static { Communication.put(Obj.UNKOBJ, Att.COMCTN); }
- private static final EnumMap Condition = new EnumMap<>(Obj.class); static { Condition.put(Obj.UNKOBJ, Att.CONDTN); }
- private static final EnumMap Conspicuity = new EnumMap<>(Obj.class); static { Conspicuity.put(Obj.UNKOBJ, Att.CONVIS); }
- private static final EnumMap Construction = new EnumMap<>(Obj.class); static { Construction.put(Obj.UNKOBJ, Att.NATCON); }
- private static final EnumMap Danger_class = new EnumMap<>(Obj.class); static { Danger_class.put(Obj.UNKOBJ, Att.CLSDNG); }
- private static final EnumMap Depth = new EnumMap<>(Obj.class); static { Depth.put(Obj.UNKOBJ, Att.VALDCO); Depth.put(Obj.SOUNDG, Att.VALSOU); }
- private static final EnumMap Depth_buried = new EnumMap<>(Obj.class); static { Depth_buried.put(Obj.UNKOBJ, Att.BURDEP); }
- private static final EnumMap Description = new EnumMap<>(Obj.class); static { Description.put(Obj.UNKOBJ, Att.TXTDSC); }
- private static final EnumMap Distance = new EnumMap<>(Obj.class); static { Distance.put(Obj.UNKOBJ, Att.WTWDIS); }
- private static final EnumMap Distance_down = new EnumMap<>(Obj.class); static { Distance_down.put(Obj.UNKOBJ, Att.DISIPD); }
- private static final EnumMap Distance_end = new EnumMap<>(Obj.class); static { Distance_end.put(Obj.UNKOBJ, Att.DISBK2); }
- private static final EnumMap Distance_start = new EnumMap<>(Obj.class); static { Distance_start.put(Obj.UNKOBJ, Att.DISBK1); }
- private static final EnumMap Distance_up = new EnumMap<>(Obj.class); static { Distance_up.put(Obj.UNKOBJ, Att.DISIPU); }
- private static final EnumMap Elevation = new EnumMap<>(Obj.class); static { Elevation.put(Obj.UNKOBJ, Att.ELEVAT); }
- private static final EnumMap End_date = new EnumMap<>(Obj.class); static { End_date.put(Obj.UNKOBJ, Att.DATEND); }
- private static final EnumMap End_time = new EnumMap<>(Obj.class); static { End_time.put(Obj.UNKOBJ, Att.TIMEND); }
- private static final EnumMap Estimated_range = new EnumMap<>(Obj.class); static { Estimated_range.put(Obj.UNKOBJ, Att.ESTRNG); }
- private static final EnumMap Exhibition = new EnumMap<>(Obj.class); static { Exhibition.put(Obj.UNKOBJ, Att.EXCLIT); }
- private static final EnumMap Exposition = new EnumMap<>(Obj.class); static { Exposition.put(Obj.UNKOBJ, Att.EXPSOU); }
- private static final EnumMap Factor = new EnumMap<>(Obj.class); static { Factor.put(Obj.UNKOBJ, Att.ICEFAC); }
- private static final EnumMap Frequency = new EnumMap<>(Obj.class); static { Frequency.put(Obj.UNKOBJ, Att.SIGFRQ); }
- private static final EnumMap Function = new EnumMap<>(Obj.class); static { Function.put(Obj.BUISGL, Att.FUNCTN); Function.put(Obj.LNDMRK, Att.FUNCTN); Function.put(Obj.NOTMRK, Att.FNCTNM); }
- private static final EnumMap Generation = new EnumMap<>(Obj.class); static { Generation.put(Obj.UNKOBJ, Att.SIGGEN); }
- private static final EnumMap Goods = new EnumMap<>(Obj.class); static { Goods.put(Obj.UNKOBJ, Att.TRSHGD); }
- private static final EnumMap Gravity_reference = new EnumMap<>(Obj.class); static { Gravity_reference.put(Obj.UNKOBJ, Att.REFLEV); }
- private static final EnumMap Group = new EnumMap<>(Obj.class); static { Group.put(Obj.UNKOBJ, Att.SIGGRP); }
- private static final EnumMap Height = new EnumMap<>(Obj.class); static { Height.put(Obj.UNKOBJ, Att.HEIGHT); }
- private static final EnumMap High_name = new EnumMap<>(Obj.class); static { High_name.put(Obj.UNKOBJ, Att.HIGNAM); }
- private static final EnumMap High_value = new EnumMap<>(Obj.class); static { High_value.put(Obj.UNKOBJ, Att.HIGWAT); }
- private static final EnumMap High_velocity = new EnumMap<>(Obj.class); static { High_velocity.put(Obj.UNKOBJ, Att.CURVHW); }
- private static final EnumMap Horizontal_clearance_length = new EnumMap<>(Obj.class); static { Horizontal_clearance_length.put(Obj.UNKOBJ, Att.HORCLL); }
- private static final EnumMap Horizontal_clearance_width = new EnumMap<>(Obj.class); static { Horizontal_clearance_width.put(Obj.UNKOBJ, Att.HORCLW); }
- private static final EnumMap Horizontal_datum = new EnumMap<>(Obj.class); static { Horizontal_datum.put(Obj.UNKOBJ, Att.HORDAT); }
- private static final EnumMap Impact = new EnumMap<>(Obj.class); static { Impact.put(Obj.UNKOBJ, Att.DIRIMP); }
- private static final EnumMap Information = new EnumMap<>(Obj.class); static { Information.put(Obj.UNKOBJ, Att.INFORM); }
- private static final EnumMap Jurisdiction = new EnumMap<>(Obj.class); static { Jurisdiction.put(Obj.UNKOBJ, Att.JRSDTN); }
- private static final EnumMap Length = new EnumMap<>(Obj.class); static { Length.put(Obj.UNKOBJ, Att.HORLEN); }
- private static final EnumMap Local_name = new EnumMap<>(Obj.class); static { Local_name.put(Obj.UNKOBJ, Att.OTHNAM); }
- private static final EnumMap Local_value = new EnumMap<>(Obj.class); static { Local_value.put(Obj.UNKOBJ, Att.OTHWAT); }
- private static final EnumMap Low_name = new EnumMap<>(Obj.class); static { Low_name.put(Obj.UNKOBJ, Att.LOWNAM); }
- private static final EnumMap Low_value = new EnumMap<>(Obj.class); static { Low_value.put(Obj.UNKOBJ, Att.LOWWAT); }
- private static final EnumMap Low_velocity = new EnumMap<>(Obj.class); static { Low_velocity.put(Obj.UNKOBJ, Att.CURVLW); }
- private static final EnumMap Maximum_depth = new EnumMap<>(Obj.class); static { Maximum_depth.put(Obj.UNKOBJ, Att.DRVAL2); }
- private static final EnumMap Maximum_elevation = new EnumMap<>(Obj.class); static { Maximum_elevation.put(Obj.UNKOBJ, Att.ELEVA2); }
- private static final EnumMap Maximum_load = new EnumMap<>(Obj.class); static { Maximum_load.put(Obj.UNKOBJ, Att.LIFCAP); }
- private static final EnumMap Maximum_range = new EnumMap<>(Obj.class); static { Maximum_range.put(Obj.UNKOBJ, Att.VALMXR); }
- private static final EnumMap Maximum_sounding = new EnumMap<>(Obj.class); static { Maximum_sounding.put(Obj.UNKOBJ, Att.SDISMX); }
- private static final EnumMap Mean_name = new EnumMap<>(Obj.class); static { Mean_name.put(Obj.UNKOBJ, Att.MEANAM); }
- private static final EnumMap Mean_value = new EnumMap<>(Obj.class); static { Mean_value.put(Obj.UNKOBJ, Att.MEAWAT); }
- private static final EnumMap Mean_velocity = new EnumMap<>(Obj.class); static { Mean_velocity.put(Obj.UNKOBJ, Att.CURVMW); }
- private static final EnumMap Message = new EnumMap<>(Obj.class); static { Message.put(Obj.UNKOBJ, Att.UPDMSG); }
- private static final EnumMap Minimum_depth = new EnumMap<>(Obj.class); static { Minimum_depth.put(Obj.UNKOBJ, Att.DRVAL1); }
- private static final EnumMap Minimum_elevation = new EnumMap<>(Obj.class); static { Minimum_elevation.put(Obj.UNKOBJ, Att.ELEVA1); }
- private static final EnumMap Minimum_sounding = new EnumMap<>(Obj.class); static { Minimum_sounding.put(Obj.UNKOBJ, Att.SDISMN); }
- private static final EnumMap Multiple = new EnumMap<>(Obj.class); static { Multiple.put(Obj.UNKOBJ, Att.MLTYLT); }
- private static final EnumMap