Changeset 30033 in osm for applications/editors/josm/plugins/smed2/src/seamap
- Timestamp:
- 2013-10-28T12:52:49+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src/seamap
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
r30029 r30033 103 103 } 104 104 105 public static void symbol(Feature feature, Symbol symbol, Obj obj, Delta delta, Scheme scheme) {105 public static void symbol(Feature feature, Symbol symbol, Obj obj, Scheme scheme, Delta delta) { 106 106 Point2D point = context.getPoint(feature.centre); 107 107 if (obj == null) { 108 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), delta, scheme);108 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, delta); 109 109 } else { 110 110 ArrayList<Color> colours = new ArrayList<Color>(); … … 116 116 patterns.add(pattMap.get(pat)); 117 117 } 118 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), delta, new Scheme(patterns, colours)); 119 } 120 } 121 122 private static Rectangle symbolSize(Symbol symbol) { 118 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), new Scheme(patterns, colours), delta); 119 } 120 } 121 122 public static void cluster(Feature feature, ArrayList<Symbol> symbols) { 123 Rectangle2D.Double bbox = null; 124 if (symbols.size() > 4) { 125 for (Instr instr : symbols.get(0)) { 126 if (instr.type == Prim.BBOX) { 127 bbox = (Rectangle2D.Double) instr.params; 128 break; 129 } 130 } 131 if (bbox == null) return; 132 } 133 switch (symbols.size()) { 134 case 1: 135 symbol(feature, symbols.get(0), null, null, new Delta(Handle.CC, new AffineTransform())); 136 break; 137 case 2: 138 symbol(feature, symbols.get(0), null, null, new Delta(Handle.RC, new AffineTransform())); 139 symbol(feature, symbols.get(1), null, null, new Delta(Handle.LC, new AffineTransform())); 140 break; 141 case 3: 142 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BC, new AffineTransform())); 143 symbol(feature, symbols.get(1), null, null, new Delta(Handle.TR, new AffineTransform())); 144 symbol(feature, symbols.get(2), null, null, new Delta(Handle.TL, new AffineTransform())); 145 break; 146 case 4: 147 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, new AffineTransform())); 148 symbol(feature, symbols.get(1), null, null, new Delta(Handle.BL, new AffineTransform())); 149 symbol(feature, symbols.get(2), null, null, new Delta(Handle.TR, new AffineTransform())); 150 symbol(feature, symbols.get(3), null, null, new Delta(Handle.TL, new AffineTransform())); 151 break; 152 case 5: 153 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, new AffineTransform())); 154 symbol(feature, symbols.get(1), null, null, new Delta(Handle.BL, new AffineTransform())); 155 symbol(feature, symbols.get(2), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 156 symbol(feature, symbols.get(3), null, null, new Delta(Handle.TC, new AffineTransform())); 157 symbol(feature, symbols.get(4), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 158 break; 159 case 6: 160 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 161 symbol(feature, symbols.get(1), null, null, new Delta(Handle.BC, new AffineTransform())); 162 symbol(feature, symbols.get(2), null, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 163 symbol(feature, symbols.get(3), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 164 symbol(feature, symbols.get(4), null, null, new Delta(Handle.TC, new AffineTransform())); 165 symbol(feature, symbols.get(5), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 166 break; 167 case 7: 168 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2))); 169 symbol(feature, symbols.get(1), null, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 170 symbol(feature, symbols.get(2), null, null, new Delta(Handle.CC, new AffineTransform())); 171 symbol(feature, symbols.get(3), null, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 172 symbol(feature, symbols.get(4), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2))); 173 symbol(feature, symbols.get(5), null, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2))); 174 symbol(feature, symbols.get(6), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2))); 175 break; 176 case 8: 177 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(0, -bbox.height/2))); 178 symbol(feature, symbols.get(1), null, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, -bbox.height/2))); 179 symbol(feature, symbols.get(2), null, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 180 symbol(feature, symbols.get(3), null, null, new Delta(Handle.CC, new AffineTransform())); 181 symbol(feature, symbols.get(4), null, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 182 symbol(feature, symbols.get(5), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2))); 183 symbol(feature, symbols.get(6), null, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2))); 184 symbol(feature, symbols.get(7), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2))); 185 break; 186 case 9: 187 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, -bbox.height/2))); 188 symbol(feature, symbols.get(1), null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2))); 189 symbol(feature, symbols.get(2), null, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, -bbox.height/2))); 190 symbol(feature, symbols.get(3), null, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 191 symbol(feature, symbols.get(4), null, null, new Delta(Handle.CC, new AffineTransform())); 192 symbol(feature, symbols.get(5), null, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 193 symbol(feature, symbols.get(6), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2))); 194 symbol(feature, symbols.get(7), null, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2))); 195 symbol(feature, symbols.get(8), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2))); 196 break; 197 } 198 } 199 200 private static Rectangle2D.Double symbolSize(Symbol symbol) { 123 201 Symbol ssymb = symbol; 124 202 while (ssymb != null) { 125 203 for (Instr item : symbol) { 126 204 if (item.type == Prim.BBOX) { 127 return (Rectangle ) item.params;205 return (Rectangle2D.Double) item.params; 128 206 } 129 207 if (item.type == Prim.SYMB) { … … 138 216 } 139 217 140 public static void lineSymbols(Feature feature, Symbol prisymb, double space, Symbol secsymb, int ratio, Color col) {218 public static void lineSymbols(Feature feature, Symbol prisymb, double space, Symbol secsymb, Symbol tersymb, int ratio, Color col) { 141 219 Area area; 142 220 switch (feature.flag) { … … 152 230 return; 153 231 } 154 Rectangle prect = symbolSize(prisymb); 155 Rectangle srect = symbolSize(secsymb); 232 Rectangle2D.Double prect = symbolSize(prisymb); 233 Rectangle2D.Double srect = symbolSize(secsymb); 234 Rectangle2D.Double trect = symbolSize(tersymb); 156 235 if (srect == null) 157 236 ratio = 0; … … 159 238 double psize = Math.abs(prect.getY()) * sScale; 160 239 double ssize = (srect != null) ? Math.abs(srect.getY()) * sScale : 0; 240 double tsize = (trect != null) ? Math.abs(srect.getY()) * sScale : 0; 161 241 Point2D prev = new Point2D.Double(); 162 242 Point2D next = new Point2D.Double(); … … 167 247 double len = 0; 168 248 double angle = 0; 169 int scount = ratio; 249 int stcount = ratio; 250 boolean stflag = false; 170 251 Symbol symbol = prisymb; 171 252 for (Bound bound : area) { … … 180 261 curr = succ = next; 181 262 gap = (space > 0); 182 s count = ratio;263 stcount = ratio - 1; 183 264 symbol = prisymb; 184 265 len = gap ? psize * space * 0.5 : psize; … … 202 283 } 203 284 if (!gap) { 204 Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(), 205 new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())) + Math.toRadians(90))), 206 new Scheme(col)); 285 Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(), new Scheme(col), 286 new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())) + Math.toRadians(90)))); 207 287 } 208 288 if (space > 0) 209 289 gap = !gap; 210 290 curr = succ; 211 len = gap ? (psize * space) : (--scount == 0) ? ssize : psize; 212 if (scount == 0) { 213 symbol = secsymb; 214 scount = ratio; 291 len = gap ? (psize * space) : (--stcount == 0) ? (stflag ? tsize : ssize) : psize; 292 if (stcount == 0) { 293 symbol = stflag ? tersymb : secsymb; 294 if (trect != null) stflag = !stflag; 295 stcount = ratio; 215 296 } else { 216 297 symbol = prisymb; … … 330 411 331 412 public static void labelText(Feature feature, String str, Font font, LabelStyle style, Color fg, Color bg, Delta delta) { 332 if (delta == null) delta = new Delta(Handle.CC , AffineTransform.getTranslateInstance(0, 0));413 if (delta == null) delta = new Delta(Handle.CC); 333 414 if (bg == null) bg = new Color(0x00000000, true); 334 415 if ((str == null) || (str.isEmpty())) str = " "; … … 339 420 double height = bounds.getHeight(); 340 421 Symbol label = new Symbol(); 341 double lx = 0; 342 double ly = 0; 343 double tx = 0; 344 double ty = 0; 422 double lx, ly, tx, ty; 345 423 switch (style) { 346 424 case RRCT: … … 378 456 label.add(new Instr(Prim.PLIN, p)); 379 457 break; 458 default: 459 lx = -width / 2; 460 ly = -height / 2; 461 tx = lx; 462 ty = ly; 463 label.add(new Instr(Prim.BBOX, new Rectangle2D.Double(lx,ly,width,height))); 464 break; 380 465 } 381 466 label.add(new Instr(Prim.TEXT, new Caption(str, font, fg, new Delta(Handle.TL, AffineTransform.getTranslateInstance(tx, ty))))); 382 467 Point2D point = context.getPoint(feature.centre); 383 Symbols.drawSymbol(g2, label, sScale, point.getX(), point.getY(), delta, null);468 Symbols.drawSymbol(g2, label, sScale, point.getX(), point.getY(), null, delta); 384 469 } 385 470 -
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r30029 r30033 18 18 import s57.S57att.*; 19 19 import s57.S57obj.*; 20 21 import seamap.SeaMap.AttItem;22 import seamap.SeaMap.AttMap;23 import seamap.SeaMap.ObjTab;24 20 import seamap.Renderer.*; 25 21 import seamap.SeaMap.*; … … 33 29 34 30 public static final Color Yland = new Color(0x50b0ff); 35 public static final Color Mline = new Color(0x c480ff);31 public static final Color Mline = new Color(0x80c480); 36 32 public static final Color Msymb = new Color(0xa30075); 37 33 … … 149 145 case RESARE: 150 146 if (zoom >= 12) { 151 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0, new Color(0x80c480));147 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Mline); 152 148 // if ((CatREA)Renderer.getAttVal(feature, feature.type, 0, Att.CATREA) == CatREA.REA_NWAK) 153 149 // Renderer.symbol(feature, Areas.NoWake, Obj.RESARE, null); … … 208 204 if (zoom >= 12) { 209 205 Renderer.symbol(feature, Areas.Plane, Obj.SPLARE, null, null); 210 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, 10, new Color(0x80c480));206 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Mline); 211 207 } 212 208 if ((zoom >= 15) && (name != null)) 213 209 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90))); 210 break; 211 default: 214 212 break; 215 213 } … … 239 237 Renderer.symbol(feature, Beacons.Shapes.get(shape), feature.type, null, null); 240 238 if (feature.objs.get(Obj.TOPMAR) != null) 241 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Beacons, null);239 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, null, Topmarks.Beacons); 242 240 } 243 241 Signals.addSignals(feature); … … 248 246 Renderer.symbol(feature, Buoys.Shapes.get(shape), feature.type, null, null); 249 247 if (feature.objs.get(Obj.TOPMAR) != null) { 250 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Buoys.get(shape), null);248 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, null, Topmarks.Buoys.get(shape)); 251 249 } 252 250 Signals.addSignals(feature); … … 258 256 AttMap atts = feature.objs.get(Obj.BRIDGE).get(0); 259 257 String str = ""; 260 if (atts.containsKey(Att.VERCLR)) { 261 verclr = (Double)atts.get(Att.VERCLR).val; 262 } else { 263 verclr = atts.containsKey(Att.VERCSA) ? (Double)atts.get(Att.VERCSA).val : 0; 264 } 265 verccl = atts.containsKey(Att.VERCCL) ? (Double)atts.get(Att.VERCCL).val : 0; 266 vercop = atts.containsKey(Att.VERCOP) ? (Double)atts.get(Att.VERCOP).val : 0; 267 if (verclr > 0) { 268 str += String.valueOf(verclr); 269 } else if (verccl > 0) { 270 if (vercop == 0) { 271 str += String.valueOf(verccl) + "/-"; 258 if (atts != null) { 259 if (atts.containsKey(Att.VERCLR)) { 260 verclr = (Double) atts.get(Att.VERCLR).val; 272 261 } else { 273 str += String.valueOf(verccl) + "/" + String.valueOf(vercop);262 verclr = atts.containsKey(Att.VERCSA) ? (Double) atts.get(Att.VERCSA).val : 0; 274 263 } 275 } 276 if (!str.isEmpty()) 277 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 0))); 264 verccl = atts.containsKey(Att.VERCCL) ? (Double) atts.get(Att.VERCCL).val : 0; 265 vercop = atts.containsKey(Att.VERCOP) ? (Double) atts.get(Att.VERCOP).val : 0; 266 if (verclr > 0) { 267 str += String.valueOf(verclr); 268 } else if (verccl > 0) { 269 if (vercop == 0) { 270 str += String.valueOf(verccl) + "/-"; 271 } else { 272 str += String.valueOf(verccl) + "/" + String.valueOf(vercop); 273 } 274 } 275 if (!str.isEmpty()) 276 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC)); 277 } 278 278 } 279 279 } … … 282 282 if ((zoom >= 16) && (feature.length < 2)) { 283 283 if (feature.type == Obj.CBLSUB) { 284 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, 0, new Color(0x80c480));284 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Mline); 285 285 } else if (feature.type == Obj.CBLOHD) { 286 286 AttMap atts = feature.objs.get(Obj.CBLOHD).get(0); 287 if ((atts != null) && (atts.containsKey(Att.CATCBL)) && (atts.get(Att.CATCBL).val == CatCBL.CBL_POWR)) { 288 Renderer.lineSymbols(feature, Areas.CableDash, 0, Areas.CableDot, Areas.CableFlash, 2, Color.black); 289 } else { 290 Renderer.lineSymbols(feature, Areas.CableDash, 0, Areas.CableDot, null, 2, Color.black); 291 } 287 292 } 288 293 } … … 290 295 291 296 private static void distances(Feature feature) { 292 /*object_rules(distances) { 293 if ((zoom>=16) && (has_attribute("category"))) { 294 attribute_switch("category") 295 attribute_case("installed") symbol("distance_i"); 296 attribute_default symbol("distance_u"); 297 end_switch 298 } 299 } 300 */ 297 if (zoom >= 14) { 298 if (!((CatDIS)Renderer.getAttVal(feature, Obj.DISMAR, 0, Att.CATDIS) == CatDIS.DIS_NONI)) { 299 Renderer.symbol(feature, Harbours.DistanceI, null, null, null); 300 } else { 301 Renderer.symbol(feature, Harbours.DistanceU, null, null, null); 302 } 303 AttMap atts = feature.objs.get(Obj.DISMAR).get(0); 304 if ((atts != null) && (atts.containsKey(Att.WTWDIS)) && (zoom >=15)) { 305 Double dist = (Double)atts.get(Att.WTWDIS).val; 306 String str = ""; 307 if (atts.containsKey(Att.HUNITS)) { 308 switch ((UniHLU)atts.get(Att.HUNITS).val) { 309 case HLU_METR: 310 str += "m "; 311 break; 312 case HLU_FEET: 313 str += "ft "; 314 break; 315 case HLU_HMTR: 316 str += "hm "; 317 break; 318 case HLU_KMTR: 319 str += "km "; 320 break; 321 case HLU_SMIL: 322 str += "M "; 323 break; 324 case HLU_NMIL: 325 str += "NM "; 326 break; 327 } 328 } 329 str += String.format("%1.0f", dist); 330 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45))); 331 } 332 } 301 333 } 302 334 … … 314 346 } 315 347 if (feature.objs.get(Obj.TOPMAR) != null) 316 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Floats, null);348 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, null, Topmarks.Floats); 317 349 Signals.addSignals(feature); 318 350 } … … 331 363 case ACHBRT: 332 364 if (zoom >= 14) { 333 Renderer.symbol(feature, Harbours.Anchorage, null, n ull, new Scheme(Mline));334 Renderer.labelText(feature, name == null ? "" : (String) name.val, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC , AffineTransform.getTranslateInstance(0, 0)));365 Renderer.symbol(feature, Harbours.Anchorage, null, new Scheme(Mline), null); 366 Renderer.labelText(feature, name == null ? "" : (String) name.val, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC)); 335 367 } 336 368 double radius = (Double)Renderer.getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS); … … 343 375 if (zoom >= 12) { 344 376 if (feature.flag != Fflag.AREA) { 345 Renderer.symbol(feature, Harbours.Anchorage, null, n ull, new Scheme(Color.black));377 Renderer.symbol(feature, Harbours.Anchorage, null, new Scheme(Color.black), null); 346 378 } else { 347 Renderer.symbol(feature, Harbours.Anchorage, null, n ull, new Scheme(Mline));348 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, 10, Mline);379 Renderer.symbol(feature, Harbours.Anchorage, null, new Scheme(Mline), null); 380 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Mline); 349 381 } 350 382 if ((zoom >= 15) && ((name) != null)) { … … 373 405 break; 374 406 case ACH_EXPL: 375 Renderer.symbol(feature, Harbours.Explosives, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(Mline));407 Renderer.symbol(feature, Harbours.Explosives, null, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 376 408 dy += 60; 377 409 break; 378 410 case ACH_QUAR: 379 Renderer.symbol(feature, Harbours.Hospital, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(Mline));411 Renderer.symbol(feature, Harbours.Hospital, null, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 380 412 dy += 60; 381 413 break; 382 414 case ACH_SEAP: 383 Renderer.symbol(feature, Areas.Seaplane, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(Mline));415 Renderer.symbol(feature, Areas.Seaplane, null, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 384 416 dy += 60; 385 417 break; … … 394 426 case BUISGL: 395 427 if (zoom >= 16) { 428 ArrayList<Symbol> symbols = new ArrayList(); 396 429 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Renderer.getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN); 397 Renderer.symbol(feature, Landmarks.Funcs.get(fncs.get(0)), null, null, null); 430 for (FncFNC fnc : fncs) { 431 symbols.add(Landmarks.Funcs.get(fnc)); 432 } 433 if (feature.objs.containsKey(Obj.SMCFAC)) { 434 ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) Renderer.getAttVal(feature, Obj.SMCFAC, 0, Att.CATSCF); 435 for (CatSCF scf : scfs) { 436 symbols.add(Facilities.Cats.get(scf)); 437 } 438 } 439 Renderer.cluster(feature, symbols); 398 440 } 399 441 break; … … 401 443 } 402 444 /* 403 if ((zoom >= 16) && is_type("anchor_berth")) symbol("anchor_berth");404 445 if ((zoom >= 12) && is_type("harbour")) { 405 446 if (has_attribute("category")) { … … 779 820 if (zoom >= 14) { 780 821 if (feature.type == Obj.PIPSOL) { 781 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, 0, new Color(0x80c480));822 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Mline); 782 823 } else if (feature.type == Obj.PIPOHD) { 783 824 … … 793 834 AttItem name = feature.atts.get(Att.OBJNAM); 794 835 if ((zoom >= 15) && (name != null)) 795 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(60, -50)));836 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50))); 796 837 /*object_rules(platforms) { 797 838 if (has_object("fog_signal")) object(fogs); … … 827 868 AttItem name = feature.atts.get(Att.OBJNAM); 828 869 if ((zoom >= 10) && (name != null)) 829 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080 ), null, null);870 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080, true), null, null); 830 871 break; 831 872 case TSELNE: … … 833 874 break; 834 875 case TSSLPT: 835 Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, 0, new Color(0x80c48080, true));876 Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, null, 0, new Color(0x80c48080, true)); 836 877 break; 837 878 case TSSBND: … … 839 880 break; 840 881 case ISTZNE: 841 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0, new Color(0x80c48080, true));882 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, new Color(0x80c48080, true)); 842 883 break; 843 884 } … … 867 908 case SISTAW: 868 909 Renderer.symbol(feature, Harbours.SignalStation, null, null, null); 910 String str = "SS"; 911 // Append (cat) to str 912 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0))); 869 913 break; 870 914 case RDOSTA: … … 881 925 case CGUSTA: 882 926 Renderer.symbol(feature, Harbours.SignalStation, null, null, null); 927 Renderer.labelText(feature, "CG", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0))); 883 928 break; 884 929 case RSCSTA: -
applications/editors/josm/plugins/smed2/src/seamap/Signals.java
r30026 r30033 101 101 case ROS_VANC: 102 102 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 103 Renderer.symbol(feature, Topmarks.TopNorth, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);103 Renderer.symbol(feature, Topmarks.TopNorth, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 104 104 break; 105 105 case ROS_VASC: 106 106 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 107 Renderer.symbol(feature, Topmarks.TopSouth, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);107 Renderer.symbol(feature, Topmarks.TopSouth, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 108 108 break; 109 109 case ROS_VAEC: 110 110 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 111 Renderer.symbol(feature, Topmarks.TopEast, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);111 Renderer.symbol(feature, Topmarks.TopEast, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 112 112 break; 113 113 case ROS_VAWC: 114 114 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 115 Renderer.symbol(feature, Topmarks.TopWest, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);115 Renderer.symbol(feature, Topmarks.TopWest, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 116 116 break; 117 117 case ROS_VAPL: 118 118 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 119 Renderer.symbol(feature, Topmarks.TopCan, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);119 Renderer.symbol(feature, Topmarks.TopCan, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 120 120 break; 121 121 case ROS_VASL: 122 122 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 123 Renderer.symbol(feature, Topmarks.TopCone, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);123 Renderer.symbol(feature, Topmarks.TopCone, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 124 124 break; 125 125 case ROS_VAID: 126 126 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 127 Renderer.symbol(feature, Topmarks.TopIsol, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);127 Renderer.symbol(feature, Topmarks.TopIsol, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 128 128 break; 129 129 case ROS_VASW: 130 130 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 131 Renderer.symbol(feature, Topmarks.TopSphere, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);131 Renderer.symbol(feature, Topmarks.TopSphere, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 132 132 break; 133 133 case ROS_VASP: 134 134 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 135 Renderer.symbol(feature, Topmarks.TopX, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);135 Renderer.symbol(feature, Topmarks.TopX, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 136 136 break; 137 137 case ROS_VAWK: 138 138 Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 139 Renderer.symbol(feature, Topmarks.TopCross, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null); 139 Renderer.symbol(feature, Topmarks.TopCross, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 140 break; 141 default: 140 142 break; 141 143 }
Note:
See TracChangeset
for help on using the changeset viewer.