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