Changeset 30150 in osm for applications/editors/josm/plugins/smed2/src/render/Rules.java
- Timestamp:
- 2013-12-25T11:40:00+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src/render
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/render/Rules.java
r30123 r30150 8 8 */ 9 9 10 package seamap;10 package render; 11 11 12 12 import java.awt.Color; … … 20 20 import s57.S57att.*; 21 21 import s57.S57obj.*; 22 import s eamap.Renderer.*;23 import seamap.SeaMap.*;22 import s57.S57map.*; 23 import render.Renderer.*; 24 24 import symbols.*; 25 25 import symbols.Symbols.*; … … 27 27 public class Rules { 28 28 29 static SeaMap map; 30 static int zoom; 29 public static final Color Yland = new Color(0x50b0ff); 30 public static final Color Mline = new Color(0xc480ff); 31 public static final Color Msymb = new Color(0xa30075); 31 32 32 33 static String getName(Feature feature) { … … 106 107 } 107 108 108 public static void rules (SeaMap m, int z) { 109 map = m; 110 zoom = z; 109 public static void rules () { 111 110 ArrayList<Feature> objects; 112 if ((objects = map.features.get(Obj.SLCONS)) != null) for (Feature feature : objects) shoreline(feature);113 if ((objects = map.features.get(Obj.PIPSOL)) != null) for (Feature feature : objects) pipelines(feature);114 if ((objects = map.features.get(Obj.CBLSUB)) != null) for (Feature feature : objects) cables(feature);115 if ((objects = map.features.get(Obj.PIPOHD)) != null) for (Feature feature : objects) pipelines(feature);116 if ((objects = map.features.get(Obj.CBLOHD)) != null) for (Feature feature : objects) cables(feature);117 if ((objects = map.features.get(Obj.TSEZNE)) != null) for (Feature feature : objects) separation(feature);118 if ((objects = map.features.get(Obj.TSSCRS)) != null) for (Feature feature : objects) separation(feature);119 if ((objects = map.features.get(Obj.TSSRON)) != null) for (Feature feature : objects) separation(feature);120 if ((objects = map.features.get(Obj.TSELNE)) != null) for (Feature feature : objects) separation(feature);121 if ((objects = map.features.get(Obj.TSSLPT)) != null) for (Feature feature : objects) separation(feature);122 if ((objects = map.features.get(Obj.TSSBND)) != null) for (Feature feature : objects) separation(feature);123 if ((objects = map.features.get(Obj.ISTZNE)) != null) for (Feature feature : objects) separation(feature);124 if ((objects = map.features.get(Obj.SNDWAV)) != null) for (Feature feature : objects) areas(feature);125 if ((objects = map.features.get(Obj.OSPARE)) != null) for (Feature feature : objects) areas(feature);126 if ((objects = map.features.get(Obj.FAIRWY)) != null) for (Feature feature : objects) areas(feature);127 if ((objects = map.features.get(Obj.DRGARE)) != null) for (Feature feature : objects) areas(feature);128 if ((objects = map.features.get(Obj.RESARE)) != null) for (Feature feature : objects) areas(feature);129 if ((objects = map.features.get(Obj.SPLARE)) != null) for (Feature feature : objects) areas(feature);130 if ((objects = map.features.get(Obj.SEAARE)) != null) for (Feature feature : objects) areas(feature);131 if ((objects = map.features.get(Obj.OBSTRN)) != null) for (Feature feature : objects) obstructions(feature);132 if ((objects = map.features.get(Obj.UWTROC)) != null) for (Feature feature : objects) obstructions(feature);133 if ((objects = map.features.get(Obj.MARCUL)) != null) for (Feature feature : objects) areas(feature);134 if ((objects = map.features.get(Obj.WTWAXS)) != null) for (Feature feature : objects) waterways(feature);135 if ((objects = map.features.get(Obj.RECTRC)) != null) for (Feature feature : objects) transits(feature);136 if ((objects = map.features.get(Obj.NAVLNE)) != null) for (Feature feature : objects) transits(feature);137 if ((objects = map.features.get(Obj.HRBFAC)) != null) for (Feature feature : objects) harbours(feature);138 if ((objects = map.features.get(Obj.ACHARE)) != null) for (Feature feature : objects) harbours(feature);139 if ((objects = map.features.get(Obj.ACHBRT)) != null) for (Feature feature : objects) harbours(feature);140 if ((objects = map.features.get(Obj.BERTHS)) != null) for (Feature feature : objects) harbours(feature);141 if ((objects = map.features.get(Obj.LOKBSN)) != null) for (Feature feature : objects) locks(feature);142 if ((objects = map.features.get(Obj.LKBSPT)) != null) for (Feature feature : objects) locks(feature);143 if ((objects = map.features.get(Obj.GATCON)) != null) for (Feature feature : objects) locks(feature);144 if ((objects = map.features.get(Obj.DISMAR)) != null) for (Feature feature : objects) distances(feature);145 if ((objects = map.features.get(Obj.HULKES)) != null) for (Feature feature : objects) ports(feature);146 if ((objects = map.features.get(Obj.CRANES)) != null) for (Feature feature : objects) ports(feature);147 if ((objects = map.features.get(Obj.LNDMRK)) != null) for (Feature feature : objects) landmarks(feature);148 if ((objects = map.features.get(Obj.BUISGL)) != null) for (Feature feature : objects) harbours(feature);149 if ((objects = map.features.get(Obj.MORFAC)) != null) for (Feature feature : objects) moorings(feature);150 if ((objects = map.features.get(Obj.NOTMRK)) != null) for (Feature feature : objects) notices(feature);151 if ((objects = map.features.get(Obj.SMCFAC)) != null) for (Feature feature : objects) marinas(feature);152 if ((objects = map.features.get(Obj.BRIDGE)) != null) for (Feature feature : objects) bridges(feature);153 if ((objects = map.features.get(Obj.PILPNT)) != null) for (Feature feature : objects) lights(feature);154 if ((objects = map.features.get(Obj.LITMIN)) != null) for (Feature feature : objects) lights(feature);155 if ((objects = map.features.get(Obj.LITMAJ)) != null) for (Feature feature : objects) lights(feature);156 if ((objects = map.features.get(Obj.LIGHTS)) != null) for (Feature feature : objects) lights(feature);157 if ((objects = map.features.get(Obj.SISTAT)) != null) for (Feature feature : objects) stations(feature);158 if ((objects = map.features.get(Obj.SISTAW)) != null) for (Feature feature : objects) stations(feature);159 if ((objects = map.features.get(Obj.CGUSTA)) != null) for (Feature feature : objects) stations(feature);160 if ((objects = map.features.get(Obj.RDOSTA)) != null) for (Feature feature : objects) stations(feature);161 if ((objects = map.features.get(Obj.RADSTA)) != null) for (Feature feature : objects) stations(feature);162 if ((objects = map.features.get(Obj.RSCSTA)) != null) for (Feature feature : objects) stations(feature);163 if ((objects = map.features.get(Obj.PILBOP)) != null) for (Feature feature : objects) stations(feature);164 if ((objects = map.features.get(Obj.WTWGAG)) != null) for (Feature feature : objects) gauges(feature);165 if ((objects = map.features.get(Obj.OFSPLF)) != null) for (Feature feature : objects) platforms(feature);166 if ((objects = map.features.get(Obj.WRECKS)) != null) for (Feature feature : objects) wrecks(feature);167 if ((objects = map.features.get(Obj.LITVES)) != null) for (Feature feature : objects) floats(feature);168 if ((objects = map.features.get(Obj.LITFLT)) != null) for (Feature feature : objects) floats(feature);169 if ((objects = map.features.get(Obj.BOYINB)) != null) for (Feature feature : objects) floats(feature);170 if ((objects = map.features.get(Obj.BOYLAT)) != null) for (Feature feature : objects) buoys(feature);171 if ((objects = map.features.get(Obj.BOYCAR)) != null) for (Feature feature : objects) buoys(feature);172 if ((objects = map.features.get(Obj.BOYISD)) != null) for (Feature feature : objects) buoys(feature);173 if ((objects = map.features.get(Obj.BOYSAW)) != null) for (Feature feature : objects) buoys(feature);174 if ((objects = map.features.get(Obj.BOYSPP)) != null) for (Feature feature : objects) buoys(feature);175 if ((objects = map.features.get(Obj.BOYWTW)) != null) for (Feature feature : objects) buoys(feature);176 if ((objects = map.features.get(Obj.BCNLAT)) != null) for (Feature feature : objects) beacons(feature);177 if ((objects = map.features.get(Obj.BCNCAR)) != null) for (Feature feature : objects) beacons(feature);178 if ((objects = map.features.get(Obj.BCNISD)) != null) for (Feature feature : objects) beacons(feature);179 if ((objects = map.features.get(Obj.BCNSAW)) != null) for (Feature feature : objects) beacons(feature);180 if ((objects = map.features.get(Obj.BCNSPP)) != null) for (Feature feature : objects) beacons(feature);181 if ((objects = map.features.get(Obj.BCNWTW)) != null) for (Feature feature : objects) beacons(feature);111 if ((objects = Renderer.map.features.get(Obj.SLCONS)) != null) for (Feature feature : objects) shoreline(feature); 112 if ((objects = Renderer.map.features.get(Obj.PIPSOL)) != null) for (Feature feature : objects) pipelines(feature); 113 if ((objects = Renderer.map.features.get(Obj.CBLSUB)) != null) for (Feature feature : objects) cables(feature); 114 if ((objects = Renderer.map.features.get(Obj.PIPOHD)) != null) for (Feature feature : objects) pipelines(feature); 115 if ((objects = Renderer.map.features.get(Obj.CBLOHD)) != null) for (Feature feature : objects) cables(feature); 116 if ((objects = Renderer.map.features.get(Obj.TSEZNE)) != null) for (Feature feature : objects) separation(feature); 117 if ((objects = Renderer.map.features.get(Obj.TSSCRS)) != null) for (Feature feature : objects) separation(feature); 118 if ((objects = Renderer.map.features.get(Obj.TSSRON)) != null) for (Feature feature : objects) separation(feature); 119 if ((objects = Renderer.map.features.get(Obj.TSELNE)) != null) for (Feature feature : objects) separation(feature); 120 if ((objects = Renderer.map.features.get(Obj.TSSLPT)) != null) for (Feature feature : objects) separation(feature); 121 if ((objects = Renderer.map.features.get(Obj.TSSBND)) != null) for (Feature feature : objects) separation(feature); 122 if ((objects = Renderer.map.features.get(Obj.ISTZNE)) != null) for (Feature feature : objects) separation(feature); 123 if ((objects = Renderer.map.features.get(Obj.SNDWAV)) != null) for (Feature feature : objects) areas(feature); 124 if ((objects = Renderer.map.features.get(Obj.OSPARE)) != null) for (Feature feature : objects) areas(feature); 125 if ((objects = Renderer.map.features.get(Obj.FAIRWY)) != null) for (Feature feature : objects) areas(feature); 126 if ((objects = Renderer.map.features.get(Obj.DRGARE)) != null) for (Feature feature : objects) areas(feature); 127 if ((objects = Renderer.map.features.get(Obj.RESARE)) != null) for (Feature feature : objects) areas(feature); 128 if ((objects = Renderer.map.features.get(Obj.SPLARE)) != null) for (Feature feature : objects) areas(feature); 129 if ((objects = Renderer.map.features.get(Obj.SEAARE)) != null) for (Feature feature : objects) areas(feature); 130 if ((objects = Renderer.map.features.get(Obj.OBSTRN)) != null) for (Feature feature : objects) obstructions(feature); 131 if ((objects = Renderer.map.features.get(Obj.UWTROC)) != null) for (Feature feature : objects) obstructions(feature); 132 if ((objects = Renderer.map.features.get(Obj.MARCUL)) != null) for (Feature feature : objects) areas(feature); 133 if ((objects = Renderer.map.features.get(Obj.WTWAXS)) != null) for (Feature feature : objects) waterways(feature); 134 if ((objects = Renderer.map.features.get(Obj.RECTRC)) != null) for (Feature feature : objects) transits(feature); 135 if ((objects = Renderer.map.features.get(Obj.NAVLNE)) != null) for (Feature feature : objects) transits(feature); 136 if ((objects = Renderer.map.features.get(Obj.HRBFAC)) != null) for (Feature feature : objects) harbours(feature); 137 if ((objects = Renderer.map.features.get(Obj.ACHARE)) != null) for (Feature feature : objects) harbours(feature); 138 if ((objects = Renderer.map.features.get(Obj.ACHBRT)) != null) for (Feature feature : objects) harbours(feature); 139 if ((objects = Renderer.map.features.get(Obj.BERTHS)) != null) for (Feature feature : objects) harbours(feature); 140 if ((objects = Renderer.map.features.get(Obj.LOKBSN)) != null) for (Feature feature : objects) locks(feature); 141 if ((objects = Renderer.map.features.get(Obj.LKBSPT)) != null) for (Feature feature : objects) locks(feature); 142 if ((objects = Renderer.map.features.get(Obj.GATCON)) != null) for (Feature feature : objects) locks(feature); 143 if ((objects = Renderer.map.features.get(Obj.DISMAR)) != null) for (Feature feature : objects) distances(feature); 144 if ((objects = Renderer.map.features.get(Obj.HULKES)) != null) for (Feature feature : objects) ports(feature); 145 if ((objects = Renderer.map.features.get(Obj.CRANES)) != null) for (Feature feature : objects) ports(feature); 146 if ((objects = Renderer.map.features.get(Obj.LNDMRK)) != null) for (Feature feature : objects) landmarks(feature); 147 if ((objects = Renderer.map.features.get(Obj.BUISGL)) != null) for (Feature feature : objects) harbours(feature); 148 if ((objects = Renderer.map.features.get(Obj.MORFAC)) != null) for (Feature feature : objects) moorings(feature); 149 if ((objects = Renderer.map.features.get(Obj.NOTMRK)) != null) for (Feature feature : objects) notices(feature); 150 if ((objects = Renderer.map.features.get(Obj.SMCFAC)) != null) for (Feature feature : objects) marinas(feature); 151 if ((objects = Renderer.map.features.get(Obj.BRIDGE)) != null) for (Feature feature : objects) bridges(feature); 152 if ((objects = Renderer.map.features.get(Obj.PILPNT)) != null) for (Feature feature : objects) lights(feature); 153 if ((objects = Renderer.map.features.get(Obj.LITMIN)) != null) for (Feature feature : objects) lights(feature); 154 if ((objects = Renderer.map.features.get(Obj.LITMAJ)) != null) for (Feature feature : objects) lights(feature); 155 if ((objects = Renderer.map.features.get(Obj.LIGHTS)) != null) for (Feature feature : objects) lights(feature); 156 if ((objects = Renderer.map.features.get(Obj.SISTAT)) != null) for (Feature feature : objects) stations(feature); 157 if ((objects = Renderer.map.features.get(Obj.SISTAW)) != null) for (Feature feature : objects) stations(feature); 158 if ((objects = Renderer.map.features.get(Obj.CGUSTA)) != null) for (Feature feature : objects) stations(feature); 159 if ((objects = Renderer.map.features.get(Obj.RDOSTA)) != null) for (Feature feature : objects) stations(feature); 160 if ((objects = Renderer.map.features.get(Obj.RADSTA)) != null) for (Feature feature : objects) stations(feature); 161 if ((objects = Renderer.map.features.get(Obj.RSCSTA)) != null) for (Feature feature : objects) stations(feature); 162 if ((objects = Renderer.map.features.get(Obj.PILBOP)) != null) for (Feature feature : objects) stations(feature); 163 if ((objects = Renderer.map.features.get(Obj.WTWGAG)) != null) for (Feature feature : objects) gauges(feature); 164 if ((objects = Renderer.map.features.get(Obj.OFSPLF)) != null) for (Feature feature : objects) platforms(feature); 165 if ((objects = Renderer.map.features.get(Obj.WRECKS)) != null) for (Feature feature : objects) wrecks(feature); 166 if ((objects = Renderer.map.features.get(Obj.LITVES)) != null) for (Feature feature : objects) floats(feature); 167 if ((objects = Renderer.map.features.get(Obj.LITFLT)) != null) for (Feature feature : objects) floats(feature); 168 if ((objects = Renderer.map.features.get(Obj.BOYINB)) != null) for (Feature feature : objects) floats(feature); 169 if ((objects = Renderer.map.features.get(Obj.BOYLAT)) != null) for (Feature feature : objects) buoys(feature); 170 if ((objects = Renderer.map.features.get(Obj.BOYCAR)) != null) for (Feature feature : objects) buoys(feature); 171 if ((objects = Renderer.map.features.get(Obj.BOYISD)) != null) for (Feature feature : objects) buoys(feature); 172 if ((objects = Renderer.map.features.get(Obj.BOYSAW)) != null) for (Feature feature : objects) buoys(feature); 173 if ((objects = Renderer.map.features.get(Obj.BOYSPP)) != null) for (Feature feature : objects) buoys(feature); 174 if ((objects = Renderer.map.features.get(Obj.BOYWTW)) != null) for (Feature feature : objects) buoys(feature); 175 if ((objects = Renderer.map.features.get(Obj.BCNLAT)) != null) for (Feature feature : objects) beacons(feature); 176 if ((objects = Renderer.map.features.get(Obj.BCNCAR)) != null) for (Feature feature : objects) beacons(feature); 177 if ((objects = Renderer.map.features.get(Obj.BCNISD)) != null) for (Feature feature : objects) beacons(feature); 178 if ((objects = Renderer.map.features.get(Obj.BCNSAW)) != null) for (Feature feature : objects) beacons(feature); 179 if ((objects = Renderer.map.features.get(Obj.BCNSPP)) != null) for (Feature feature : objects) beacons(feature); 180 if ((objects = Renderer.map.features.get(Obj.BCNWTW)) != null) for (Feature feature : objects) beacons(feature); 182 181 } 183 182 … … 186 185 switch (feature.type) { 187 186 case DRGARE: 188 if ( zoom < 16)187 if (Renderer.zoom < 16) 189 188 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, new Color(0x40ffffff, true))); 190 189 else 191 190 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 })); 192 if (( zoom >= 12) && (name != null))191 if ((Renderer.zoom >= 12) && (name != null)) 193 192 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE, Color.black); 194 193 break; 195 194 case FAIRWY: 196 195 if (feature.area > 2.0) { 197 if ( zoom < 16)198 Renderer.lineVector(feature, new LineStyle( Renderer.Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true)));196 if (Renderer.zoom < 16) 197 Renderer.lineVector(feature, new LineStyle(Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true))); 199 198 else 200 Renderer.lineVector(feature, new LineStyle( Renderer.Mline, 8, new float[] { 50, 50 }));199 Renderer.lineVector(feature, new LineStyle(Mline, 8, new float[] { 50, 50 })); 201 200 } else { 202 if ( zoom >= 14)201 if (Renderer.zoom >= 14) 203 202 Renderer.lineVector(feature, new LineStyle(null, 0, new Color(0x40ffffff, true))); 204 203 } 205 204 break; 206 205 case MARCUL: 207 if ( zoom >= 12) {208 if ( zoom >= 14) {206 if (Renderer.zoom >= 12) { 207 if (Renderer.zoom >= 14) { 209 208 Renderer.symbol(feature, Areas.MarineFarm); 210 209 } 211 if ((feature.area > 0.2) || ((feature.area > 0.05) && ( zoom >= 14)) || ((feature.area > 0.005) && (zoom >= 16))) {210 if ((feature.area > 0.2) || ((feature.area > 0.05) && (Renderer.zoom >= 14)) || ((feature.area > 0.005) && (Renderer.zoom >= 16))) { 212 211 Renderer.lineVector(feature, new LineStyle(Color.black, 4, new float[] { 10, 10 })); 213 212 } … … 218 217 Renderer.symbol(feature, Areas.WindFarm); 219 218 Renderer.lineVector(feature, new LineStyle(Color.black, 20, new float[] { 40, 40 })); 220 if (( zoom >= 15) && (name != null))219 if ((Renderer.zoom >= 15) && (name != null)) 221 220 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10))); 222 221 } 223 222 break; 224 223 case RESARE: 225 if ( zoom >= 12) {226 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Renderer.Mline);224 if (Renderer.zoom >= 12) { 225 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Mline); 227 226 if (testAttribute(feature, feature.type, Att.CATREA, CatREA.REA_NWAK)) { 228 227 Renderer.symbol(feature, Areas.NoWake); … … 233 232 switch ((CatSEA) getAttVal(feature, feature.type, 0, Att.CATSEA)) { 234 233 case SEA_RECH: 235 if (( zoom >= 10) && (name != null))234 if ((Renderer.zoom >= 10) && (name != null)) 236 235 if (feature.flag == Fflag.LINE) { 237 236 Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40); … … 241 240 break; 242 241 case SEA_BAY: 243 if (( zoom >= 12) && (name != null))242 if ((Renderer.zoom >= 12) && (name != null)) 244 243 if (feature.flag == Fflag.LINE) { 245 244 Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40); … … 249 248 break; 250 249 case SEA_SHOL: 251 if ( zoom >= 14) {250 if (Renderer.zoom >= 14) { 252 251 if (feature.flag == Fflag.AREA) { 253 252 Renderer.lineVector(feature, new LineStyle(new Color(0xc480ff), 4, new float[] { 25, 25 })); … … 271 270 case SEA_GAT: 272 271 case SEA_NRRW: 273 if (( zoom >= 12) && (name != null))272 if ((Renderer.zoom >= 12) && (name != null)) 274 273 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE, Color.black); 275 274 break; … … 279 278 break; 280 279 case SNDWAV: 281 if ( zoom >= 12) Renderer.fillPattern(feature, Areas.Sandwaves);280 if (Renderer.zoom >= 12) Renderer.fillPattern(feature, Areas.Sandwaves); 282 281 break; 283 282 case SPLARE: 284 if ( zoom >= 12) {285 Renderer.symbol(feature, Areas.Plane, new Scheme( Renderer.Msymb));286 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Renderer.Mline);287 } 288 if (( zoom >= 15) && (name != null))283 if (Renderer.zoom >= 12) { 284 Renderer.symbol(feature, Areas.Plane, new Scheme(Msymb)); 285 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Mline); 286 } 287 if ((Renderer.zoom >= 15) && (name != null)) 289 288 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90))); 290 289 break; … … 332 331 333 332 private static void bridges(Feature feature) { 334 if ( zoom >= 16) {333 if (Renderer.zoom >= 16) { 335 334 double verclr, verccl, vercop, horclr; 336 335 AttMap atts = feature.objs.get(Obj.BRIDGE).get(0); … … 371 370 372 371 private static void cables(Feature feature) { 373 if (( zoom >= 16) && (feature.length < 2)) {372 if ((Renderer.zoom >= 16) && (feature.length < 2)) { 374 373 if (feature.type == Obj.CBLSUB) { 375 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Renderer.Mline);374 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Mline); 376 375 } else if (feature.type == Obj.CBLOHD) { 377 376 AttMap atts = feature.objs.get(Obj.CBLOHD).get(0); … … 393 392 394 393 private static void distances(Feature feature) { 395 if ( zoom >= 14) {394 if (Renderer.zoom >= 14) { 396 395 if (!testAttribute(feature, Obj.DISMAR, Att.CATDIS, CatDIS.DIS_NONI)) { 397 396 Renderer.symbol(feature, Harbours.DistanceI); … … 399 398 Renderer.symbol(feature, Harbours.DistanceU); 400 399 } 401 if (( zoom >=15) && hasAttribute(feature, Obj.DISMAR, Att.WTWDIS)) {400 if ((Renderer.zoom >=15) && hasAttribute(feature, Obj.DISMAR, Att.WTWDIS)) { 402 401 AttMap atts = feature.objs.get(Obj.DISMAR).get(0); 403 402 Double dist = (Double) atts.get(Att.WTWDIS).val; … … 453 452 454 453 private static void gauges(Feature feature) { 455 if ( zoom >= 14) {454 if (Renderer.zoom >= 14) { 456 455 Renderer.symbol(feature, Harbours.TideGauge); 457 456 Signals.addSignals(feature); … … 463 462 switch (feature.type) { 464 463 case ACHBRT: 465 if ( zoom >= 14) {466 Renderer.symbol(feature, Harbours.Anchorage, new Scheme( Renderer.Mline));467 Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Renderer.Mline, Color.white, new Delta(Handle.BC));464 if (Renderer.zoom >= 14) { 465 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Mline)); 466 Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC)); 468 467 } 469 468 double radius = (Double)getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS); 470 469 if (radius != 0) { 471 470 UniHLU units = (UniHLU)getAttVal(feature, Obj.ACHBRT, 0, Att.HUNITS); 472 Renderer.lineCircle (feature, new LineStyle( Renderer.Mline, 4, new float[] { 10, 10 }, null), radius, units);471 Renderer.lineCircle (feature, new LineStyle(Mline, 4, new float[] { 10, 10 }, null), radius, units); 473 472 } 474 473 break; 475 474 case ACHARE: 476 if ( zoom >= 12) {475 if (Renderer.zoom >= 12) { 477 476 if (feature.flag != Fflag.AREA) { 478 477 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Color.black)); 479 478 } else { 480 Renderer.symbol(feature, Harbours.Anchorage, new Scheme( Renderer.Mline));481 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Renderer.Mline);482 } 483 if (( zoom >= 15) && ((name) != null)) {484 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));479 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Mline)); 480 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Mline); 481 } 482 if ((Renderer.zoom >= 15) && ((name) != null)) { 483 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0))); 485 484 } 486 485 ArrayList<StsSTS> sts = (ArrayList<StsSTS>)getAttVal(feature, Obj.ACHARE, 0, Att.STATUS); 487 if (( zoom >= 15) && (sts != null) && (sts.contains(StsSTS.STS_RESV))) {488 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));486 if ((Renderer.zoom >= 15) && (sts != null) && (sts.contains(StsSTS.STS_RESV))) { 487 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60))); 489 488 } 490 489 } … … 494 493 switch (cat) { 495 494 case ACH_DEEP: 496 Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));495 Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 497 496 dy += 60; 498 497 break; 499 498 case ACH_TANK: 500 Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));499 Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 501 500 dy += 60; 502 501 break; 503 502 case ACH_H24P: 504 Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));503 Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 505 504 dy += 60; 506 505 break; 507 506 case ACH_EXPL: 508 Renderer.symbol(feature, Harbours.Explosives, new Scheme( Renderer.Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));507 Renderer.symbol(feature, Harbours.Explosives, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 509 508 dy += 60; 510 509 break; 511 510 case ACH_QUAR: 512 Renderer.symbol(feature, Harbours.Hospital, new Scheme( Renderer.Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));511 Renderer.symbol(feature, Harbours.Hospital, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 513 512 dy += 60; 514 513 break; 515 514 case ACH_SEAP: 516 Renderer.symbol(feature, Areas.Seaplane, new Scheme( Renderer.Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));515 Renderer.symbol(feature, Areas.Seaplane, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 517 516 dy += 60; 518 517 break; … … 521 520 break; 522 521 case BERTHS: 523 if ( zoom >= 14) {524 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Renderer.Mline, Color.white, null);522 if (Renderer.zoom >= 14) { 523 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Mline, Color.white, null); 525 524 } 526 525 break; 527 526 case BUISGL: 528 if ( zoom >= 16) {527 if (Renderer.zoom >= 16) { 529 528 ArrayList<Symbol> symbols = new ArrayList<Symbol>(); 530 529 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN); … … 542 541 break; 543 542 case HRBFAC: 544 if ( zoom >= 12) {543 if (Renderer.zoom >= 12) { 545 544 ArrayList<CatHAF> cathaf = (ArrayList<CatHAF>) getAttVal(feature, Obj.HRBFAC, 0, Att.CATHAF); 546 545 if (cathaf.size() == 1) { … … 621 620 622 621 private static void marinas(Feature feature) { 623 if ( zoom >= 16) {622 if (Renderer.zoom >= 16) { 624 623 625 624 } … … 648 647 649 648 private static void notices(Feature feature) { 650 if ( zoom >= 14) {649 if (Renderer.zoom >= 14) { 651 650 double dx = 0.0, dy = 0.0; 652 651 switch (feature.type) { … … 865 864 866 865 private static void obstructions(Feature feature) { 867 if (( zoom >= 14) && (feature.type == Obj.UWTROC)) {866 if ((Renderer.zoom >= 14) && (feature.type == Obj.UWTROC)) { 868 867 WatLEV lvl = (WatLEV) getAttVal(feature, feature.type, 0, Att.WATLEV); 869 868 switch (lvl) { … … 883 882 884 883 private static void pipelines(Feature feature) { 885 if (( zoom >= 16) && (feature.length < 2)) {884 if ((Renderer.zoom >= 16) && (feature.length < 2)) { 886 885 if (feature.type == Obj.PIPSOL) { 887 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Renderer.Mline);886 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Mline); 888 887 } else if (feature.type == Obj.PIPOHD) { 889 888 Renderer.lineVector(feature, new LineStyle(Color.black, 8)); … … 911 910 Renderer.symbol(feature, Landmarks.Platform); 912 911 String name = getName(feature); 913 if (( zoom >= 15) && (name != null))912 if ((Renderer.zoom >= 15) && (name != null)) 914 913 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50))); 915 914 Signals.addSignals(feature); … … 917 916 918 917 private static void ports(Feature feature) { 919 if ( zoom >= 14) {918 if (Renderer.zoom >= 14) { 920 919 if (feature.type == Obj.CRANES) { 921 920 if ((CatCRN) getAttVal(feature, feature.type, 0, Att.CATCRN) == CatCRN.CRN_CONT) … … 926 925 Renderer.lineVector(feature, new LineStyle(Color.black, 4, null, new Color(0xffe000))); 927 926 String name = getName(feature); 928 if (( zoom >= 15) && (name != null))927 if ((Renderer.zoom >= 15) && (name != null)) 929 928 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, null); 930 929 } … … 937 936 case TSSCRS: 938 937 case TSSRON: 939 if ( zoom <= 15)938 if (Renderer.zoom <= 15) 940 939 Renderer.lineVector(feature, new LineStyle(null, 0, null, new Color(0x80c48080, true))); 941 940 else 942 941 Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, null, null)); 943 942 String name = getName(feature); 944 if (( zoom >= 10) && (name != null))943 if ((Renderer.zoom >= 10) && (name != null)) 945 944 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080, true), null, null); 946 945 break; … … 961 960 962 961 private static void shoreline(Feature feature) { 963 if ( zoom >= 12) {962 if (Renderer.zoom >= 12) { 964 963 switch ((CatSLC) getAttVal(feature, feature.type, 0, Att.CATSLC)) { 965 964 case SLC_TWAL: … … 967 966 if (lev == WatLEV.LEV_CVRS) { 968 967 Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null)); 969 if ( zoom >= 15)968 if (Renderer.zoom >= 15) 970 969 Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, 20); 971 970 } else { 972 971 Renderer.lineVector(feature, new LineStyle(Color.black, 10, null, null)); 973 972 } 974 if ( zoom >= 15)973 if (Renderer.zoom >= 15) 975 974 Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20); 976 975 } … … 979 978 980 979 private static void stations(Feature feature) { 981 if ( zoom >= 14) {980 if (Renderer.zoom >= 14) { 982 981 String str = ""; 983 982 switch (feature.type) { … … 1007 1006 break; 1008 1007 } 1009 if (( zoom >= 15) && !str.isEmpty()) {1008 if ((Renderer.zoom >= 15) && !str.isEmpty()) { 1010 1009 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0))); 1011 1010 } … … 1015 1014 1016 1015 private static void transits(Feature feature) { 1017 if ( zoom >= 12) {1016 if (Renderer.zoom >= 12) { 1018 1017 if (feature.type == Obj.RECTRC) Renderer.lineVector (feature, new LineStyle(Color.black, 10, null, null)); 1019 1018 else if (feature.type == Obj.NAVLNE) Renderer.lineVector (feature, new LineStyle(Color.black, 10, new float[] { 25, 25 }, null)); 1020 1019 } 1021 if ( zoom >= 15) {1020 if (Renderer.zoom >= 15) { 1022 1021 String str = ""; 1023 1022 String name = getName(feature); … … 1034 1033 1035 1034 private static void wrecks(Feature feature) { 1036 if ( zoom >= 14) {1035 if (Renderer.zoom >= 14) { 1037 1036 CatWRK cat = (CatWRK) getAttVal(feature, feature.type, 0, Att.CATWRK); 1038 1037 switch (cat) {
Note:
See TracChangeset
for help on using the changeset viewer.