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