1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package render;
|
---|
3 |
|
---|
4 | import java.awt.Color;
|
---|
5 | import java.awt.Font;
|
---|
6 | import java.awt.geom.AffineTransform;
|
---|
7 | import java.text.DecimalFormat;
|
---|
8 | import java.util.ArrayList;
|
---|
9 | import java.util.ConcurrentModificationException;
|
---|
10 | import java.util.EnumMap;
|
---|
11 | import java.util.HashMap;
|
---|
12 |
|
---|
13 | import render.ChartContext.RuleSet;
|
---|
14 | import render.Renderer.LabelStyle;
|
---|
15 | import s57.S57att.Att;
|
---|
16 | import s57.S57map.AttMap;
|
---|
17 | import s57.S57map.Feature;
|
---|
18 | import s57.S57map.ObjTab;
|
---|
19 | import s57.S57map.Pflag;
|
---|
20 | import s57.S57map.Rflag;
|
---|
21 | import s57.S57obj.Obj;
|
---|
22 | import s57.S57val;
|
---|
23 | import s57.S57val.AddMRK;
|
---|
24 | import s57.S57val.AttVal;
|
---|
25 | import s57.S57val.BcnSHP;
|
---|
26 | import s57.S57val.BnkWTW;
|
---|
27 | import s57.S57val.BoySHP;
|
---|
28 | import s57.S57val.CatACH;
|
---|
29 | import s57.S57val.CatCBL;
|
---|
30 | import s57.S57val.CatCRN;
|
---|
31 | import s57.S57val.CatDIS;
|
---|
32 | import s57.S57val.CatHAF;
|
---|
33 | import s57.S57val.CatLAM;
|
---|
34 | import s57.S57val.CatLIT;
|
---|
35 | import s57.S57val.CatLMK;
|
---|
36 | import s57.S57val.CatMOR;
|
---|
37 | import s57.S57val.CatNMK;
|
---|
38 | import s57.S57val.CatOBS;
|
---|
39 | import s57.S57val.CatOFP;
|
---|
40 | import s57.S57val.CatOPA;
|
---|
41 | import s57.S57val.CatPIL;
|
---|
42 | import s57.S57val.CatREA;
|
---|
43 | import s57.S57val.CatROD;
|
---|
44 | import s57.S57val.CatROS;
|
---|
45 | import s57.S57val.CatSCF;
|
---|
46 | import s57.S57val.CatSEA;
|
---|
47 | import s57.S57val.CatSIL;
|
---|
48 | import s57.S57val.CatSIT;
|
---|
49 | import s57.S57val.CatSIW;
|
---|
50 | import s57.S57val.CatSLC;
|
---|
51 | import s57.S57val.CatWED;
|
---|
52 | import s57.S57val.CatWRK;
|
---|
53 | import s57.S57val.ColCOL;
|
---|
54 | import s57.S57val.ColPAT;
|
---|
55 | import s57.S57val.FncFNC;
|
---|
56 | import s57.S57val.MarSYS;
|
---|
57 | import s57.S57val.StsSTS;
|
---|
58 | import s57.S57val.TopSHP;
|
---|
59 | import s57.S57val.TrfTRF;
|
---|
60 | import s57.S57val.UniHLU;
|
---|
61 | import s57.S57val.WatLEV;
|
---|
62 | import s57.S57val.CatVAN;
|
---|
63 | import symbols.Areas;
|
---|
64 | import symbols.Beacons;
|
---|
65 | import symbols.Buoys;
|
---|
66 | import symbols.Facilities;
|
---|
67 | import symbols.Harbours;
|
---|
68 | import symbols.Landmarks;
|
---|
69 | import symbols.Notices;
|
---|
70 | import symbols.Symbols;
|
---|
71 | import symbols.Symbols.Delta;
|
---|
72 | import symbols.Symbols.Handle;
|
---|
73 | import symbols.Symbols.LineStyle;
|
---|
74 | import symbols.Symbols.Patt;
|
---|
75 | import symbols.Symbols.Scheme;
|
---|
76 | import symbols.Symbols.Symbol;
|
---|
77 | import symbols.Topmarks;
|
---|
78 |
|
---|
79 | /**
|
---|
80 | * @author Malcolm Herring
|
---|
81 | */
|
---|
82 | public class Rules {
|
---|
83 |
|
---|
84 | static final DecimalFormat df = new DecimalFormat("#.#");
|
---|
85 |
|
---|
86 | static final EnumMap<ColCOL, Color> bodyColours = new EnumMap<>(ColCOL.class);
|
---|
87 | static {
|
---|
88 | bodyColours.put(ColCOL.COL_UNK, new Color(0, true));
|
---|
89 | bodyColours.put(ColCOL.COL_WHT, new Color(0xffffff));
|
---|
90 | bodyColours.put(ColCOL.COL_BLK, new Color(0x000000));
|
---|
91 | bodyColours.put(ColCOL.COL_RED, new Color(0xd40000));
|
---|
92 | bodyColours.put(ColCOL.COL_GRN, new Color(0x00d400));
|
---|
93 | bodyColours.put(ColCOL.COL_BLU, Color.blue);
|
---|
94 | bodyColours.put(ColCOL.COL_YEL, new Color(0xffd400));
|
---|
95 | bodyColours.put(ColCOL.COL_GRY, Color.gray);
|
---|
96 | bodyColours.put(ColCOL.COL_BRN, new Color(0x8b4513));
|
---|
97 | bodyColours.put(ColCOL.COL_AMB, new Color(0xfbf00f));
|
---|
98 | bodyColours.put(ColCOL.COL_VIO, new Color(0xee82ee));
|
---|
99 | bodyColours.put(ColCOL.COL_ORG, Color.orange);
|
---|
100 | bodyColours.put(ColCOL.COL_MAG, new Color(0xf000f0));
|
---|
101 | bodyColours.put(ColCOL.COL_PNK, Color.pink);
|
---|
102 | }
|
---|
103 |
|
---|
104 | static final EnumMap<ColPAT, Patt> pattMap = new EnumMap<>(ColPAT.class);
|
---|
105 | static {
|
---|
106 | pattMap.put(ColPAT.PAT_UNKN, Patt.Z);
|
---|
107 | pattMap.put(ColPAT.PAT_HORI, Patt.H);
|
---|
108 | pattMap.put(ColPAT.PAT_VERT, Patt.V);
|
---|
109 | pattMap.put(ColPAT.PAT_DIAG, Patt.D);
|
---|
110 | pattMap.put(ColPAT.PAT_BRDR, Patt.B);
|
---|
111 | pattMap.put(ColPAT.PAT_SQUR, Patt.S);
|
---|
112 | pattMap.put(ColPAT.PAT_CROS, Patt.C);
|
---|
113 | pattMap.put(ColPAT.PAT_SALT, Patt.X);
|
---|
114 | pattMap.put(ColPAT.PAT_STRP, Patt.H);
|
---|
115 | }
|
---|
116 |
|
---|
117 | static String getName() {
|
---|
118 | AttVal<?> name = feature.atts.get(Att.OBJNAM);
|
---|
119 | if (name == null) {
|
---|
120 | AttMap atts = feature.objs.get(feature.type).get(0);
|
---|
121 | if (atts != null) {
|
---|
122 | name = atts.get(Att.OBJNAM);
|
---|
123 | }
|
---|
124 | }
|
---|
125 | return (name != null) ? ((String) name.val).replace(""", "\"") : null;
|
---|
126 | }
|
---|
127 |
|
---|
128 | public static void addName(int z, Font font) {
|
---|
129 | addName(z, font, Color.black, new Delta(Handle.CC, new AffineTransform()));
|
---|
130 | }
|
---|
131 |
|
---|
132 | public static void addName(int z, Font font, Color colour) {
|
---|
133 | addName(z, font, colour, new Delta(Handle.CC, new AffineTransform()));
|
---|
134 | }
|
---|
135 |
|
---|
136 | public static void addName(int z, Font font, Delta delta) {
|
---|
137 | addName(z, font, Color.black, delta);
|
---|
138 | }
|
---|
139 |
|
---|
140 | public static void addName(int z, Font font, Color colour, Delta delta) {
|
---|
141 | if (Renderer.zoom >= z) {
|
---|
142 | String name = getName();
|
---|
143 | if (name != null) {
|
---|
144 | Renderer.labelText(name, font, colour, delta);
|
---|
145 | }
|
---|
146 | }
|
---|
147 | }
|
---|
148 |
|
---|
149 | static AttMap getAtts(Obj obj, int idx) {
|
---|
150 | HashMap<Integer, AttMap> objs = feature.objs.get(obj);
|
---|
151 | if (objs == null)
|
---|
152 | return null;
|
---|
153 | else
|
---|
154 | return objs.get(idx);
|
---|
155 | }
|
---|
156 |
|
---|
157 | public static Object getAttVal(Obj obj, Att att) {
|
---|
158 | AttMap atts;
|
---|
159 | HashMap<Integer, AttMap> objs;
|
---|
160 | AttVal<?> item;
|
---|
161 | if ((objs = feature.objs.get(obj)) != null)
|
---|
162 | atts = objs.get(0);
|
---|
163 | else
|
---|
164 | return null;
|
---|
165 | if ((item = atts.get(att)) == null)
|
---|
166 | return null;
|
---|
167 | else
|
---|
168 | return item.val;
|
---|
169 | }
|
---|
170 |
|
---|
171 | public static String getAttStr(Obj obj, Att att) {
|
---|
172 | String str = (String) getAttVal(obj, att);
|
---|
173 | if (str != null) {
|
---|
174 | return str;
|
---|
175 | }
|
---|
176 | return "";
|
---|
177 | }
|
---|
178 |
|
---|
179 | @SuppressWarnings("unchecked")
|
---|
180 | public static Enum<?> getAttEnum(Obj obj, Att att) {
|
---|
181 | ArrayList<?> list = (ArrayList<?>) getAttVal(obj, att);
|
---|
182 | if (list != null) {
|
---|
183 | return ((ArrayList<Enum<?>>) list).get(0);
|
---|
184 | }
|
---|
185 | return S57val.unknAtt(att);
|
---|
186 | }
|
---|
187 |
|
---|
188 | @SuppressWarnings("unchecked")
|
---|
189 | public static ArrayList<?> getAttList(Obj obj, Att att) {
|
---|
190 | ArrayList<Enum<?>> list = (ArrayList<Enum<?>>) getAttVal(obj, att);
|
---|
191 | if (list != null) {
|
---|
192 | return list;
|
---|
193 | }
|
---|
194 | list = new ArrayList<>();
|
---|
195 | list.add(S57val.unknAtt(att));
|
---|
196 | return list;
|
---|
197 | }
|
---|
198 |
|
---|
199 | @SuppressWarnings("unchecked")
|
---|
200 | static Scheme getScheme(Obj obj) {
|
---|
201 | ArrayList<Color> colours = new ArrayList<>();
|
---|
202 | for (ColCOL col : (ArrayList<ColCOL>) getAttList(obj, Att.COLOUR)) {
|
---|
203 | colours.add(bodyColours.get(col));
|
---|
204 | }
|
---|
205 | ArrayList<Patt> patterns = new ArrayList<>();
|
---|
206 | for (ColPAT pat : (ArrayList<ColPAT>) getAttList(obj, Att.COLPAT)) {
|
---|
207 | patterns.add(pattMap.get(pat));
|
---|
208 | }
|
---|
209 | return new Scheme(patterns, colours);
|
---|
210 | }
|
---|
211 |
|
---|
212 | static boolean hasAttribute(Obj obj, Att att) {
|
---|
213 | AttMap atts;
|
---|
214 | if ((atts = getAtts(obj, 0)) != null) {
|
---|
215 | AttVal<?> item = atts.get(att);
|
---|
216 | return item != null;
|
---|
217 | }
|
---|
218 | return false;
|
---|
219 | }
|
---|
220 |
|
---|
221 | static boolean testAttribute(Obj obj, Att att, Object val) {
|
---|
222 | AttMap atts;
|
---|
223 | if ((atts = getAtts(obj, 0)) != null) {
|
---|
224 | AttVal<?> item = atts.get(att);
|
---|
225 | if (item != null) {
|
---|
226 | switch (item.conv) {
|
---|
227 | case S:
|
---|
228 | case A:
|
---|
229 | return ((String) item.val).equals(val);
|
---|
230 | case E:
|
---|
231 | case L:
|
---|
232 | return ((ArrayList<?>) item.val).contains(val);
|
---|
233 | case F:
|
---|
234 | case I:
|
---|
235 | return item.val == val;
|
---|
236 | }
|
---|
237 | }
|
---|
238 | }
|
---|
239 | return false;
|
---|
240 | }
|
---|
241 |
|
---|
242 | static boolean hasObject(Obj obj) {
|
---|
243 | return (feature.objs.containsKey(obj));
|
---|
244 | }
|
---|
245 |
|
---|
246 | public static Feature feature;
|
---|
247 | static ArrayList<Feature> objects;
|
---|
248 |
|
---|
249 | static boolean testObject(Obj obj) {
|
---|
250 | return ((objects = Renderer.map.features.get(obj)) != null);
|
---|
251 | }
|
---|
252 |
|
---|
253 | static boolean testFeature(Feature f) {
|
---|
254 | return ((feature = f).reln == Rflag.MASTER);
|
---|
255 | }
|
---|
256 |
|
---|
257 | public static boolean rules() {
|
---|
258 | try {
|
---|
259 | if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.BASE)) {
|
---|
260 | if (testObject(Obj.LNDARE)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
261 | if (testObject(Obj.BUAARE)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
262 | if (testObject(Obj.HRBFAC)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
263 | if (testObject(Obj.HRBBSN)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
264 | if (testObject(Obj.LOKBSN)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
265 | if (testObject(Obj.LKBSPT)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
266 | if (testObject(Obj.LAKARE)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
267 | if (testObject(Obj.RIVERS)) for (Feature f : objects) if (testFeature(f)) waterways();
|
---|
268 | if (testObject(Obj.CANALS)) for (Feature f : objects) if (testFeature(f)) waterways();
|
---|
269 | if (testObject(Obj.DEPARE)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
270 | if (testObject(Obj.COALNE)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
271 | if (testObject(Obj.ROADWY)) for (Feature f : objects) if (testFeature(f)) highways();
|
---|
272 | if (testObject(Obj.RAILWY)) for (Feature f : objects) if (testFeature(f)) highways();
|
---|
273 | }
|
---|
274 | if (Renderer.context.ruleset() == RuleSet.ALL) {
|
---|
275 | if (testObject(Obj.SOUNDG)) for (Feature f : objects) if (testFeature(f)) depths();
|
---|
276 | if (testObject(Obj.DEPCNT)) for (Feature f : objects) if (testFeature(f)) depths();
|
---|
277 | }
|
---|
278 | if (testObject(Obj.SLCONS)) for (Feature f : objects) if (testFeature(f)) shoreline();
|
---|
279 | if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.SEAMARK)) {
|
---|
280 | if (testObject(Obj.PIPSOL)) for (Feature f : objects) if (testFeature(f)) pipelines();
|
---|
281 | if (testObject(Obj.CBLSUB)) for (Feature f : objects) if (testFeature(f)) cables();
|
---|
282 | if (testObject(Obj.PIPOHD)) for (Feature f : objects) if (testFeature(f)) pipelines();
|
---|
283 | if (testObject(Obj.CBLOHD)) for (Feature f : objects) if (testFeature(f)) cables();
|
---|
284 | if (testObject(Obj.TSEZNE)) for (Feature f : objects) if (testFeature(f)) separation();
|
---|
285 | if (testObject(Obj.TSSCRS)) for (Feature f : objects) if (testFeature(f)) separation();
|
---|
286 | if (testObject(Obj.TSSRON)) for (Feature f : objects) if (testFeature(f)) separation();
|
---|
287 | if (testObject(Obj.TSELNE)) for (Feature f : objects) if (testFeature(f)) separation();
|
---|
288 | if (testObject(Obj.TSSLPT)) for (Feature f : objects) if (testFeature(f)) separation();
|
---|
289 | if (testObject(Obj.TSSBND)) for (Feature f : objects) if (testFeature(f)) separation();
|
---|
290 | if (testObject(Obj.ISTZNE)) for (Feature f : objects) if (testFeature(f)) separation();
|
---|
291 | if (testObject(Obj.SNDWAV)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
292 | if (testObject(Obj.WEDKLP)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
293 | if (testObject(Obj.OSPARE)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
294 | if (testObject(Obj.FAIRWY)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
295 | if (testObject(Obj.DRGARE)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
296 | if (testObject(Obj.RESARE)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
297 | if (testObject(Obj.PRCARE)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
298 | if (testObject(Obj.SPLARE)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
299 | if (testObject(Obj.SEAARE)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
300 | if (testObject(Obj.DMPGRD)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
301 | if (testObject(Obj.OBSTRN)) for (Feature f : objects) if (testFeature(f)) obstructions();
|
---|
302 | if (testObject(Obj.UWTROC)) for (Feature f : objects) if (testFeature(f)) obstructions();
|
---|
303 | if (testObject(Obj.MARCUL)) for (Feature f : objects) if (testFeature(f)) areas();
|
---|
304 | if (testObject(Obj.RECTRC)) for (Feature f : objects) if (testFeature(f)) transits();
|
---|
305 | if (testObject(Obj.NAVLNE)) for (Feature f : objects) if (testFeature(f)) transits();
|
---|
306 | if (testObject(Obj.HRBFAC)) for (Feature f : objects) if (testFeature(f)) harbours();
|
---|
307 | if (testObject(Obj.ACHARE)) for (Feature f : objects) if (testFeature(f)) harbours();
|
---|
308 | if (testObject(Obj.ACHBRT)) for (Feature f : objects) if (testFeature(f)) harbours();
|
---|
309 | if (testObject(Obj.BERTHS)) for (Feature f : objects) if (testFeature(f)) harbours();
|
---|
310 | if (testObject(Obj.DISMAR)) for (Feature f : objects) if (testFeature(f)) distances();
|
---|
311 | if (testObject(Obj.HULKES)) for (Feature f : objects) if (testFeature(f)) ports();
|
---|
312 | if (testObject(Obj.CRANES)) for (Feature f : objects) if (testFeature(f)) ports();
|
---|
313 | if (testObject(Obj.LNDMRK)) for (Feature f : objects) if (testFeature(f)) landmarks();
|
---|
314 | if (testObject(Obj.SILTNK)) for (Feature f : objects) if (testFeature(f)) landmarks();
|
---|
315 | if (testObject(Obj.BUISGL)) for (Feature f : objects) if (testFeature(f)) harbours();
|
---|
316 | if (testObject(Obj.MORFAC)) for (Feature f : objects) if (testFeature(f)) moorings();
|
---|
317 | if (testObject(Obj.NOTMRK)) for (Feature f : objects) if (testFeature(f)) notices();
|
---|
318 | if (testObject(Obj.SMCFAC)) for (Feature f : objects) if (testFeature(f)) marinas();
|
---|
319 | if (testObject(Obj.BRIDGE)) for (Feature f : objects) if (testFeature(f)) bridges();
|
---|
320 | if (testObject(Obj.PILPNT)) for (Feature f : objects) if (testFeature(f)) points();
|
---|
321 | if (testObject(Obj.TOPMAR)) for (Feature f : objects) if (testFeature(f)) points();
|
---|
322 | if (testObject(Obj.DAYMAR)) for (Feature f : objects) if (testFeature(f)) points();
|
---|
323 | if (testObject(Obj.FOGSIG)) for (Feature f : objects) if (testFeature(f)) points();
|
---|
324 | if (testObject(Obj.RDOCAL)) for (Feature f : objects) if (testFeature(f)) callpoint();
|
---|
325 | if (testObject(Obj.LITMIN)) for (Feature f : objects) if (testFeature(f)) lights();
|
---|
326 | if (testObject(Obj.LITMAJ)) for (Feature f : objects) if (testFeature(f)) lights();
|
---|
327 | if (testObject(Obj.LIGHTS)) for (Feature f : objects) if (testFeature(f)) lights();
|
---|
328 | if (testObject(Obj.SISTAT)) for (Feature f : objects) if (testFeature(f)) stations();
|
---|
329 | if (testObject(Obj.SISTAW)) for (Feature f : objects) if (testFeature(f)) stations();
|
---|
330 | if (testObject(Obj.CGUSTA)) for (Feature f : objects) if (testFeature(f)) stations();
|
---|
331 | if (testObject(Obj.RDOSTA)) for (Feature f : objects) if (testFeature(f)) stations();
|
---|
332 | if (testObject(Obj.RADRFL)) for (Feature f : objects) if (testFeature(f)) stations();
|
---|
333 | if (testObject(Obj.RADSTA)) for (Feature f : objects) if (testFeature(f)) stations();
|
---|
334 | if (testObject(Obj.RTPBCN)) for (Feature f : objects) if (testFeature(f)) stations();
|
---|
335 | if (testObject(Obj.RSCSTA)) for (Feature f : objects) if (testFeature(f)) stations();
|
---|
336 | if (testObject(Obj.PILBOP)) for (Feature f : objects) if (testFeature(f)) stations();
|
---|
337 | if (testObject(Obj.WTWGAG)) for (Feature f : objects) if (testFeature(f)) gauges();
|
---|
338 | if (testObject(Obj.OFSPLF)) for (Feature f : objects) if (testFeature(f)) platforms();
|
---|
339 | if (testObject(Obj.WRECKS)) for (Feature f : objects) if (testFeature(f)) wrecks();
|
---|
340 | if (testObject(Obj.LITVES)) for (Feature f : objects) if (testFeature(f)) floats();
|
---|
341 | if (testObject(Obj.LITFLT)) for (Feature f : objects) if (testFeature(f)) floats();
|
---|
342 | if (testObject(Obj.BOYINB)) for (Feature f : objects) if (testFeature(f)) floats();
|
---|
343 | if (testObject(Obj.BOYLAT)) for (Feature f : objects) if (testFeature(f)) buoys();
|
---|
344 | if (testObject(Obj.BOYCAR)) for (Feature f : objects) if (testFeature(f)) buoys();
|
---|
345 | if (testObject(Obj.BOYISD)) for (Feature f : objects) if (testFeature(f)) buoys();
|
---|
346 | if (testObject(Obj.BOYSAW)) for (Feature f : objects) if (testFeature(f)) buoys();
|
---|
347 | if (testObject(Obj.BOYSPP)) for (Feature f : objects) if (testFeature(f)) buoys();
|
---|
348 | if (testObject(Obj.BCNLAT)) for (Feature f : objects) if (testFeature(f)) beacons();
|
---|
349 | if (testObject(Obj.BCNCAR)) for (Feature f : objects) if (testFeature(f)) beacons();
|
---|
350 | if (testObject(Obj.BCNISD)) for (Feature f : objects) if (testFeature(f)) beacons();
|
---|
351 | if (testObject(Obj.BCNSAW)) for (Feature f : objects) if (testFeature(f)) beacons();
|
---|
352 | if (testObject(Obj.BCNSPP)) for (Feature f : objects) if (testFeature(f)) beacons();
|
---|
353 | if (testObject(Obj.VAATON)) for (Feature f : objects) if (testFeature(f)) virtual();
|
---|
354 | }
|
---|
355 | } catch (ConcurrentModificationException e) {
|
---|
356 | return false;
|
---|
357 | } catch (Exception e) {
|
---|
358 | return true;
|
---|
359 | }
|
---|
360 | return true;
|
---|
361 | }
|
---|
362 |
|
---|
363 | private static void areas() {
|
---|
364 | String name = getName();
|
---|
365 | switch (feature.type) {
|
---|
366 | case BUAARE:
|
---|
367 | Renderer.lineVector(new LineStyle(new Color(0x20000000, true)));
|
---|
368 | break;
|
---|
369 | case COALNE:
|
---|
370 | if (Renderer.zoom >= 12)
|
---|
371 | Renderer.lineVector(new LineStyle(Color.black, 10));
|
---|
372 | break;
|
---|
373 | case DEPARE:
|
---|
374 | Double depmax = 0.0;
|
---|
375 | if (((depmax = (Double) getAttVal(Obj.DEPARE, Att.DRVAL2)) != null) && (depmax <= 0.0)) {
|
---|
376 | Renderer.lineVector(new LineStyle(Symbols.Gdries));
|
---|
377 | }
|
---|
378 | break;
|
---|
379 | case LAKARE:
|
---|
380 | if ((Renderer.zoom >= 12) || (feature.geom.area > 10.0))
|
---|
381 | Renderer.lineVector(new LineStyle(Symbols.Bwater));
|
---|
382 | break;
|
---|
383 | case DRGARE:
|
---|
384 | if (Renderer.zoom < 16)
|
---|
385 | Renderer.lineVector(new LineStyle(Color.black, 8, new float[] { 25, 25 }, new Color(0x40ffffff, true)));
|
---|
386 | else
|
---|
387 | Renderer.lineVector(new LineStyle(Color.black, 8, new float[] { 25, 25 }));
|
---|
388 | addName(12, new Font("Arial", Font.PLAIN, 100), new Delta(Handle.CC, new AffineTransform()));
|
---|
389 | break;
|
---|
390 | case FAIRWY:
|
---|
391 | if (Renderer.zoom >= 12) {
|
---|
392 | if (feature.geom.area > 1.0) {
|
---|
393 | if (Renderer.zoom < 16)
|
---|
394 | Renderer.lineVector(new LineStyle(new Color(0x20ffffff, true)));
|
---|
395 | else
|
---|
396 | Renderer.lineVector(new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 }));
|
---|
397 | } else {
|
---|
398 | if (Renderer.zoom >= 14)
|
---|
399 | Renderer.lineVector(new LineStyle(new Color(0x20ffffff, true)));
|
---|
400 | }
|
---|
401 | }
|
---|
402 | break;
|
---|
403 | case LKBSPT:
|
---|
404 | case LOKBSN:
|
---|
405 | case HRBBSN:
|
---|
406 | if (Renderer.zoom >= 12) {
|
---|
407 | Renderer.lineVector(new LineStyle(Color.black, 10, Symbols.Bwater));
|
---|
408 | } else {
|
---|
409 | Renderer.lineVector(new LineStyle(Symbols.Bwater));
|
---|
410 | }
|
---|
411 | break;
|
---|
412 | case HRBFAC:
|
---|
413 | if (feature.objs.get(Obj.HRBBSN) != null) {
|
---|
414 | if (Renderer.zoom >= 12) {
|
---|
415 | Renderer.lineVector(new LineStyle(Color.black, 10, Symbols.Bwater));
|
---|
416 | } else {
|
---|
417 | Renderer.lineVector(new LineStyle(Symbols.Bwater));
|
---|
418 | }
|
---|
419 | }
|
---|
420 | break;
|
---|
421 | case LNDARE:
|
---|
422 | Renderer.lineVector(new LineStyle(Symbols.Yland));
|
---|
423 | break;
|
---|
424 | case MARCUL:
|
---|
425 | if (Renderer.zoom >= 12) {
|
---|
426 | if (Renderer.zoom >= 14) {
|
---|
427 | Renderer.symbol(Areas.MarineFarm);
|
---|
428 | }
|
---|
429 | if ((feature.geom.area > 0.2) || ((feature.geom.area > 0.05) && (Renderer.zoom >= 14)) || ((feature.geom.area > 0.005) && (Renderer.zoom >= 16))) {
|
---|
430 | Renderer.lineVector(new LineStyle(Color.black, 4, new float[] { 10, 10 }));
|
---|
431 | }
|
---|
432 | }
|
---|
433 | break;
|
---|
434 | case OSPARE:
|
---|
435 | if (testAttribute(feature.type, Att.CATOPA, CatOPA.OPA_WIND)) {
|
---|
436 | Renderer.symbol(Areas.WindFarm);
|
---|
437 | Renderer.lineVector(new LineStyle(Color.black, 12, new float[] { 40, 40 }));
|
---|
438 | addName(15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 120)));
|
---|
439 | }
|
---|
440 | break;
|
---|
441 | case RESARE:
|
---|
442 | case MIPARE:
|
---|
443 | case DMPGRD:
|
---|
444 | if (Renderer.zoom >= 12) {
|
---|
445 | Renderer.lineSymbols(Areas.Restricted, 1.0, null, null, 0, Symbols.Mline);
|
---|
446 | if (testAttribute(feature.type, Att.CATREA, CatREA.REA_NWAK)) {
|
---|
447 | Renderer.symbol(Areas.NoWake);
|
---|
448 | }
|
---|
449 | }
|
---|
450 | break;
|
---|
451 | case PRCARE:
|
---|
452 | if (Renderer.zoom >= 12) {
|
---|
453 | Renderer.lineVector(new LineStyle(Symbols.Mline, 10, new float[] { 40, 40 }));
|
---|
454 | }
|
---|
455 | break;
|
---|
456 | case SEAARE:
|
---|
457 | switch ((CatSEA) getAttEnum(feature.type, Att.CATSEA)) {
|
---|
458 | case SEA_RECH:
|
---|
459 | if ((Renderer.zoom >= 10) && (name != null))
|
---|
460 | if (feature.geom.prim == Pflag.LINE) {
|
---|
461 | Renderer.lineText(name, new Font("Arial", Font.PLAIN, 150), Color.black, -40);
|
---|
462 | } else {
|
---|
463 | Renderer.labelText(name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
|
---|
464 | }
|
---|
465 | break;
|
---|
466 | case SEA_BAY:
|
---|
467 | if ((Renderer.zoom >= 12) && (name != null))
|
---|
468 | if (feature.geom.prim == Pflag.LINE) {
|
---|
469 | Renderer.lineText(name, new Font("Arial", Font.PLAIN, 150), Color.black, -40);
|
---|
470 | } else {
|
---|
471 | Renderer.labelText(name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
|
---|
472 | }
|
---|
473 | break;
|
---|
474 | case SEA_SHOL:
|
---|
475 | if (Renderer.zoom >= 14) {
|
---|
476 | if (feature.geom.prim == Pflag.AREA) {
|
---|
477 | Renderer.lineVector(new LineStyle(new Color(0xc480ff), 4, new float[] { 25, 25 }));
|
---|
478 | if (name != null) {
|
---|
479 | Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
|
---|
480 | Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 20)));
|
---|
481 | }
|
---|
482 | } else if (feature.geom.prim == Pflag.LINE) {
|
---|
483 | if (name != null) {
|
---|
484 | Renderer.lineText(name, new Font("Arial", Font.ITALIC, 75), Color.black, -40);
|
---|
485 | Renderer.lineText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, 20);
|
---|
486 | }
|
---|
487 | } else {
|
---|
488 | if (name != null) {
|
---|
489 | Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
|
---|
490 | Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 20)));
|
---|
491 | }
|
---|
492 | }
|
---|
493 | }
|
---|
494 | break;
|
---|
495 | case SEA_GAT:
|
---|
496 | case SEA_NRRW:
|
---|
497 | addName(12, new Font("Arial", Font.PLAIN, 100));
|
---|
498 | break;
|
---|
499 | default:
|
---|
500 | break;
|
---|
501 | }
|
---|
502 | break;
|
---|
503 | case SNDWAV:
|
---|
504 | if (Renderer.zoom >= 12)
|
---|
505 | Renderer.fillPattern(Areas.Sandwaves);
|
---|
506 | break;
|
---|
507 | case WEDKLP:
|
---|
508 | if (Renderer.zoom >= 12) {
|
---|
509 | switch ((CatWED) getAttEnum(feature.type, Att.CATWED)) {
|
---|
510 | case WED_KELP:
|
---|
511 | if (feature.geom.prim == Pflag.AREA) {
|
---|
512 | Renderer.fillPattern(Areas.KelpA);
|
---|
513 | } else {
|
---|
514 | Renderer.symbol(Areas.KelpS);
|
---|
515 | }
|
---|
516 | break;
|
---|
517 | default:
|
---|
518 | break;
|
---|
519 | }
|
---|
520 | }
|
---|
521 | break;
|
---|
522 | case SPLARE:
|
---|
523 | if (Renderer.zoom >= 12) {
|
---|
524 | Renderer.symbol(Areas.Plane, new Scheme(Symbols.Msymb));
|
---|
525 | Renderer.lineSymbols(Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Symbols.Mline);
|
---|
526 | }
|
---|
527 | addName(15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
|
---|
528 | break;
|
---|
529 | default:
|
---|
530 | break;
|
---|
531 | }
|
---|
532 | }
|
---|
533 |
|
---|
534 | @SuppressWarnings("unchecked")
|
---|
535 | private static void beacons() {
|
---|
536 | if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BCNLAT) || (feature.type == Obj.BCNCAR)))
|
---|
537 | || ((Renderer.zoom >= 11) && ((feature.type == Obj.BCNSAW) || hasObject(Obj.RTPBCN)))) {
|
---|
538 | if (testAttribute(feature.type, Att.STATUS, StsSTS.STS_ILLD)) {
|
---|
539 | Renderer.symbol(Beacons.Floodlight);
|
---|
540 | }
|
---|
541 | BcnSHP shape = (BcnSHP) getAttEnum(feature.type, Att.BCNSHP);
|
---|
542 | if (shape == BcnSHP.BCN_UNKN)
|
---|
543 | shape = BcnSHP.BCN_PILE;
|
---|
544 | if ((shape == BcnSHP.BCN_WTHY) && (feature.type == Obj.BCNLAT)) {
|
---|
545 | switch ((CatLAM) getAttEnum(feature.type, Att.CATLAM)) {
|
---|
546 | case LAM_PORT:
|
---|
547 | Renderer.symbol(Beacons.WithyPort);
|
---|
548 | break;
|
---|
549 | case LAM_STBD:
|
---|
550 | Renderer.symbol(Beacons.WithyStarboard);
|
---|
551 | break;
|
---|
552 | default:
|
---|
553 | Renderer.symbol(Beacons.Stake, getScheme(feature.type));
|
---|
554 | }
|
---|
555 | } else if (shape == BcnSHP.BCN_PRCH && feature.type == Obj.BCNLAT && !feature.objs.containsKey(Obj.TOPMAR)) {
|
---|
556 | switch ((CatLAM) getAttEnum(feature.type, Att.CATLAM)) {
|
---|
557 | case LAM_PORT:
|
---|
558 | Renderer.symbol(Beacons.PerchPort);
|
---|
559 | break;
|
---|
560 | case LAM_STBD:
|
---|
561 | Renderer.symbol(Beacons.PerchStarboard);
|
---|
562 | break;
|
---|
563 | default:
|
---|
564 | Renderer.symbol(Beacons.Stake, getScheme(feature.type));
|
---|
565 | }
|
---|
566 | } else {
|
---|
567 | Renderer.symbol(Beacons.Shapes.get(shape), getScheme(feature.type));
|
---|
568 | if (feature.objs.containsKey(Obj.TOPMAR)) {
|
---|
569 | AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
|
---|
570 | if (testAttribute(Obj.TOPMAR, Att.STATUS, StsSTS.STS_ILLD)) {
|
---|
571 | Renderer.symbol(Beacons.Floodlight);
|
---|
572 | }
|
---|
573 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
574 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.TOPMAR), Topmarks.BeaconDelta);
|
---|
575 | }
|
---|
576 | } else if (feature.objs.containsKey(Obj.DAYMAR)) {
|
---|
577 | AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
|
---|
578 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
579 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.DAYMAR), Topmarks.BeaconDelta);
|
---|
580 | }
|
---|
581 | }
|
---|
582 | }
|
---|
583 | if (hasObject(Obj.NOTMRK))
|
---|
584 | notices();
|
---|
585 | addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
|
---|
586 | Signals.addSignals();
|
---|
587 | }
|
---|
588 | }
|
---|
589 |
|
---|
590 | @SuppressWarnings("unchecked")
|
---|
591 | private static void buoys() {
|
---|
592 | 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)))) {
|
---|
593 | BoySHP shape = (BoySHP) getAttEnum(feature.type, Att.BOYSHP);
|
---|
594 | if (shape == BoySHP.BOY_UNKN)
|
---|
595 | shape = BoySHP.BOY_PILR;
|
---|
596 | Renderer.symbol(Buoys.Shapes.get(shape), getScheme(feature.type));
|
---|
597 | if (feature.objs.containsKey(Obj.TOPMAR)) {
|
---|
598 | AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
|
---|
599 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
600 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape));
|
---|
601 | }
|
---|
602 | } else if (feature.objs.containsKey(Obj.DAYMAR)) {
|
---|
603 | AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
|
---|
604 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
605 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.DAYMAR), Topmarks.BuoyDeltas.get(shape));
|
---|
606 | }
|
---|
607 | }
|
---|
608 | addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
|
---|
609 | Signals.addSignals();
|
---|
610 | }
|
---|
611 | }
|
---|
612 |
|
---|
613 | private static void bridges() {
|
---|
614 | if (Renderer.zoom >= 16) {
|
---|
615 | double verclr, verccl, vercop, horclr;
|
---|
616 | AttMap atts = feature.objs.get(Obj.BRIDGE).get(0);
|
---|
617 | String vstr = "";
|
---|
618 | String hstr = "";
|
---|
619 | if (atts != null) {
|
---|
620 | if (atts.containsKey(Att.HORCLR)) {
|
---|
621 | horclr = (Double) atts.get(Att.HORCLR).val;
|
---|
622 | hstr = String.valueOf(horclr);
|
---|
623 | }
|
---|
624 | if (atts.containsKey(Att.VERCLR)) {
|
---|
625 | verclr = (Double) atts.get(Att.VERCLR).val;
|
---|
626 | } else {
|
---|
627 | verclr = atts.containsKey(Att.VERCSA) ? (Double) atts.get(Att.VERCSA).val : 0;
|
---|
628 | }
|
---|
629 | verccl = atts.containsKey(Att.VERCCL) ? (Double) atts.get(Att.VERCCL).val : 0;
|
---|
630 | vercop = atts.containsKey(Att.VERCOP) ? (Double) atts.get(Att.VERCOP).val : 0;
|
---|
631 | if (verclr > 0) {
|
---|
632 | vstr += String.valueOf(verclr);
|
---|
633 | } else if (verccl > 0) {
|
---|
634 | if (vercop == 0) {
|
---|
635 | vstr += String.valueOf(verccl) + "/-";
|
---|
636 | } else {
|
---|
637 | vstr += String.valueOf(verccl) + "/" + String.valueOf(vercop);
|
---|
638 | }
|
---|
639 | }
|
---|
640 | if (hstr.isEmpty() && !vstr.isEmpty()) {
|
---|
641 | Renderer.labelText(vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC));
|
---|
642 | } else if (!hstr.isEmpty() && !vstr.isEmpty()) {
|
---|
643 | Renderer.labelText(vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.BC));
|
---|
644 | Renderer.labelText(hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.TC));
|
---|
645 | } else if (!hstr.isEmpty() && vstr.isEmpty()) {
|
---|
646 | Renderer.labelText(hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.CC));
|
---|
647 | }
|
---|
648 | }
|
---|
649 | }
|
---|
650 | }
|
---|
651 |
|
---|
652 | private static void cables() {
|
---|
653 | if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) {
|
---|
654 | if (feature.type == Obj.CBLSUB) {
|
---|
655 | Renderer.lineSymbols(Areas.Cable, 0.0, null, null, 0, Symbols.Mline);
|
---|
656 | } else if (feature.type == Obj.CBLOHD) {
|
---|
657 | AttMap atts = feature.objs.get(Obj.CBLOHD).get(0);
|
---|
658 | if (atts != null && atts.containsKey(Att.CATCBL) && atts.get(Att.CATCBL).val == CatCBL.CBL_POWR) {
|
---|
659 | Renderer.lineSymbols(Areas.CableDash, 0, Areas.CableDot, Areas.CableFlash, 2, Color.black);
|
---|
660 | } else {
|
---|
661 | Renderer.lineSymbols(Areas.CableDash, 0, Areas.CableDot, null, 2, Color.black);
|
---|
662 | }
|
---|
663 | if (atts != null) {
|
---|
664 | if (atts.containsKey(Att.VERCLR)) {
|
---|
665 | 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)));
|
---|
666 | } else if (atts.containsKey(Att.VERCSA)) {
|
---|
667 | 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)));
|
---|
668 | }
|
---|
669 | }
|
---|
670 | }
|
---|
671 | }
|
---|
672 | }
|
---|
673 |
|
---|
674 | private static void callpoint() {
|
---|
675 | if (Renderer.zoom >= 14) {
|
---|
676 | Symbol symb = Harbours.CallPoint2;
|
---|
677 | TrfTRF trf = (TrfTRF) getAttEnum(feature.type, Att.TRAFIC);
|
---|
678 | if (trf != TrfTRF.TRF_TWOW) {
|
---|
679 | symb = Harbours.CallPoint1;
|
---|
680 | }
|
---|
681 | Double orient = 0.0;
|
---|
682 | if ((orient = (Double) getAttVal(feature.type, Att.ORIENT)) == null) {
|
---|
683 | orient = 0.0;
|
---|
684 | }
|
---|
685 | Renderer.symbol(symb, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(orient))));
|
---|
686 | String chn;
|
---|
687 | if (!(chn = getAttStr(feature.type, Att.COMCHA)).isEmpty()) {
|
---|
688 | Renderer.labelText(("Ch." + chn), new Font("Arial", Font.PLAIN, 50), Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 50)));
|
---|
689 | }
|
---|
690 | }
|
---|
691 | }
|
---|
692 |
|
---|
693 | private static void depths() {
|
---|
694 | switch (feature.type) {
|
---|
695 | case SOUNDG:
|
---|
696 | if ((Renderer.zoom >= 14) && hasAttribute(Obj.SOUNDG, Att.VALSOU)) {
|
---|
697 | double depth = (double) getAttVal(Obj.SOUNDG, Att.VALSOU);
|
---|
698 | String dstr = df.format(depth);
|
---|
699 | String[] tok = dstr.split("[-.]");
|
---|
700 | String ul = "";
|
---|
701 | String id = tok[0];
|
---|
702 | String dd = "";
|
---|
703 | if (tok[0].equals("")) {
|
---|
704 | for (int i = 0; i < tok[1].length(); i++) {
|
---|
705 | ul += "_";
|
---|
706 | }
|
---|
707 | id = tok[1];
|
---|
708 | dd = (tok.length == 3) ? tok[2] : "";
|
---|
709 | } else {
|
---|
710 | dd = (tok.length == 2) ? tok[1] : "";
|
---|
711 | }
|
---|
712 | Renderer.labelText(ul, new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.RC, AffineTransform.getTranslateInstance(10, 15)));
|
---|
713 | Renderer.labelText(id, new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.RC, AffineTransform.getTranslateInstance(10, 0)));
|
---|
714 | Renderer.labelText(dd, new Font("Arial", Font.PLAIN, 20), Color.black, new Delta(Handle.LC, AffineTransform.getTranslateInstance(15, 10)));
|
---|
715 | }
|
---|
716 | break;
|
---|
717 | case DEPCNT:
|
---|
718 | break;
|
---|
719 | default:
|
---|
720 | break;
|
---|
721 | }
|
---|
722 | }
|
---|
723 |
|
---|
724 | private static void distances() {
|
---|
725 | if (Renderer.zoom >= 14) {
|
---|
726 | if (!testAttribute(Obj.DISMAR, Att.CATDIS, CatDIS.DIS_NONI)) {
|
---|
727 | Renderer.symbol(Harbours.DistanceI);
|
---|
728 | } else {
|
---|
729 | Renderer.symbol(Harbours.DistanceU);
|
---|
730 | }
|
---|
731 | if (Renderer.zoom >= 15) {
|
---|
732 | AttMap atts = getAtts(Obj.DISMAR, 0);
|
---|
733 | if (atts != null && atts.containsKey(Att.WTWDIS)) {
|
---|
734 | Double dist = (Double) atts.get(Att.WTWDIS).val;
|
---|
735 | String str = "";
|
---|
736 | if (atts.containsKey(Att.HUNITS)) {
|
---|
737 | switch ((UniHLU) getAttEnum(Obj.DISMAR, Att.HUNITS)) {
|
---|
738 | case HLU_METR:
|
---|
739 | str += "m ";
|
---|
740 | break;
|
---|
741 | case HLU_FEET:
|
---|
742 | str += "ft ";
|
---|
743 | break;
|
---|
744 | case HLU_HMTR:
|
---|
745 | str += "hm ";
|
---|
746 | break;
|
---|
747 | case HLU_KMTR:
|
---|
748 | str += "km ";
|
---|
749 | break;
|
---|
750 | case HLU_SMIL:
|
---|
751 | str += "M ";
|
---|
752 | break;
|
---|
753 | case HLU_NMIL:
|
---|
754 | str += "NM ";
|
---|
755 | break;
|
---|
756 | default:
|
---|
757 | break;
|
---|
758 | }
|
---|
759 | }
|
---|
760 | str += String.format("%1.0f", dist);
|
---|
761 | Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45)));
|
---|
762 | }
|
---|
763 | }
|
---|
764 | }
|
---|
765 | }
|
---|
766 |
|
---|
767 | @SuppressWarnings("unchecked")
|
---|
768 | private static void floats() {
|
---|
769 | if ((Renderer.zoom >= 12) || ((Renderer.zoom >= 11) && ((feature.type == Obj.LITVES) || (feature.type == Obj.BOYINB) || hasObject(Obj.RTPBCN)))) {
|
---|
770 | switch (feature.type) {
|
---|
771 | case LITVES:
|
---|
772 | Renderer.symbol(Buoys.Super, getScheme(feature.type));
|
---|
773 | break;
|
---|
774 | case LITFLT:
|
---|
775 | Renderer.symbol(Buoys.Float, getScheme(feature.type));
|
---|
776 | break;
|
---|
777 | case BOYINB:
|
---|
778 | Renderer.symbol(Buoys.Super, getScheme(feature.type));
|
---|
779 | break;
|
---|
780 | default:
|
---|
781 | break;
|
---|
782 | }
|
---|
783 | if (feature.objs.containsKey(Obj.TOPMAR)) {
|
---|
784 | AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
|
---|
785 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
786 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.TOPMAR), Topmarks.FloatDelta);
|
---|
787 | }
|
---|
788 | } else if (feature.objs.containsKey(Obj.DAYMAR)) {
|
---|
789 | AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
|
---|
790 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
791 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.DAYMAR), Topmarks.FloatDelta);
|
---|
792 | }
|
---|
793 | }
|
---|
794 | addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
|
---|
795 | Signals.addSignals();
|
---|
796 | }
|
---|
797 | }
|
---|
798 |
|
---|
799 | private static void gauges() {
|
---|
800 | if (Renderer.zoom >= 14) {
|
---|
801 | Renderer.symbol(Harbours.TideGauge);
|
---|
802 | addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
|
---|
803 | Signals.addSignals();
|
---|
804 | }
|
---|
805 | }
|
---|
806 |
|
---|
807 | @SuppressWarnings("unchecked")
|
---|
808 | private static void harbours() {
|
---|
809 | String name = getName();
|
---|
810 | switch (feature.type) {
|
---|
811 | case ACHBRT:
|
---|
812 | if (Renderer.zoom >= 14) {
|
---|
813 | Renderer.symbol(Harbours.Anchor, new Scheme(Symbols.Msymb));
|
---|
814 | if (Renderer.zoom >= 15) {
|
---|
815 | Renderer.labelText(name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Symbols.Msymb, LabelStyle.RRCT, Symbols.Msymb, Color.white, new Delta(Handle.BC));
|
---|
816 | }
|
---|
817 | }
|
---|
818 | if (getAttVal(Obj.ACHBRT, Att.RADIUS) != null) {
|
---|
819 | double radius;
|
---|
820 | if ((radius = (Double) getAttVal(Obj.ACHBRT, Att.RADIUS)) != 0) {
|
---|
821 | UniHLU units = (UniHLU) getAttEnum(Obj.ACHBRT, Att.HUNITS);
|
---|
822 | if (units == UniHLU.HLU_UNKN) {
|
---|
823 | units = UniHLU.HLU_METR;
|
---|
824 | }
|
---|
825 | Renderer.lineCircle(new LineStyle(Symbols.Mline, 4, new float[] { 10, 10 }, null), radius, units);
|
---|
826 | }
|
---|
827 | }
|
---|
828 | break;
|
---|
829 | case ACHARE:
|
---|
830 | if (Renderer.zoom >= 12) {
|
---|
831 | if (feature.geom.prim != Pflag.AREA) {
|
---|
832 | Renderer.symbol(Harbours.Anchorage, new Scheme(Color.black));
|
---|
833 | } else {
|
---|
834 | Renderer.symbol(Harbours.Anchorage, new Scheme(Symbols.Mline));
|
---|
835 | Renderer.lineSymbols(Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Symbols.Mline);
|
---|
836 | }
|
---|
837 | addName(15, new Font("Arial", Font.BOLD, 60), Symbols.Mline, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
|
---|
838 | ArrayList<StsSTS> sts = (ArrayList<StsSTS>) getAttList(Obj.ACHARE, Att.STATUS);
|
---|
839 | if (Renderer.zoom >= 15 && sts.contains(StsSTS.STS_RESV)) {
|
---|
840 | Renderer.labelText("Reserved", new Font("Arial", Font.PLAIN, 50), Symbols.Mline, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));
|
---|
841 | }
|
---|
842 | ArrayList<CatACH> cats = (ArrayList<CatACH>) getAttList(Obj.ACHARE, Att.CATACH);
|
---|
843 | int dy = (cats.size() - 1) * -30;
|
---|
844 | for (CatACH cat : cats) {
|
---|
845 | switch (cat) {
|
---|
846 | case ACH_DEEP:
|
---|
847 | Renderer.labelText("DW", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
848 | dy += 60;
|
---|
849 | break;
|
---|
850 | case ACH_TANK:
|
---|
851 | Renderer.labelText("Tanker", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
852 | dy += 60;
|
---|
853 | break;
|
---|
854 | case ACH_H24P:
|
---|
855 | Renderer.labelText("24h", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
856 | dy += 60;
|
---|
857 | break;
|
---|
858 | case ACH_EXPL:
|
---|
859 | Renderer.symbol(Harbours.Explosives, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
860 | dy += 60;
|
---|
861 | break;
|
---|
862 | case ACH_QUAR:
|
---|
863 | Renderer.symbol(Harbours.Hospital, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
864 | dy += 60;
|
---|
865 | break;
|
---|
866 | case ACH_SEAP:
|
---|
867 | Renderer.symbol(Areas.Seaplane, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
868 | dy += 60;
|
---|
869 | break;
|
---|
870 | default:
|
---|
871 | }
|
---|
872 | }
|
---|
873 | }
|
---|
874 | break;
|
---|
875 | case BERTHS:
|
---|
876 | if (Renderer.zoom >= 14) {
|
---|
877 | Renderer.lineVector(new LineStyle(Symbols.Mline, 6, new float[] { 20, 20 }));
|
---|
878 | Renderer.labelText(name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, LabelStyle.RRCT, Symbols.Mline, Color.white);
|
---|
879 | }
|
---|
880 | break;
|
---|
881 | case BUISGL:
|
---|
882 | if (Renderer.zoom >= 16) {
|
---|
883 | Renderer.lineVector(new LineStyle(Color.black, 8, new Color(0xffc0c0c0, true)));
|
---|
884 | if (testAttribute(Obj.BUISGL, Att.STATUS, StsSTS.STS_ILLD)) {
|
---|
885 | Renderer.symbol(Beacons.Floodlight);
|
---|
886 | }
|
---|
887 | ArrayList<Symbol> symbols = new ArrayList<>();
|
---|
888 | ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttList(Obj.BUISGL, Att.FUNCTN);
|
---|
889 | for (FncFNC fnc : fncs) {
|
---|
890 | symbols.add(Landmarks.Funcs.get(fnc));
|
---|
891 | }
|
---|
892 | if (feature.objs.containsKey(Obj.SMCFAC)) {
|
---|
893 | ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(Obj.SMCFAC, Att.CATSCF);
|
---|
894 | for (CatSCF scf : scfs) {
|
---|
895 | symbols.add(Facilities.Cats.get(scf));
|
---|
896 | }
|
---|
897 | }
|
---|
898 | Renderer.cluster(symbols);
|
---|
899 | Signals.addSignals();
|
---|
900 | }
|
---|
901 | break;
|
---|
902 | case HRBFAC:
|
---|
903 | if (Renderer.zoom >= 12) {
|
---|
904 | ArrayList<CatHAF> cathaf = (ArrayList<CatHAF>) getAttList(Obj.HRBFAC, Att.CATHAF);
|
---|
905 | if (cathaf.size() == 1) {
|
---|
906 | switch (cathaf.get(0)) {
|
---|
907 | case HAF_MRNA:
|
---|
908 | Renderer.symbol(Harbours.Marina);
|
---|
909 | break;
|
---|
910 | case HAF_MANF:
|
---|
911 | Renderer.symbol(Harbours.MarinaNF);
|
---|
912 | break;
|
---|
913 | case HAF_FISH:
|
---|
914 | Renderer.symbol(Harbours.Fishing);
|
---|
915 | break;
|
---|
916 | default:
|
---|
917 | Renderer.symbol(Harbours.Harbour);
|
---|
918 | break;
|
---|
919 | }
|
---|
920 | } else {
|
---|
921 | Renderer.symbol(Harbours.Harbour);
|
---|
922 | }
|
---|
923 | }
|
---|
924 | break;
|
---|
925 | default:
|
---|
926 | break;
|
---|
927 | }
|
---|
928 | }
|
---|
929 |
|
---|
930 | @SuppressWarnings("unchecked")
|
---|
931 | private static void highways() {
|
---|
932 | switch (feature.type) {
|
---|
933 | case ROADWY:
|
---|
934 | ArrayList<CatROD> cat = (ArrayList<CatROD>) getAttList(Obj.ROADWY, Att.CATROD);
|
---|
935 | if (cat.size() > 0) {
|
---|
936 | switch (cat.get(0)) {
|
---|
937 | case ROD_MWAY:
|
---|
938 | Renderer.lineVector(new LineStyle(Color.black, 20));
|
---|
939 | break;
|
---|
940 | case ROD_MAJR:
|
---|
941 | Renderer.lineVector(new LineStyle(Color.black, 15));
|
---|
942 | break;
|
---|
943 | case ROD_MINR:
|
---|
944 | Renderer.lineVector(new LineStyle(Color.black, 10));
|
---|
945 | break;
|
---|
946 | default:
|
---|
947 | Renderer.lineVector(new LineStyle(Color.black, 5));
|
---|
948 | }
|
---|
949 | } else {
|
---|
950 | Renderer.lineVector(new LineStyle(Color.black, 5));
|
---|
951 | }
|
---|
952 | break;
|
---|
953 | case RAILWY:
|
---|
954 | Renderer.lineVector(new LineStyle(Color.gray, 10));
|
---|
955 | Renderer.lineVector(new LineStyle(Color.black, 10, new float[] { 30, 30 }));
|
---|
956 | break;
|
---|
957 | default:
|
---|
958 | }
|
---|
959 | }
|
---|
960 |
|
---|
961 | @SuppressWarnings("unchecked")
|
---|
962 | private static void landmarks() {
|
---|
963 | if (!hasAttribute(Obj.LNDMRK, Att.CATLMK) && (!hasAttribute(Obj.LNDMRK, Att.FUNCTN) || testAttribute(Obj.LNDMRK, Att.FUNCTN, FncFNC.FNC_LGHT)) && hasObject(Obj.LIGHTS)) {
|
---|
964 | lights();
|
---|
965 | addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
|
---|
966 | }
|
---|
967 | else if (Renderer.zoom >= 12) {
|
---|
968 | switch (feature.type) {
|
---|
969 | case LNDMRK:
|
---|
970 | if (testAttribute(Obj.LNDMRK, Att.STATUS, StsSTS.STS_ILLD)) {
|
---|
971 | Renderer.symbol(Beacons.Floodlight);
|
---|
972 | }
|
---|
973 | ArrayList<CatLMK> cats = (ArrayList<CatLMK>) getAttList(feature.type, Att.CATLMK);
|
---|
974 | Symbol catSym = Landmarks.Shapes.get(cats.get(0));
|
---|
975 | ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttList(feature.type, Att.FUNCTN);
|
---|
976 | Symbol fncSym = Landmarks.Funcs.get(fncs.get(0));
|
---|
977 | if ((fncs.get(0) == FncFNC.FNC_CHCH) && (cats.get(0) == CatLMK.LMK_TOWR))
|
---|
978 | catSym = Landmarks.ChurchTower;
|
---|
979 | if (cats.get(0) == CatLMK.LMK_RADR)
|
---|
980 | fncSym = Landmarks.RadioTV;
|
---|
981 | Renderer.symbol(catSym);
|
---|
982 | if (catSym != Landmarks.Spire)
|
---|
983 | Renderer.symbol(fncSym);
|
---|
984 | break;
|
---|
985 | case SILTNK:
|
---|
986 | if (testAttribute(feature.type, Att.CATSIL, CatSIL.SIL_WTRT))
|
---|
987 | Renderer.symbol(Landmarks.WaterTower);
|
---|
988 | break;
|
---|
989 | default:
|
---|
990 | break;
|
---|
991 | }
|
---|
992 | Signals.addSignals();
|
---|
993 | addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
|
---|
994 | }
|
---|
995 | }
|
---|
996 |
|
---|
997 | @SuppressWarnings("unchecked")
|
---|
998 | private static void lights() {
|
---|
999 | boolean ok = false;
|
---|
1000 | switch (feature.type) {
|
---|
1001 | case LITMAJ:
|
---|
1002 | case LNDMRK:
|
---|
1003 | if (Renderer.zoom >= 12) {
|
---|
1004 | Renderer.symbol(Beacons.LightMajor);
|
---|
1005 | ok = true;
|
---|
1006 | }
|
---|
1007 | break;
|
---|
1008 | case LITMIN:
|
---|
1009 | case LIGHTS:
|
---|
1010 | case PILPNT:
|
---|
1011 | if (Renderer.zoom >= 14) {
|
---|
1012 | if (testAttribute(Obj.LIGHTS, Att.CATLIT, CatLIT.LIT_FLDL)) {
|
---|
1013 | Renderer.symbol(Beacons.Floodlight, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(90))));
|
---|
1014 | Renderer.symbol(Harbours.SignalStation);
|
---|
1015 | } else {
|
---|
1016 | Renderer.symbol(Beacons.LightMinor);
|
---|
1017 | }
|
---|
1018 | ok = true;
|
---|
1019 | }
|
---|
1020 | break;
|
---|
1021 | default:
|
---|
1022 | break;
|
---|
1023 | }
|
---|
1024 | if (ok) {
|
---|
1025 | if (feature.objs.containsKey(Obj.TOPMAR)) {
|
---|
1026 | if (testAttribute(Obj.TOPMAR, Att.STATUS, StsSTS.STS_ILLD)) {
|
---|
1027 | Renderer.symbol(Beacons.Floodlight);
|
---|
1028 | }
|
---|
1029 | AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
|
---|
1030 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
1031 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.TOPMAR), Topmarks.LightDelta);
|
---|
1032 | }
|
---|
1033 | } else if (feature.objs.containsKey(Obj.DAYMAR)) {
|
---|
1034 | AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
|
---|
1035 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
1036 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.DAYMAR), Topmarks.LightDelta);
|
---|
1037 | }
|
---|
1038 | }
|
---|
1039 | Signals.addSignals();
|
---|
1040 | }
|
---|
1041 | }
|
---|
1042 |
|
---|
1043 | @SuppressWarnings("unchecked")
|
---|
1044 | private static void marinas() {
|
---|
1045 | if (Renderer.zoom >= 16) {
|
---|
1046 | ArrayList<Symbol> symbols = new ArrayList<>();
|
---|
1047 | ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(Obj.SMCFAC, Att.CATSCF);
|
---|
1048 | for (CatSCF scf : scfs) {
|
---|
1049 | symbols.add(Facilities.Cats.get(scf));
|
---|
1050 | }
|
---|
1051 | Renderer.cluster(symbols);
|
---|
1052 | }
|
---|
1053 | }
|
---|
1054 |
|
---|
1055 | private static void moorings() {
|
---|
1056 | if (Renderer.zoom >= 14) {
|
---|
1057 | switch ((CatMOR) getAttEnum(feature.type, Att.CATMOR)) {
|
---|
1058 | case MOR_DLPN:
|
---|
1059 | Renderer.symbol(Harbours.Dolphin);
|
---|
1060 | Signals.addSignals();
|
---|
1061 | break;
|
---|
1062 | case MOR_DDPN:
|
---|
1063 | Renderer.symbol(Harbours.DeviationDolphin);
|
---|
1064 | Signals.addSignals();
|
---|
1065 | break;
|
---|
1066 | case MOR_BLRD:
|
---|
1067 | case MOR_POST:
|
---|
1068 | Renderer.symbol(Harbours.Bollard);
|
---|
1069 | break;
|
---|
1070 | case MOR_BUOY:
|
---|
1071 | if (Renderer.zoom >= 17) {
|
---|
1072 | BoySHP shape = (BoySHP) getAttEnum(feature.type, Att.BOYSHP);
|
---|
1073 | if (shape == BoySHP.BOY_UNKN) {
|
---|
1074 | shape = BoySHP.BOY_SPHR;
|
---|
1075 | }
|
---|
1076 | Renderer.symbol(Buoys.Shapes.get(shape), getScheme(feature.type));
|
---|
1077 | Renderer.symbol(Topmarks.TopMooring, Topmarks.BuoyDeltas.get(shape));
|
---|
1078 | }
|
---|
1079 | break;
|
---|
1080 | default:
|
---|
1081 | break;
|
---|
1082 | }
|
---|
1083 | }
|
---|
1084 | }
|
---|
1085 |
|
---|
1086 | @SuppressWarnings("unchecked")
|
---|
1087 | private static void notices() {
|
---|
1088 | if (Renderer.zoom >= 14) {
|
---|
1089 | double dx = 0.0, dy = 0.0;
|
---|
1090 | switch (feature.type) {
|
---|
1091 | case BCNCAR:
|
---|
1092 | case BCNISD:
|
---|
1093 | case BCNLAT:
|
---|
1094 | case BCNSAW:
|
---|
1095 | case BCNSPP:
|
---|
1096 | if (testAttribute(Obj.TOPMAR, Att.TOPSHP, TopSHP.TOP_BORD) || testAttribute(Obj.DAYMAR, Att.TOPSHP, TopSHP.TOP_BORD)) {
|
---|
1097 | dy = -100.0;
|
---|
1098 | } else {
|
---|
1099 | dy = -45.0;
|
---|
1100 | }
|
---|
1101 | break;
|
---|
1102 | case NOTMRK:
|
---|
1103 | dy = 0.0;
|
---|
1104 | break;
|
---|
1105 | default:
|
---|
1106 | return;
|
---|
1107 | }
|
---|
1108 | MarSYS sys = MarSYS.SYS_CEVN;
|
---|
1109 | BnkWTW bnk = BnkWTW.BWW_UNKN;
|
---|
1110 | AttVal<?> att = feature.atts.get(Att.MARSYS);
|
---|
1111 | if (att != null)
|
---|
1112 | sys = (MarSYS) att.val;
|
---|
1113 | att = feature.atts.get(Att.BNKWTW);
|
---|
1114 | if (att != null)
|
---|
1115 | bnk = (BnkWTW) att.val;
|
---|
1116 | ObjTab objs = feature.objs.get(Obj.NOTMRK);
|
---|
1117 | int n = objs.size();
|
---|
1118 | if (n > 5) {
|
---|
1119 | Renderer.symbol(Notices.Notice, new Delta(Handle.CC, AffineTransform.getTranslateInstance(dx, dy)));
|
---|
1120 | } else {
|
---|
1121 | int i = 0;
|
---|
1122 | for (AttMap atts : objs.values()) {
|
---|
1123 | if (atts.get(Att.MARSYS) != null)
|
---|
1124 | sys = ((ArrayList<MarSYS>) atts.get(Att.MARSYS).val).get(0);
|
---|
1125 | if (atts.get(Att.BNKWTW) != null)
|
---|
1126 | bnk = ((ArrayList<BnkWTW>) atts.get(Att.BNKWTW).val).get(0);
|
---|
1127 | CatNMK cat = CatNMK.NMK_UNKN;
|
---|
1128 | if (atts.get(Att.CATNMK) != null)
|
---|
1129 | cat = ((ArrayList<CatNMK>) atts.get(Att.CATNMK).val).get(0);
|
---|
1130 | Symbol sym = Notices.getNotice(cat, sys, bnk);
|
---|
1131 | Scheme sch = Notices.getScheme(sys, bnk);
|
---|
1132 | ArrayList<AddMRK> add = new ArrayList<>();
|
---|
1133 | if (atts.get(Att.ADDMRK) != null)
|
---|
1134 | add = (ArrayList<AddMRK>) atts.get(Att.ADDMRK).val;
|
---|
1135 | Handle h = Handle.CC;
|
---|
1136 | double ax = 0.0;
|
---|
1137 | double ay = 0.0;
|
---|
1138 | switch (i) {
|
---|
1139 | case 0:
|
---|
1140 | if (n != 1)
|
---|
1141 | h = null;
|
---|
1142 | break;
|
---|
1143 | case 1:
|
---|
1144 | if (n <= 3) {
|
---|
1145 | h = Handle.RC;
|
---|
1146 | ax = -30;
|
---|
1147 | ay = dy;
|
---|
1148 | } else {
|
---|
1149 | h = Handle.BR;
|
---|
1150 | }
|
---|
1151 | break;
|
---|
1152 | case 2:
|
---|
1153 | if (n <= 3)
|
---|
1154 | h = Handle.LC;
|
---|
1155 | else
|
---|
1156 | h = Handle.BL;
|
---|
1157 | break;
|
---|
1158 | case 3:
|
---|
1159 | if (n == 4)
|
---|
1160 | h = Handle.TC;
|
---|
1161 | else
|
---|
1162 | h = Handle.TR;
|
---|
1163 | break;
|
---|
1164 | case 4:
|
---|
1165 | h = Handle.TL;
|
---|
1166 | break;
|
---|
1167 | }
|
---|
1168 | if (h != null) {
|
---|
1169 | Renderer.symbol(sym, sch, new Delta(h, AffineTransform.getTranslateInstance(dx, dy)));
|
---|
1170 | if (!add.isEmpty())
|
---|
1171 | Renderer.symbol(Notices.NoticeBoard, new Delta(Handle.BC, AffineTransform.getTranslateInstance(ax, ay - 30)));
|
---|
1172 | }
|
---|
1173 | i++;
|
---|
1174 | }
|
---|
1175 | }
|
---|
1176 | }
|
---|
1177 | }
|
---|
1178 |
|
---|
1179 | private static void obstructions() {
|
---|
1180 | if ((Renderer.zoom >= 12) && (feature.type == Obj.OBSTRN)) {
|
---|
1181 | if (getAttEnum(feature.type, Att.CATOBS) == CatOBS.OBS_BOOM) {
|
---|
1182 | Renderer.lineVector(new LineStyle(Color.black, 5, new float[] { 20, 20 }, null));
|
---|
1183 | if (Renderer.zoom >= 15) {
|
---|
1184 | Renderer.lineText("Boom", new Font("Arial", Font.PLAIN, 40), Color.black, -20);
|
---|
1185 | }
|
---|
1186 | }
|
---|
1187 | }
|
---|
1188 | if ((Renderer.zoom >= 14) && (feature.type == Obj.UWTROC)) {
|
---|
1189 | switch ((WatLEV) getAttEnum(feature.type, Att.WATLEV)) {
|
---|
1190 | case LEV_CVRS:
|
---|
1191 | Renderer.symbol(Areas.RockC);
|
---|
1192 | break;
|
---|
1193 | case LEV_AWSH:
|
---|
1194 | Renderer.symbol(Areas.RockA);
|
---|
1195 | break;
|
---|
1196 | default:
|
---|
1197 | Renderer.symbol(Areas.Rock);
|
---|
1198 | }
|
---|
1199 | }
|
---|
1200 | }
|
---|
1201 |
|
---|
1202 | private static void pipelines() {
|
---|
1203 | if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) {
|
---|
1204 | if (feature.type == Obj.PIPSOL) {
|
---|
1205 | Renderer.lineSymbols(Areas.Pipeline, 0.33, null, null, 0, Symbols.Mline);
|
---|
1206 | } else if (feature.type == Obj.PIPOHD) {
|
---|
1207 | Renderer.lineVector(new LineStyle(Color.black, 8));
|
---|
1208 | AttMap atts = feature.atts;
|
---|
1209 | double verclr = 0;
|
---|
1210 | if (atts != null) {
|
---|
1211 | if (atts.containsKey(Att.VERCLR)) {
|
---|
1212 | verclr = (Double) atts.get(Att.VERCLR).val;
|
---|
1213 | } else {
|
---|
1214 | verclr = atts.containsKey(Att.VERCSA) ? (Double) atts.get(Att.VERCSA).val : 0;
|
---|
1215 | }
|
---|
1216 | if (verclr > 0) {
|
---|
1217 | Renderer.labelText(String.valueOf(verclr), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 25)));
|
---|
1218 | }
|
---|
1219 | }
|
---|
1220 | }
|
---|
1221 | }
|
---|
1222 | }
|
---|
1223 |
|
---|
1224 | @SuppressWarnings("unchecked")
|
---|
1225 | private static void platforms() {
|
---|
1226 | ArrayList<CatOFP> cats = (ArrayList<CatOFP>) getAttList(Obj.OFSPLF, Att.CATOFP);
|
---|
1227 | if (cats.get(0) == CatOFP.OFP_FPSO)
|
---|
1228 | Renderer.symbol(Buoys.Storage);
|
---|
1229 | else
|
---|
1230 | Renderer.symbol(Landmarks.Platform);
|
---|
1231 | if (testAttribute(feature.type, Att.STATUS, StsSTS.STS_ILLD)) {
|
---|
1232 | Renderer.symbol(Beacons.Floodlight);
|
---|
1233 | }
|
---|
1234 | addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
|
---|
1235 | Signals.addSignals();
|
---|
1236 | }
|
---|
1237 |
|
---|
1238 | @SuppressWarnings("unchecked")
|
---|
1239 | private static void points() {
|
---|
1240 | boolean ok = false;
|
---|
1241 | switch (feature.type) {
|
---|
1242 | case FOGSIG:
|
---|
1243 | if (Renderer.zoom >= 12) {
|
---|
1244 | if (feature.objs.containsKey(Obj.LIGHTS))
|
---|
1245 | lights();
|
---|
1246 | else
|
---|
1247 | Renderer.symbol(Harbours.Post);
|
---|
1248 | ok = true;
|
---|
1249 | }
|
---|
1250 | break;
|
---|
1251 | default:
|
---|
1252 | if (Renderer.zoom >= 14) {
|
---|
1253 | if (testAttribute(feature.type, Att.STATUS, StsSTS.STS_ILLD)) {
|
---|
1254 | Renderer.symbol(Beacons.Floodlight);
|
---|
1255 | }
|
---|
1256 | if (feature.objs.containsKey(Obj.LIGHTS))
|
---|
1257 | lights();
|
---|
1258 | else
|
---|
1259 | Renderer.symbol(Harbours.Post);
|
---|
1260 | ok = true;
|
---|
1261 | }
|
---|
1262 | break;
|
---|
1263 | }
|
---|
1264 | if (ok) {
|
---|
1265 | if (feature.objs.containsKey(Obj.TOPMAR)) {
|
---|
1266 | AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
|
---|
1267 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
1268 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.TOPMAR), null);
|
---|
1269 | }
|
---|
1270 | } else if (feature.objs.containsKey(Obj.DAYMAR)) {
|
---|
1271 | AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
|
---|
1272 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
1273 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.DAYMAR), null);
|
---|
1274 | }
|
---|
1275 | }
|
---|
1276 | Signals.addSignals();
|
---|
1277 | }
|
---|
1278 | }
|
---|
1279 |
|
---|
1280 | private static void ports() {
|
---|
1281 | if (Renderer.zoom >= 14) {
|
---|
1282 | if (feature.type == Obj.CRANES) {
|
---|
1283 | if ((CatCRN) getAttEnum(feature.type, Att.CATCRN) == CatCRN.CRN_CONT)
|
---|
1284 | Renderer.symbol(Harbours.ContainerCrane);
|
---|
1285 | else
|
---|
1286 | Renderer.symbol(Harbours.PortCrane);
|
---|
1287 | } else if (feature.type == Obj.HULKES) {
|
---|
1288 | Renderer.lineVector(new LineStyle(Color.black, 4, null, new Color(0xffe000)));
|
---|
1289 | addName(15, new Font("Arial", Font.BOLD, 40));
|
---|
1290 | }
|
---|
1291 | }
|
---|
1292 | }
|
---|
1293 |
|
---|
1294 | private static void separation() {
|
---|
1295 | switch (feature.type) {
|
---|
1296 | case TSEZNE:
|
---|
1297 | case TSSCRS:
|
---|
1298 | case TSSRON:
|
---|
1299 | if (Renderer.zoom <= 15)
|
---|
1300 | Renderer.lineVector(new LineStyle(Symbols.Mtss));
|
---|
1301 | else
|
---|
1302 | Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, null, null));
|
---|
1303 | addName(10, new Font("Arial", Font.BOLD, 150), Symbols.Mline);
|
---|
1304 | break;
|
---|
1305 | case TSELNE:
|
---|
1306 | Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, null, null));
|
---|
1307 | break;
|
---|
1308 | case TSSLPT:
|
---|
1309 | Renderer.lineSymbols(Areas.LaneArrow, 0.5, null, null, 0, Symbols.Mtss);
|
---|
1310 | break;
|
---|
1311 | case TSSBND:
|
---|
1312 | Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, new float[] { 40, 40 }, null));
|
---|
1313 | break;
|
---|
1314 | case ISTZNE:
|
---|
1315 | Renderer.lineSymbols(Areas.Restricted, 1.0, null, null, 0, Symbols.Mtss);
|
---|
1316 | break;
|
---|
1317 | default:
|
---|
1318 | break;
|
---|
1319 | }
|
---|
1320 | }
|
---|
1321 |
|
---|
1322 | @SuppressWarnings("unchecked")
|
---|
1323 | private static void shoreline() {
|
---|
1324 | CatSLC cat = (CatSLC) getAttEnum(feature.type, Att.CATSLC);
|
---|
1325 | if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.BASE)) {
|
---|
1326 | if ((cat != CatSLC.SLC_SWAY) && (cat != CatSLC.SLC_TWAL)) {
|
---|
1327 | if (Renderer.zoom >= 12) {
|
---|
1328 | Renderer.lineVector(new LineStyle(Color.black, 10, Symbols.Yland));
|
---|
1329 | } else {
|
---|
1330 | Renderer.lineVector(new LineStyle(Symbols.Yland));
|
---|
1331 | }
|
---|
1332 | }
|
---|
1333 | }
|
---|
1334 | if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.SEAMARK)) {
|
---|
1335 | if (Renderer.zoom >= 12) {
|
---|
1336 | switch (cat) {
|
---|
1337 | case SLC_TWAL:
|
---|
1338 | WatLEV lev = (WatLEV) getAttEnum(feature.type, Att.WATLEV);
|
---|
1339 | if (lev == WatLEV.LEV_CVRS) {
|
---|
1340 | Renderer.lineVector(new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
|
---|
1341 | if (Renderer.zoom >= 15)
|
---|
1342 | Renderer.lineText("(covers)", new Font("Arial", Font.PLAIN, 60), Color.black, 80);
|
---|
1343 | } else {
|
---|
1344 | Renderer.lineVector(new LineStyle(Color.black, 10, null, null));
|
---|
1345 | }
|
---|
1346 | if (Renderer.zoom >= 15)
|
---|
1347 | Renderer.lineText("Training Wall", new Font("Arial", Font.PLAIN, 60), Color.black, -30);
|
---|
1348 | break;
|
---|
1349 | case SLC_SWAY:
|
---|
1350 | Renderer.lineVector(new LineStyle(Color.black, 2, null, new Color(0xffe000)));
|
---|
1351 | if ((Renderer.zoom >= 16) && feature.objs.containsKey(Obj.SMCFAC)) {
|
---|
1352 | ArrayList<Symbol> symbols = new ArrayList<>();
|
---|
1353 | ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(Obj.SMCFAC, Att.CATSCF);
|
---|
1354 | for (CatSCF scf : scfs) {
|
---|
1355 | symbols.add(Facilities.Cats.get(scf));
|
---|
1356 | }
|
---|
1357 | Renderer.cluster(symbols);
|
---|
1358 | }
|
---|
1359 | break;
|
---|
1360 | default:
|
---|
1361 | break;
|
---|
1362 | }
|
---|
1363 | }
|
---|
1364 | }
|
---|
1365 | }
|
---|
1366 |
|
---|
1367 | @SuppressWarnings("unchecked")
|
---|
1368 | private static void stations() {
|
---|
1369 | if (Renderer.zoom >= 14) {
|
---|
1370 | String str = "";
|
---|
1371 | switch (feature.type) {
|
---|
1372 | case SISTAT:
|
---|
1373 | Renderer.symbol(Harbours.SignalStation);
|
---|
1374 | str = "SS";
|
---|
1375 | ArrayList<CatSIT> tcats = (ArrayList<CatSIT>) getAttList(Obj.SISTAT, Att.CATSIT);
|
---|
1376 | switch (tcats.get(0)) {
|
---|
1377 | case SIT_IPT:
|
---|
1378 | str += "(INT)";
|
---|
1379 | break;
|
---|
1380 | case SIT_PRTE:
|
---|
1381 | str += "(Traffic)";
|
---|
1382 | break;
|
---|
1383 | case SIT_PRTC:
|
---|
1384 | str += "(Port Control)";
|
---|
1385 | break;
|
---|
1386 | case SIT_LOCK:
|
---|
1387 | str += "(Lock)";
|
---|
1388 | break;
|
---|
1389 | case SIT_BRDG:
|
---|
1390 | str += "(Bridge)";
|
---|
1391 | break;
|
---|
1392 | default:
|
---|
1393 | break;
|
---|
1394 | }
|
---|
1395 | break;
|
---|
1396 | case SISTAW:
|
---|
1397 | Renderer.symbol(Harbours.SignalStation);
|
---|
1398 | str = "SS";
|
---|
1399 | str = "SS";
|
---|
1400 | ArrayList<CatSIW> wcats = (ArrayList<CatSIW>) getAttList(Obj.SISTAW, Att.CATSIW);
|
---|
1401 | switch (wcats.get(0)) {
|
---|
1402 | case SIW_STRM:
|
---|
1403 | str += "(Storm)";
|
---|
1404 | break;
|
---|
1405 | case SIW_WTHR:
|
---|
1406 | str += "(Weather)";
|
---|
1407 | break;
|
---|
1408 | case SIW_ICE:
|
---|
1409 | str += "(Ice)";
|
---|
1410 | break;
|
---|
1411 | case SIW_TIDG:
|
---|
1412 | str = "Tide gauge";
|
---|
1413 | break;
|
---|
1414 | case SIW_TIDS:
|
---|
1415 | str = "Tide scale";
|
---|
1416 | break;
|
---|
1417 | case SIW_TIDE:
|
---|
1418 | str += "(Tide)";
|
---|
1419 | break;
|
---|
1420 | case SIW_TSTR:
|
---|
1421 | str += "(Stream)";
|
---|
1422 | break;
|
---|
1423 | case SIW_DNGR:
|
---|
1424 | str += "(Danger)";
|
---|
1425 | break;
|
---|
1426 | case SIW_MILY:
|
---|
1427 | str += "(Firing)";
|
---|
1428 | break;
|
---|
1429 | case SIW_TIME:
|
---|
1430 | str += "(Time)";
|
---|
1431 | break;
|
---|
1432 | default:
|
---|
1433 | break;
|
---|
1434 | }
|
---|
1435 | break;
|
---|
1436 | case RDOSTA:
|
---|
1437 | case RTPBCN:
|
---|
1438 | Renderer.symbol(Harbours.SignalStation);
|
---|
1439 | Renderer.symbol(Beacons.RadarStation);
|
---|
1440 | break;
|
---|
1441 | case RADRFL:
|
---|
1442 | Renderer.symbol(Topmarks.RadarReflector);
|
---|
1443 | break;
|
---|
1444 | case RADSTA:
|
---|
1445 | Renderer.symbol(Harbours.SignalStation);
|
---|
1446 | Renderer.symbol(Beacons.RadarStation);
|
---|
1447 | Renderer.labelText("Ra", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70)));
|
---|
1448 | break;
|
---|
1449 | case PILBOP:
|
---|
1450 | Renderer.symbol(Harbours.Pilot);
|
---|
1451 | addName(15, new Font("Arial", Font.BOLD, 40), Symbols.Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40)));
|
---|
1452 | CatPIL cat = (CatPIL) getAttEnum(feature.type, Att.CATPIL);
|
---|
1453 | if (cat == CatPIL.PIL_HELI) {
|
---|
1454 | Renderer.labelText("H", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
|
---|
1455 | }
|
---|
1456 | break;
|
---|
1457 | case CGUSTA:
|
---|
1458 | Renderer.symbol(Harbours.SignalStation);
|
---|
1459 | str = "CG";
|
---|
1460 | if (feature.objs.containsKey(Obj.RSCSTA))
|
---|
1461 | Renderer.symbol(Harbours.Rescue, new Delta(Handle.CC, AffineTransform.getTranslateInstance(130, 0)));
|
---|
1462 | break;
|
---|
1463 | case RSCSTA:
|
---|
1464 | Renderer.symbol(Harbours.Rescue);
|
---|
1465 | break;
|
---|
1466 | default:
|
---|
1467 | break;
|
---|
1468 | }
|
---|
1469 | if ((Renderer.zoom >= 15) && !str.isEmpty()) {
|
---|
1470 | Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.LC, AffineTransform.getTranslateInstance(40, 0)));
|
---|
1471 | }
|
---|
1472 | Signals.addSignals();
|
---|
1473 | }
|
---|
1474 | }
|
---|
1475 |
|
---|
1476 | private static void transits() {
|
---|
1477 | if (Renderer.zoom >= 14) {
|
---|
1478 | if (feature.type == Obj.RECTRC)
|
---|
1479 | Renderer.lineVector(new LineStyle(Color.black, 5, null, null));
|
---|
1480 | else if (feature.type == Obj.NAVLNE)
|
---|
1481 | Renderer.lineVector(new LineStyle(Color.black, 5, new float[] { 25, 25 }, null));
|
---|
1482 | }
|
---|
1483 | if (Renderer.zoom >= 15) {
|
---|
1484 | String str = "";
|
---|
1485 | String name = getName();
|
---|
1486 | if (name != null)
|
---|
1487 | str += name + " ";
|
---|
1488 | Double ort;
|
---|
1489 | if ((ort = (Double) getAttVal(feature.type, Att.ORIENT)) != null) {
|
---|
1490 | str += df.format(ort) + "º";
|
---|
1491 | if (!str.isEmpty())
|
---|
1492 | Renderer.lineText(str, new Font("Arial", Font.PLAIN, 40), Color.black, -20);
|
---|
1493 | }
|
---|
1494 | }
|
---|
1495 | }
|
---|
1496 |
|
---|
1497 | @SuppressWarnings("unchecked")
|
---|
1498 | private static void virtual() {
|
---|
1499 | if (Renderer.zoom >= 12) {
|
---|
1500 | Renderer.symbol(Harbours.SignalStation, new Scheme(Symbols.Msymb));
|
---|
1501 | Renderer.symbol(Beacons.RadarStation, new Scheme(Symbols.Msymb));
|
---|
1502 | ArrayList<CatVAN> cats = (ArrayList<CatVAN>) getAttList(Obj.VAATON, Att.CATVAN);
|
---|
1503 | for (CatVAN van : cats) {
|
---|
1504 | switch (van) {
|
---|
1505 | case VAN_NCAR:
|
---|
1506 | Renderer.symbol(Topmarks.TopNorth, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1507 | break;
|
---|
1508 | case VAN_SCAR:
|
---|
1509 | Renderer.symbol(Topmarks.TopSouth, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1510 | break;
|
---|
1511 | case VAN_ECAR:
|
---|
1512 | Renderer.symbol(Topmarks.TopEast, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1513 | break;
|
---|
1514 | case VAN_WCAR:
|
---|
1515 | Renderer.symbol(Topmarks.TopWest, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1516 | break;
|
---|
1517 | case VAN_PLAT:
|
---|
1518 | case VAN_PCHS:
|
---|
1519 | Renderer.symbol(Topmarks.TopCan, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1520 | break;
|
---|
1521 | case VAN_SLAT:
|
---|
1522 | case VAN_PCHP:
|
---|
1523 | Renderer.symbol(Topmarks.TopCone, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1524 | break;
|
---|
1525 | case VAN_IDGR:
|
---|
1526 | Renderer.symbol(Topmarks.TopIsol, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1527 | break;
|
---|
1528 | case VAN_SAFW:
|
---|
1529 | Renderer.symbol(Topmarks.TopSphere, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1530 | break;
|
---|
1531 | case VAN_SPPM:
|
---|
1532 | Renderer.symbol(Topmarks.TopX, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1533 | break;
|
---|
1534 | case VAN_WREK:
|
---|
1535 | Renderer.symbol(Topmarks.TopCross, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1536 | break;
|
---|
1537 | default:
|
---|
1538 | break;
|
---|
1539 | }
|
---|
1540 | }
|
---|
1541 | }
|
---|
1542 | if (Renderer.zoom >= 15) {
|
---|
1543 | Renderer.labelText("V-AIS", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
|
---|
1544 | }
|
---|
1545 | }
|
---|
1546 |
|
---|
1547 | private static void waterways() {
|
---|
1548 | Renderer.lineVector(new LineStyle(Symbols.Bwater, 20, (feature.geom.prim == Pflag.AREA) ? Symbols.Bwater : null));
|
---|
1549 | }
|
---|
1550 |
|
---|
1551 | private static void wrecks() {
|
---|
1552 | if (Renderer.zoom >= 14) {
|
---|
1553 | switch ((CatWRK) getAttEnum(feature.type, Att.CATWRK)) {
|
---|
1554 | case WRK_DNGR:
|
---|
1555 | case WRK_MSTS:
|
---|
1556 | Renderer.symbol(Areas.WreckD);
|
---|
1557 | break;
|
---|
1558 | case WRK_HULS:
|
---|
1559 | Renderer.symbol(Areas.WreckS);
|
---|
1560 | break;
|
---|
1561 | default:
|
---|
1562 | Renderer.symbol(Areas.WreckND);
|
---|
1563 | }
|
---|
1564 | }
|
---|
1565 | }
|
---|
1566 | }
|
---|