Changeset 31027 in osm for applications/editors/josm/plugins/seachart/src/render
- Timestamp:
- 2015-02-19T21:52:40+01:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/seachart/src/render
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/render/Renderer.java
r31014 r31027 16 16 import java.util.*; 17 17 18 import render.Rules.*; 18 19 import s57.S57val.*; 19 20 import s57.S57map; 21 import s57.S57obj.Obj; 20 22 import s57.S57map.*; 21 23 import symbols.Areas; … … 45 47 g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP); 46 48 g2.setStroke(new BasicStroke(0, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)); 47 Rules.rules( );49 Rules.rules(RuleSet.BASE); 48 50 } 49 51 } … … 267 269 } 268 270 } 271 if ((style.fill != null) && (feature.geom.prim == Pflag.AREA)) { 272 g2.setPaint(style.fill); 273 g2.fill(p); 274 } 269 275 if (style.line != null) { 270 276 if (style.dash != null) { … … 276 282 g2.setStroke(new BasicStroke((float) (style.width * sScale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 1, dash, 0)); 277 283 } else { 278 g2.setStroke(new BasicStroke((float) (style.width * sScale), BasicStroke.CAP_ BUTT, BasicStroke.JOIN_ROUND));284 g2.setStroke(new BasicStroke((float) (style.width * sScale), BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); 279 285 } 280 286 g2.setPaint(style.line); 281 287 g2.draw(p); 282 }283 if (style.fill != null) {284 g2.setPaint(style.fill);285 g2.fill(p);286 288 } 287 289 } -
applications/editors/josm/plugins/seachart/src/render/Rules.java
r31014 r31027 27 27 28 28 public class Rules { 29 30 public enum RuleSet { ALL, BASE, SEAMARK } 29 31 30 32 public static final Color Yland = new Color(0xdcb820); … … 65 67 } 66 68 67 static String getName( Feature feature) {69 static String getName() { 68 70 AttVal<?> name = feature.atts.get(Att.OBJNAM); 69 71 if (name == null) { … … 87 89 public static void addName(Feature feature, int z, Font font, Color colour, Delta delta) { 88 90 if (Renderer.zoom >= z) { 89 String name = getName( feature);91 String name = getName(); 90 92 if (name != null) { 91 93 Renderer.labelText(feature, name, font, colour, delta); … … 175 177 } 176 178 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); 179 static Feature feature; 180 static ArrayList<Feature> objects; 181 static RuleSet ruleset; 182 static boolean testObject(Obj obj) { 183 return ((objects = Renderer.map.features.get(obj)) != null); 184 } 185 186 static boolean testFeature(Feature f) { 187 return ((feature = f).reln == Rflag.MASTER); 188 } 189 190 public static void rules (RuleSet set) { 191 ruleset = set; 192 if ((set == RuleSet.ALL) || (set == RuleSet.BASE)) { 193 if (testObject(Obj.LNDARE)) for (Feature f : objects) if (testFeature(f)) areas(); 194 if (testObject(Obj.BUAARE)) for (Feature f : objects) if (testFeature(f)) areas(); 195 if (testObject(Obj.HRBFAC)) for (Feature f : objects) if (testFeature(f)) areas(); 196 if (testObject(Obj.HRBBSN)) for (Feature f : objects) if (testFeature(f)) areas(); 197 if (testObject(Obj.LOKBSN)) for (Feature f : objects) if (testFeature(f)) areas(); 198 if (testObject(Obj.LKBSPT)) for (Feature f : objects) if (testFeature(f)) areas(); 199 if (testObject(Obj.LAKARE)) for (Feature f : objects) if (testFeature(f)) areas(); 200 if (testObject(Obj.RIVBNK)) for (Feature f : objects) if (testFeature(f)) areas(); 201 if (testObject(Obj.RIVERS)) for (Feature f : objects) if (testFeature(f)) waterways(); 202 if (testObject(Obj.CANALS)) for (Feature f : objects) if (testFeature(f)) waterways(); 203 if (testObject(Obj.DEPARE)) for (Feature f : objects) if (testFeature(f)) areas(); 204 if (testObject(Obj.COALNE)) for (Feature f : objects) if (testFeature(f)) areas(); 205 if (testObject(Obj.ROADWY)) for (Feature f : objects) if (testFeature(f)) highways(); 206 if (testObject(Obj.RAILWY)) for (Feature f : objects) if (testFeature(f)) highways(); 207 } 208 if (testObject(Obj.SLCONS)) for (Feature f : objects) if (testFeature(f)) shoreline(); 209 if ((set == RuleSet.ALL) || (set == RuleSet.SEAMARK)) { 210 if (testObject(Obj.PIPSOL)) for (Feature f : objects) if (testFeature(f)) pipelines(); 211 if (testObject(Obj.CBLSUB)) for (Feature f : objects) if (testFeature(f)) cables(); 212 if (testObject(Obj.PIPOHD)) for (Feature f : objects) if (testFeature(f)) pipelines(); 213 if (testObject(Obj.CBLOHD)) for (Feature f : objects) if (testFeature(f)) cables(); 214 if (testObject(Obj.TSEZNE)) for (Feature f : objects) if (testFeature(f)) separation(); 215 if (testObject(Obj.TSSCRS)) for (Feature f : objects) if (testFeature(f)) separation(); 216 if (testObject(Obj.TSSRON)) for (Feature f : objects) if (testFeature(f)) separation(); 217 if (testObject(Obj.TSELNE)) for (Feature f : objects) if (testFeature(f)) separation(); 218 if (testObject(Obj.TSSLPT)) for (Feature f : objects) if (testFeature(f)) separation(); 219 if (testObject(Obj.TSSBND)) for (Feature f : objects) if (testFeature(f)) separation(); 220 if (testObject(Obj.ISTZNE)) for (Feature f : objects) if (testFeature(f)) separation(); 221 if (testObject(Obj.SNDWAV)) for (Feature f : objects) if (testFeature(f)) areas(); 222 if (testObject(Obj.OSPARE)) for (Feature f : objects) if (testFeature(f)) areas(); 223 if (testObject(Obj.FAIRWY)) for (Feature f : objects) if (testFeature(f)) areas(); 224 if (testObject(Obj.DRGARE)) for (Feature f : objects) if (testFeature(f)) areas(); 225 if (testObject(Obj.RESARE)) for (Feature f : objects) if (testFeature(f)) areas(); 226 if (testObject(Obj.SPLARE)) for (Feature f : objects) if (testFeature(f)) areas(); 227 if (testObject(Obj.SEAARE)) for (Feature f : objects) if (testFeature(f)) areas(); 228 if (testObject(Obj.OBSTRN)) for (Feature f : objects) if (testFeature(f)) obstructions(); 229 if (testObject(Obj.UWTROC)) for (Feature f : objects) if (testFeature(f)) obstructions(); 230 if (testObject(Obj.MARCUL)) for (Feature f : objects) if (testFeature(f)) areas(); 231 if (testObject(Obj.RECTRC)) for (Feature f : objects) if (testFeature(f)) transits(); 232 if (testObject(Obj.NAVLNE)) for (Feature f : objects) if (testFeature(f)) transits(); 233 if (testObject(Obj.HRBFAC)) for (Feature f : objects) if (testFeature(f)) harbours(); 234 if (testObject(Obj.ACHARE)) for (Feature f : objects) if (testFeature(f)) harbours(); 235 if (testObject(Obj.ACHBRT)) for (Feature f : objects) if (testFeature(f)) harbours(); 236 if (testObject(Obj.BERTHS)) for (Feature f : objects) if (testFeature(f)) harbours(); 237 if (testObject(Obj.DISMAR)) for (Feature f : objects) if (testFeature(f)) distances(); 238 if (testObject(Obj.HULKES)) for (Feature f : objects) if (testFeature(f)) ports(); 239 if (testObject(Obj.CRANES)) for (Feature f : objects) if (testFeature(f)) ports(); 240 if (testObject(Obj.LNDMRK)) for (Feature f : objects) if (testFeature(f)) landmarks(); 241 if (testObject(Obj.BUISGL)) for (Feature f : objects) if (testFeature(f)) harbours(); 242 if (testObject(Obj.MORFAC)) for (Feature f : objects) if (testFeature(f)) moorings(); 243 if (testObject(Obj.NOTMRK)) for (Feature f : objects) if (testFeature(f)) notices(); 244 if (testObject(Obj.SMCFAC)) for (Feature f : objects) if (testFeature(f)) marinas(); 245 if (testObject(Obj.BRIDGE)) for (Feature f : objects) if (testFeature(f)) bridges(); 246 if (testObject(Obj.PILPNT)) for (Feature f : objects) if (testFeature(f)) lights(); 247 if (testObject(Obj.RDOCAL)) for (Feature f : objects) if (testFeature(f)) callpoint(); 248 if (testObject(Obj.LITMIN)) for (Feature f : objects) if (testFeature(f)) lights(); 249 if (testObject(Obj.LITMAJ)) for (Feature f : objects) if (testFeature(f)) lights(); 250 if (testObject(Obj.LIGHTS)) for (Feature f : objects) if (testFeature(f)) lights(); 251 if (testObject(Obj.SISTAT)) for (Feature f : objects) if (testFeature(f)) stations(); 252 if (testObject(Obj.SISTAW)) for (Feature f : objects) if (testFeature(f)) stations(); 253 if (testObject(Obj.CGUSTA)) for (Feature f : objects) if (testFeature(f)) stations(); 254 if (testObject(Obj.RDOSTA)) for (Feature f : objects) if (testFeature(f)) stations(); 255 if (testObject(Obj.RADSTA)) for (Feature f : objects) if (testFeature(f)) stations(); 256 if (testObject(Obj.RTPBCN)) for (Feature f : objects) if (testFeature(f)) stations(); 257 if (testObject(Obj.RSCSTA)) for (Feature f : objects) if (testFeature(f)) stations(); 258 if (testObject(Obj.PILBOP)) for (Feature f : objects) if (testFeature(f)) stations(); 259 if (testObject(Obj.WTWGAG)) for (Feature f : objects) if (testFeature(f)) gauges(); 260 if (testObject(Obj.OFSPLF)) for (Feature f : objects) if (testFeature(f)) platforms(); 261 if (testObject(Obj.WRECKS)) for (Feature f : objects) if (testFeature(f)) wrecks(); 262 if (testObject(Obj.LITVES)) for (Feature f : objects) if (testFeature(f)) floats(); 263 if (testObject(Obj.LITFLT)) for (Feature f : objects) if (testFeature(f)) floats(); 264 if (testObject(Obj.BOYINB)) for (Feature f : objects) if (testFeature(f)) floats(); 265 if (testObject(Obj.BOYLAT)) for (Feature f : objects) if (testFeature(f)) buoys(); 266 if (testObject(Obj.BOYCAR)) for (Feature f : objects) if (testFeature(f)) buoys(); 267 if (testObject(Obj.BOYISD)) for (Feature f : objects) if (testFeature(f)) buoys(); 268 if (testObject(Obj.BOYSAW)) for (Feature f : objects) if (testFeature(f)) buoys(); 269 if (testObject(Obj.BOYSPP)) for (Feature f : objects) if (testFeature(f)) buoys(); 270 if (testObject(Obj.BOYWTW)) for (Feature f : objects) if (testFeature(f)) buoys(); 271 if (testObject(Obj.BCNLAT)) for (Feature f : objects) if (testFeature(f)) beacons(); 272 if (testObject(Obj.BCNCAR)) for (Feature f : objects) if (testFeature(f)) beacons(); 273 if (testObject(Obj.BCNISD)) for (Feature f : objects) if (testFeature(f)) beacons(); 274 if (testObject(Obj.BCNSAW)) for (Feature f : objects) if (testFeature(f)) beacons(); 275 if (testObject(Obj.BCNSPP)) for (Feature f : objects) if (testFeature(f)) beacons(); 276 if (testObject(Obj.BCNWTW)) for (Feature f : objects) if (testFeature(f)) beacons(); 277 } 278 } 279 280 private static void areas() { 281 String name = getName(); 262 282 switch (feature.type) { 283 case BUAARE: 284 Renderer.lineVector(feature, new LineStyle(new Color(0x40000000, true))); 285 break; 263 286 case COALNE: 264 287 Renderer.lineVector(feature, new LineStyle(Color.black, 10)); … … 270 293 } 271 294 break; 272 case DOCARE:273 295 case LAKARE: 274 296 case RIVBNK: 275 Renderer.lineVector(feature, new LineStyle(Bwater ));297 Renderer.lineVector(feature, new LineStyle(Bwater, 10, Bwater)); 276 298 break; 277 299 case DRGARE: … … 291 313 if (Renderer.zoom >= 14) 292 314 Renderer.lineVector(feature, new LineStyle(new Color(0x40ffffff, true))); 315 } 316 break; 317 case LKBSPT: 318 case LOKBSN: 319 case HRBBSN: 320 Renderer.lineVector(feature, new LineStyle(Color.black, 10, Bwater)); 321 break; 322 case HRBFAC: 323 if (feature.objs.get(Obj.HRBBSN) != null) { 324 Renderer.lineVector(feature, new LineStyle(Color.black, 10, Bwater)); 293 325 } 294 326 break; … … 384 416 } 385 417 386 private static void beacons( Feature feature) {418 private static void beacons() { 387 419 if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BCNLAT) || (feature.type == Obj.BCNCAR)))) { 388 420 BcnSHP shape = (BcnSHP)getAttEnum(feature, feature.type, 0, Att.BCNSHP); … … 427 459 } 428 460 429 private static void buoys( Feature feature) {461 private static void buoys() { 430 462 if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BOYLAT) || (feature.type == Obj.BOYCAR)))) { 431 463 BoySHP shape = (BoySHP) getAttEnum(feature, feature.type, 0, Att.BOYSHP); … … 451 483 } 452 484 453 private static void bridges( Feature feature) {485 private static void bridges() { 454 486 if (Renderer.zoom >= 16) { 455 487 double verclr, verccl, vercop, horclr; … … 490 522 } 491 523 492 private static void cables( Feature feature) {524 private static void cables() { 493 525 if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) { 494 526 if (feature.type == Obj.CBLSUB) { … … 512 544 } 513 545 514 private static void callpoint( Feature feature) {546 private static void callpoint() { 515 547 if (Renderer.zoom >= 14) { 516 548 Symbol symb = Harbours.CallPoint2; … … 531 563 } 532 564 533 private static void distances( Feature feature) {565 private static void distances() { 534 566 if (Renderer.zoom >= 14) { 535 567 if (!testAttribute(feature, Obj.DISMAR, 0, Att.CATDIS, CatDIS.DIS_NONI)) { … … 574 606 } 575 607 576 private static void floats( Feature feature) {608 private static void floats() { 577 609 switch (feature.type) { 578 610 case LITVES: … … 593 625 } 594 626 595 private static void gauges( Feature feature) {627 private static void gauges() { 596 628 if (Renderer.zoom >= 14) { 597 629 Renderer.symbol(feature, Harbours.TideGauge); … … 600 632 } 601 633 602 private static void harbours( Feature feature) {603 String name = getName( feature);634 private static void harbours() { 635 String name = getName(); 604 636 switch (feature.type) { 605 637 case ACHBRT: … … 717 749 } 718 750 719 private static void landmarks(Feature feature) { 751 private static void highways() { 752 switch (feature.type) { 753 case ROADWY: 754 ArrayList<CatROD> cat = (ArrayList<CatROD>) (getAttList(feature, Obj.ROADWY, 0, Att.CATROD)); 755 if (cat.size() > 0) { 756 switch (cat.get(0)) { 757 case ROD_MWAY: 758 Renderer.lineVector(feature, new LineStyle(Color.black, 20)); 759 break; 760 case ROD_MAJR: 761 Renderer.lineVector(feature, new LineStyle(Color.black, 15)); 762 break; 763 case ROD_MINR: 764 Renderer.lineVector(feature, new LineStyle(Color.black, 10)); 765 break; 766 default: 767 Renderer.lineVector(feature, new LineStyle(Color.black, 5)); 768 } 769 } else { 770 Renderer.lineVector(feature, new LineStyle(Color.black, 5)); 771 } 772 break; 773 case RAILWY: 774 Renderer.lineVector(feature, new LineStyle(Color.gray, 10)); 775 Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 30, 30 })); 776 break; 777 default: 778 } 779 } 780 781 private static void landmarks() { 720 782 ArrayList<CatLMK> cats = (ArrayList<CatLMK>) getAttList(feature, feature.type, 0, Att.CATLMK); 721 783 Symbol catSym = Landmarks.Shapes.get(cats.get(0)); … … 734 796 } 735 797 736 private static void lights( Feature feature) {798 private static void lights() { 737 799 switch (feature.type) { 738 800 case LITMAJ: … … 764 826 } 765 827 766 private static void locks(Feature feature) { 767 } 768 769 private static void marinas(Feature feature) { 828 private static void marinas() { 770 829 if (Renderer.zoom >= 16) { 771 830 ArrayList<Symbol> symbols = new ArrayList<Symbol>(); … … 778 837 } 779 838 780 private static void moorings( Feature feature) {839 private static void moorings() { 781 840 switch ((CatMOR) getAttEnum(feature, feature.type, 0, Att.CATMOR)) { 782 841 case MOR_DLPN: … … 804 863 } 805 864 806 private static void notices( Feature feature) {865 private static void notices() { 807 866 if (Renderer.zoom >= 14) { 808 867 double dx = 0.0, dy = 0.0; … … 871 930 } 872 931 873 private static void obstructions( Feature feature) {932 private static void obstructions() { 874 933 if ((Renderer.zoom >= 12) && (feature.type == Obj.OBSTRN)) { 875 934 switch ((CatOBS) getAttEnum(feature, feature.type, 0, Att.CATOBS)) { … … 899 958 } 900 959 901 private static void pipelines( Feature feature) {960 private static void pipelines() { 902 961 if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) { 903 962 if (feature.type == Obj.PIPSOL) { … … 921 980 } 922 981 923 private static void platforms( Feature feature) {982 private static void platforms() { 924 983 ArrayList<CatOFP> cats = (ArrayList<CatOFP>) getAttList(feature, Obj.OFSPLF, 0, Att.CATOFP); 925 984 if ((CatOFP) cats.get(0) == CatOFP.OFP_FPSO) … … 931 990 } 932 991 933 private static void ports( Feature feature) {992 private static void ports() { 934 993 if (Renderer.zoom >= 14) { 935 994 if (feature.type == Obj.CRANES) { … … 945 1004 } 946 1005 947 private static void separation( Feature feature) {1006 private static void separation() { 948 1007 switch (feature.type) { 949 1008 case TSEZNE: … … 973 1032 } 974 1033 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)); 1034 private static void shoreline() { 1035 if ((ruleset == RuleSet.ALL) || (ruleset == RuleSet.BASE)) { 1036 Renderer.lineVector(feature, new LineStyle(Color.black, 10, Yland)); 1037 } 1038 if ((ruleset == RuleSet.ALL) || (ruleset == RuleSet.SEAMARK)) { 1039 if (Renderer.zoom >= 12) { 1040 switch ((CatSLC) getAttEnum(feature, feature.type, 0, Att.CATSLC)) { 1041 case SLC_TWAL: 1042 WatLEV lev = (WatLEV) getAttEnum(feature, feature.type, 0, Att.WATLEV); 1043 if (lev == WatLEV.LEV_CVRS) { 1044 Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null)); 1045 if (Renderer.zoom >= 15) 1046 Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, 80); 1047 } else { 1048 Renderer.lineVector(feature, new LineStyle(Color.black, 10, null, null)); 1049 } 982 1050 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) { 1051 Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -30); 1052 break; 1053 case SLC_SWAY: 1054 Renderer.lineVector(feature, new LineStyle(Color.black, 2, null, new Color(0xffe000))); 1055 if ((Renderer.zoom >= 16) && feature.objs.containsKey(Obj.SMCFAC)) { 1056 ArrayList<Symbol> symbols = new ArrayList<Symbol>(); 1057 ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(feature, Obj.SMCFAC, 0, Att.CATSCF); 1058 for (CatSCF scf : scfs) { 1059 symbols.add(Facilities.Cats.get(scf)); 1060 } 1061 Renderer.cluster(feature, symbols); 1062 } 1063 break; 1064 default: 1065 break; 1066 } 1067 } 1068 } 1069 } 1070 1071 private static void stations() { 1008 1072 if (Renderer.zoom >= 14) { 1009 1073 String str = ""; … … 1109 1173 } 1110 1174 1111 private static void transits( Feature feature) {1175 private static void transits() { 1112 1176 if (Renderer.zoom >= 14) { 1113 1177 if (feature.type == Obj.RECTRC) Renderer.lineVector (feature, new LineStyle(Color.black, 10, null, null)); … … 1116 1180 if (Renderer.zoom >= 15) { 1117 1181 String str = ""; 1118 String name = getName( feature);1182 String name = getName(); 1119 1183 if (name != null) 1120 1184 str += name + " "; … … 1128 1192 } 1129 1193 1130 private static void waterways( Feature feature) {1194 private static void waterways() { 1131 1195 Renderer.lineVector(feature, new LineStyle(Bwater, 20)); 1132 1196 } 1133 1197 1134 private static void wrecks( Feature feature) {1198 private static void wrecks() { 1135 1199 if (Renderer.zoom >= 14) { 1136 1200 switch ((CatWRK) getAttEnum(feature, feature.type, 0, Att.CATWRK)) {
Note:
See TracChangeset
for help on using the changeset viewer.