1 | /* Copyright 2013 Malcolm Herring
|
---|
2 | *
|
---|
3 | * This is free software: you can redistribute it and/or modify
|
---|
4 | * it under the terms of the GNU General Public License as published by
|
---|
5 | * the Free Software Foundation, version 3 of the License.
|
---|
6 | *
|
---|
7 | * For a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.
|
---|
8 | */
|
---|
9 |
|
---|
10 | package seamap;
|
---|
11 |
|
---|
12 | import java.awt.Color;
|
---|
13 | import java.awt.Font;
|
---|
14 | import java.awt.geom.AffineTransform;
|
---|
15 | import java.util.ArrayList;
|
---|
16 |
|
---|
17 | import s57.S57val.*;
|
---|
18 | import s57.S57att.*;
|
---|
19 | import s57.S57obj.*;
|
---|
20 |
|
---|
21 | import seamap.SeaMap.AttItem;
|
---|
22 | import seamap.SeaMap.AttMap;
|
---|
23 | import seamap.SeaMap.ObjTab;
|
---|
24 | import seamap.Renderer.*;
|
---|
25 | import seamap.SeaMap.*;
|
---|
26 | import symbols.*;
|
---|
27 | import symbols.Symbols.*;
|
---|
28 |
|
---|
29 | public class Rules {
|
---|
30 |
|
---|
31 | static SeaMap map;
|
---|
32 | static int zoom;
|
---|
33 |
|
---|
34 | public static void rules (SeaMap m, int z) {
|
---|
35 | map = m;
|
---|
36 | zoom = z;
|
---|
37 | ArrayList<Feature> objects;
|
---|
38 | if ((objects = map.features.get(Obj.SLCONS)) != null) for (Feature feature : objects) shoreline(feature);
|
---|
39 | if ((objects = map.features.get(Obj.PIPSOL)) != null) for (Feature feature : objects) pipelines(feature);
|
---|
40 | if ((objects = map.features.get(Obj.CBLSUB)) != null) for (Feature feature : objects) cables(feature);
|
---|
41 | if ((objects = map.features.get(Obj.PIPOHD)) != null) for (Feature feature : objects) pipelines(feature);
|
---|
42 | if ((objects = map.features.get(Obj.CBLOHD)) != null) for (Feature feature : objects) cables(feature);
|
---|
43 | if ((objects = map.features.get(Obj.TSEZNE)) != null) for (Feature feature : objects) separation(feature);
|
---|
44 | if ((objects = map.features.get(Obj.TSSCRS)) != null) for (Feature feature : objects) separation(feature);
|
---|
45 | if ((objects = map.features.get(Obj.TSSRON)) != null) for (Feature feature : objects) separation(feature);
|
---|
46 | if ((objects = map.features.get(Obj.TSELNE)) != null) for (Feature feature : objects) separation(feature);
|
---|
47 | if ((objects = map.features.get(Obj.TSSLPT)) != null) for (Feature feature : objects) separation(feature);
|
---|
48 | if ((objects = map.features.get(Obj.TSSBND)) != null) for (Feature feature : objects) separation(feature);
|
---|
49 | if ((objects = map.features.get(Obj.ISTZNE)) != null) for (Feature feature : objects) separation(feature);
|
---|
50 | if ((objects = map.features.get(Obj.SNDWAV)) != null) for (Feature feature : objects) areas(feature);
|
---|
51 | if ((objects = map.features.get(Obj.OSPARE)) != null) for (Feature feature : objects) areas(feature);
|
---|
52 | if ((objects = map.features.get(Obj.FAIRWY)) != null) for (Feature feature : objects) areas(feature);
|
---|
53 | if ((objects = map.features.get(Obj.DRGARE)) != null) for (Feature feature : objects) areas(feature);
|
---|
54 | if ((objects = map.features.get(Obj.RESARE)) != null) for (Feature feature : objects) areas(feature);
|
---|
55 | if ((objects = map.features.get(Obj.SPLARE)) != null) for (Feature feature : objects) areas(feature);
|
---|
56 | if ((objects = map.features.get(Obj.SEAARE)) != null) for (Feature feature : objects) areas(feature);
|
---|
57 | if ((objects = map.features.get(Obj.OBSTRN)) != null) for (Feature feature : objects) obstructions(feature);
|
---|
58 | if ((objects = map.features.get(Obj.UWTROC)) != null) for (Feature feature : objects) obstructions(feature);
|
---|
59 | if ((objects = map.features.get(Obj.MARCUL)) != null) for (Feature feature : objects) areas(feature);
|
---|
60 | if ((objects = map.features.get(Obj.WTWAXS)) != null) for (Feature feature : objects) waterways(feature);
|
---|
61 | if ((objects = map.features.get(Obj.RECTRC)) != null) for (Feature feature : objects) transits(feature);
|
---|
62 | if ((objects = map.features.get(Obj.NAVLNE)) != null) for (Feature feature : objects) transits(feature);
|
---|
63 | if ((objects = map.features.get(Obj.HRBFAC)) != null) for (Feature feature : objects) harbours(feature);
|
---|
64 | if ((objects = map.features.get(Obj.ACHARE)) != null) for (Feature feature : objects) harbours(feature);
|
---|
65 | if ((objects = map.features.get(Obj.ACHBRT)) != null) for (Feature feature : objects) harbours(feature);
|
---|
66 | if ((objects = map.features.get(Obj.BERTHS)) != null) for (Feature feature : objects) harbours(feature);
|
---|
67 | if ((objects = map.features.get(Obj.LOKBSN)) != null) for (Feature feature : objects) locks(feature);
|
---|
68 | if ((objects = map.features.get(Obj.LKBSPT)) != null) for (Feature feature : objects) locks(feature);
|
---|
69 | if ((objects = map.features.get(Obj.GATCON)) != null) for (Feature feature : objects) locks(feature);
|
---|
70 | if ((objects = map.features.get(Obj.DISMAR)) != null) for (Feature feature : objects) distances(feature);
|
---|
71 | if ((objects = map.features.get(Obj.HULKES)) != null) for (Feature feature : objects) ports(feature);
|
---|
72 | if ((objects = map.features.get(Obj.CRANES)) != null) for (Feature feature : objects) ports(feature);
|
---|
73 | if ((objects = map.features.get(Obj.LNDMRK)) != null) for (Feature feature : objects) landmarks(feature);
|
---|
74 | if ((objects = map.features.get(Obj.BUISGL)) != null) for (Feature feature : objects) harbours(feature);
|
---|
75 | if ((objects = map.features.get(Obj.MORFAC)) != null) for (Feature feature : objects) moorings(feature);
|
---|
76 | if ((objects = map.features.get(Obj.NOTMRK)) != null) for (Feature feature : objects) notices(feature);
|
---|
77 | if ((objects = map.features.get(Obj.SMCFAC)) != null) for (Feature feature : objects) marinas(feature);
|
---|
78 | if ((objects = map.features.get(Obj.BRIDGE)) != null) for (Feature feature : objects) bridges(feature);
|
---|
79 | if ((objects = map.features.get(Obj.LITMAJ)) != null) for (Feature feature : objects) lights(feature);
|
---|
80 | if ((objects = map.features.get(Obj.LITMIN)) != null) for (Feature feature : objects) lights(feature);
|
---|
81 | if ((objects = map.features.get(Obj.LIGHTS)) != null) for (Feature feature : objects) lights(feature);
|
---|
82 | if ((objects = map.features.get(Obj.SISTAT)) != null) for (Feature feature : objects) signals(feature);
|
---|
83 | if ((objects = map.features.get(Obj.SISTAW)) != null) for (Feature feature : objects) signals(feature);
|
---|
84 | if ((objects = map.features.get(Obj.CGUSTA)) != null) for (Feature feature : objects) signals(feature);
|
---|
85 | if ((objects = map.features.get(Obj.RDOSTA)) != null) for (Feature feature : objects) signals(feature);
|
---|
86 | if ((objects = map.features.get(Obj.RADSTA)) != null) for (Feature feature : objects) signals(feature);
|
---|
87 | if ((objects = map.features.get(Obj.RSCSTA)) != null) for (Feature feature : objects) signals(feature);
|
---|
88 | if ((objects = map.features.get(Obj.PILBOP)) != null) for (Feature feature : objects) signals(feature);
|
---|
89 | if ((objects = map.features.get(Obj.WTWGAG)) != null) for (Feature feature : objects) gauges(feature);
|
---|
90 | if ((objects = map.features.get(Obj.OFSPLF)) != null) for (Feature feature : objects) platforms(feature);
|
---|
91 | if ((objects = map.features.get(Obj.WRECKS)) != null) for (Feature feature : objects) wrecks(feature);
|
---|
92 | if ((objects = map.features.get(Obj.LITVES)) != null) for (Feature feature : objects) floats(feature);
|
---|
93 | if ((objects = map.features.get(Obj.LITFLT)) != null) for (Feature feature : objects) floats(feature);
|
---|
94 | if ((objects = map.features.get(Obj.BOYINB)) != null) for (Feature feature : objects) floats(feature);
|
---|
95 | if ((objects = map.features.get(Obj.BOYLAT)) != null) for (Feature feature : objects) buoys(feature);
|
---|
96 | if ((objects = map.features.get(Obj.BOYCAR)) != null) for (Feature feature : objects) buoys(feature);
|
---|
97 | if ((objects = map.features.get(Obj.BOYISD)) != null) for (Feature feature : objects) buoys(feature);
|
---|
98 | if ((objects = map.features.get(Obj.BOYSAW)) != null) for (Feature feature : objects) buoys(feature);
|
---|
99 | if ((objects = map.features.get(Obj.BOYSPP)) != null) for (Feature feature : objects) buoys(feature);
|
---|
100 | if ((objects = map.features.get(Obj.BOYWTW)) != null) for (Feature feature : objects) buoys(feature);
|
---|
101 | if ((objects = map.features.get(Obj.BCNLAT)) != null) for (Feature feature : objects) beacons(feature);
|
---|
102 | if ((objects = map.features.get(Obj.BCNCAR)) != null) for (Feature feature : objects) beacons(feature);
|
---|
103 | if ((objects = map.features.get(Obj.BCNISD)) != null) for (Feature feature : objects) beacons(feature);
|
---|
104 | if ((objects = map.features.get(Obj.BCNSAW)) != null) for (Feature feature : objects) beacons(feature);
|
---|
105 | if ((objects = map.features.get(Obj.BCNSPP)) != null) for (Feature feature : objects) beacons(feature);
|
---|
106 | if ((objects = map.features.get(Obj.BCNWTW)) != null) for (Feature feature : objects) beacons(feature);
|
---|
107 | }
|
---|
108 |
|
---|
109 | private static void areas(Feature feature) {
|
---|
110 | AttItem name = feature.atts.get(Att.OBJNAM);
|
---|
111 | switch (feature.type) {
|
---|
112 | case DRGARE:
|
---|
113 | if (zoom < 16)
|
---|
114 | Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, new Color(0x40ffffff, true)));
|
---|
115 | else
|
---|
116 | Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, null));
|
---|
117 | if ((zoom >= 12) && (name != null))
|
---|
118 | Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE, Color.black, null, null);
|
---|
119 | break;
|
---|
120 | case FAIRWY:
|
---|
121 | if (feature.area > 2.0) {
|
---|
122 | if (zoom < 16)
|
---|
123 | Renderer.lineVector(feature, new LineStyle(new Color(0xc480ff), 8, new float[] { 50, 50 }, new Color(0x40ffffff, true)));
|
---|
124 | else
|
---|
125 | Renderer.lineVector(feature, new LineStyle(new Color(0xc480ff), 8, new float[] { 50, 50 }, null));
|
---|
126 | } else {
|
---|
127 | if (zoom >= 14)
|
---|
128 | Renderer.lineVector(feature, new LineStyle(new Color(0x40ffffff, true), 0, null, null));
|
---|
129 | }
|
---|
130 | break;
|
---|
131 | case MARCUL:
|
---|
132 | if (zoom >= 14)
|
---|
133 | Renderer.symbol(feature, Areas.MarineFarm, Obj.MARCUL, null, null);
|
---|
134 | if (zoom >= 16)
|
---|
135 | Renderer.lineVector(feature, new LineStyle( Color.black, 4, new float[] { 10, 10 }, null));
|
---|
136 | break;
|
---|
137 | case OSPARE:
|
---|
138 | if ((CatPRA)Renderer.getAttVal(feature, feature.type, 0, Att.CATPRA) == CatPRA.PRA_WFRM) {
|
---|
139 | Renderer.symbol(feature, Areas.WindFarm, Obj.OSPARE, null, null);
|
---|
140 | Renderer.lineVector(feature, new LineStyle(Color.black, 20, new float[] { 40, 40 }, null));
|
---|
141 | if ((zoom >= 15) && (name != null))
|
---|
142 | Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));
|
---|
143 | }
|
---|
144 | break;
|
---|
145 | case RESARE:
|
---|
146 | if (zoom >= 12) {
|
---|
147 | Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0, new Color(0x80c480));
|
---|
148 | // if ((CatREA)Renderer.getAttVal(feature, feature.type, 0, Att.CATREA) == CatREA.REA_NWAK)
|
---|
149 | // Renderer.symbol(feature, Areas.NoWake, Obj.RESARE, null);
|
---|
150 | }
|
---|
151 | break;
|
---|
152 | case SEAARE:
|
---|
153 | switch ((CatSEA) Renderer.getAttVal(feature, feature.type, 0, Att.CATSEA)) {
|
---|
154 | case SEA_RECH:
|
---|
155 | break;
|
---|
156 | case SEA_BAY:
|
---|
157 | break;
|
---|
158 | case SEA_SHOL:
|
---|
159 | break;
|
---|
160 | case SEA_GAT:
|
---|
161 | case SEA_NRRW:
|
---|
162 | break;
|
---|
163 | }
|
---|
164 | break;
|
---|
165 | /*
|
---|
166 | if (is_type("sea_area")) {
|
---|
167 | if (has_attribute("category")) {
|
---|
168 | make_string("");
|
---|
169 | attribute_switch("category")
|
---|
170 | attribute_case("reach") { if (zoom >= 10) add_string("font-family:Arial;font-weight:normal;font-style:italic;font-size:150;text-anchor:middle") }
|
---|
171 | attribute_case("bay") { if (zoom >= 12) add_string("font-family:Arial;font-weight:normal;font-style:italic;font-size:150;text-anchor:middle") }
|
---|
172 | attribute_case("shoal") { if (zoom >= 14) {
|
---|
173 | if (is_area) {
|
---|
174 | area("stroke:#c480ff;stroke-width:4;stroke-dasharray:25,25;fill:none");
|
---|
175 | if (has_item_attribute("name")) text(item_attribute("name"), "font-family:Arial;font-weight:normal;font-style:italic;font-size:75;text-anchor:middle", 0, -40);
|
---|
176 | text("(Shoal)", "font-family:Arial;font-weight:normal;font-size:60;text-anchor:middle", 0, 0);
|
---|
177 | } else if (is_line) {
|
---|
178 | if (has_item_attribute("name")) way_text(item_attribute("name"), "font-family:Arial;font-weight:normal;font-style:italic;font-size:75;text-anchor:middle", 0.5, -40, line("stroke:none;fill:none"));
|
---|
179 | way_text("(Shoal)", "font-family:Arial;font-weight:normal;font-size:60;text-anchor:middle", 0.5, 0, line("stroke:none;fill:none"));
|
---|
180 | } else {
|
---|
181 | if (has_item_attribute("name")) text(item_attribute("name"), "font-family:Arial;font-weight:normal;font-style:italic;font-size:75;text-anchor:middle", 0, -40);
|
---|
182 | text("(Shoal)", "font-family:Arial;font-weight:normal;font-size:60;text-anchor:middle", 0, 0);
|
---|
183 | }
|
---|
184 | }
|
---|
185 | }
|
---|
186 | attribute_case("gat|narrows") { if (zoom >= 12) add_string("font-family:Arial;font-weight:normal;font-style:italic;font-size:100;text-anchor:middle") }
|
---|
187 | end_switch
|
---|
188 | if ((strlen(string) > 0) && !attribute_test("category", "shoal")) {
|
---|
189 | int ref = line("stroke:none;fill:none");
|
---|
190 | if (ref != 0) {
|
---|
191 | if (has_item_attribute("name")) way_text(item_attribute("name"), string, 0.5, 0, ref);
|
---|
192 | } else {
|
---|
193 | if (has_item_attribute("name")) text(item_attribute("name"), string, 0, 0);
|
---|
194 | }
|
---|
195 | }
|
---|
196 | free_string
|
---|
197 | }
|
---|
198 | }
|
---|
199 | */
|
---|
200 | case SNDWAV:
|
---|
201 | if (zoom >= 12) Renderer.fillPattern(feature, Areas.Sandwaves);
|
---|
202 | break;
|
---|
203 | case SPLARE:
|
---|
204 | if (zoom >= 12) {
|
---|
205 | Renderer.symbol(feature, Areas.Plane, Obj.SPLARE, null, null);
|
---|
206 | Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, 10, new Color(0x80c480));
|
---|
207 | }
|
---|
208 | if ((zoom >= 15) && (name != null))
|
---|
209 | Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
|
---|
210 | break;
|
---|
211 | }
|
---|
212 | }
|
---|
213 |
|
---|
214 | private static void beacons(Feature feature) {
|
---|
215 | BcnSHP shape = (BcnSHP) Renderer.getAttVal(feature, feature.type, 0, Att.BCNSHP);
|
---|
216 | if (((shape == BcnSHP.BCN_PRCH) || (shape == BcnSHP.BCN_WTHY)) && (feature.type == Obj.BCNLAT)) {
|
---|
217 | CatLAM cat = (CatLAM) Renderer.getAttVal(feature, feature.type, 0, Att.CATLAM);
|
---|
218 | switch (cat) {
|
---|
219 | case LAM_PORT:
|
---|
220 | if (shape == BcnSHP.BCN_PRCH)
|
---|
221 | Renderer.symbol(feature, Beacons.PerchPort, null, null, null);
|
---|
222 | else
|
---|
223 | Renderer.symbol(feature, Beacons.WithyPort, null, null, null);
|
---|
224 | break;
|
---|
225 | case LAM_STBD:
|
---|
226 | if (shape == BcnSHP.BCN_PRCH)
|
---|
227 | Renderer.symbol(feature, Beacons.PerchStarboard, null, null, null);
|
---|
228 | else
|
---|
229 | Renderer.symbol(feature, Beacons.WithyStarboard, null, null, null);
|
---|
230 | break;
|
---|
231 | default:
|
---|
232 | Renderer.symbol(feature, Beacons.Stake, feature.type, null, null);
|
---|
233 | }
|
---|
234 | } else {
|
---|
235 | Renderer.symbol(feature, Beacons.Shapes.get(shape), feature.type, null, null);
|
---|
236 | if (feature.objs.get(Obj.TOPMAR) != null)
|
---|
237 | Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Beacons, null);
|
---|
238 | }
|
---|
239 | Signals.addSignals(feature);
|
---|
240 | }
|
---|
241 |
|
---|
242 | private static void buoys(Feature feature) {
|
---|
243 | BoySHP shape = (BoySHP) Renderer.getAttVal(feature, feature.type, 0, Att.BOYSHP);
|
---|
244 | Renderer.symbol(feature, Buoys.Shapes.get(shape), feature.type, null, null);
|
---|
245 | if (feature.objs.get(Obj.TOPMAR) != null) {
|
---|
246 | Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Buoys.get(shape), null);
|
---|
247 | }
|
---|
248 | Signals.addSignals(feature);
|
---|
249 | }
|
---|
250 |
|
---|
251 | private static void bridges(Feature feature) {
|
---|
252 | if (zoom >= 16) {
|
---|
253 | double verclr, verccl, vercop;
|
---|
254 | AttMap atts = feature.objs.get(Obj.BRIDGE).get(0);
|
---|
255 | String str = "";
|
---|
256 | if (atts.containsKey(Att.VERCLR)) {
|
---|
257 | verclr = (Double)atts.get(Att.VERCLR).val;
|
---|
258 | } else {
|
---|
259 | verclr = atts.containsKey(Att.VERCSA) ? (Double)atts.get(Att.VERCSA).val : 0;
|
---|
260 | }
|
---|
261 | verccl = atts.containsKey(Att.VERCCL) ? (Double)atts.get(Att.VERCCL).val : 0;
|
---|
262 | vercop = atts.containsKey(Att.VERCOP) ? (Double)atts.get(Att.VERCOP).val : 0;
|
---|
263 | if (verclr > 0) {
|
---|
264 | str += String.valueOf(verclr);
|
---|
265 | } else if (verccl > 0) {
|
---|
266 | if (vercop == 0) {
|
---|
267 | str += String.valueOf(verccl) + "/-";
|
---|
268 | } else {
|
---|
269 | str += String.valueOf(verccl) + "/" + String.valueOf(vercop);
|
---|
270 | }
|
---|
271 | }
|
---|
272 | if (!str.isEmpty())
|
---|
273 | Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 0)));
|
---|
274 | }
|
---|
275 | }
|
---|
276 |
|
---|
277 | private static void cables(Feature feature) {
|
---|
278 | if (zoom >= 14) {
|
---|
279 | if (feature.type == Obj.CBLSUB) {
|
---|
280 | Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, 0, new Color(0x80c480));
|
---|
281 | } else if (feature.type == Obj.CBLOHD) {
|
---|
282 |
|
---|
283 | }
|
---|
284 | }
|
---|
285 | }
|
---|
286 |
|
---|
287 | private static void distances(Feature feature) {
|
---|
288 | /*object_rules(distances) {
|
---|
289 | if ((zoom>=16) && (has_attribute("category"))) {
|
---|
290 | attribute_switch("category")
|
---|
291 | attribute_case("installed") symbol("distance_i");
|
---|
292 | attribute_default symbol("distance_u");
|
---|
293 | end_switch
|
---|
294 | }
|
---|
295 | }
|
---|
296 | */
|
---|
297 | }
|
---|
298 |
|
---|
299 | private static void floats(Feature feature) {
|
---|
300 | switch (feature.type) {
|
---|
301 | case LITVES:
|
---|
302 | Renderer.symbol(feature, Buoys.Super, feature.type, null, null);
|
---|
303 | break;
|
---|
304 | case LITFLT:
|
---|
305 | Renderer.symbol(feature, Buoys.Float, feature.type, null, null);
|
---|
306 | break;
|
---|
307 | case BOYINB:
|
---|
308 | Renderer.symbol(feature, Buoys.Super, feature.type, null, null);
|
---|
309 | break;
|
---|
310 | }
|
---|
311 | if (feature.objs.get(Obj.TOPMAR) != null)
|
---|
312 | Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Floats, null);
|
---|
313 | Signals.addSignals(feature);
|
---|
314 | }
|
---|
315 |
|
---|
316 | private static void gauges(Feature feature) {
|
---|
317 | /*object_rules(gauge) {
|
---|
318 | if (zoom >= 14) symbol("tide_gauge");
|
---|
319 | }
|
---|
320 | */
|
---|
321 | Signals.addSignals(feature);
|
---|
322 | }
|
---|
323 |
|
---|
324 | private static void harbours(Feature feature) {
|
---|
325 | AttItem name = feature.atts.get(Att.OBJNAM);
|
---|
326 | switch (feature.type) {
|
---|
327 | case ACHBRT:
|
---|
328 | if (zoom >= 14) {
|
---|
329 | Renderer.symbol(feature, Harbours.Anchorage, null, null, new Scheme(new Color(0xc480ff)));
|
---|
330 | Renderer.labelText(feature, name == null ? " " : (String) name.val, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, new Color(0xc480ff), Color.white, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 0)));
|
---|
331 | }
|
---|
332 | double radius = (Double)Renderer.getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS);
|
---|
333 | if (radius != 0) {
|
---|
334 | UniHLU units = (UniHLU)Renderer.getAttVal(feature, Obj.ACHBRT, 0, Att.HUNITS);
|
---|
335 | Renderer.lineCircle (feature, new LineStyle(new Color(0xc480ff), 4, new float[] { 10, 10 }, null), radius, units);
|
---|
336 | }
|
---|
337 | break;
|
---|
338 | case ACHARE:
|
---|
339 | if (zoom >= 12) {
|
---|
340 | if (feature.flag != Fflag.AREA) {
|
---|
341 | Renderer.symbol(feature, Harbours.Anchorage, null, null, new Scheme(Color.black));
|
---|
342 | } else {
|
---|
343 | Renderer.symbol(feature, Harbours.Anchorage, null, null, new Scheme(new Color(0xc480ff)));
|
---|
344 | Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, 10, new Color(0xc480ff));
|
---|
345 | }
|
---|
346 | if ((zoom >= 15) && ((name) != null)) {
|
---|
347 | Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, new Color(0xc480ff), null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
|
---|
348 | }
|
---|
349 | ArrayList<StsSTS> sts = (ArrayList<StsSTS>)Renderer.getAttVal(feature, Obj.ACHARE, 0, Att.STATUS);
|
---|
350 | if ((zoom >= 15) && (sts != null) && (sts.contains(StsSTS.STS_RESV))) {
|
---|
351 | Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, new Color(0xc480ff), null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));
|
---|
352 | }
|
---|
353 | }
|
---|
354 | ArrayList<CatACH> cats = (ArrayList<CatACH>)Renderer.getAttVal(feature, Obj.ACHARE, 0, Att.CATACH);
|
---|
355 | int dy = (cats.size() - 1) * -30;
|
---|
356 | for (CatACH cat : cats) {
|
---|
357 | switch (cat) {
|
---|
358 | case ACH_DEEP:
|
---|
359 | Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, new Color(0xc480ff), null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
360 | dy += 60;
|
---|
361 | break;
|
---|
362 | case ACH_TANK:
|
---|
363 | Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, new Color(0xc480ff), null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
364 | dy += 60;
|
---|
365 | break;
|
---|
366 | case ACH_H24P:
|
---|
367 | Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, new Color(0xc480ff), null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
368 | dy += 60;
|
---|
369 | break;
|
---|
370 | case ACH_EXPL:
|
---|
371 | Renderer.symbol(feature, Harbours.Explosives, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(new Color(0xc480ff)));
|
---|
372 | dy += 60;
|
---|
373 | break;
|
---|
374 | case ACH_QUAR:
|
---|
375 | Renderer.symbol(feature, Harbours.Hospital, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(new Color(0xc480ff)));
|
---|
376 | dy += 60;
|
---|
377 | break;
|
---|
378 | case ACH_SEAP:
|
---|
379 | Renderer.symbol(feature, Areas.Seaplane, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(new Color(0xc480ff)));
|
---|
380 | dy += 60;
|
---|
381 | break;
|
---|
382 | }
|
---|
383 | }
|
---|
384 | break;
|
---|
385 | case BERTHS:
|
---|
386 | if (zoom >= 14) {
|
---|
387 | Renderer.labelText(feature, name == null ? " " : (String) name.val, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, new Color(0xc480ff), Color.white, null);
|
---|
388 | }
|
---|
389 | break;
|
---|
390 | case BUISGL:
|
---|
391 | if (zoom >= 16) {
|
---|
392 | ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Renderer.getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN);
|
---|
393 | Renderer.symbol(feature, Landmarks.Funcs.get(fncs.get(0)), null, null, null);
|
---|
394 | }
|
---|
395 | break;
|
---|
396 | }
|
---|
397 | }
|
---|
398 | /*
|
---|
399 | if ((zoom >= 16) && is_type("anchor_berth")) symbol("anchor_berth");
|
---|
400 | if ((zoom >= 12) && is_type("harbour")) {
|
---|
401 | if (has_attribute("category")) {
|
---|
402 | attribute_switch("category")
|
---|
403 | attribute_case("marina|yacht") symbol("marina");
|
---|
404 | attribute_case("marina_no_facilities") symbol("marina_nf");
|
---|
405 | attribute_default symbol("harbour");
|
---|
406 | end_switch
|
---|
407 | } else symbol("harbour");
|
---|
408 | if ((zoom >= 15) && (has_item_attribute("name")))
|
---|
409 | text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:middle", 0, -90);
|
---|
410 | }
|
---|
411 | */
|
---|
412 |
|
---|
413 | private static void landmarks(Feature feature) {
|
---|
414 | ArrayList<CatLMK> cats = (ArrayList<CatLMK>) Renderer.getAttVal(feature, feature.type, 0, Att.CATLMK);
|
---|
415 | Symbol catSym = Landmarks.Shapes.get(cats.get(0));
|
---|
416 | ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Renderer.getAttVal(feature, feature.type, 0, Att.FUNCTN);
|
---|
417 | Symbol fncSym = Landmarks.Funcs.get(fncs.get(0));
|
---|
418 | if ((fncs.get(0) == FncFNC.FNC_CHCH) && (cats.get(0) == CatLMK.LMK_TOWR))
|
---|
419 | catSym = Landmarks.ChurchTower;
|
---|
420 | if ((cats.get(0) == CatLMK.LMK_UNKN) && (fncs.get(0) == FncFNC.FNC_UNKN) && (feature.objs.get(Obj.LIGHTS) != null))
|
---|
421 | catSym = Beacons.LightMajor;
|
---|
422 | if (cats.get(0) == CatLMK.LMK_RADR)
|
---|
423 | fncSym = Landmarks.RadioTV;
|
---|
424 | Renderer.symbol(feature, catSym, null, null, null);
|
---|
425 | Renderer.symbol(feature, fncSym, null, null, null);
|
---|
426 | /* if (!has_attribute("function") && !has_attribute("category") && has_object("light")) {
|
---|
427 | symbol("lighthouse");
|
---|
428 | if ((zoom >= 15) && has_item_attribute("name"))
|
---|
429 | text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:middle", 0, -70);
|
---|
430 | } else {
|
---|
431 | if ((zoom >= 15) && has_item_attribute("name"))
|
---|
432 | text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:start", 60, -50);
|
---|
433 | }
|
---|
434 | }
|
---|
435 | */
|
---|
436 | Signals.addSignals(feature);
|
---|
437 | }
|
---|
438 |
|
---|
439 | private static void buildings(Feature feature) {
|
---|
440 | }
|
---|
441 |
|
---|
442 | private static void lights(Feature feature) {
|
---|
443 | switch (feature.type) {
|
---|
444 | case LITMAJ:
|
---|
445 | Renderer.symbol(feature, Beacons.LightMajor, null, null, null);
|
---|
446 | break;
|
---|
447 | case LITMIN:
|
---|
448 | case LIGHTS:
|
---|
449 | Renderer.symbol(feature, Beacons.LightMinor, null, null, null);
|
---|
450 | break;
|
---|
451 | }
|
---|
452 | Signals.addSignals(feature);
|
---|
453 | }
|
---|
454 |
|
---|
455 | private static void locks(Feature feature) {
|
---|
456 | /*object_rules(locks) {
|
---|
457 | if ((zoom>=13) && is_type("lock_basin|lock_basin_part")) symbol("lock");
|
---|
458 | if ((zoom>=15) && is_type("gate")) symbol("lock_gate");
|
---|
459 | }
|
---|
460 | */
|
---|
461 | }
|
---|
462 | private static void marinas(Feature feature) {
|
---|
463 | if (zoom >= 16) {
|
---|
464 |
|
---|
465 | }
|
---|
466 | /* int n = countObjects(item, type);
|
---|
467 | Atta_t atta = enumAttribute("category", obja);
|
---|
468 | char **map = cluster_map(obja);
|
---|
469 | if (map == NULL) return;
|
---|
470 | switch (n) {
|
---|
471 | case 0: {
|
---|
472 | Obj_t *obj = getObj(item, obja, 0);
|
---|
473 | int n = countValues(getAtt(obj, atta));
|
---|
474 | switch (n) {
|
---|
475 | case 1:
|
---|
476 | renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", CC, 0, 0, 0);
|
---|
477 | break;
|
---|
478 | case 2:
|
---|
479 | renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", RC, 0, 0, 0);
|
---|
480 | renderSymbol(item, obja, map[getAttEnum(obj, atta, 1)], "", "", LC, 0, 0, 0);
|
---|
481 | break;
|
---|
482 | case 3:
|
---|
483 | renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", BC, 0, 0, 0);
|
---|
484 | renderSymbol(item, obja, map[getAttEnum(obj, atta, 1)], "", "", TR, 0, 0, 0);
|
---|
485 | renderSymbol(item, obja, map[getAttEnum(obj, atta, 2)], "", "", TL, 0, 0, 0);
|
---|
486 | break;
|
---|
487 | case 4:
|
---|
488 | renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", BR, 0, 0, 0);
|
---|
489 | renderSymbol(item, obja, map[getAttEnum(obj, atta, 1)], "", "", BL, 0, 0, 0);
|
---|
490 | renderSymbol(item, obja, map[getAttEnum(obj, atta, 2)], "", "", TR, 0, 0, 0);
|
---|
491 | renderSymbol(item, obja, map[getAttEnum(obj, atta, 3)], "", "", TL, 0, 0, 0);
|
---|
492 | break;
|
---|
493 | }
|
---|
494 | }
|
---|
495 | break;
|
---|
496 | case 1:
|
---|
497 | renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", CC, 0, 0, 0);
|
---|
498 | break;
|
---|
499 | case 2:
|
---|
500 | renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", RC, 0, 0, 0);
|
---|
501 | renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 2), atta, 0)], "", "", LC, 0, 0, 0);
|
---|
502 | break;
|
---|
503 | case 3:
|
---|
504 | renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", BC, 0, 0, 0);
|
---|
505 | renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 2), atta, 0)], "", "", TR, 0, 0, 0);
|
---|
506 | renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 3), atta, 0)], "", "", TL, 0, 0, 0);
|
---|
507 | break;
|
---|
508 | case 4:
|
---|
509 | renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", BR, 0, 0, 0);
|
---|
510 | renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 2), atta, 0)], "", "", BL, 0, 0, 0);
|
---|
511 | renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 3), atta, 0)], "", "", TR, 0, 0, 0);
|
---|
512 | renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 4), atta, 0)], "", "", TL, 0, 0, 0);
|
---|
513 | break;
|
---|
514 | }
|
---|
515 | */
|
---|
516 | }
|
---|
517 |
|
---|
518 | private static void moorings(Feature feature) {
|
---|
519 | CatMOR cat = (CatMOR) Renderer.getAttVal(feature, feature.type, 0, Att.CATMOR);
|
---|
520 | switch (cat) {
|
---|
521 | case MOR_DLPN:
|
---|
522 | Renderer.symbol(feature, Harbours.Dolphin, null, null, null);
|
---|
523 | break;
|
---|
524 | case MOR_DDPN:
|
---|
525 | Renderer.symbol(feature, Harbours.DeviationDolphin, null, null, null);
|
---|
526 | break;
|
---|
527 | case MOR_BLRD:
|
---|
528 | case MOR_POST:
|
---|
529 | Renderer.symbol(feature, Harbours.Bollard, null, null, null);
|
---|
530 | break;
|
---|
531 | case MOR_BUOY:
|
---|
532 | BoySHP shape = (BoySHP) Renderer.getAttVal(feature, feature.type, 0, Att.BOYSHP);
|
---|
533 | if (shape == BoySHP.BOY_UNKN)
|
---|
534 | shape = BoySHP.BOY_SPHR;
|
---|
535 | Renderer.symbol(feature, Buoys.Shapes.get(shape), feature.type, null, null);
|
---|
536 | break;
|
---|
537 | }
|
---|
538 | Signals.addSignals(feature);
|
---|
539 | }
|
---|
540 |
|
---|
541 | private static void notices(Feature feature) {
|
---|
542 | if (zoom >= 14) {
|
---|
543 | double dx = 0.0, dy = 0.0;
|
---|
544 | switch (feature.type) {
|
---|
545 | case BCNCAR:
|
---|
546 | case BCNISD:
|
---|
547 | case BCNLAT:
|
---|
548 | case BCNSAW:
|
---|
549 | case BCNSPP:
|
---|
550 | case BCNWTW:
|
---|
551 | dy = 45.0;
|
---|
552 | break;
|
---|
553 | case NOTMRK:
|
---|
554 | dy = 0.0;
|
---|
555 | break;
|
---|
556 | default:
|
---|
557 | return;
|
---|
558 | }
|
---|
559 | Symbol s1 = null, s2 = null;
|
---|
560 | MarSYS sys = MarSYS.SYS_CEVN;
|
---|
561 | BnkWTW bnk = BnkWTW.BWW_UNKN;
|
---|
562 | AttItem att = feature.atts.get(Att.MARSYS);
|
---|
563 | if (att != null) sys = (MarSYS)att.val;
|
---|
564 | ObjTab objs = feature.objs.get(Obj.NOTMRK);
|
---|
565 | int n = objs.size();
|
---|
566 | if (n > 2) {
|
---|
567 | s1 = Notices.Notice;
|
---|
568 | n = 1;
|
---|
569 | } else {
|
---|
570 | for (AttMap atts : objs.values()) {
|
---|
571 | if (atts.get(Att.MARSYS) != null) sys = (MarSYS)atts.get(Att.MARSYS).val;
|
---|
572 | CatNMK cat = CatNMK.NMK_UNKN;
|
---|
573 | if (atts.get(Att.CATNMK) != null) cat = (CatNMK)atts.get(Att.CATNMK).val;
|
---|
574 | s2 = Notices.getNotice(cat, sys);
|
---|
575 | }
|
---|
576 | }
|
---|
577 | /* Obj_t *obj = getObj(item, NOTMRK, i);
|
---|
578 | if (obj == NULL) continue;
|
---|
579 | Atta_t add;
|
---|
580 | int idx = 0;
|
---|
581 | while ((add = getAttEnum(obj, ADDMRK, idx++)) != MRK_UNKN) {
|
---|
582 | if ((add == MRK_LTRI) && (i == 2)) swap = true;
|
---|
583 | if ((add == MRK_RTRI) && (i != 2)) swap = true;
|
---|
584 | }
|
---|
585 | }
|
---|
586 | } else {
|
---|
587 |
|
---|
588 | }
|
---|
589 | for (int i = 0; i <=2; i++) {
|
---|
590 | Obj_t *obj = getObj(item, NOTMRK, i);
|
---|
591 | if (obj == NULL) continue;
|
---|
592 | Atta_t category = getAttEnum(obj, CATNMK, i);
|
---|
593 | Atta_t add;
|
---|
594 | int idx = 0;
|
---|
595 | int top=0, bottom=0, left=0, right=0;
|
---|
596 | while ((add = getAttEnum(obj, ADDMRK, idx++)) != MRK_UNKN) {
|
---|
597 | switch (add) {
|
---|
598 | case MRK_TOPB:
|
---|
599 | top = add;
|
---|
600 | break;
|
---|
601 | case MRK_BOTB:
|
---|
602 | case MRK_BTRI:
|
---|
603 | bottom = add;
|
---|
604 | break;
|
---|
605 | case MRK_LTRI:
|
---|
606 | left = add;
|
---|
607 | break;
|
---|
608 | case MRK_RTRI:
|
---|
609 | right = add;
|
---|
610 | break;
|
---|
611 | default:
|
---|
612 | break;
|
---|
613 | }
|
---|
614 | }
|
---|
615 | double orient = getAtt(obj, ORIENT) != NULL ? getAtt(obj, ORIENT)->val.val.f : 0.0;
|
---|
616 | int system = getAtt(obj, MARSYS) != NULL ? getAtt(obj, MARSYS)->val.val.e : 0;
|
---|
617 | double flip = 0.0;
|
---|
618 | char *symb = "";
|
---|
619 | char *base = "";
|
---|
620 | char *colour = "black";
|
---|
621 | if ((system == SYS_BWR2) || (system == SYS_BNWR)) {
|
---|
622 | symb = bniwr_map[category];
|
---|
623 | switch (category) {
|
---|
624 | case NMK_NANK:
|
---|
625 | case NMK_LMHR:
|
---|
626 | case NMK_KTPM...NMK_RSPD:
|
---|
627 | {
|
---|
628 | int bank = getAtt(obj, BNKWTW) != NULL ? getAtt(obj, BNKWTW)->val.val.e : 0;
|
---|
629 | switch (bank) {
|
---|
630 | case BWW_LEFT:
|
---|
631 | base = "notice_blb";
|
---|
632 | colour = "red";
|
---|
633 | break;
|
---|
634 | case BWW_RGHT:
|
---|
635 | base = "notice_brb";
|
---|
636 | colour = "green";
|
---|
637 | break;
|
---|
638 | default:
|
---|
639 | base = "notice_bsi";
|
---|
640 | colour = "black";
|
---|
641 | break;
|
---|
642 | }
|
---|
643 | }
|
---|
644 | default:
|
---|
645 | break;
|
---|
646 | }
|
---|
647 | } else if (system == SYS_PPWB) {
|
---|
648 | int bank = getAtt(obj, BNKWTW) != NULL ? getAtt(obj, BNKWTW)->val.val.e : 0;
|
---|
649 | if (bank != 0) {
|
---|
650 | switch (category) {
|
---|
651 | case NMK_WLAR:
|
---|
652 | if (bank == BNK_LEFT)
|
---|
653 | base = "notice_pwlarl";
|
---|
654 | else
|
---|
655 | base = "notice_pwlarr";
|
---|
656 | break;
|
---|
657 | case NMK_WRAL:
|
---|
658 | if (bank == BNK_LEFT)
|
---|
659 | base = "notice_pwrall";
|
---|
660 | else
|
---|
661 | base = "notice_pwralr";
|
---|
662 | break;
|
---|
663 | case NMK_KTPM:
|
---|
664 | if (bank == BNK_LEFT)
|
---|
665 | base = "notice_ppml";
|
---|
666 | else
|
---|
667 | base = "notice_ppmr";
|
---|
668 | break;
|
---|
669 | case NMK_KTSM:
|
---|
670 | if (bank == BNK_LEFT)
|
---|
671 | base = "notice_psml";
|
---|
672 | else
|
---|
673 | base = "notice_psmr";
|
---|
674 | break;
|
---|
675 | case NMK_KTMR:
|
---|
676 | if (bank == BNK_LEFT)
|
---|
677 | base = "notice_pmrl";
|
---|
678 | else
|
---|
679 | base = "notice_pmrr";
|
---|
680 | break;
|
---|
681 | case NMK_CRTP:
|
---|
682 | if (bank == BNK_LEFT)
|
---|
683 | base = "notice_pcpl";
|
---|
684 | else
|
---|
685 | base = "notice_pcpr";
|
---|
686 | break;
|
---|
687 | case NMK_CRTS:
|
---|
688 | if (bank == BNK_LEFT)
|
---|
689 | base = "notice_pcsl";
|
---|
690 | else
|
---|
691 | base = "notice_pcsr";
|
---|
692 | break;
|
---|
693 | default:
|
---|
694 | break;
|
---|
695 | }
|
---|
696 | }
|
---|
697 | } else {
|
---|
698 | symb = notice_map[category];
|
---|
699 | switch (category) {
|
---|
700 | case NMK_NOVK...NMK_NWSH:
|
---|
701 | case NMK_NMTC...NMK_NLBG:
|
---|
702 | base = "notice_a";
|
---|
703 | break;
|
---|
704 | case NMK_MVTL...NMK_CHDR:
|
---|
705 | base = "notice_b";
|
---|
706 | break;
|
---|
707 | case NMK_PRTL...NMK_PRTR:
|
---|
708 | case NMK_OVHC...NMK_LBGP:
|
---|
709 | base = "notice_e";
|
---|
710 | colour = "white";
|
---|
711 | break;
|
---|
712 | default:
|
---|
713 | break;
|
---|
714 | }
|
---|
715 | switch (category) {
|
---|
716 | case NMK_MVTL:
|
---|
717 | case NMK_ANKP:
|
---|
718 | case NMK_PRTL:
|
---|
719 | case NMK_MWAL:
|
---|
720 | case NMK_MWAR:
|
---|
721 | flip = 180.0;
|
---|
722 | break;
|
---|
723 | case NMK_SWWR:
|
---|
724 | case NMK_WRSL:
|
---|
725 | case NMK_WARL:
|
---|
726 | flip = -90.0;
|
---|
727 | break;
|
---|
728 | case NMK_SWWC:
|
---|
729 | case NMK_SWWL:
|
---|
730 | case NMK_WLSR:
|
---|
731 | case NMK_WALR:
|
---|
732 | flip = 90.0;
|
---|
733 | break;
|
---|
734 | default:
|
---|
735 | break;
|
---|
736 | }
|
---|
737 | }
|
---|
738 | if (n == 2) {
|
---|
739 | dx = (((i != 2) && swap) || ((i == 2) && !swap)) ? -30.0 : 30.0;
|
---|
740 | }
|
---|
741 | if (top == MRK_TOPB)
|
---|
742 | renderSymbol(item, NOTMRK, "notice_board", "", "", BC, dx, dy, orient);
|
---|
743 | if (bottom == MRK_BOTB)
|
---|
744 | renderSymbol(item, NOTMRK, "notice_board", "", "", BC, dx, dy, orient+180);
|
---|
745 | if (bottom == MRK_BTRI)
|
---|
746 | renderSymbol(item, NOTMRK, "notice_triangle", "", "", BC, dx, dy, orient+180);
|
---|
747 | if (left == MRK_LTRI)
|
---|
748 | renderSymbol(item, NOTMRK, "notice_triangle", "", "", BC, dx, dy, orient-90);
|
---|
749 | if (right == MRK_RTRI)
|
---|
750 | renderSymbol(item, NOTMRK, "notice_triangle", "", "", BC, dx, dy, orient+90);
|
---|
751 | renderSymbol(item, NOTMRK, base, "", "", CC, dx, dy, orient);
|
---|
752 | renderSymbol(item, NOTMRK, symb, "", colour, CC, dx, dy, orient+flip);
|
---|
753 | }
|
---|
754 | */
|
---|
755 | }
|
---|
756 | }
|
---|
757 | private static void obstructions(Feature feature) {
|
---|
758 | if ((zoom >= 14) && (feature.type == Obj.UWTROC)) {
|
---|
759 | WatLEV lvl = (WatLEV) Renderer.getAttVal(feature, feature.type, 0, Att.WATLEV);
|
---|
760 | switch (lvl) {
|
---|
761 | case LEV_CVRS:
|
---|
762 | Renderer.symbol(feature, Areas.RockC, null, null, null);
|
---|
763 | break;
|
---|
764 | case LEV_AWSH:
|
---|
765 | Renderer.symbol(feature, Areas.RockA, null, null, null);
|
---|
766 | break;
|
---|
767 | default:
|
---|
768 | Renderer.symbol(feature, Areas.Rock, null, null, null);
|
---|
769 | }
|
---|
770 | } else {
|
---|
771 | Renderer.symbol(feature, Areas.Rock, null, null, null);
|
---|
772 | }
|
---|
773 | }
|
---|
774 | private static void pipelines(Feature feature) {
|
---|
775 | if (zoom >= 14) {
|
---|
776 | if (feature.type == Obj.PIPSOL) {
|
---|
777 | Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, 0, new Color(0x80c480));
|
---|
778 | } else if (feature.type == Obj.PIPOHD) {
|
---|
779 |
|
---|
780 | }
|
---|
781 | }
|
---|
782 | }
|
---|
783 | private static void platforms(Feature feature) {
|
---|
784 | ArrayList<CatOFP> cats = (ArrayList<CatOFP>)Renderer.getAttVal(feature, Obj.OFSPLF, 0, Att.CATOFP);
|
---|
785 | if ((CatOFP) cats.get(0) == CatOFP.OFP_FPSO)
|
---|
786 | Renderer.symbol(feature, Buoys.Storage, null, null, null);
|
---|
787 | else
|
---|
788 | Renderer.symbol(feature, Landmarks.Platform, null, null, null);
|
---|
789 | AttItem name = feature.atts.get(Att.OBJNAM);
|
---|
790 | if ((zoom >= 15) && (name != null))
|
---|
791 | Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(60, -50)));
|
---|
792 | /*object_rules(platforms) {
|
---|
793 | if (has_object("fog_signal")) object(fogs);
|
---|
794 | if (has_object("radar_transponder")) object(rtbs);
|
---|
795 | if (has_object("light")) object(lights);
|
---|
796 | }
|
---|
797 | */
|
---|
798 | }
|
---|
799 | private static void ports(Feature feature) {
|
---|
800 | if (zoom >= 14) {
|
---|
801 | if (feature.type == Obj.CRANES) {
|
---|
802 | if ((CatCRN) Renderer.getAttVal(feature, feature.type, 0, Att.CATCRN) == CatCRN.CRN_CONT)
|
---|
803 | Renderer.symbol(feature, Harbours.ContainerCrane, null, null, null);
|
---|
804 | else
|
---|
805 | Renderer.symbol(feature, Harbours.PortCrane, null, null, null);
|
---|
806 | } else if (feature.type == Obj.HULKES) {
|
---|
807 | Renderer.lineVector(feature, new LineStyle(Color.black, 4, null, new Color(0xffe000)));
|
---|
808 | AttItem name = feature.atts.get(Att.OBJNAM);
|
---|
809 | if ((zoom >= 15) && (name != null))
|
---|
810 | Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, null);
|
---|
811 | }
|
---|
812 | }
|
---|
813 | }
|
---|
814 | private static void separation(Feature feature) {
|
---|
815 | switch (feature.type) {
|
---|
816 | case TSEZNE:
|
---|
817 | case TSSCRS:
|
---|
818 | case TSSRON:
|
---|
819 | if (zoom <= 15)
|
---|
820 | Renderer.lineVector(feature, new LineStyle(null, 0, null, new Color(0x80c48080, true)));
|
---|
821 | else
|
---|
822 | Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, null, null));
|
---|
823 | AttItem name = feature.atts.get(Att.OBJNAM);
|
---|
824 | if ((zoom >= 10) && (name != null))
|
---|
825 | Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080), null, null);
|
---|
826 | break;
|
---|
827 | case TSELNE:
|
---|
828 | Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, null, null));
|
---|
829 | break;
|
---|
830 | case TSSLPT:
|
---|
831 | Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, 0, new Color(0x80c48080, true));
|
---|
832 | break;
|
---|
833 | case TSSBND:
|
---|
834 | Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, new float[] { 40, 40 }, null));
|
---|
835 | break;
|
---|
836 | case ISTZNE:
|
---|
837 | Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0, new Color(0x80c48080, true));
|
---|
838 | break;
|
---|
839 | }
|
---|
840 | }
|
---|
841 | private static void shoreline(Feature feature) {
|
---|
842 | if (zoom >= 12) {
|
---|
843 | switch ((CatSLC) Renderer.getAttVal(feature, feature.type, 0, Att.CATSLC)) {
|
---|
844 | case SLC_TWAL:
|
---|
845 | WatLEV lev = (WatLEV) Renderer.getAttVal(feature, feature.type, 0, Att.WATLEV);
|
---|
846 | if (lev == WatLEV.LEV_CVRS) {
|
---|
847 | Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
|
---|
848 | if (zoom >= 15)
|
---|
849 | Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, 20);
|
---|
850 | } else {
|
---|
851 | Renderer.lineVector(feature, new LineStyle(Color.black, 10, null, null));
|
---|
852 | }
|
---|
853 | if (zoom >= 15)
|
---|
854 | Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20);
|
---|
855 | }
|
---|
856 | }
|
---|
857 | }
|
---|
858 |
|
---|
859 | private static void signals(Feature feature) {
|
---|
860 | if (zoom >= 14) {
|
---|
861 | switch (feature.type) {
|
---|
862 | case SISTAT:
|
---|
863 | case SISTAW:
|
---|
864 | Renderer.symbol(feature, Harbours.SignalStation, null, null, null);
|
---|
865 | break;
|
---|
866 | case RDOSTA:
|
---|
867 | Renderer.symbol(feature, Harbours.SignalStation, null, null, null);
|
---|
868 | Renderer.symbol(feature, Beacons.RadarStation, null, null, null);
|
---|
869 | break;
|
---|
870 | case RADSTA:
|
---|
871 | Renderer.symbol(feature, Harbours.SignalStation, null, null, null);
|
---|
872 | Renderer.symbol(feature, Beacons.RadarStation, null, null, null);
|
---|
873 | break;
|
---|
874 | case PILBOP:
|
---|
875 | Renderer.symbol(feature, Harbours.Pilot, null, null, null);
|
---|
876 | break;
|
---|
877 | case CGUSTA:
|
---|
878 | Renderer.symbol(feature, Harbours.SignalStation, null, null, null);
|
---|
879 | break;
|
---|
880 | case RSCSTA:
|
---|
881 | Renderer.symbol(feature, Harbours.Rescue, null, null, null);
|
---|
882 | break;
|
---|
883 | }
|
---|
884 | }
|
---|
885 | Signals.addSignals(feature);
|
---|
886 | }
|
---|
887 |
|
---|
888 | private static void transits(Feature feature) {
|
---|
889 | if (zoom >= 12) {
|
---|
890 | if (feature.type == Obj.RECTRC) Renderer.lineVector (feature, new LineStyle(Color.black, 10, null, null));
|
---|
891 | else if (feature.type == Obj.NAVLNE) Renderer.lineVector (feature, new LineStyle(Color.black, 10, new float[] { 25, 25 }, null));
|
---|
892 | }
|
---|
893 | if (zoom >= 15) {
|
---|
894 | String str = "";
|
---|
895 | AttItem name = feature.atts.get(Att.OBJNAM);
|
---|
896 | if (name != null) str += (String)name.val + " ";
|
---|
897 | Double ort = (Double) Renderer.getAttVal(feature, feature.type, 0, Att.ORIENT);
|
---|
898 | if (ort != null) str += ort.toString() + "\u0152";
|
---|
899 | if (!str.isEmpty()) Renderer.lineText(feature, str, new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20);
|
---|
900 | }
|
---|
901 | }
|
---|
902 | private static void waterways(Feature feature) {
|
---|
903 | }
|
---|
904 |
|
---|
905 | private static void wrecks(Feature feature) {
|
---|
906 | if (zoom >= 14) {
|
---|
907 | CatWRK cat = (CatWRK) Renderer.getAttVal(feature, feature.type, 0, Att.CATWRK);
|
---|
908 | switch (cat) {
|
---|
909 | case WRK_DNGR:
|
---|
910 | case WRK_MSTS:
|
---|
911 | Renderer.symbol(feature, Areas.WreckD, null, null, null);
|
---|
912 | break;
|
---|
913 | case WRK_HULS:
|
---|
914 | Renderer.symbol(feature, Areas.WreckS, null, null, null);
|
---|
915 | break;
|
---|
916 | default:
|
---|
917 | Renderer.symbol(feature, Areas.WreckND, null, null, null);
|
---|
918 | }
|
---|
919 | }
|
---|
920 | }
|
---|
921 | }
|
---|