Changeset 30040 in osm for applications/editors/josm
- Timestamp:
- 2013-11-04T14:21:53+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/s57/S57val.java
r30024 r30040 858 858 Catcom.put(CatCOM.COM_CSTM, new S57enum(7, "custom")); Catcom.put(CatCOM.COM_HRBR, new S57enum(8, "harbour")); 859 859 } 860 public enum CatHBR { HBR_UNKN, HBR_CSTM, HBR_REFG, HBR_MRNA, HBR_FISH, HBR_PRIV }860 public enum CatHBR { HBR_UNKN, HBR_CSTM, HBR_REFG, HBR_MRNA, HBR_FISH, HBR_PRIV, HBR_ } 861 861 private static final EnumMap<CatHBR, S57enum> Cathbr = new EnumMap<CatHBR, S57enum>(CatHBR.class); static { Cathbr.put(CatHBR.HBR_UNKN, new S57enum(0, "")); 862 862 Cathbr.put(CatHBR.HBR_CSTM, new S57enum(1, "custom")); Cathbr.put(CatHBR.HBR_REFG, new S57enum(2, "refuge")); Cathbr.put(CatHBR.HBR_MRNA, new S57enum(3, "marina")); -
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r30037 r30040 154 154 switch ((CatSEA) Util.getAttVal(feature, feature.type, 0, Att.CATSEA)) { 155 155 case SEA_RECH: 156 if ((zoom >= 10) && (name != null)) 157 if (feature.flag == Fflag.LINE) { 158 Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40); 159 } else { 160 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), LabelStyle.NONE, Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 161 } 156 162 break; 157 163 case SEA_BAY: 164 if ((zoom >= 12) && (name != null)) 165 if (feature.flag == Fflag.LINE) { 166 Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40); 167 } else { 168 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), LabelStyle.NONE, Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 169 } 158 170 break; 159 171 case SEA_SHOL: 172 if (zoom >= 14) { 173 if (feature.flag == Fflag.AREA) { 174 Renderer.lineVector(feature, new LineStyle(new Color(0xc480ff), 4, new float[] { 25, 25 })); 175 if (name != null) { 176 Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), LabelStyle.NONE, Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 177 Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), LabelStyle.NONE, Color.black, new Delta(Handle.BC)); 178 } 179 } else if (feature.flag == Fflag.LINE) { 180 if (name != null) { 181 Renderer.lineText(feature, name, new Font("Arial", Font.ITALIC, 75), Color.black, 0.5, -40); 182 Renderer.lineText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5, 0); 183 } 184 } else { 185 if (name != null) { 186 Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), LabelStyle.NONE, Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40))); 187 Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), LabelStyle.NONE, Color.black, new Delta(Handle.BC)); 188 } 189 } 190 } 160 191 break; 161 192 case SEA_GAT: 162 193 case SEA_NRRW: 194 if ((zoom >= 12) && (name != null)) 195 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE, Color.black); 163 196 break; 164 197 default: … … 166 199 } 167 200 break; 168 /*169 if (is_type("sea_area")) {170 if (has_attribute("category")) {171 make_string("");172 attribute_switch("category")173 attribute_case("reach") { if (zoom >= 10) add_string("font-family:Arial;font-weight:normal;font-style:italic;font-size:150;text-anchor:middle") }174 attribute_case("bay") { if (zoom >= 12) add_string("font-family:Arial;font-weight:normal;font-style:italic;font-size:150;text-anchor:middle") }175 attribute_case("shoal") { if (zoom >= 14) {176 if (is_area) {177 area("stroke:#c480ff;stroke-width:4;stroke-dasharray:25,25;fill:none");178 if (has_item_attribute("name")) text(item_attribute("name"), "font-family:Arial;font-weight:normal;font-style:italic;font-size:75;text-anchor:middle", 0, -40);179 text("(Shoal)", "font-family:Arial;font-weight:normal;font-size:60;text-anchor:middle", 0, 0);180 } else if (is_line) {181 if (has_item_attribute("name")) way_text(item_attribute("name"), "font-family:Arial;font-weight:normal;font-style:italic;font-size:75;text-anchor:middle", 0.5, -40, line("stroke:none;fill:none"));182 way_text("(Shoal)", "font-family:Arial;font-weight:normal;font-size:60;text-anchor:middle", 0.5, 0, line("stroke:none;fill:none"));183 } else {184 if (has_item_attribute("name")) text(item_attribute("name"), "font-family:Arial;font-weight:normal;font-style:italic;font-size:75;text-anchor:middle", 0, -40);185 text("(Shoal)", "font-family:Arial;font-weight:normal;font-size:60;text-anchor:middle", 0, 0);186 }187 }188 }189 attribute_case("gat|narrows") { if (zoom >= 12) add_string("font-family:Arial;font-weight:normal;font-style:italic;font-size:100;text-anchor:middle") }190 end_switch191 if ((strlen(string) > 0) && !attribute_test("category", "shoal")) {192 int ref = line("stroke:none;fill:none");193 if (ref != 0) {194 if (has_item_attribute("name")) way_text(item_attribute("name"), string, 0.5, 0, ref);195 } else {196 if (has_item_attribute("name")) text(item_attribute("name"), string, 0, 0);197 }198 }199 free_string200 }201 }202 */203 201 case SNDWAV: 204 202 if (zoom >= 12) Renderer.fillPattern(feature, Areas.Sandwaves); … … 358 356 359 357 private static void gauges(Feature feature) { 360 /*object_rules(gauge) { 361 if (zoom >= 14) symbol("tide_gauge"); 362 } 363 */ 364 Signals.addSignals(feature); 358 if (zoom >= 14) { 359 Renderer.symbol(feature, Harbours.TideGauge); 360 Signals.addSignals(feature); 361 } 365 362 } 366 363 … … 433 430 case BUISGL: 434 431 if (zoom >= 16) { 435 ArrayList<Symbol> symbols = new ArrayList ();432 ArrayList<Symbol> symbols = new ArrayList<Symbol>(); 436 433 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Util.getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN); 437 434 for (FncFNC fnc : fncs) { … … 447 444 } 448 445 break; 446 case HRBFAC: 447 if (zoom >= 12) { 448 switch ((CatHAF) Util.getAttVal(feature, feature.type, 0, Att.CATHAF)) { 449 case HAF_MRNA: 450 Renderer.symbol(feature, Harbours.Marina); 451 break; 452 case HAF_MANF: 453 Renderer.symbol(feature, Harbours.MarinaNF); 454 break; 455 default: 456 Renderer.symbol(feature, Harbours.Harbour); 457 break; 458 } 459 } 449 460 default: 450 461 break; 451 462 } 452 463 } 453 /*454 if ((zoom >= 12) && is_type("harbour")) {455 if (has_attribute("category")) {456 attribute_switch("category")457 attribute_case("marina|yacht") symbol("marina");458 attribute_case("marina_no_facilities") symbol("marina_nf");459 attribute_default symbol("harbour");460 end_switch461 } else symbol("harbour");462 if ((zoom >= 15) && (has_item_attribute("name")))463 text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:middle", 0, -90);464 }465 */466 464 467 465 private static void landmarks(Feature feature) { … … 516 514 517 515 private static void moorings(Feature feature) { 518 CatMOR cat = (CatMOR) Util.getAttVal(feature, feature.type, 0, Att.CATMOR); 519 switch (cat) { 516 switch ((CatMOR) Util.getAttVal(feature, feature.type, 0, Att.CATMOR)) { 520 517 case MOR_DLPN: 521 518 Renderer.symbol(feature, Harbours.Dolphin);
Note:
See TracChangeset
for help on using the changeset viewer.