Changeset 30027 in osm for applications/editors/josm/plugins/smed2/src/seamap/Rules.java
- Timestamp:
- 2013-10-18T17:29:48+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r30026 r30027 19 19 import s57.S57obj.*; 20 20 21 import seamap.SeaMap.AttItem; 22 import seamap.SeaMap.AttMap; 23 import seamap.SeaMap.ObjTab; 21 24 import seamap.Renderer.*; 22 25 import seamap.SeaMap.*; … … 69 72 if ((objects = map.features.get(Obj.CRANES)) != null) for (Feature feature : objects) ports(feature); 70 73 if ((objects = map.features.get(Obj.LNDMRK)) != null) for (Feature feature : objects) landmarks(feature); 74 if ((objects = map.features.get(Obj.BUISGL)) != null) for (Feature feature : objects) harbours(feature); 71 75 if ((objects = map.features.get(Obj.MORFAC)) != null) for (Feature feature : objects) moorings(feature); 72 76 if ((objects = map.features.get(Obj.NOTMRK)) != null) for (Feature feature : objects) notices(feature); … … 247 251 private static void bridges(Feature feature) { 248 252 if (zoom >= 16) { 249 250 } 251 /* case BRIDGE: { 252 Att_t *attv = getAtt(getObj(item, BRIDGE, 0), VERCLR); 253 if (attv == NULL) attv = getAtt(getObj(item, BRIDGE, 0), VERCSA); 254 Att_t *attc = getAtt(getObj(item, BRIDGE, 0), VERCCL); 255 Att_t *atto = getAtt(getObj(item, BRIDGE, 0), VERCOP); 256 if (attv != NULL) { 257 renderSymbol(item, obja, "clear_v", "", "", CC, 0, 0, 0); 258 drawText(item, stringValue(attv->val), "font-family:Arial; font-weight:normal; font-size:70; text-anchor:middle", 0, 12); 259 } 260 else if ((attc != NULL) && (atto == NULL)) { 261 char *string=strdup(stringValue(attc->val)); 262 string = realloc(string, strlen(string) + 3); strcat(string, "/-"); 263 renderSymbol(item, obja, "clear_v", "", "", CC, 0, 0, 0); 264 drawText(item, string, "font-family:Arial; font-weight:normal; font-size:70; text-anchor:middle", 0, 12); 265 free(string); 266 } 267 else if ((attc != NULL) && (atto != NULL)) { 268 char *string=strdup(stringValue(attc->val)); 269 string = realloc(string, strlen(string) + 2); strcat(string, "/"); 270 string = realloc(string, strlen(string) + strlen(stringValue(atto->val)) + 1); strcat(string, stringValue(atto->val)); 271 renderSymbol(item, obja, "clear_v", "", "", CC, 0, 0, 0); 272 drawText(item, string, "font-family:Arial; font-weight:normal; font-size:60; text-anchor:middle", 0, 10); 273 free(string); 274 } 275 } 276 */ 277 } 253 double verclr, verccl, vercop; 254 AttMap atts = feature.objs.get(Obj.BRIDGE).get(0); 255 String str = ""; 256 if (atts.containsKey(Att.VERCLR)) { 257 verclr = (Double)atts.get(Att.VERCLR).val; 258 } else { 259 verclr = atts.containsKey(Att.VERCSA) ? (Double)atts.get(Att.VERCSA).val : 0; 260 } 261 verccl = atts.containsKey(Att.VERCCL) ? (Double)atts.get(Att.VERCCL).val : 0; 262 vercop = atts.containsKey(Att.VERCOP) ? (Double)atts.get(Att.VERCOP).val : 0; 263 if (verclr > 0) { 264 str += String.valueOf(verclr); 265 } else if (verccl > 0) { 266 if (vercop == 0) { 267 str += String.valueOf(verccl) + "/-"; 268 } else { 269 str += String.valueOf(verccl) + "/" + String.valueOf(vercop); 270 } 271 } 272 if (!str.isEmpty()) 273 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 0))); 274 } 275 } 276 278 277 private static void cables(Feature feature) { 279 278 if (zoom >= 14) { … … 389 388 } 390 389 break; 390 case BUISGL: 391 if (zoom >= 16) { 392 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Renderer.getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN); 393 Renderer.symbol(feature, Landmarks.Funcs.get(fncs.get(0)), null, null, null); 394 } 395 break; 391 396 } 392 397 } … … 430 435 */ 431 436 Signals.addSignals(feature); 437 } 438 439 private static void buildings(Feature feature) { 432 440 } 433 441
Note:
See TracChangeset
for help on using the changeset viewer.
