1 | /* Copyright 2014 Malcolm Herring
|
---|
2 | *
|
---|
3 | * This is free software: you can redistribute it and/or modify
|
---|
4 | * it under the terms of the GNU General Public License as published by
|
---|
5 | * the Free Software Foundation, version 3 of the License.
|
---|
6 | *
|
---|
7 | * For a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.
|
---|
8 | */
|
---|
9 |
|
---|
10 | package render;
|
---|
11 |
|
---|
12 | import java.awt.Color;
|
---|
13 | import java.awt.Font;
|
---|
14 | import java.awt.geom.AffineTransform;
|
---|
15 | import java.util.ArrayList;
|
---|
16 | import java.util.EnumMap;
|
---|
17 | import java.util.HashMap;
|
---|
18 |
|
---|
19 | import s57.S57val;
|
---|
20 | import s57.S57val.*;
|
---|
21 | import s57.S57att.*;
|
---|
22 | import s57.S57obj.*;
|
---|
23 | import s57.S57map.*;
|
---|
24 | import render.Renderer.*;
|
---|
25 | import symbols.*;
|
---|
26 | import symbols.Symbols.*;
|
---|
27 |
|
---|
28 | public class Rules {
|
---|
29 |
|
---|
30 | public static final Color Yland = new Color(0x50b0ff);
|
---|
31 | public static final Color Mline = new Color(0xc480ff);
|
---|
32 | public static final Color Msymb = new Color(0xa30075);
|
---|
33 |
|
---|
34 | static final EnumMap<ColCOL, Color> bodyColours = new EnumMap<ColCOL, Color>(ColCOL.class);
|
---|
35 | static {
|
---|
36 | bodyColours.put(ColCOL.COL_UNK, new Color(0, true));
|
---|
37 | bodyColours.put(ColCOL.COL_WHT, new Color(0xffffff));
|
---|
38 | bodyColours.put(ColCOL.COL_BLK, new Color(0x000000));
|
---|
39 | bodyColours.put(ColCOL.COL_RED, new Color(0xd40000));
|
---|
40 | bodyColours.put(ColCOL.COL_GRN, new Color(0x00d400));
|
---|
41 | bodyColours.put(ColCOL.COL_BLU, Color.blue);
|
---|
42 | bodyColours.put(ColCOL.COL_YEL, new Color(0xffd400));
|
---|
43 | bodyColours.put(ColCOL.COL_GRY, Color.gray);
|
---|
44 | bodyColours.put(ColCOL.COL_BRN, new Color(0x8b4513));
|
---|
45 | bodyColours.put(ColCOL.COL_AMB, new Color(0xfbf00f));
|
---|
46 | bodyColours.put(ColCOL.COL_VIO, new Color(0xee82ee));
|
---|
47 | bodyColours.put(ColCOL.COL_ORG, Color.orange);
|
---|
48 | bodyColours.put(ColCOL.COL_MAG, new Color(0xf000f0));
|
---|
49 | bodyColours.put(ColCOL.COL_PNK, Color.pink);
|
---|
50 | }
|
---|
51 |
|
---|
52 | static final EnumMap<ColPAT, Patt> pattMap = new EnumMap<ColPAT, Patt>(ColPAT.class);
|
---|
53 | static {
|
---|
54 | pattMap.put(ColPAT.PAT_UNKN, Patt.Z);
|
---|
55 | pattMap.put(ColPAT.PAT_HORI, Patt.H);
|
---|
56 | pattMap.put(ColPAT.PAT_VERT, Patt.V);
|
---|
57 | pattMap.put(ColPAT.PAT_DIAG, Patt.D);
|
---|
58 | pattMap.put(ColPAT.PAT_BRDR, Patt.B);
|
---|
59 | pattMap.put(ColPAT.PAT_SQUR, Patt.S);
|
---|
60 | pattMap.put(ColPAT.PAT_CROS, Patt.C);
|
---|
61 | pattMap.put(ColPAT.PAT_SALT, Patt.X);
|
---|
62 | pattMap.put(ColPAT.PAT_STRP, Patt.H);
|
---|
63 | }
|
---|
64 |
|
---|
65 | static String getName(Feature feature) {
|
---|
66 | AttVal<?> name = feature.atts.get(Att.OBJNAM);
|
---|
67 | if (name == null) {
|
---|
68 | AttMap atts = feature.objs.get(feature.type).get(0);
|
---|
69 | if (atts != null) {
|
---|
70 | name = atts.get(Att.OBJNAM);
|
---|
71 | }
|
---|
72 | }
|
---|
73 | return (name != null) ? (String)name.val: null;
|
---|
74 | }
|
---|
75 |
|
---|
76 | public static void addName(Feature feature, int z, Font font) {
|
---|
77 | addName(feature, z, font, Color.black, new Delta(Handle.CC, new AffineTransform()));
|
---|
78 | }
|
---|
79 | public static void addName(Feature feature, int z, Font font, Color colour) {
|
---|
80 | addName(feature, z, font, colour, new Delta(Handle.CC, new AffineTransform()));
|
---|
81 | }
|
---|
82 | public static void addName(Feature feature, int z, Font font, Delta delta) {
|
---|
83 | addName(feature, z, font, Color.black, delta);
|
---|
84 | }
|
---|
85 | public static void addName(Feature feature, int z, Font font, Color colour, Delta delta) {
|
---|
86 | if (Renderer.zoom >= z) {
|
---|
87 | String name = getName(feature);
|
---|
88 | if (name != null) {
|
---|
89 | Renderer.labelText(feature, name, font, colour, delta);
|
---|
90 | }
|
---|
91 | }
|
---|
92 | }
|
---|
93 |
|
---|
94 | static AttMap getAtts(Feature feature, Obj obj, int idx) {
|
---|
95 | HashMap<Integer, AttMap> objs = feature.objs.get(obj);
|
---|
96 | if (objs == null)
|
---|
97 | return null;
|
---|
98 | else
|
---|
99 | return objs.get(idx);
|
---|
100 | }
|
---|
101 |
|
---|
102 | public static Object getAttVal(Feature feature, Obj obj, int idx, Att att) {
|
---|
103 | AttMap atts = null;
|
---|
104 | HashMap<Integer, AttMap> objs = feature.objs.get(obj);
|
---|
105 | if (objs != null)
|
---|
106 | atts = objs.get(idx);
|
---|
107 | if (atts == null)
|
---|
108 | return S57val.nullVal(att);
|
---|
109 | else {
|
---|
110 | AttVal<?> item = atts.get(att);
|
---|
111 | if (item == null)
|
---|
112 | return S57val.nullVal(att);
|
---|
113 | return item.val;
|
---|
114 | }
|
---|
115 | }
|
---|
116 |
|
---|
117 | static Scheme getScheme(Feature feature, Obj obj) {
|
---|
118 | ArrayList<Color> colours = new ArrayList<Color>();
|
---|
119 | for (ColCOL col : (ArrayList<ColCOL>)getAttVal(feature, obj, 0, Att.COLOUR)) {
|
---|
120 | colours.add(bodyColours.get(col));
|
---|
121 | }
|
---|
122 | ArrayList<Patt> patterns = new ArrayList<Patt>();
|
---|
123 | for(ColPAT pat: (ArrayList<ColPAT>) getAttVal(feature, obj, 0, Att.COLPAT)) {
|
---|
124 | patterns.add(pattMap.get(pat));
|
---|
125 | }
|
---|
126 | return new Scheme(patterns, colours);
|
---|
127 | }
|
---|
128 |
|
---|
129 | static boolean testAttribute(Feature feature, Obj obj, int idx, Att att, Object val) {
|
---|
130 | AttMap atts = getAtts(feature, obj, idx);
|
---|
131 | if (atts != null) {
|
---|
132 | AttVal item = atts.get(att);
|
---|
133 | if (item != null) {
|
---|
134 | switch (item.conv) {
|
---|
135 | case S:
|
---|
136 | case A:
|
---|
137 | return ((String)item.val).equals(val);
|
---|
138 | case L:
|
---|
139 | return ((ArrayList<?>)item.val).contains(val);
|
---|
140 | case E:
|
---|
141 | case F:
|
---|
142 | case I:
|
---|
143 | return item.val.equals(val);
|
---|
144 | }
|
---|
145 | }
|
---|
146 | }
|
---|
147 | return false;
|
---|
148 | }
|
---|
149 |
|
---|
150 | public static void rules () {
|
---|
151 | ArrayList<Feature> objects;
|
---|
152 | if ((objects = Renderer.map.features.get(Obj.SLCONS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) shoreline(feature);
|
---|
153 | if ((objects = Renderer.map.features.get(Obj.PIPSOL)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) pipelines(feature);
|
---|
154 | if ((objects = Renderer.map.features.get(Obj.CBLSUB)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) cables(feature);
|
---|
155 | if ((objects = Renderer.map.features.get(Obj.PIPOHD)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) pipelines(feature);
|
---|
156 | if ((objects = Renderer.map.features.get(Obj.CBLOHD)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) cables(feature);
|
---|
157 | if ((objects = Renderer.map.features.get(Obj.TSEZNE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
|
---|
158 | if ((objects = Renderer.map.features.get(Obj.TSSCRS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
|
---|
159 | if ((objects = Renderer.map.features.get(Obj.TSSRON)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
|
---|
160 | if ((objects = Renderer.map.features.get(Obj.TSELNE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
|
---|
161 | if ((objects = Renderer.map.features.get(Obj.TSSLPT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
|
---|
162 | if ((objects = Renderer.map.features.get(Obj.TSSBND)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
|
---|
163 | if ((objects = Renderer.map.features.get(Obj.ISTZNE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
|
---|
164 | if ((objects = Renderer.map.features.get(Obj.SNDWAV)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
|
---|
165 | if ((objects = Renderer.map.features.get(Obj.OSPARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
|
---|
166 | if ((objects = Renderer.map.features.get(Obj.FAIRWY)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
|
---|
167 | if ((objects = Renderer.map.features.get(Obj.DRGARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
|
---|
168 | if ((objects = Renderer.map.features.get(Obj.RESARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
|
---|
169 | if ((objects = Renderer.map.features.get(Obj.SPLARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
|
---|
170 | if ((objects = Renderer.map.features.get(Obj.SEAARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
|
---|
171 | if ((objects = Renderer.map.features.get(Obj.OBSTRN)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) obstructions(feature);
|
---|
172 | if ((objects = Renderer.map.features.get(Obj.UWTROC)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) obstructions(feature);
|
---|
173 | if ((objects = Renderer.map.features.get(Obj.MARCUL)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
|
---|
174 | if ((objects = Renderer.map.features.get(Obj.WTWAXS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) waterways(feature);
|
---|
175 | if ((objects = Renderer.map.features.get(Obj.RECTRC)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) transits(feature);
|
---|
176 | if ((objects = Renderer.map.features.get(Obj.NAVLNE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) transits(feature);
|
---|
177 | if ((objects = Renderer.map.features.get(Obj.HRBFAC)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) harbours(feature);
|
---|
178 | if ((objects = Renderer.map.features.get(Obj.ACHARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) harbours(feature);
|
---|
179 | if ((objects = Renderer.map.features.get(Obj.ACHBRT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) harbours(feature);
|
---|
180 | if ((objects = Renderer.map.features.get(Obj.BERTHS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) harbours(feature);
|
---|
181 | if ((objects = Renderer.map.features.get(Obj.LOKBSN)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) locks(feature);
|
---|
182 | if ((objects = Renderer.map.features.get(Obj.LKBSPT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) locks(feature);
|
---|
183 | if ((objects = Renderer.map.features.get(Obj.GATCON)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) locks(feature);
|
---|
184 | if ((objects = Renderer.map.features.get(Obj.DISMAR)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) distances(feature);
|
---|
185 | if ((objects = Renderer.map.features.get(Obj.HULKES)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) ports(feature);
|
---|
186 | if ((objects = Renderer.map.features.get(Obj.CRANES)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) ports(feature);
|
---|
187 | if ((objects = Renderer.map.features.get(Obj.LNDMRK)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) landmarks(feature);
|
---|
188 | if ((objects = Renderer.map.features.get(Obj.BUISGL)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) harbours(feature);
|
---|
189 | if ((objects = Renderer.map.features.get(Obj.MORFAC)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) moorings(feature);
|
---|
190 | if ((objects = Renderer.map.features.get(Obj.NOTMRK)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) notices(feature);
|
---|
191 | if ((objects = Renderer.map.features.get(Obj.SMCFAC)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) marinas(feature);
|
---|
192 | if ((objects = Renderer.map.features.get(Obj.BRIDGE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) bridges(feature);
|
---|
193 | if ((objects = Renderer.map.features.get(Obj.PILPNT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) lights(feature);
|
---|
194 | if ((objects = Renderer.map.features.get(Obj.LITMIN)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) lights(feature);
|
---|
195 | if ((objects = Renderer.map.features.get(Obj.LITMAJ)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) lights(feature);
|
---|
196 | if ((objects = Renderer.map.features.get(Obj.LIGHTS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) lights(feature);
|
---|
197 | if ((objects = Renderer.map.features.get(Obj.SISTAT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
|
---|
198 | if ((objects = Renderer.map.features.get(Obj.SISTAW)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
|
---|
199 | if ((objects = Renderer.map.features.get(Obj.CGUSTA)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
|
---|
200 | if ((objects = Renderer.map.features.get(Obj.RDOSTA)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
|
---|
201 | if ((objects = Renderer.map.features.get(Obj.RADSTA)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
|
---|
202 | if ((objects = Renderer.map.features.get(Obj.RSCSTA)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
|
---|
203 | if ((objects = Renderer.map.features.get(Obj.PILBOP)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
|
---|
204 | if ((objects = Renderer.map.features.get(Obj.WTWGAG)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) gauges(feature);
|
---|
205 | if ((objects = Renderer.map.features.get(Obj.OFSPLF)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) platforms(feature);
|
---|
206 | if ((objects = Renderer.map.features.get(Obj.WRECKS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) wrecks(feature);
|
---|
207 | if ((objects = Renderer.map.features.get(Obj.LITVES)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) floats(feature);
|
---|
208 | if ((objects = Renderer.map.features.get(Obj.LITFLT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) floats(feature);
|
---|
209 | if ((objects = Renderer.map.features.get(Obj.BOYINB)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) floats(feature);
|
---|
210 | if ((objects = Renderer.map.features.get(Obj.BOYLAT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) buoys(feature);
|
---|
211 | if ((objects = Renderer.map.features.get(Obj.BOYCAR)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) buoys(feature);
|
---|
212 | if ((objects = Renderer.map.features.get(Obj.BOYISD)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) buoys(feature);
|
---|
213 | if ((objects = Renderer.map.features.get(Obj.BOYSAW)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) buoys(feature);
|
---|
214 | if ((objects = Renderer.map.features.get(Obj.BOYSPP)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) buoys(feature);
|
---|
215 | if ((objects = Renderer.map.features.get(Obj.BOYWTW)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) buoys(feature);
|
---|
216 | if ((objects = Renderer.map.features.get(Obj.BCNLAT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) beacons(feature);
|
---|
217 | if ((objects = Renderer.map.features.get(Obj.BCNCAR)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) beacons(feature);
|
---|
218 | if ((objects = Renderer.map.features.get(Obj.BCNISD)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) beacons(feature);
|
---|
219 | if ((objects = Renderer.map.features.get(Obj.BCNSAW)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) beacons(feature);
|
---|
220 | if ((objects = Renderer.map.features.get(Obj.BCNSPP)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) beacons(feature);
|
---|
221 | if ((objects = Renderer.map.features.get(Obj.BCNWTW)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) beacons(feature);
|
---|
222 | }
|
---|
223 |
|
---|
224 | private static void areas(Feature feature) {
|
---|
225 | String name = getName(feature);
|
---|
226 | switch (feature.type) {
|
---|
227 | case DRGARE:
|
---|
228 | if (Renderer.zoom < 16)
|
---|
229 | Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, new Color(0x40ffffff, true)));
|
---|
230 | else
|
---|
231 | Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }));
|
---|
232 | addName(feature, 12, new Font("Arial", Font.PLAIN, 100), new Delta(Handle.CC, new AffineTransform()));
|
---|
233 | break;
|
---|
234 | case FAIRWY:
|
---|
235 | if (feature.geom.area > 2.0) {
|
---|
236 | if (Renderer.zoom < 16)
|
---|
237 | Renderer.lineVector(feature, new LineStyle(Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true)));
|
---|
238 | else
|
---|
239 | Renderer.lineVector(feature, new LineStyle(Mline, 8, new float[] { 50, 50 }));
|
---|
240 | } else {
|
---|
241 | if (Renderer.zoom >= 14)
|
---|
242 | Renderer.lineVector(feature, new LineStyle(null, 0, new Color(0x40ffffff, true)));
|
---|
243 | }
|
---|
244 | break;
|
---|
245 | case MARCUL:
|
---|
246 | if (Renderer.zoom >= 12) {
|
---|
247 | if (Renderer.zoom >= 14) {
|
---|
248 | Renderer.symbol(feature, Areas.MarineFarm);
|
---|
249 | }
|
---|
250 | if ((feature.geom.area > 0.2) || ((feature.geom.area > 0.05) && (Renderer.zoom >= 14)) || ((feature.geom.area > 0.005) && (Renderer.zoom >= 16))) {
|
---|
251 | Renderer.lineVector(feature, new LineStyle(Color.black, 4, new float[] { 10, 10 }));
|
---|
252 | }
|
---|
253 | }
|
---|
254 | break;
|
---|
255 | case OSPARE:
|
---|
256 | if (testAttribute(feature, feature.type, 0, Att.CATPRA, CatPRA.PRA_WFRM)) {
|
---|
257 | Renderer.symbol(feature, Areas.WindFarm);
|
---|
258 | Renderer.lineVector(feature, new LineStyle(Color.black, 20, new float[] { 40, 40 }));
|
---|
259 | addName(feature, 15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));
|
---|
260 | }
|
---|
261 | break;
|
---|
262 | case RESARE:
|
---|
263 | case MIPARE:
|
---|
264 | if (Renderer.zoom >= 12) {
|
---|
265 | Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Mline);
|
---|
266 | if (testAttribute(feature, feature.type, 0, Att.CATREA, CatREA.REA_NWAK)) {
|
---|
267 | Renderer.symbol(feature, Areas.NoWake);
|
---|
268 | }
|
---|
269 | }
|
---|
270 | break;
|
---|
271 | case SEAARE:
|
---|
272 | switch ((CatSEA) getAttVal(feature, feature.type, 0, Att.CATSEA)) {
|
---|
273 | case SEA_RECH:
|
---|
274 | if ((Renderer.zoom >= 10) && (name != null))
|
---|
275 | if (feature.geom.prim == Pflag.LINE) {
|
---|
276 | Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40);
|
---|
277 | } else {
|
---|
278 | Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
|
---|
279 | }
|
---|
280 | break;
|
---|
281 | case SEA_BAY:
|
---|
282 | if ((Renderer.zoom >= 12) && (name != null))
|
---|
283 | if (feature.geom.prim == Pflag.LINE) {
|
---|
284 | Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40);
|
---|
285 | } else {
|
---|
286 | Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
|
---|
287 | }
|
---|
288 | break;
|
---|
289 | case SEA_SHOL:
|
---|
290 | if (Renderer.zoom >= 14) {
|
---|
291 | if (feature.geom.prim == Pflag.AREA) {
|
---|
292 | Renderer.lineVector(feature, new LineStyle(new Color(0xc480ff), 4, new float[] { 25, 25 }));
|
---|
293 | if (name != null) {
|
---|
294 | Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
|
---|
295 | Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC));
|
---|
296 | }
|
---|
297 | } else if (feature.geom.prim == Pflag.LINE) {
|
---|
298 | if (name != null) {
|
---|
299 | Renderer.lineText(feature, name, new Font("Arial", Font.ITALIC, 75), Color.black, 0.5, -40);
|
---|
300 | Renderer.lineText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5, 0);
|
---|
301 | }
|
---|
302 | } else {
|
---|
303 | if (name != null) {
|
---|
304 | Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
|
---|
305 | Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC));
|
---|
306 | }
|
---|
307 | }
|
---|
308 | }
|
---|
309 | break;
|
---|
310 | case SEA_GAT:
|
---|
311 | case SEA_NRRW:
|
---|
312 | addName(feature, 12, new Font("Arial", Font.PLAIN, 100));
|
---|
313 | break;
|
---|
314 | default:
|
---|
315 | break;
|
---|
316 | }
|
---|
317 | break;
|
---|
318 | case SNDWAV:
|
---|
319 | if (Renderer.zoom >= 12) Renderer.fillPattern(feature, Areas.Sandwaves);
|
---|
320 | break;
|
---|
321 | case SPLARE:
|
---|
322 | if (Renderer.zoom >= 12) {
|
---|
323 | Renderer.symbol(feature, Areas.Plane, new Scheme(Msymb));
|
---|
324 | Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Mline);
|
---|
325 | }
|
---|
326 | addName(feature, 15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
|
---|
327 | break;
|
---|
328 | default:
|
---|
329 | break;
|
---|
330 | }
|
---|
331 | }
|
---|
332 |
|
---|
333 | private static void beacons(Feature feature) {
|
---|
334 | if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BCNLAT) || (feature.type == Obj.BCNCAR)))) {
|
---|
335 | BcnSHP shape = (BcnSHP) getAttVal(feature, feature.type, 0,
|
---|
336 | Att.BCNSHP);
|
---|
337 | if (((shape == BcnSHP.BCN_PRCH) || (shape == BcnSHP.BCN_WTHY))
|
---|
338 | && (feature.type == Obj.BCNLAT)) {
|
---|
339 | CatLAM cat = (CatLAM) getAttVal(feature, feature.type, 0,
|
---|
340 | Att.CATLAM);
|
---|
341 | switch (cat) {
|
---|
342 | case LAM_PORT:
|
---|
343 | if (shape == BcnSHP.BCN_PRCH)
|
---|
344 | Renderer.symbol(feature, Beacons.PerchPort);
|
---|
345 | else
|
---|
346 | Renderer.symbol(feature, Beacons.WithyPort);
|
---|
347 | break;
|
---|
348 | case LAM_STBD:
|
---|
349 | if (shape == BcnSHP.BCN_PRCH)
|
---|
350 | Renderer.symbol(feature, Beacons.PerchStarboard);
|
---|
351 | else
|
---|
352 | Renderer.symbol(feature, Beacons.WithyStarboard);
|
---|
353 | break;
|
---|
354 | default:
|
---|
355 | Renderer.symbol(feature, Beacons.Stake,
|
---|
356 | getScheme(feature, feature.type));
|
---|
357 | }
|
---|
358 | } else {
|
---|
359 | Renderer.symbol(feature, Beacons.Shapes.get(shape), getScheme(feature, feature.type));
|
---|
360 | if (feature.objs.containsKey(Obj.TOPMAR)) {
|
---|
361 | Symbol topmark = Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val);
|
---|
362 | if (topmark != null)
|
---|
363 | Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.BeaconDelta);
|
---|
364 | } else if (feature.objs.containsKey(Obj.DAYMAR)) {
|
---|
365 | Symbol topmark = Topmarks.Shapes.get(feature.objs.get(Obj.DAYMAR).get(0).get(Att.TOPSHP).val);
|
---|
366 | if (topmark != null)
|
---|
367 | Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.DAYMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.DAYMAR), Topmarks.BeaconDelta);
|
---|
368 | }
|
---|
369 | }
|
---|
370 | Signals.addSignals(feature);
|
---|
371 | }
|
---|
372 | }
|
---|
373 |
|
---|
374 | private static void buoys(Feature feature) {
|
---|
375 | if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BOYLAT) || (feature.type == Obj.BOYCAR)))) {
|
---|
376 | BoySHP shape = (BoySHP) getAttVal(feature, feature.type, 0, Att.BOYSHP);
|
---|
377 | Renderer.symbol(feature, Buoys.Shapes.get(shape), getScheme(feature, feature.type));
|
---|
378 | if (feature.objs.containsKey(Obj.TOPMAR)) {
|
---|
379 | Symbol topmark = Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val);
|
---|
380 | if (topmark != null)
|
---|
381 | Renderer.symbol(feature, topmark, getScheme(feature, Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape));
|
---|
382 | } else if (feature.objs.containsKey(Obj.DAYMAR)) {
|
---|
383 | Symbol topmark = Topmarks.Shapes.get(feature.objs.get(Obj.DAYMAR).get(0).get(Att.TOPSHP).val);
|
---|
384 | if (topmark != null)
|
---|
385 | Renderer.symbol(feature, topmark, getScheme(feature, Obj.DAYMAR), Topmarks.BuoyDeltas.get(shape));
|
---|
386 | }
|
---|
387 | Signals.addSignals(feature);
|
---|
388 | }
|
---|
389 | }
|
---|
390 |
|
---|
391 | private static void bridges(Feature feature) {
|
---|
392 | if (Renderer.zoom >= 16) {
|
---|
393 | double verclr, verccl, vercop, horclr;
|
---|
394 | AttMap atts = feature.objs.get(Obj.BRIDGE).get(0);
|
---|
395 | String vstr = "";
|
---|
396 | String hstr = "";
|
---|
397 | if (atts != null) {
|
---|
398 | if (atts.containsKey(Att.HORCLR)) {
|
---|
399 | horclr = (Double) atts.get(Att.HORCLR).val;
|
---|
400 | hstr = String.valueOf(horclr);
|
---|
401 | }
|
---|
402 | if (atts.containsKey(Att.VERCLR)) {
|
---|
403 | verclr = (Double) atts.get(Att.VERCLR).val;
|
---|
404 | } else {
|
---|
405 | verclr = atts.containsKey(Att.VERCSA) ? (Double) atts.get(Att.VERCSA).val : 0;
|
---|
406 | }
|
---|
407 | verccl = atts.containsKey(Att.VERCCL) ? (Double) atts.get(Att.VERCCL).val : 0;
|
---|
408 | vercop = atts.containsKey(Att.VERCOP) ? (Double) atts.get(Att.VERCOP).val : 0;
|
---|
409 | if (verclr > 0) {
|
---|
410 | vstr += String.valueOf(verclr);
|
---|
411 | } else if (verccl > 0) {
|
---|
412 | if (vercop == 0) {
|
---|
413 | vstr += String.valueOf(verccl) + "/-";
|
---|
414 | } else {
|
---|
415 | vstr += String.valueOf(verccl) + "/" + String.valueOf(vercop);
|
---|
416 | }
|
---|
417 | }
|
---|
418 | if (hstr.isEmpty() && !vstr.isEmpty()) {
|
---|
419 | Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC));
|
---|
420 | } else if (!hstr.isEmpty() && !vstr.isEmpty()) {
|
---|
421 | Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.BC));
|
---|
422 | Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.TC));
|
---|
423 | } else if (!hstr.isEmpty() && vstr.isEmpty()) {
|
---|
424 | Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.CC));
|
---|
425 | }
|
---|
426 | }
|
---|
427 | }
|
---|
428 | }
|
---|
429 |
|
---|
430 | private static void cables(Feature feature) {
|
---|
431 | if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) {
|
---|
432 | if (feature.type == Obj.CBLSUB) {
|
---|
433 | Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Mline);
|
---|
434 | } else if (feature.type == Obj.CBLOHD) {
|
---|
435 | AttMap atts = feature.objs.get(Obj.CBLOHD).get(0);
|
---|
436 | if ((atts != null) && (atts.containsKey(Att.CATCBL)) && (atts.get(Att.CATCBL).val == CatCBL.CBL_POWR)) {
|
---|
437 | Renderer.lineSymbols(feature, Areas.CableDash, 0, Areas.CableDot, Areas.CableFlash, 2, Color.black);
|
---|
438 | } else {
|
---|
439 | Renderer.lineSymbols(feature, Areas.CableDash, 0, Areas.CableDot, null, 2, Color.black);
|
---|
440 | }
|
---|
441 | if (atts != null) {
|
---|
442 | if (atts.containsKey(Att.VERCLR)) {
|
---|
443 | Renderer.labelText(feature, String.valueOf((Double) atts.get(Att.VERCLR).val), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
|
---|
444 | } else if (atts.containsKey(Att.VERCSA)) {
|
---|
445 | Renderer.labelText(feature, String.valueOf((Double) atts.get(Att.VERCSA).val), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.PCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
|
---|
446 | }
|
---|
447 | }
|
---|
448 | }
|
---|
449 | }
|
---|
450 | }
|
---|
451 |
|
---|
452 | private static void distances(Feature feature) {
|
---|
453 | if (Renderer.zoom >= 14) {
|
---|
454 | if (!testAttribute(feature, Obj.DISMAR, 0, Att.CATDIS, CatDIS.DIS_NONI)) {
|
---|
455 | Renderer.symbol(feature, Harbours.DistanceI);
|
---|
456 | } else {
|
---|
457 | Renderer.symbol(feature, Harbours.DistanceU);
|
---|
458 | }
|
---|
459 | if (Renderer.zoom >= 15) {
|
---|
460 | AttMap atts = getAtts(feature, Obj.DISMAR, 0);
|
---|
461 | if ((atts != null) && (atts.containsKey(Att.WTWDIS))) {
|
---|
462 | Double dist = (Double) atts.get(Att.WTWDIS).val;
|
---|
463 | String str = "";
|
---|
464 | if (atts.containsKey(Att.HUNITS)) {
|
---|
465 | switch ((UniHLU) atts.get(Att.HUNITS).val) {
|
---|
466 | case HLU_METR:
|
---|
467 | str += "m ";
|
---|
468 | break;
|
---|
469 | case HLU_FEET:
|
---|
470 | str += "ft ";
|
---|
471 | break;
|
---|
472 | case HLU_HMTR:
|
---|
473 | str += "hm ";
|
---|
474 | break;
|
---|
475 | case HLU_KMTR:
|
---|
476 | str += "km ";
|
---|
477 | break;
|
---|
478 | case HLU_SMIL:
|
---|
479 | str += "M ";
|
---|
480 | break;
|
---|
481 | case HLU_NMIL:
|
---|
482 | str += "NM ";
|
---|
483 | break;
|
---|
484 | default:
|
---|
485 | break;
|
---|
486 | }
|
---|
487 | }
|
---|
488 | str += String.format("%1.0f", dist);
|
---|
489 | Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45)));
|
---|
490 | }
|
---|
491 | }
|
---|
492 | }
|
---|
493 | }
|
---|
494 |
|
---|
495 | private static void floats(Feature feature) {
|
---|
496 | switch (feature.type) {
|
---|
497 | case LITVES:
|
---|
498 | Renderer.symbol(feature, Buoys.Super, getScheme(feature, feature.type));
|
---|
499 | break;
|
---|
500 | case LITFLT:
|
---|
501 | Renderer.symbol(feature, Buoys.Float, getScheme(feature, feature.type));
|
---|
502 | break;
|
---|
503 | case BOYINB:
|
---|
504 | Renderer.symbol(feature, Buoys.Super, getScheme(feature, feature.type));
|
---|
505 | break;
|
---|
506 | default:
|
---|
507 | break;
|
---|
508 | }
|
---|
509 | if (feature.objs.get(Obj.TOPMAR) != null)
|
---|
510 | Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.FloatDelta);
|
---|
511 | Signals.addSignals(feature);
|
---|
512 | }
|
---|
513 |
|
---|
514 | private static void gauges(Feature feature) {
|
---|
515 | if (Renderer.zoom >= 14) {
|
---|
516 | Renderer.symbol(feature, Harbours.TideGauge);
|
---|
517 | Signals.addSignals(feature);
|
---|
518 | }
|
---|
519 | }
|
---|
520 |
|
---|
521 | private static void harbours(Feature feature) {
|
---|
522 | String name = getName(feature);
|
---|
523 | switch (feature.type) {
|
---|
524 | case ACHBRT:
|
---|
525 | if (Renderer.zoom >= 14) {
|
---|
526 | Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Mline));
|
---|
527 | if (Renderer.zoom >= 15) {
|
---|
528 | Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Msymb, LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC));
|
---|
529 | }
|
---|
530 | }
|
---|
531 | double radius = (Double)getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS);
|
---|
532 | if (radius != 0) {
|
---|
533 | UniHLU units = (UniHLU)getAttVal(feature, Obj.ACHBRT, 0, Att.HUNITS);
|
---|
534 | Renderer.lineCircle (feature, new LineStyle(Mline, 4, new float[] { 10, 10 }, null), radius, units);
|
---|
535 | }
|
---|
536 | break;
|
---|
537 | case ACHARE:
|
---|
538 | if (Renderer.zoom >= 12) {
|
---|
539 | if (feature.geom.prim != Pflag.AREA) {
|
---|
540 | Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Color.black));
|
---|
541 | } else {
|
---|
542 | Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Mline));
|
---|
543 | Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Mline);
|
---|
544 | }
|
---|
545 | addName(feature, 15, new Font("Arial", Font.BOLD, 60), Mline, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
|
---|
546 | ArrayList<StsSTS> sts = (ArrayList<StsSTS>)getAttVal(feature, Obj.ACHARE, 0, Att.STATUS);
|
---|
547 | if ((Renderer.zoom >= 15) && (sts != null) && (sts.contains(StsSTS.STS_RESV))) {
|
---|
548 | Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), Mline, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));
|
---|
549 | }
|
---|
550 | }
|
---|
551 | ArrayList<CatACH> cats = (ArrayList<CatACH>)getAttVal(feature, Obj.ACHARE, 0, Att.CATACH);
|
---|
552 | int dy = (cats.size() - 1) * -30;
|
---|
553 | for (CatACH cat : cats) {
|
---|
554 | switch (cat) {
|
---|
555 | case ACH_DEEP:
|
---|
556 | Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
557 | dy += 60;
|
---|
558 | break;
|
---|
559 | case ACH_TANK:
|
---|
560 | Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
561 | dy += 60;
|
---|
562 | break;
|
---|
563 | case ACH_H24P:
|
---|
564 | Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
565 | dy += 60;
|
---|
566 | break;
|
---|
567 | case ACH_EXPL:
|
---|
568 | Renderer.symbol(feature, Harbours.Explosives, new Scheme(Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
569 | dy += 60;
|
---|
570 | break;
|
---|
571 | case ACH_QUAR:
|
---|
572 | Renderer.symbol(feature, Harbours.Hospital, new Scheme(Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
573 | dy += 60;
|
---|
574 | break;
|
---|
575 | case ACH_SEAP:
|
---|
576 | Renderer.symbol(feature, Areas.Seaplane, new Scheme(Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
|
---|
577 | dy += 60;
|
---|
578 | break;
|
---|
579 | default:
|
---|
580 | }
|
---|
581 | }
|
---|
582 | break;
|
---|
583 | case BERTHS:
|
---|
584 | if (Renderer.zoom >= 14) {
|
---|
585 | Renderer.lineVector(feature, new LineStyle(Mline, 6, new float[] { 20, 20 }));
|
---|
586 | Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), Msymb, LabelStyle.RRCT, Mline, Color.white);
|
---|
587 | }
|
---|
588 | break;
|
---|
589 | case BUISGL:
|
---|
590 | if (Renderer.zoom >= 16) {
|
---|
591 | ArrayList<Symbol> symbols = new ArrayList<Symbol>();
|
---|
592 | ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN);
|
---|
593 | for (FncFNC fnc : fncs) {
|
---|
594 | symbols.add(Landmarks.Funcs.get(fnc));
|
---|
595 | }
|
---|
596 | if (feature.objs.containsKey(Obj.SMCFAC)) {
|
---|
597 | ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttVal(feature, Obj.SMCFAC, 0, Att.CATSCF);
|
---|
598 | for (CatSCF scf : scfs) {
|
---|
599 | symbols.add(Facilities.Cats.get(scf));
|
---|
600 | }
|
---|
601 | }
|
---|
602 | Renderer.cluster(feature, symbols);
|
---|
603 | }
|
---|
604 | break;
|
---|
605 | case HRBFAC:
|
---|
606 | if (Renderer.zoom >= 12) {
|
---|
607 | ArrayList<CatHAF> cathaf = (ArrayList<CatHAF>) getAttVal(feature, Obj.HRBFAC, 0, Att.CATHAF);
|
---|
608 | if (cathaf.size() == 1) {
|
---|
609 | switch (cathaf.get(0)) {
|
---|
610 | case HAF_MRNA:
|
---|
611 | Renderer.symbol(feature, Harbours.Marina);
|
---|
612 | break;
|
---|
613 | case HAF_MANF:
|
---|
614 | Renderer.symbol(feature, Harbours.MarinaNF);
|
---|
615 | break;
|
---|
616 | case HAF_FISH:
|
---|
617 | Renderer.symbol(feature, Harbours.Fishing);
|
---|
618 | break;
|
---|
619 | default:
|
---|
620 | Renderer.symbol(feature, Harbours.Harbour);
|
---|
621 | break;
|
---|
622 | }
|
---|
623 | } else {
|
---|
624 | Renderer.symbol(feature, Harbours.Harbour);
|
---|
625 | }
|
---|
626 | }
|
---|
627 | break;
|
---|
628 | default:
|
---|
629 | break;
|
---|
630 | }
|
---|
631 | }
|
---|
632 |
|
---|
633 | private static void landmarks(Feature feature) {
|
---|
634 | ArrayList<CatLMK> cats = (ArrayList<CatLMK>) getAttVal(feature, feature.type, 0, Att.CATLMK);
|
---|
635 | Symbol catSym = Landmarks.Shapes.get(cats.get(0));
|
---|
636 | ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttVal(feature, feature.type, 0, Att.FUNCTN);
|
---|
637 | Symbol fncSym = Landmarks.Funcs.get(fncs.get(0));
|
---|
638 | if ((fncs.get(0) == FncFNC.FNC_CHCH) && (cats.get(0) == CatLMK.LMK_TOWR))
|
---|
639 | catSym = Landmarks.ChurchTower;
|
---|
640 | if ((cats.get(0) == CatLMK.LMK_UNKN) && (fncs.get(0) == FncFNC.FNC_UNKN) && (feature.objs.get(Obj.LIGHTS) != null))
|
---|
641 | catSym = Beacons.LightMajor;
|
---|
642 | if (cats.get(0) == CatLMK.LMK_RADR)
|
---|
643 | fncSym = Landmarks.RadioTV;
|
---|
644 | Renderer.symbol(feature, catSym);
|
---|
645 | Renderer.symbol(feature, fncSym);
|
---|
646 | addName(feature, 15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
|
---|
647 | Signals.addSignals(feature);
|
---|
648 | }
|
---|
649 |
|
---|
650 | private static void lights(Feature feature) {
|
---|
651 | switch (feature.type) {
|
---|
652 | case LITMAJ:
|
---|
653 | Renderer.symbol(feature, Beacons.LightMajor);
|
---|
654 | break;
|
---|
655 | case LITMIN:
|
---|
656 | case LIGHTS:
|
---|
657 | Renderer.symbol(feature, Beacons.LightMinor);
|
---|
658 | break;
|
---|
659 | case PILPNT:
|
---|
660 | if (feature.objs.containsKey(Obj.LIGHTS))
|
---|
661 | Renderer.symbol(feature, Beacons.LightMinor);
|
---|
662 | else
|
---|
663 | Renderer.symbol(feature, Harbours.Post);
|
---|
664 | break;
|
---|
665 | default:
|
---|
666 | break;
|
---|
667 | }
|
---|
668 | Signals.addSignals(feature);
|
---|
669 | }
|
---|
670 |
|
---|
671 | private static void locks(Feature feature) {
|
---|
672 | }
|
---|
673 |
|
---|
674 | private static void marinas(Feature feature) {
|
---|
675 | if (Renderer.zoom >= 16) {
|
---|
676 | ArrayList<Symbol> symbols = new ArrayList<Symbol>();
|
---|
677 | ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttVal(feature, Obj.SMCFAC, 0, Att.CATSCF);
|
---|
678 | for (CatSCF scf : scfs) {
|
---|
679 | symbols.add(Facilities.Cats.get(scf));
|
---|
680 | }
|
---|
681 | Renderer.cluster(feature, symbols);
|
---|
682 | }
|
---|
683 | }
|
---|
684 |
|
---|
685 | private static void moorings(Feature feature) {
|
---|
686 | switch ((CatMOR) getAttVal(feature, feature.type, 0, Att.CATMOR)) {
|
---|
687 | case MOR_DLPN:
|
---|
688 | Renderer.symbol(feature, Harbours.Dolphin);
|
---|
689 | break;
|
---|
690 | case MOR_DDPN:
|
---|
691 | Renderer.symbol(feature, Harbours.DeviationDolphin);
|
---|
692 | break;
|
---|
693 | case MOR_BLRD:
|
---|
694 | case MOR_POST:
|
---|
695 | Renderer.symbol(feature, Harbours.Bollard);
|
---|
696 | break;
|
---|
697 | case MOR_BUOY:
|
---|
698 | BoySHP shape = (BoySHP) getAttVal(feature, feature.type, 0, Att.BOYSHP);
|
---|
699 | if (shape == BoySHP.BOY_UNKN)
|
---|
700 | shape = BoySHP.BOY_SPHR;
|
---|
701 | Renderer.symbol(feature, Buoys.Shapes.get(shape), getScheme(feature, feature.type));
|
---|
702 | Renderer.symbol(feature, Topmarks.TopMooring, Topmarks.BuoyDeltas.get(shape));
|
---|
703 | break;
|
---|
704 | }
|
---|
705 | Signals.addSignals(feature);
|
---|
706 | }
|
---|
707 |
|
---|
708 | private static void notices(Feature feature) {
|
---|
709 | if (Renderer.zoom >= 14) {
|
---|
710 | double dx = 0.0, dy = 0.0;
|
---|
711 | switch (feature.type) {
|
---|
712 | case BCNCAR:
|
---|
713 | case BCNISD:
|
---|
714 | case BCNLAT:
|
---|
715 | case BCNSAW:
|
---|
716 | case BCNSPP:
|
---|
717 | case BCNWTW:
|
---|
718 | dy = 45.0;
|
---|
719 | break;
|
---|
720 | case NOTMRK:
|
---|
721 | dy = 0.0;
|
---|
722 | break;
|
---|
723 | default:
|
---|
724 | return;
|
---|
725 | }
|
---|
726 | Symbol s1 = null, s2 = null;
|
---|
727 | MarSYS sys = MarSYS.SYS_CEVN;
|
---|
728 | BnkWTW bnk = BnkWTW.BWW_UNKN;
|
---|
729 | AttVal att = feature.atts.get(Att.MARSYS);
|
---|
730 | if (att != null) sys = (MarSYS)att.val;
|
---|
731 | ObjTab objs = feature.objs.get(Obj.NOTMRK);
|
---|
732 | int n = objs.size();
|
---|
733 | if (n > 2) {
|
---|
734 | s1 = Notices.Notice;
|
---|
735 | n = 1;
|
---|
736 | } else {
|
---|
737 | for (AttMap atts : objs.values()) {
|
---|
738 | if (atts.get(Att.MARSYS) != null) sys = (MarSYS)atts.get(Att.MARSYS).val;
|
---|
739 | CatNMK cat = CatNMK.NMK_UNKN;
|
---|
740 | if (atts.get(Att.CATNMK) != null) cat = (CatNMK)atts.get(Att.CATNMK).val;
|
---|
741 | s2 = Notices.getNotice(cat, sys);
|
---|
742 | }
|
---|
743 | }
|
---|
744 | /* Obj_t *obj = getObj(item, NOTMRK, i);
|
---|
745 | if (obj == NULL) continue;
|
---|
746 | Atta_t add;
|
---|
747 | int idx = 0;
|
---|
748 | while ((add = getAttEnum(obj, ADDMRK, idx++)) != MRK_UNKN) {
|
---|
749 | if ((add == MRK_LTRI) && (i == 2)) swap = true;
|
---|
750 | if ((add == MRK_RTRI) && (i != 2)) swap = true;
|
---|
751 | }
|
---|
752 | }
|
---|
753 | } else {
|
---|
754 |
|
---|
755 | }
|
---|
756 | for (int i = 0; i <=2; i++) {
|
---|
757 | Obj_t *obj = getObj(item, NOTMRK, i);
|
---|
758 | if (obj == NULL) continue;
|
---|
759 | Atta_t category = getAttEnum(obj, CATNMK, i);
|
---|
760 | Atta_t add;
|
---|
761 | int idx = 0;
|
---|
762 | int top=0, bottom=0, left=0, right=0;
|
---|
763 | while ((add = getAttEnum(obj, ADDMRK, idx++)) != MRK_UNKN) {
|
---|
764 | switch (add) {
|
---|
765 | case MRK_TOPB:
|
---|
766 | top = add;
|
---|
767 | break;
|
---|
768 | case MRK_BOTB:
|
---|
769 | case MRK_BTRI:
|
---|
770 | bottom = add;
|
---|
771 | break;
|
---|
772 | case MRK_LTRI:
|
---|
773 | left = add;
|
---|
774 | break;
|
---|
775 | case MRK_RTRI:
|
---|
776 | right = add;
|
---|
777 | break;
|
---|
778 | default:
|
---|
779 | break;
|
---|
780 | }
|
---|
781 | }
|
---|
782 | double orient = getAtt(obj, ORIENT) != NULL ? getAtt(obj, ORIENT)->val.val.f : 0.0;
|
---|
783 | int system = getAtt(obj, MARSYS) != NULL ? getAtt(obj, MARSYS)->val.val.e : 0;
|
---|
784 | double flip = 0.0;
|
---|
785 | char *symb = "";
|
---|
786 | char *base = "";
|
---|
787 | char *colour = "black";
|
---|
788 | if ((system == SYS_BWR2) || (system == SYS_BNWR)) {
|
---|
789 | symb = bniwr_map[category];
|
---|
790 | switch (category) {
|
---|
791 | case NMK_NANK:
|
---|
792 | case NMK_LMHR:
|
---|
793 | case NMK_KTPM...NMK_RSPD:
|
---|
794 | {
|
---|
795 | int bank = getAtt(obj, BNKWTW) != NULL ? getAtt(obj, BNKWTW)->val.val.e : 0;
|
---|
796 | switch (bank) {
|
---|
797 | case BWW_LEFT:
|
---|
798 | base = "notice_blb";
|
---|
799 | colour = "red";
|
---|
800 | break;
|
---|
801 | case BWW_RGHT:
|
---|
802 | base = "notice_brb";
|
---|
803 | colour = "green";
|
---|
804 | break;
|
---|
805 | default:
|
---|
806 | base = "notice_bsi";
|
---|
807 | colour = "black";
|
---|
808 | break;
|
---|
809 | }
|
---|
810 | }
|
---|
811 | default:
|
---|
812 | break;
|
---|
813 | }
|
---|
814 | } else if (system == SYS_PPWB) {
|
---|
815 | int bank = getAtt(obj, BNKWTW) != NULL ? getAtt(obj, BNKWTW)->val.val.e : 0;
|
---|
816 | if (bank != 0) {
|
---|
817 | switch (category) {
|
---|
818 | case NMK_WLAR:
|
---|
819 | if (bank == BNK_LEFT)
|
---|
820 | base = "notice_pwlarl";
|
---|
821 | else
|
---|
822 | base = "notice_pwlarr";
|
---|
823 | break;
|
---|
824 | case NMK_WRAL:
|
---|
825 | if (bank == BNK_LEFT)
|
---|
826 | base = "notice_pwrall";
|
---|
827 | else
|
---|
828 | base = "notice_pwralr";
|
---|
829 | break;
|
---|
830 | case NMK_KTPM:
|
---|
831 | if (bank == BNK_LEFT)
|
---|
832 | base = "notice_ppml";
|
---|
833 | else
|
---|
834 | base = "notice_ppmr";
|
---|
835 | break;
|
---|
836 | case NMK_KTSM:
|
---|
837 | if (bank == BNK_LEFT)
|
---|
838 | base = "notice_psml";
|
---|
839 | else
|
---|
840 | base = "notice_psmr";
|
---|
841 | break;
|
---|
842 | case NMK_KTMR:
|
---|
843 | if (bank == BNK_LEFT)
|
---|
844 | base = "notice_pmrl";
|
---|
845 | else
|
---|
846 | base = "notice_pmrr";
|
---|
847 | break;
|
---|
848 | case NMK_CRTP:
|
---|
849 | if (bank == BNK_LEFT)
|
---|
850 | base = "notice_pcpl";
|
---|
851 | else
|
---|
852 | base = "notice_pcpr";
|
---|
853 | break;
|
---|
854 | case NMK_CRTS:
|
---|
855 | if (bank == BNK_LEFT)
|
---|
856 | base = "notice_pcsl";
|
---|
857 | else
|
---|
858 | base = "notice_pcsr";
|
---|
859 | break;
|
---|
860 | default:
|
---|
861 | break;
|
---|
862 | }
|
---|
863 | }
|
---|
864 | } else {
|
---|
865 | symb = notice_map[category];
|
---|
866 | switch (category) {
|
---|
867 | case NMK_NOVK...NMK_NWSH:
|
---|
868 | case NMK_NMTC...NMK_NLBG:
|
---|
869 | base = "notice_a";
|
---|
870 | break;
|
---|
871 | case NMK_MVTL...NMK_CHDR:
|
---|
872 | base = "notice_b";
|
---|
873 | break;
|
---|
874 | case NMK_PRTL...NMK_PRTR:
|
---|
875 | case NMK_OVHC...NMK_LBGP:
|
---|
876 | base = "notice_e";
|
---|
877 | colour = "white";
|
---|
878 | break;
|
---|
879 | default:
|
---|
880 | break;
|
---|
881 | }
|
---|
882 | switch (category) {
|
---|
883 | case NMK_MVTL:
|
---|
884 | case NMK_ANKP:
|
---|
885 | case NMK_PRTL:
|
---|
886 | case NMK_MWAL:
|
---|
887 | case NMK_MWAR:
|
---|
888 | flip = 180.0;
|
---|
889 | break;
|
---|
890 | case NMK_SWWR:
|
---|
891 | case NMK_WRSL:
|
---|
892 | case NMK_WARL:
|
---|
893 | flip = -90.0;
|
---|
894 | break;
|
---|
895 | case NMK_SWWC:
|
---|
896 | case NMK_SWWL:
|
---|
897 | case NMK_WLSR:
|
---|
898 | case NMK_WALR:
|
---|
899 | flip = 90.0;
|
---|
900 | break;
|
---|
901 | default:
|
---|
902 | break;
|
---|
903 | }
|
---|
904 | }
|
---|
905 | if (n == 2) {
|
---|
906 | dx = (((i != 2) && swap) || ((i == 2) && !swap)) ? -30.0 : 30.0;
|
---|
907 | }
|
---|
908 | if (top == MRK_TOPB)
|
---|
909 | renderSymbol(item, NOTMRK, "notice_board", "", "", BC, dx, dy, orient);
|
---|
910 | if (bottom == MRK_BOTB)
|
---|
911 | renderSymbol(item, NOTMRK, "notice_board", "", "", BC, dx, dy, orient+180);
|
---|
912 | if (bottom == MRK_BTRI)
|
---|
913 | renderSymbol(item, NOTMRK, "notice_triangle", "", "", BC, dx, dy, orient+180);
|
---|
914 | if (left == MRK_LTRI)
|
---|
915 | renderSymbol(item, NOTMRK, "notice_triangle", "", "", BC, dx, dy, orient-90);
|
---|
916 | if (right == MRK_RTRI)
|
---|
917 | renderSymbol(item, NOTMRK, "notice_triangle", "", "", BC, dx, dy, orient+90);
|
---|
918 | renderSymbol(item, NOTMRK, base, "", "", CC, dx, dy, orient);
|
---|
919 | renderSymbol(item, NOTMRK, symb, "", colour, CC, dx, dy, orient+flip);
|
---|
920 | }
|
---|
921 | */
|
---|
922 | }
|
---|
923 | }
|
---|
924 |
|
---|
925 | private static void obstructions(Feature feature) {
|
---|
926 | if ((Renderer.zoom >= 12) && (feature.type == Obj.OBSTRN)) {
|
---|
927 | switch ((CatOBS) getAttVal(feature, feature.type, 0, Att.CATOBS)) {
|
---|
928 | case OBS_BOOM:
|
---|
929 | Renderer.lineVector(feature, new LineStyle(Color.black, 5, new float[] { 20, 20 }, null));
|
---|
930 | if (Renderer.zoom >= 15) Renderer.lineText(feature, "Boom", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20);
|
---|
931 | }
|
---|
932 | }
|
---|
933 | if ((Renderer.zoom >= 14) && (feature.type == Obj.UWTROC)) {
|
---|
934 | WatLEV lvl = (WatLEV) getAttVal(feature, feature.type, 0, Att.WATLEV);
|
---|
935 | switch (lvl) {
|
---|
936 | case LEV_CVRS:
|
---|
937 | Renderer.symbol(feature, Areas.RockC);
|
---|
938 | break;
|
---|
939 | case LEV_AWSH:
|
---|
940 | Renderer.symbol(feature, Areas.RockA);
|
---|
941 | break;
|
---|
942 | default:
|
---|
943 | Renderer.symbol(feature, Areas.Rock);
|
---|
944 | }
|
---|
945 | } else {
|
---|
946 | Renderer.symbol(feature, Areas.Rock);
|
---|
947 | }
|
---|
948 | }
|
---|
949 |
|
---|
950 | private static void pipelines(Feature feature) {
|
---|
951 | if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) {
|
---|
952 | if (feature.type == Obj.PIPSOL) {
|
---|
953 | Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Mline);
|
---|
954 | } else if (feature.type == Obj.PIPOHD) {
|
---|
955 | Renderer.lineVector(feature, new LineStyle(Color.black, 8));
|
---|
956 | AttMap atts = feature.atts;
|
---|
957 | double verclr = 0;
|
---|
958 | if (atts != null) {
|
---|
959 | if (atts.containsKey(Att.VERCLR)) {
|
---|
960 | verclr = (Double) atts.get(Att.VERCLR).val;
|
---|
961 | } else {
|
---|
962 | verclr = atts.containsKey(Att.VERCSA) ? (Double) atts.get(Att.VERCSA).val : 0;
|
---|
963 | }
|
---|
964 | if (verclr > 0) {
|
---|
965 | Renderer.labelText(feature, String.valueOf(verclr), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
|
---|
966 | }
|
---|
967 | }
|
---|
968 | }
|
---|
969 | }
|
---|
970 | }
|
---|
971 |
|
---|
972 | private static void platforms(Feature feature) {
|
---|
973 | ArrayList<CatOFP> cats = (ArrayList<CatOFP>)getAttVal(feature, Obj.OFSPLF, 0, Att.CATOFP);
|
---|
974 | if ((CatOFP) cats.get(0) == CatOFP.OFP_FPSO)
|
---|
975 | Renderer.symbol(feature, Buoys.Storage);
|
---|
976 | else
|
---|
977 | Renderer.symbol(feature, Landmarks.Platform);
|
---|
978 | addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
|
---|
979 | Signals.addSignals(feature);
|
---|
980 | }
|
---|
981 |
|
---|
982 | private static void ports(Feature feature) {
|
---|
983 | if (Renderer.zoom >= 14) {
|
---|
984 | if (feature.type == Obj.CRANES) {
|
---|
985 | if ((CatCRN) getAttVal(feature, feature.type, 0, Att.CATCRN) == CatCRN.CRN_CONT)
|
---|
986 | Renderer.symbol(feature, Harbours.ContainerCrane);
|
---|
987 | else
|
---|
988 | Renderer.symbol(feature, Harbours.PortCrane);
|
---|
989 | } else if (feature.type == Obj.HULKES) {
|
---|
990 | Renderer.lineVector(feature, new LineStyle(Color.black, 4, null, new Color(0xffe000)));
|
---|
991 | addName(feature, 15, new Font("Arial", Font.BOLD, 80));
|
---|
992 | }
|
---|
993 | }
|
---|
994 | }
|
---|
995 |
|
---|
996 | private static void separation(Feature feature) {
|
---|
997 | switch (feature.type) {
|
---|
998 | case TSEZNE:
|
---|
999 | case TSSCRS:
|
---|
1000 | case TSSRON:
|
---|
1001 | if (Renderer.zoom <= 15)
|
---|
1002 | Renderer.lineVector(feature, new LineStyle(null, 0, null, new Color(0x80c48080, true)));
|
---|
1003 | else
|
---|
1004 | Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, null, null));
|
---|
1005 | addName(feature, 10, new Font("Arial", Font.BOLD, 150), new Color(0x80c48080, true));
|
---|
1006 | break;
|
---|
1007 | case TSELNE:
|
---|
1008 | Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, null, null));
|
---|
1009 | break;
|
---|
1010 | case TSSLPT:
|
---|
1011 | Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, null, 0, new Color(0x80c48080, true));
|
---|
1012 | break;
|
---|
1013 | case TSSBND:
|
---|
1014 | Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, new float[] { 40, 40 }, null));
|
---|
1015 | break;
|
---|
1016 | case ISTZNE:
|
---|
1017 | Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, new Color(0x80c48080, true));
|
---|
1018 | break;
|
---|
1019 | }
|
---|
1020 | }
|
---|
1021 |
|
---|
1022 | private static void shoreline(Feature feature) {
|
---|
1023 | if (Renderer.zoom >= 12) {
|
---|
1024 | switch ((CatSLC) getAttVal(feature, feature.type, 0, Att.CATSLC)) {
|
---|
1025 | case SLC_TWAL:
|
---|
1026 | WatLEV lev = (WatLEV) getAttVal(feature, feature.type, 0, Att.WATLEV);
|
---|
1027 | if (lev == WatLEV.LEV_CVRS) {
|
---|
1028 | Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
|
---|
1029 | if (Renderer.zoom >= 15)
|
---|
1030 | Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, 80);
|
---|
1031 | } else {
|
---|
1032 | Renderer.lineVector(feature, new LineStyle(Color.black, 10, null, null));
|
---|
1033 | }
|
---|
1034 | if (Renderer.zoom >= 15)
|
---|
1035 | Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -30);
|
---|
1036 | break;
|
---|
1037 | case SLC_SWAY:
|
---|
1038 | Renderer.lineVector(feature, new LineStyle(Color.black, 2, null, new Color(0xffe000)));
|
---|
1039 | if ((Renderer.zoom >= 16) && feature.objs.containsKey(Obj.SMCFAC)) {
|
---|
1040 | ArrayList<Symbol> symbols = new ArrayList<Symbol>();
|
---|
1041 | ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttVal(feature, Obj.SMCFAC, 0, Att.CATSCF);
|
---|
1042 | for (CatSCF scf : scfs) {
|
---|
1043 | symbols.add(Facilities.Cats.get(scf));
|
---|
1044 | }
|
---|
1045 | Renderer.cluster(feature, symbols);
|
---|
1046 | }
|
---|
1047 | break;
|
---|
1048 | }
|
---|
1049 | }
|
---|
1050 | }
|
---|
1051 |
|
---|
1052 | private static void stations(Feature feature) {
|
---|
1053 | if (Renderer.zoom >= 14) {
|
---|
1054 | String str = "";
|
---|
1055 | switch (feature.type) {
|
---|
1056 | case SISTAT:
|
---|
1057 | case SISTAW:
|
---|
1058 | Renderer.symbol(feature, Harbours.SignalStation);
|
---|
1059 | str = "SS";
|
---|
1060 | // Append (cat) to str
|
---|
1061 | break;
|
---|
1062 | case RDOSTA:
|
---|
1063 | Renderer.symbol(feature, Harbours.SignalStation);
|
---|
1064 | Renderer.symbol(feature, Beacons.RadarStation);
|
---|
1065 | break;
|
---|
1066 | case RADSTA:
|
---|
1067 | Renderer.symbol(feature, Harbours.SignalStation);
|
---|
1068 | Renderer.symbol(feature, Beacons.RadarStation);
|
---|
1069 | break;
|
---|
1070 | case PILBOP:
|
---|
1071 | Renderer.symbol(feature, Harbours.Pilot);
|
---|
1072 | break;
|
---|
1073 | case CGUSTA:
|
---|
1074 | Renderer.symbol(feature, Harbours.SignalStation);
|
---|
1075 | str = "CG";
|
---|
1076 | break;
|
---|
1077 | case RSCSTA:
|
---|
1078 | Renderer.symbol(feature, Harbours.Rescue);
|
---|
1079 | break;
|
---|
1080 | }
|
---|
1081 | if ((Renderer.zoom >= 15) && !str.isEmpty()) {
|
---|
1082 | Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0)));
|
---|
1083 | }
|
---|
1084 | Signals.addSignals(feature);
|
---|
1085 | }
|
---|
1086 | /* case CGUSTA:
|
---|
1087 | strcpy(string1, "CG");
|
---|
1088 | if ((obj != NULL) && (att = getAtt(obj, COMCHA)) != NULL)
|
---|
1089 | sprintf(strchr(string1, 0), " Ch.%s", stringValue(att->val));
|
---|
1090 | break;
|
---|
1091 | case SISTAT:
|
---|
1092 | strcpy(string1, "SS");
|
---|
1093 | if (obj != NULL) {
|
---|
1094 | if ((att = getAtt(obj, CATSIT)) != NULL)
|
---|
1095 | strcat(string1, sit_map[att->val.val.l->val]);
|
---|
1096 | if ((att = getAtt(obj, COMCHA)) != NULL)
|
---|
1097 | sprintf(strchr(string1, 0), "\nCh.%s", stringValue(att->val));
|
---|
1098 | }
|
---|
1099 | break;
|
---|
1100 | case SISTAW:
|
---|
1101 | strcpy(string1, "SS");
|
---|
1102 | if (obj != NULL) {
|
---|
1103 | if ((att = getAtt(obj, CATSIW)) != NULL)
|
---|
1104 | strcat(string1, siw_map[att->val.val.l->val]);
|
---|
1105 | if ((att = getAtt(obj, COMCHA)) != NULL)
|
---|
1106 | sprintf(strchr(string1, 0), "\nCh.%s", stringValue(att->val));
|
---|
1107 | }
|
---|
1108 | break;*/
|
---|
1109 | }
|
---|
1110 |
|
---|
1111 | private static void transits(Feature feature) {
|
---|
1112 | if (Renderer.zoom >= 12) {
|
---|
1113 | if (feature.type == Obj.RECTRC) Renderer.lineVector (feature, new LineStyle(Color.black, 10, null, null));
|
---|
1114 | else if (feature.type == Obj.NAVLNE) Renderer.lineVector (feature, new LineStyle(Color.black, 10, new float[] { 25, 25 }, null));
|
---|
1115 | }
|
---|
1116 | if (Renderer.zoom >= 15) {
|
---|
1117 | String str = "";
|
---|
1118 | String name = getName(feature);
|
---|
1119 | if (name != null) str += name + " ";
|
---|
1120 | Double ort = (Double) getAttVal(feature, feature.type, 0, Att.ORIENT);
|
---|
1121 | if (ort != null) str += ort.toString() + "\u0152";
|
---|
1122 | if (!str.isEmpty()) Renderer.lineText(feature, str, new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20);
|
---|
1123 | }
|
---|
1124 | }
|
---|
1125 |
|
---|
1126 | private static void waterways(Feature feature) {
|
---|
1127 |
|
---|
1128 | }
|
---|
1129 |
|
---|
1130 | private static void wrecks(Feature feature) {
|
---|
1131 | if (Renderer.zoom >= 14) {
|
---|
1132 | CatWRK cat = (CatWRK) getAttVal(feature, feature.type, 0, Att.CATWRK);
|
---|
1133 | switch (cat) {
|
---|
1134 | case WRK_DNGR:
|
---|
1135 | case WRK_MSTS:
|
---|
1136 | Renderer.symbol(feature, Areas.WreckD);
|
---|
1137 | break;
|
---|
1138 | case WRK_HULS:
|
---|
1139 | Renderer.symbol(feature, Areas.WreckS);
|
---|
1140 | break;
|
---|
1141 | default:
|
---|
1142 | Renderer.symbol(feature, Areas.WreckND);
|
---|
1143 | }
|
---|
1144 | }
|
---|
1145 | }
|
---|
1146 | }
|
---|