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 | Renderer.symbol(Beacons.LightMajor);
|
---|
1004 | if (Renderer.zoom >= 12) {
|
---|
1005 | ok = true;
|
---|
1006 | } else {
|
---|
1007 | Signals.lights();
|
---|
1008 | }
|
---|
1009 | break;
|
---|
1010 | case LITMIN:
|
---|
1011 | case LIGHTS:
|
---|
1012 | case PILPNT:
|
---|
1013 | if (Renderer.zoom >= 14) {
|
---|
1014 | if (testAttribute(Obj.LIGHTS, Att.CATLIT, CatLIT.LIT_FLDL)) {
|
---|
1015 | Renderer.symbol(Beacons.Floodlight, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(90))));
|
---|
1016 | Renderer.symbol(Harbours.SignalStation);
|
---|
1017 | } else {
|
---|
1018 | Renderer.symbol(Beacons.LightMinor);
|
---|
1019 | }
|
---|
1020 | ok = true;
|
---|
1021 | }
|
---|
1022 | break;
|
---|
1023 | default:
|
---|
1024 | break;
|
---|
1025 | }
|
---|
1026 | if (ok) {
|
---|
1027 | if (feature.objs.containsKey(Obj.TOPMAR)) {
|
---|
1028 | if (testAttribute(Obj.TOPMAR, Att.STATUS, StsSTS.STS_ILLD)) {
|
---|
1029 | Renderer.symbol(Beacons.Floodlight);
|
---|
1030 | }
|
---|
1031 | AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
|
---|
1032 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
1033 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.TOPMAR), Topmarks.LightDelta);
|
---|
1034 | }
|
---|
1035 | } else if (feature.objs.containsKey(Obj.DAYMAR)) {
|
---|
1036 | AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
|
---|
1037 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
1038 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.DAYMAR), Topmarks.LightDelta);
|
---|
1039 | }
|
---|
1040 | }
|
---|
1041 | Signals.addSignals();
|
---|
1042 | addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -50)));
|
---|
1043 | }
|
---|
1044 | }
|
---|
1045 |
|
---|
1046 | @SuppressWarnings("unchecked")
|
---|
1047 | private static void marinas() {
|
---|
1048 | if (Renderer.zoom >= 16) {
|
---|
1049 | ArrayList<Symbol> symbols = new ArrayList<>();
|
---|
1050 | ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(Obj.SMCFAC, Att.CATSCF);
|
---|
1051 | for (CatSCF scf : scfs) {
|
---|
1052 | symbols.add(Facilities.Cats.get(scf));
|
---|
1053 | }
|
---|
1054 | Renderer.cluster(symbols);
|
---|
1055 | }
|
---|
1056 | }
|
---|
1057 |
|
---|
1058 | private static void moorings() {
|
---|
1059 | if (Renderer.zoom >= 14) {
|
---|
1060 | switch ((CatMOR) getAttEnum(feature.type, Att.CATMOR)) {
|
---|
1061 | case MOR_DLPN:
|
---|
1062 | Renderer.symbol(Harbours.Dolphin);
|
---|
1063 | Signals.addSignals();
|
---|
1064 | break;
|
---|
1065 | case MOR_DDPN:
|
---|
1066 | Renderer.symbol(Harbours.DeviationDolphin);
|
---|
1067 | Signals.addSignals();
|
---|
1068 | break;
|
---|
1069 | case MOR_BLRD:
|
---|
1070 | case MOR_POST:
|
---|
1071 | Renderer.symbol(Harbours.Bollard);
|
---|
1072 | break;
|
---|
1073 | case MOR_BUOY:
|
---|
1074 | if (Renderer.zoom >= 17) {
|
---|
1075 | BoySHP shape = (BoySHP) getAttEnum(feature.type, Att.BOYSHP);
|
---|
1076 | if (shape == BoySHP.BOY_UNKN) {
|
---|
1077 | shape = BoySHP.BOY_SPHR;
|
---|
1078 | }
|
---|
1079 | Renderer.symbol(Buoys.Shapes.get(shape), getScheme(feature.type));
|
---|
1080 | Renderer.symbol(Topmarks.TopMooring, Topmarks.BuoyDeltas.get(shape));
|
---|
1081 | }
|
---|
1082 | break;
|
---|
1083 | default:
|
---|
1084 | break;
|
---|
1085 | }
|
---|
1086 | }
|
---|
1087 | }
|
---|
1088 |
|
---|
1089 | @SuppressWarnings("unchecked")
|
---|
1090 | private static void notices() {
|
---|
1091 | if (Renderer.zoom >= 14) {
|
---|
1092 | double dx = 0.0, dy = 0.0;
|
---|
1093 | switch (feature.type) {
|
---|
1094 | case BCNCAR:
|
---|
1095 | case BCNISD:
|
---|
1096 | case BCNLAT:
|
---|
1097 | case BCNSAW:
|
---|
1098 | case BCNSPP:
|
---|
1099 | if (testAttribute(Obj.TOPMAR, Att.TOPSHP, TopSHP.TOP_BORD) || testAttribute(Obj.DAYMAR, Att.TOPSHP, TopSHP.TOP_BORD)) {
|
---|
1100 | dy = -100.0;
|
---|
1101 | } else {
|
---|
1102 | dy = -45.0;
|
---|
1103 | }
|
---|
1104 | break;
|
---|
1105 | case NOTMRK:
|
---|
1106 | dy = 0.0;
|
---|
1107 | break;
|
---|
1108 | default:
|
---|
1109 | return;
|
---|
1110 | }
|
---|
1111 | MarSYS sys = MarSYS.SYS_CEVN;
|
---|
1112 | BnkWTW bnk = BnkWTW.BWW_UNKN;
|
---|
1113 | AttVal<?> att = feature.atts.get(Att.MARSYS);
|
---|
1114 | if (att != null)
|
---|
1115 | sys = (MarSYS) att.val;
|
---|
1116 | att = feature.atts.get(Att.BNKWTW);
|
---|
1117 | if (att != null)
|
---|
1118 | bnk = (BnkWTW) att.val;
|
---|
1119 | ObjTab objs = feature.objs.get(Obj.NOTMRK);
|
---|
1120 | int n = objs.size();
|
---|
1121 | if (n > 5) {
|
---|
1122 | Renderer.symbol(Notices.Notice, new Delta(Handle.CC, AffineTransform.getTranslateInstance(dx, dy)));
|
---|
1123 | } else {
|
---|
1124 | int i = 0;
|
---|
1125 | for (AttMap atts : objs.values()) {
|
---|
1126 | if (atts.get(Att.MARSYS) != null)
|
---|
1127 | sys = ((ArrayList<MarSYS>) atts.get(Att.MARSYS).val).get(0);
|
---|
1128 | if (atts.get(Att.BNKWTW) != null)
|
---|
1129 | bnk = ((ArrayList<BnkWTW>) atts.get(Att.BNKWTW).val).get(0);
|
---|
1130 | CatNMK cat = CatNMK.NMK_UNKN;
|
---|
1131 | if (atts.get(Att.CATNMK) != null)
|
---|
1132 | cat = ((ArrayList<CatNMK>) atts.get(Att.CATNMK).val).get(0);
|
---|
1133 | Symbol sym = Notices.getNotice(cat, sys, bnk);
|
---|
1134 | Scheme sch = Notices.getScheme(sys, bnk);
|
---|
1135 | ArrayList<AddMRK> add = new ArrayList<>();
|
---|
1136 | if (atts.get(Att.ADDMRK) != null)
|
---|
1137 | add = (ArrayList<AddMRK>) atts.get(Att.ADDMRK).val;
|
---|
1138 | Handle h = Handle.CC;
|
---|
1139 | double ax = 0.0;
|
---|
1140 | double ay = 0.0;
|
---|
1141 | switch (i) {
|
---|
1142 | case 0:
|
---|
1143 | if (n != 1)
|
---|
1144 | h = null;
|
---|
1145 | break;
|
---|
1146 | case 1:
|
---|
1147 | if (n <= 3) {
|
---|
1148 | h = Handle.RC;
|
---|
1149 | ax = -30;
|
---|
1150 | ay = dy;
|
---|
1151 | } else {
|
---|
1152 | h = Handle.BR;
|
---|
1153 | }
|
---|
1154 | break;
|
---|
1155 | case 2:
|
---|
1156 | if (n <= 3)
|
---|
1157 | h = Handle.LC;
|
---|
1158 | else
|
---|
1159 | h = Handle.BL;
|
---|
1160 | break;
|
---|
1161 | case 3:
|
---|
1162 | if (n == 4)
|
---|
1163 | h = Handle.TC;
|
---|
1164 | else
|
---|
1165 | h = Handle.TR;
|
---|
1166 | break;
|
---|
1167 | case 4:
|
---|
1168 | h = Handle.TL;
|
---|
1169 | break;
|
---|
1170 | }
|
---|
1171 | if (h != null) {
|
---|
1172 | Renderer.symbol(sym, sch, new Delta(h, AffineTransform.getTranslateInstance(dx, dy)));
|
---|
1173 | if (!add.isEmpty())
|
---|
1174 | Renderer.symbol(Notices.NoticeBoard, new Delta(Handle.BC, AffineTransform.getTranslateInstance(ax, ay - 30)));
|
---|
1175 | }
|
---|
1176 | i++;
|
---|
1177 | }
|
---|
1178 | }
|
---|
1179 | }
|
---|
1180 | }
|
---|
1181 |
|
---|
1182 | private static void obstructions() {
|
---|
1183 | if ((Renderer.zoom >= 12) && (feature.type == Obj.OBSTRN)) {
|
---|
1184 | if (getAttEnum(feature.type, Att.CATOBS) == CatOBS.OBS_BOOM) {
|
---|
1185 | Renderer.lineVector(new LineStyle(Color.black, 5, new float[] { 20, 20 }, null));
|
---|
1186 | if (Renderer.zoom >= 15) {
|
---|
1187 | Renderer.lineText("Boom", new Font("Arial", Font.PLAIN, 40), Color.black, -20);
|
---|
1188 | }
|
---|
1189 | }
|
---|
1190 | }
|
---|
1191 | if ((Renderer.zoom >= 14) && (feature.type == Obj.UWTROC)) {
|
---|
1192 | switch ((WatLEV) getAttEnum(feature.type, Att.WATLEV)) {
|
---|
1193 | case LEV_CVRS:
|
---|
1194 | Renderer.symbol(Areas.RockC);
|
---|
1195 | break;
|
---|
1196 | case LEV_AWSH:
|
---|
1197 | Renderer.symbol(Areas.RockA);
|
---|
1198 | break;
|
---|
1199 | default:
|
---|
1200 | Renderer.symbol(Areas.Rock);
|
---|
1201 | }
|
---|
1202 | }
|
---|
1203 | }
|
---|
1204 |
|
---|
1205 | private static void pipelines() {
|
---|
1206 | if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) {
|
---|
1207 | if (feature.type == Obj.PIPSOL) {
|
---|
1208 | Renderer.lineSymbols(Areas.Pipeline, 0.33, null, null, 0, Symbols.Mline);
|
---|
1209 | } else if (feature.type == Obj.PIPOHD) {
|
---|
1210 | Renderer.lineVector(new LineStyle(Color.black, 8));
|
---|
1211 | AttMap atts = feature.atts;
|
---|
1212 | double verclr = 0;
|
---|
1213 | if (atts != null) {
|
---|
1214 | if (atts.containsKey(Att.VERCLR)) {
|
---|
1215 | verclr = (Double) atts.get(Att.VERCLR).val;
|
---|
1216 | } else {
|
---|
1217 | verclr = atts.containsKey(Att.VERCSA) ? (Double) atts.get(Att.VERCSA).val : 0;
|
---|
1218 | }
|
---|
1219 | if (verclr > 0) {
|
---|
1220 | 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)));
|
---|
1221 | }
|
---|
1222 | }
|
---|
1223 | }
|
---|
1224 | }
|
---|
1225 | }
|
---|
1226 |
|
---|
1227 | @SuppressWarnings("unchecked")
|
---|
1228 | private static void platforms() {
|
---|
1229 | ArrayList<CatOFP> cats = (ArrayList<CatOFP>) getAttList(Obj.OFSPLF, Att.CATOFP);
|
---|
1230 | if (cats.get(0) == CatOFP.OFP_FPSO)
|
---|
1231 | Renderer.symbol(Buoys.Storage);
|
---|
1232 | else
|
---|
1233 | Renderer.symbol(Landmarks.Platform);
|
---|
1234 | if (testAttribute(feature.type, Att.STATUS, StsSTS.STS_ILLD)) {
|
---|
1235 | Renderer.symbol(Beacons.Floodlight);
|
---|
1236 | }
|
---|
1237 | addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
|
---|
1238 | Signals.addSignals();
|
---|
1239 | }
|
---|
1240 |
|
---|
1241 | @SuppressWarnings("unchecked")
|
---|
1242 | private static void points() {
|
---|
1243 | boolean ok = false;
|
---|
1244 | switch (feature.type) {
|
---|
1245 | case FOGSIG:
|
---|
1246 | if (Renderer.zoom >= 12) {
|
---|
1247 | if (feature.objs.containsKey(Obj.LIGHTS))
|
---|
1248 | lights();
|
---|
1249 | else
|
---|
1250 | Renderer.symbol(Harbours.Post);
|
---|
1251 | ok = true;
|
---|
1252 | }
|
---|
1253 | break;
|
---|
1254 | default:
|
---|
1255 | if (Renderer.zoom >= 14) {
|
---|
1256 | if (testAttribute(feature.type, Att.STATUS, StsSTS.STS_ILLD)) {
|
---|
1257 | Renderer.symbol(Beacons.Floodlight);
|
---|
1258 | }
|
---|
1259 | if (feature.objs.containsKey(Obj.LIGHTS))
|
---|
1260 | lights();
|
---|
1261 | else
|
---|
1262 | Renderer.symbol(Harbours.Post);
|
---|
1263 | ok = true;
|
---|
1264 | }
|
---|
1265 | break;
|
---|
1266 | }
|
---|
1267 | if (ok) {
|
---|
1268 | if (feature.objs.containsKey(Obj.TOPMAR)) {
|
---|
1269 | AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
|
---|
1270 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
1271 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.TOPMAR), null);
|
---|
1272 | }
|
---|
1273 | } else if (feature.objs.containsKey(Obj.DAYMAR)) {
|
---|
1274 | AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
|
---|
1275 | if (topmap.containsKey(Att.TOPSHP)) {
|
---|
1276 | Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>) topmap.get(Att.TOPSHP).val).get(0)), getScheme(Obj.DAYMAR), null);
|
---|
1277 | }
|
---|
1278 | }
|
---|
1279 | Signals.addSignals();
|
---|
1280 | }
|
---|
1281 | }
|
---|
1282 |
|
---|
1283 | private static void ports() {
|
---|
1284 | if (Renderer.zoom >= 14) {
|
---|
1285 | if (feature.type == Obj.CRANES) {
|
---|
1286 | if ((CatCRN) getAttEnum(feature.type, Att.CATCRN) == CatCRN.CRN_CONT)
|
---|
1287 | Renderer.symbol(Harbours.ContainerCrane);
|
---|
1288 | else
|
---|
1289 | Renderer.symbol(Harbours.PortCrane);
|
---|
1290 | } else if (feature.type == Obj.HULKES) {
|
---|
1291 | Renderer.lineVector(new LineStyle(Color.black, 4, null, new Color(0xffe000)));
|
---|
1292 | addName(15, new Font("Arial", Font.BOLD, 40));
|
---|
1293 | }
|
---|
1294 | }
|
---|
1295 | }
|
---|
1296 |
|
---|
1297 | private static void separation() {
|
---|
1298 | switch (feature.type) {
|
---|
1299 | case TSEZNE:
|
---|
1300 | case TSSCRS:
|
---|
1301 | case TSSRON:
|
---|
1302 | if (Renderer.zoom <= 15)
|
---|
1303 | Renderer.lineVector(new LineStyle(Symbols.Mtss));
|
---|
1304 | else
|
---|
1305 | Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, null, null));
|
---|
1306 | addName(10, new Font("Arial", Font.BOLD, 150), Symbols.Mline);
|
---|
1307 | break;
|
---|
1308 | case TSELNE:
|
---|
1309 | Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, null, null));
|
---|
1310 | break;
|
---|
1311 | case TSSLPT:
|
---|
1312 | Renderer.lineSymbols(Areas.LaneArrow, 0.5, null, null, 0, Symbols.Mtss);
|
---|
1313 | break;
|
---|
1314 | case TSSBND:
|
---|
1315 | Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, new float[] { 40, 40 }, null));
|
---|
1316 | break;
|
---|
1317 | case ISTZNE:
|
---|
1318 | Renderer.lineSymbols(Areas.Restricted, 1.0, null, null, 0, Symbols.Mtss);
|
---|
1319 | break;
|
---|
1320 | default:
|
---|
1321 | break;
|
---|
1322 | }
|
---|
1323 | }
|
---|
1324 |
|
---|
1325 | @SuppressWarnings("unchecked")
|
---|
1326 | private static void shoreline() {
|
---|
1327 | CatSLC cat = (CatSLC) getAttEnum(feature.type, Att.CATSLC);
|
---|
1328 | if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.BASE)) {
|
---|
1329 | if ((cat != CatSLC.SLC_SWAY) && (cat != CatSLC.SLC_TWAL)) {
|
---|
1330 | if (Renderer.zoom >= 12) {
|
---|
1331 | Renderer.lineVector(new LineStyle(Color.black, 10, Symbols.Yland));
|
---|
1332 | } else {
|
---|
1333 | Renderer.lineVector(new LineStyle(Symbols.Yland));
|
---|
1334 | }
|
---|
1335 | }
|
---|
1336 | }
|
---|
1337 | if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.SEAMARK)) {
|
---|
1338 | if (Renderer.zoom >= 12) {
|
---|
1339 | switch (cat) {
|
---|
1340 | case SLC_TWAL:
|
---|
1341 | WatLEV lev = (WatLEV) getAttEnum(feature.type, Att.WATLEV);
|
---|
1342 | if (lev == WatLEV.LEV_CVRS) {
|
---|
1343 | Renderer.lineVector(new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
|
---|
1344 | if (Renderer.zoom >= 15)
|
---|
1345 | Renderer.lineText("(covers)", new Font("Arial", Font.PLAIN, 40), Color.black, 80);
|
---|
1346 | } else {
|
---|
1347 | Renderer.lineVector(new LineStyle(Color.black, 10, null, null));
|
---|
1348 | }
|
---|
1349 | if (Renderer.zoom >= 15)
|
---|
1350 | Renderer.lineText("Training Wall", new Font("Arial", Font.PLAIN, 40), Color.black, -30);
|
---|
1351 | break;
|
---|
1352 | case SLC_SWAY:
|
---|
1353 | Renderer.lineVector(new LineStyle(Color.black, 2, null, new Color(0xffe000)));
|
---|
1354 | if ((Renderer.zoom >= 16) && feature.objs.containsKey(Obj.SMCFAC)) {
|
---|
1355 | ArrayList<Symbol> symbols = new ArrayList<>();
|
---|
1356 | ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(Obj.SMCFAC, Att.CATSCF);
|
---|
1357 | for (CatSCF scf : scfs) {
|
---|
1358 | symbols.add(Facilities.Cats.get(scf));
|
---|
1359 | }
|
---|
1360 | Renderer.cluster(symbols);
|
---|
1361 | }
|
---|
1362 | break;
|
---|
1363 | default:
|
---|
1364 | break;
|
---|
1365 | }
|
---|
1366 | }
|
---|
1367 | }
|
---|
1368 | }
|
---|
1369 |
|
---|
1370 | @SuppressWarnings("unchecked")
|
---|
1371 | private static void stations() {
|
---|
1372 | if (Renderer.zoom >= 14) {
|
---|
1373 | String str = "";
|
---|
1374 | switch (feature.type) {
|
---|
1375 | case SISTAT:
|
---|
1376 | Renderer.symbol(Harbours.SignalStation);
|
---|
1377 | str = "SS";
|
---|
1378 | ArrayList<CatSIT> tcats = (ArrayList<CatSIT>) getAttList(Obj.SISTAT, Att.CATSIT);
|
---|
1379 | switch (tcats.get(0)) {
|
---|
1380 | case SIT_IPT:
|
---|
1381 | str += "(INT)";
|
---|
1382 | break;
|
---|
1383 | case SIT_PRTE:
|
---|
1384 | str += "(Traffic)";
|
---|
1385 | break;
|
---|
1386 | case SIT_PRTC:
|
---|
1387 | str += "(Port Control)";
|
---|
1388 | break;
|
---|
1389 | case SIT_LOCK:
|
---|
1390 | str += "(Lock)";
|
---|
1391 | break;
|
---|
1392 | case SIT_BRDG:
|
---|
1393 | str += "(Bridge)";
|
---|
1394 | break;
|
---|
1395 | default:
|
---|
1396 | break;
|
---|
1397 | }
|
---|
1398 | break;
|
---|
1399 | case SISTAW:
|
---|
1400 | Renderer.symbol(Harbours.SignalStation);
|
---|
1401 | str = "SS";
|
---|
1402 | str = "SS";
|
---|
1403 | ArrayList<CatSIW> wcats = (ArrayList<CatSIW>) getAttList(Obj.SISTAW, Att.CATSIW);
|
---|
1404 | switch (wcats.get(0)) {
|
---|
1405 | case SIW_STRM:
|
---|
1406 | str += "(Storm)";
|
---|
1407 | break;
|
---|
1408 | case SIW_WTHR:
|
---|
1409 | str += "(Weather)";
|
---|
1410 | break;
|
---|
1411 | case SIW_ICE:
|
---|
1412 | str += "(Ice)";
|
---|
1413 | break;
|
---|
1414 | case SIW_TIDG:
|
---|
1415 | str = "Tide gauge";
|
---|
1416 | break;
|
---|
1417 | case SIW_TIDS:
|
---|
1418 | str = "Tide scale";
|
---|
1419 | break;
|
---|
1420 | case SIW_TIDE:
|
---|
1421 | str += "(Tide)";
|
---|
1422 | break;
|
---|
1423 | case SIW_TSTR:
|
---|
1424 | str += "(Stream)";
|
---|
1425 | break;
|
---|
1426 | case SIW_DNGR:
|
---|
1427 | str += "(Danger)";
|
---|
1428 | break;
|
---|
1429 | case SIW_MILY:
|
---|
1430 | str += "(Firing)";
|
---|
1431 | break;
|
---|
1432 | case SIW_TIME:
|
---|
1433 | str += "(Time)";
|
---|
1434 | break;
|
---|
1435 | default:
|
---|
1436 | break;
|
---|
1437 | }
|
---|
1438 | break;
|
---|
1439 | case RDOSTA:
|
---|
1440 | case RTPBCN:
|
---|
1441 | Renderer.symbol(Harbours.SignalStation);
|
---|
1442 | Renderer.symbol(Beacons.RadarStation);
|
---|
1443 | break;
|
---|
1444 | case RADRFL:
|
---|
1445 | Renderer.symbol(Topmarks.RadarReflector);
|
---|
1446 | break;
|
---|
1447 | case RADSTA:
|
---|
1448 | Renderer.symbol(Harbours.SignalStation);
|
---|
1449 | Renderer.symbol(Beacons.RadarStation);
|
---|
1450 | Renderer.labelText("Ra", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70)));
|
---|
1451 | break;
|
---|
1452 | case PILBOP:
|
---|
1453 | Renderer.symbol(Harbours.Pilot);
|
---|
1454 | addName(15, new Font("Arial", Font.BOLD, 40), Symbols.Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40)));
|
---|
1455 | CatPIL cat = (CatPIL) getAttEnum(feature.type, Att.CATPIL);
|
---|
1456 | if (cat == CatPIL.PIL_HELI) {
|
---|
1457 | Renderer.labelText("H", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
|
---|
1458 | }
|
---|
1459 | break;
|
---|
1460 | case CGUSTA:
|
---|
1461 | Renderer.symbol(Harbours.SignalStation);
|
---|
1462 | str = "CG";
|
---|
1463 | if (feature.objs.containsKey(Obj.RSCSTA))
|
---|
1464 | Renderer.symbol(Harbours.Rescue, new Delta(Handle.CC, AffineTransform.getTranslateInstance(130, 0)));
|
---|
1465 | break;
|
---|
1466 | case RSCSTA:
|
---|
1467 | Renderer.symbol(Harbours.Rescue);
|
---|
1468 | break;
|
---|
1469 | default:
|
---|
1470 | break;
|
---|
1471 | }
|
---|
1472 | if ((Renderer.zoom >= 15) && !str.isEmpty()) {
|
---|
1473 | Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, -50)));
|
---|
1474 | }
|
---|
1475 | Signals.addSignals();
|
---|
1476 | }
|
---|
1477 | }
|
---|
1478 |
|
---|
1479 | private static void transits() {
|
---|
1480 | if (Renderer.zoom >= 14) {
|
---|
1481 | if (feature.type == Obj.RECTRC)
|
---|
1482 | Renderer.lineVector(new LineStyle(Color.black, 5, null, null));
|
---|
1483 | else if (feature.type == Obj.NAVLNE)
|
---|
1484 | Renderer.lineVector(new LineStyle(Color.black, 5, new float[] { 25, 25 }, null));
|
---|
1485 | }
|
---|
1486 | if (Renderer.zoom >= 15) {
|
---|
1487 | String str = "";
|
---|
1488 | String name = getName();
|
---|
1489 | if (name != null)
|
---|
1490 | str += name + " ";
|
---|
1491 | Double ort;
|
---|
1492 | if ((ort = (Double) getAttVal(feature.type, Att.ORIENT)) != null) {
|
---|
1493 | str += df.format(ort) + "º";
|
---|
1494 | if (!str.isEmpty())
|
---|
1495 | Renderer.lineText(str, new Font("Arial", Font.PLAIN, 40), Color.black, -20);
|
---|
1496 | }
|
---|
1497 | }
|
---|
1498 | }
|
---|
1499 |
|
---|
1500 | @SuppressWarnings("unchecked")
|
---|
1501 | private static void virtual() {
|
---|
1502 | if (Renderer.zoom >= 12) {
|
---|
1503 | Renderer.symbol(Harbours.SignalStation, new Scheme(Symbols.Msymb));
|
---|
1504 | Renderer.symbol(Beacons.RadarStation, new Scheme(Symbols.Msymb));
|
---|
1505 | ArrayList<CatVAN> cats = (ArrayList<CatVAN>) getAttList(Obj.VAATON, Att.CATVAN);
|
---|
1506 | for (CatVAN van : cats) {
|
---|
1507 | switch (van) {
|
---|
1508 | case VAN_NCAR:
|
---|
1509 | Renderer.symbol(Topmarks.TopNorth, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1510 | break;
|
---|
1511 | case VAN_SCAR:
|
---|
1512 | Renderer.symbol(Topmarks.TopSouth, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1513 | break;
|
---|
1514 | case VAN_ECAR:
|
---|
1515 | Renderer.symbol(Topmarks.TopEast, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1516 | break;
|
---|
1517 | case VAN_WCAR:
|
---|
1518 | Renderer.symbol(Topmarks.TopWest, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1519 | break;
|
---|
1520 | case VAN_PLAT:
|
---|
1521 | case VAN_PCHS:
|
---|
1522 | Renderer.symbol(Topmarks.TopCan, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1523 | break;
|
---|
1524 | case VAN_SLAT:
|
---|
1525 | case VAN_PCHP:
|
---|
1526 | Renderer.symbol(Topmarks.TopCone, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1527 | break;
|
---|
1528 | case VAN_IDGR:
|
---|
1529 | Renderer.symbol(Topmarks.TopIsol, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1530 | break;
|
---|
1531 | case VAN_SAFW:
|
---|
1532 | Renderer.symbol(Topmarks.TopSphere, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1533 | break;
|
---|
1534 | case VAN_SPPM:
|
---|
1535 | Renderer.symbol(Topmarks.TopX, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1536 | break;
|
---|
1537 | case VAN_WREK:
|
---|
1538 | Renderer.symbol(Topmarks.TopCross, new Scheme(Symbols.Msymb), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
|
---|
1539 | break;
|
---|
1540 | default:
|
---|
1541 | break;
|
---|
1542 | }
|
---|
1543 | }
|
---|
1544 | }
|
---|
1545 | if (Renderer.zoom >= 15) {
|
---|
1546 | Renderer.labelText("V-AIS", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
|
---|
1547 | }
|
---|
1548 | }
|
---|
1549 |
|
---|
1550 | private static void waterways() {
|
---|
1551 | Renderer.lineVector(new LineStyle(Symbols.Bwater, 20, (feature.geom.prim == Pflag.AREA) ? Symbols.Bwater : null));
|
---|
1552 | }
|
---|
1553 |
|
---|
1554 | private static void wrecks() {
|
---|
1555 | if (Renderer.zoom >= 14) {
|
---|
1556 | switch ((CatWRK) getAttEnum(feature.type, Att.CATWRK)) {
|
---|
1557 | case WRK_DNGR:
|
---|
1558 | case WRK_MSTS:
|
---|
1559 | Renderer.symbol(Areas.WreckD);
|
---|
1560 | break;
|
---|
1561 | case WRK_HULS:
|
---|
1562 | Renderer.symbol(Areas.WreckS);
|
---|
1563 | break;
|
---|
1564 | default:
|
---|
1565 | Renderer.symbol(Areas.WreckND);
|
---|
1566 | }
|
---|
1567 | }
|
---|
1568 | }
|
---|
1569 | }
|
---|