Changeset 30046 in osm for applications/editors/josm
- Timestamp:
- 2013-11-08T23:08:11+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/s57/S57att.java
r30024 r30046 139 139 AttStr.put(Att.NPLDST, "national_pilot_district"); AttStr.put(Att.NTXTDS, "national_description"); AttStr.put(Att.HORDAT, "horizontal_datum"); 140 140 AttStr.put(Att.POSACC, "positional_accuracy"); AttStr.put(Att.QUAPOS, "position_quality"); AttStr.put(Att.ADDMRK, "addition"); AttStr.put(Att.BNKWTW, "bank"); 141 AttStr.put(Att.CATBNK, "category"); AttStr.put(Att.CATNMK, "category"); AttStr.put(Att.CLSDNG, " class"); AttStr.put(Att.DIRIMP, "impact");141 AttStr.put(Att.CATBNK, "category"); AttStr.put(Att.CATNMK, "category"); AttStr.put(Att.CLSDNG, "danger_class"); AttStr.put(Att.DIRIMP, "impact"); 142 142 AttStr.put(Att.DISBK1, "distance_start"); AttStr.put(Att.DISBK2, "distance_end");AttStr.put(Att.DISIPU, "distance_up"); AttStr.put(Att.DISIPD, "distance_down"); 143 143 AttStr.put(Att.ELEVA1, "minimum_elevation"); AttStr.put(Att.ELEVA2, "maximum_elevation"); AttStr.put(Att.FNCTNM, "function"); AttStr.put(Att.WTWDIS, "distance"); 144 AttStr.put(Att.BUNVES, "avail ibility"); AttStr.put(Att.CATBRT, "category"); AttStr.put(Att.CATBUN, "category"); AttStr.put(Att.CATCCL, "category");144 AttStr.put(Att.BUNVES, "availability"); AttStr.put(Att.CATBRT, "category"); AttStr.put(Att.CATBUN, "category"); AttStr.put(Att.CATCCL, "category"); 145 145 AttStr.put(Att.CATHBR, "category"); AttStr.put(Att.CATRFD, "category"); AttStr.put(Att.CATTML, "category"); AttStr.put(Att.COMCTN, "communication"); 146 146 AttStr.put(Att.HORCLL, "clearance_length"); AttStr.put(Att.HORCLW, "clearance_width"); AttStr.put(Att.TRSHGD, "goods"); AttStr.put(Att.UNLOCD, "locode"); … … 150 150 AttStr.put(Att.CATVTR, "category"); AttStr.put(Att.CATTAB, "operation"); AttStr.put(Att.SCHREF, "schedule"); AttStr.put(Att.USESHP, "use"); AttStr.put(Att.CURVHW, "high_velocity"); 151 151 AttStr.put(Att.CURVLW, "low_velocity"); AttStr.put(Att.CURVMW, "mean_velocity"); AttStr.put(Att.CURVOW, "other_velocity"); AttStr.put(Att.APTREF, "passing_time"); 152 AttStr.put(Att.CATCOM, "category"); 152 153 AttStr.put(Att.CATEXS, "category"); AttStr.put(Att.CATWWM, "category"); AttStr.put(Att.SHPTYP, "ship"); AttStr.put(Att.UPDMSG, "message"); AttStr.put(Att.LITRAD, "radius"); 153 154 } … … 203 204 objatt.add(new ObjAtt(Obj.WEDKLP, Att.CATWED)); objatt.add(new ObjAtt(Obj.WRECKS, Att.CATWRK)); objatt.add(new ObjAtt(Obj.TS_FEB, Att.CAT_TS)); 204 205 objatt.add(new ObjAtt(Obj.DEPCNT, Att.VALDCO)); objatt.add(new ObjAtt(Obj.SOUNDG, Att.VALSOU)); objatt.add(new ObjAtt(Obj.NOTMRK, Att.BNKWTW)); 206 objatt.add(new ObjAtt(Obj.WTWAXS, Att.CATCCL)); objatt.add(new ObjAtt(Obj.WTWARE, Att.CATCCL)); objatt.add(new ObjAtt(Obj.COMARE, Att.CATCOM)); 207 objatt.add(new ObjAtt(Obj.RDOCAL, Att.CATCOM)); objatt.add(new ObjAtt(Obj.WTWGAG, Att.CATGAG)); 205 208 objatt.add(new ObjAtt(Obj.ACHBRT, Att.RADIUS)); objatt.add(new ObjAtt(Obj.LIGHTS, Att.LITRAD)); 206 209 } -
applications/editors/josm/plugins/smed2/src/s57/S57val.java
r30040 r30046 96 96 public enum CatCHP { CHP_UNKN, CHP_CSTM, CHP_BRDR } 97 97 private static final EnumMap<CatCHP, S57enum> Catchp = new EnumMap<CatCHP, S57enum>(CatCHP.class); static { Catchp.put(CatCHP.CHP_UNKN, new S57enum(0, "")); 98 Catchp.put(CatCHP.CHP_CSTM, new S57enum(1, "custom ")); Catchp.put(CatCHP.CHP_BRDR, new S57enum(2, "border"));98 Catchp.put(CatCHP.CHP_CSTM, new S57enum(1, "customs")); Catchp.put(CatCHP.CHP_BRDR, new S57enum(2, "border")); 99 99 } 100 100 public enum CatCOA { COA_UNKN, COA_STEP, COA_FLAT, COA_SAND, COA_STON, COA_SHNG, COA_GLCR, COA_MNGV, COA_MRSH, COA_CRRF, COA_ICE, COA_SHEL } … … 855 855 private static final EnumMap<CatCOM, S57enum> Catcom = new EnumMap<CatCOM, S57enum>(CatCOM.class); static { Catcom.put(CatCOM.COM_UNKN, new S57enum(0, "")); 856 856 Catcom.put(CatCOM.COM_VTSC, new S57enum(1, "vts_centre")); Catcom.put(CatCOM.COM_VTSS, new S57enum(2, "vts_sector")); Catcom.put(CatCOM.COM_IVSP, new S57enum(3, "ivs_point")); 857 Catcom.put(CatCOM.COM_MID, new S57enum(4, "mi d")); Catcom.put(CatCOM.COM_LOCK, new S57enum(5, "lock")); Catcom.put(CatCOM.COM_BRDG, new S57enum(6, "bridge"));858 Catcom.put(CatCOM.COM_CSTM, new S57enum(7, "custom ")); Catcom.put(CatCOM.COM_HRBR, new S57enum(8, "harbour"));857 Catcom.put(CatCOM.COM_MID, new S57enum(4, "mib")); Catcom.put(CatCOM.COM_LOCK, new S57enum(5, "lock")); Catcom.put(CatCOM.COM_BRDG, new S57enum(6, "bridge")); 858 Catcom.put(CatCOM.COM_CSTM, new S57enum(7, "customs")); Catcom.put(CatCOM.COM_HRBR, new S57enum(8, "harbour")); 859 859 } 860 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 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"));862 Cathbr.put(CatHBR.HBR_CSTM, new S57enum(1, "customs")); Cathbr.put(CatHBR.HBR_REFG, new S57enum(2, "refuge")); Cathbr.put(CatHBR.HBR_MRNA, new S57enum(3, "marina")); 863 863 Cathbr.put(CatHBR.HBR_FISH, new S57enum(4, "fishing")); Cathbr.put(CatHBR.HBR_PRIV, new S57enum(5, "private")); 864 864 } -
applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
r30037 r30046 16 16 import java.util.*; 17 17 18 import s57.S57att.*;19 import s57.S57obj.*;20 18 import s57.S57val.*; 21 import s57.S57val;22 19 import seamap.SeaMap; 23 20 import seamap.SeaMap.*; … … 30 27 public static final double symbolScale[] = { 256.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.61, 0.372, 0.227, 0.138, 0.0843, 0.0514, 0.0313, 0.0191, 0.0117, 0.007, 0.138 }; 31 28 29 public static final Color Yland = new Color(0x50b0ff); 30 public static final Color Mline = new Color(0x80c480); 31 public static final Color Msymb = new Color(0xa30075); 32 33 static final EnumMap<ColCOL, Color> bodyColours = new EnumMap<ColCOL, Color>(ColCOL.class); 34 static { 35 bodyColours.put(ColCOL.COL_UNK, new Color(0, true)); 36 bodyColours.put(ColCOL.COL_WHT, new Color(0xffffff)); 37 bodyColours.put(ColCOL.COL_BLK, new Color(0x000000)); 38 bodyColours.put(ColCOL.COL_RED, new Color(0xd40000)); 39 bodyColours.put(ColCOL.COL_GRN, new Color(0x00d400)); 40 bodyColours.put(ColCOL.COL_BLU, Color.blue); 41 bodyColours.put(ColCOL.COL_YEL, new Color(0xffd400)); 42 bodyColours.put(ColCOL.COL_GRY, Color.gray); 43 bodyColours.put(ColCOL.COL_BRN, new Color(0x8b4513)); 44 bodyColours.put(ColCOL.COL_AMB, new Color(0xfbf00f)); 45 bodyColours.put(ColCOL.COL_VIO, new Color(0xee82ee)); 46 bodyColours.put(ColCOL.COL_ORG, Color.orange); 47 bodyColours.put(ColCOL.COL_MAG, new Color(0xf000f0)); 48 bodyColours.put(ColCOL.COL_PNK, Color.pink); 49 } 50 51 static final EnumMap<ColPAT, Patt> pattMap = new EnumMap<ColPAT, Patt>(ColPAT.class); 52 static { 53 pattMap.put(ColPAT.PAT_UNKN, Patt.Z); 54 pattMap.put(ColPAT.PAT_HORI, Patt.H); 55 pattMap.put(ColPAT.PAT_VERT, Patt.V); 56 pattMap.put(ColPAT.PAT_DIAG, Patt.D); 57 pattMap.put(ColPAT.PAT_BRDR, Patt.B); 58 pattMap.put(ColPAT.PAT_SQUR, Patt.S); 59 pattMap.put(ColPAT.PAT_CROS, Patt.C); 60 pattMap.put(ColPAT.PAT_SALT, Patt.X); 61 pattMap.put(ColPAT.PAT_STRP, Patt.H); 62 } 63 32 64 public enum LabelStyle { NONE, RRCT, RECT, ELPS, CIRC, VCLR, HCLR } 33 65 -
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r30040 r30046 14 14 import java.awt.geom.AffineTransform; 15 15 import java.util.ArrayList; 16 16 import java.util.HashMap; 17 18 import s57.S57val; 17 19 import s57.S57val.*; 18 20 import s57.S57att.*; … … 28 30 static int zoom; 29 31 30 public static final Color Yland = new Color(0x50b0ff); 31 public static final Color Mline = new Color(0x80c480); 32 public static final Color Msymb = new Color(0xa30075); 32 static String getName(Feature feature) { 33 AttItem name = feature.atts.get(Att.OBJNAM); 34 if (name == null) { 35 name = feature.objs.get(feature.type).get(0).get(Att.OBJNAM); 36 } 37 if (name != null) return (String)name.val; 38 return null; 39 } 40 41 static AttMap getAtts(Feature feature, Obj obj, int idx) { 42 HashMap<Integer, AttMap> objs = feature.objs.get(obj); 43 if (objs == null) 44 return null; 45 else 46 return objs.get(idx); 47 } 48 49 public static Object getAttVal(Feature feature, Obj obj, int idx, Att att) { 50 AttMap atts = null; 51 HashMap<Integer, AttMap> objs = feature.objs.get(obj); 52 if (objs != null) 53 atts = objs.get(idx); 54 if (atts == null) 55 return S57val.nullVal(att); 56 else { 57 AttItem item = atts.get(att); 58 if (item == null) 59 return S57val.nullVal(att); 60 return item.val; 61 } 62 } 63 64 static Scheme getScheme(Feature feature, Obj obj) { 65 ArrayList<Color> colours = new ArrayList<Color>(); 66 for (ColCOL col : (ArrayList<ColCOL>)getAttVal(feature, obj, 0, Att.COLOUR)) { 67 colours.add(Renderer.bodyColours.get(col)); 68 } 69 ArrayList<Patt> patterns = new ArrayList<Patt>(); 70 for(ColPAT pat: (ArrayList<ColPAT>) getAttVal(feature, obj, 0, Att.COLPAT)) { 71 patterns.add(Renderer.pattMap.get(pat)); 72 } 73 return new Scheme(patterns, colours); 74 } 75 76 static boolean hasObject(Feature feature, Obj obj) { 77 return (feature.objs.containsKey(obj)); 78 } 79 80 static boolean hasAttribute(Feature feature, Obj obj, Att att) { 81 AttMap atts = getAtts(feature, obj, 0); 82 return ((atts != null) && (atts.containsKey(att))); 83 } 84 85 static boolean testAttribute(Feature feature, Obj obj, Att att, Object val) { 86 AttMap atts = getAtts(feature, obj, 0); 87 if (atts != null) { 88 AttItem item = atts.get(att); 89 if (item != null) { 90 switch (item.conv) { 91 case S: 92 case A: 93 return ((String)item.val).equals(val); 94 case L: 95 return ((ArrayList<?>)item.val).contains(val); 96 case E: 97 case F: 98 case I: 99 return item.val.equals(val); 100 } 101 } 102 } 103 return false; 104 } 33 105 34 106 public static void rules (SeaMap m, int z) { … … 77 149 if ((objects = map.features.get(Obj.SMCFAC)) != null) for (Feature feature : objects) marinas(feature); 78 150 if ((objects = map.features.get(Obj.BRIDGE)) != null) for (Feature feature : objects) bridges(feature); 151 if ((objects = map.features.get(Obj.PILPNT)) != null) for (Feature feature : objects) lights(feature); 152 if ((objects = map.features.get(Obj.LITMIN)) != null) for (Feature feature : objects) lights(feature); 79 153 if ((objects = map.features.get(Obj.LITMAJ)) != null) for (Feature feature : objects) lights(feature); 80 if ((objects = map.features.get(Obj.LITMIN)) != null) for (Feature feature : objects) lights(feature);81 154 if ((objects = map.features.get(Obj.LIGHTS)) != null) for (Feature feature : objects) lights(feature); 82 155 if ((objects = map.features.get(Obj.SISTAT)) != null) for (Feature feature : objects) stations(feature); … … 108 181 109 182 private static void areas(Feature feature) { 110 String name = Util.getName(feature);183 String name = getName(feature); 111 184 switch (feature.type) { 112 185 case DRGARE: … … 121 194 if (feature.area > 2.0) { 122 195 if (zoom < 16) 123 Renderer.lineVector(feature, new LineStyle( Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true)));196 Renderer.lineVector(feature, new LineStyle(Renderer.Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true))); 124 197 else 125 Renderer.lineVector(feature, new LineStyle( Mline, 8, new float[] { 50, 50 }));198 Renderer.lineVector(feature, new LineStyle(Renderer.Mline, 8, new float[] { 50, 50 })); 126 199 } else { 127 200 if (zoom >= 14) … … 136 209 break; 137 210 case OSPARE: 138 if ( Util.testAttribute(feature, feature.type, Att.CATPRA, CatPRA.PRA_WFRM)) {211 if (testAttribute(feature, feature.type, Att.CATPRA, CatPRA.PRA_WFRM)) { 139 212 Renderer.symbol(feature, Areas.WindFarm); 140 213 Renderer.lineVector(feature, new LineStyle(Color.black, 20, new float[] { 40, 40 })); … … 145 218 case RESARE: 146 219 if (zoom >= 12) { 147 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Mline);148 if ( Util.testAttribute(feature, feature.type, Att.CATPRA, CatREA.REA_NWAK)) {220 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Renderer.Mline); 221 if (testAttribute(feature, feature.type, Att.CATPRA, CatREA.REA_NWAK)) { 149 222 Renderer.symbol(feature, Areas.NoWake); 150 223 } … … 152 225 break; 153 226 case SEAARE: 154 switch ((CatSEA) Util.getAttVal(feature, feature.type, 0, Att.CATSEA)) {227 switch ((CatSEA) getAttVal(feature, feature.type, 0, Att.CATSEA)) { 155 228 case SEA_RECH: 156 229 if ((zoom >= 10) && (name != null)) … … 205 278 if (zoom >= 12) { 206 279 Renderer.symbol(feature, Areas.Plane); 207 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Mline);280 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Renderer.Mline); 208 281 } 209 282 if ((zoom >= 15) && (name != null)) … … 216 289 217 290 private static void beacons(Feature feature) { 218 BcnSHP shape = (BcnSHP) Util.getAttVal(feature, feature.type, 0, Att.BCNSHP);291 BcnSHP shape = (BcnSHP) getAttVal(feature, feature.type, 0, Att.BCNSHP); 219 292 if (((shape == BcnSHP.BCN_PRCH) || (shape == BcnSHP.BCN_WTHY)) && (feature.type == Obj.BCNLAT)) { 220 CatLAM cat = (CatLAM) Util.getAttVal(feature, feature.type, 0, Att.CATLAM);293 CatLAM cat = (CatLAM) getAttVal(feature, feature.type, 0, Att.CATLAM); 221 294 switch (cat) { 222 295 case LAM_PORT: … … 233 306 break; 234 307 default: 235 Renderer.symbol(feature, Beacons.Stake, Util.getScheme(feature, feature.type));308 Renderer.symbol(feature, Beacons.Stake, getScheme(feature, feature.type)); 236 309 } 237 310 } else { 238 Renderer.symbol(feature, Beacons.Shapes.get(shape), Util.getScheme(feature, feature.type));311 Renderer.symbol(feature, Beacons.Shapes.get(shape), getScheme(feature, feature.type)); 239 312 if (feature.objs.get(Obj.TOPMAR) != null) 240 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Util.getScheme(feature, Obj.TOPMAR), Topmarks.BeaconDelta);313 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.BeaconDelta); 241 314 } 242 315 Signals.addSignals(feature); … … 244 317 245 318 private static void buoys(Feature feature) { 246 BoySHP shape = (BoySHP) Util.getAttVal(feature, feature.type, 0, Att.BOYSHP);247 Renderer.symbol(feature, Buoys.Shapes.get(shape), Util.getScheme(feature, feature.type));248 if ( Util.hasObject(feature, Obj.TOPMAR)) {249 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Util.getScheme(feature, Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape));319 BoySHP shape = (BoySHP) getAttVal(feature, feature.type, 0, Att.BOYSHP); 320 Renderer.symbol(feature, Buoys.Shapes.get(shape), getScheme(feature, feature.type)); 321 if (hasObject(feature, Obj.TOPMAR)) { 322 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape)); 250 323 } 251 324 Signals.addSignals(feature); … … 283 356 if ((zoom >= 16) && (feature.length < 2)) { 284 357 if (feature.type == Obj.CBLSUB) { 285 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Mline);358 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Renderer.Mline); 286 359 } else if (feature.type == Obj.CBLOHD) { 287 360 AttMap atts = feature.objs.get(Obj.CBLOHD).get(0); … … 297 370 private static void distances(Feature feature) { 298 371 if (zoom >= 14) { 299 if (! Util.testAttribute(feature, Obj.DISMAR, Att.CATDIS, CatDIS.DIS_NONI)) {372 if (!testAttribute(feature, Obj.DISMAR, Att.CATDIS, CatDIS.DIS_NONI)) { 300 373 Renderer.symbol(feature, Harbours.DistanceI); 301 374 } else { 302 375 Renderer.symbol(feature, Harbours.DistanceU); 303 376 } 304 if ((zoom >=15) && Util.hasAttribute(feature, Obj.DISMAR, Att.WTWDIS)) {377 if ((zoom >=15) && hasAttribute(feature, Obj.DISMAR, Att.WTWDIS)) { 305 378 AttMap atts = feature.objs.get(Obj.DISMAR).get(0); 306 379 Double dist = (Double) atts.get(Att.WTWDIS).val; … … 339 412 switch (feature.type) { 340 413 case LITVES: 341 Renderer.symbol(feature, Buoys.Super, Util.getScheme(feature, feature.type));414 Renderer.symbol(feature, Buoys.Super, getScheme(feature, feature.type)); 342 415 break; 343 416 case LITFLT: 344 Renderer.symbol(feature, Buoys.Float, Util.getScheme(feature, feature.type));417 Renderer.symbol(feature, Buoys.Float, getScheme(feature, feature.type)); 345 418 break; 346 419 case BOYINB: 347 Renderer.symbol(feature, Buoys.Super, Util.getScheme(feature, feature.type));420 Renderer.symbol(feature, Buoys.Super, getScheme(feature, feature.type)); 348 421 break; 349 422 default: … … 351 424 } 352 425 if (feature.objs.get(Obj.TOPMAR) != null) 353 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Util.getScheme(feature, Obj.TOPMAR), Topmarks.FloatDelta);426 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.FloatDelta); 354 427 Signals.addSignals(feature); 355 428 } … … 363 436 364 437 private static void harbours(Feature feature) { 365 String name = Util.getName(feature);438 String name = getName(feature); 366 439 switch (feature.type) { 367 440 case ACHBRT: 368 441 if (zoom >= 14) { 369 Renderer.symbol(feature, Harbours.Anchorage, new Scheme( Mline));370 Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC));371 } 372 double radius = (Double) Util.getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS);442 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Renderer.Mline)); 443 Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Renderer.Mline, Color.white, new Delta(Handle.BC)); 444 } 445 double radius = (Double)getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS); 373 446 if (radius != 0) { 374 UniHLU units = (UniHLU) Util.getAttVal(feature, Obj.ACHBRT, 0, Att.HUNITS);375 Renderer.lineCircle (feature, new LineStyle( Mline, 4, new float[] { 10, 10 }, null), radius, units);447 UniHLU units = (UniHLU)getAttVal(feature, Obj.ACHBRT, 0, Att.HUNITS); 448 Renderer.lineCircle (feature, new LineStyle(Renderer.Mline, 4, new float[] { 10, 10 }, null), radius, units); 376 449 } 377 450 break; … … 381 454 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Color.black)); 382 455 } else { 383 Renderer.symbol(feature, Harbours.Anchorage, new Scheme( Mline));384 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Mline);456 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Renderer.Mline)); 457 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Renderer.Mline); 385 458 } 386 459 if ((zoom >= 15) && ((name) != null)) { 387 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));388 } 389 ArrayList<StsSTS> sts = (ArrayList<StsSTS>) Util.getAttVal(feature, Obj.ACHARE, 0, Att.STATUS);460 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0))); 461 } 462 ArrayList<StsSTS> sts = (ArrayList<StsSTS>)getAttVal(feature, Obj.ACHARE, 0, Att.STATUS); 390 463 if ((zoom >= 15) && (sts != null) && (sts.contains(StsSTS.STS_RESV))) { 391 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));392 } 393 } 394 ArrayList<CatACH> cats = (ArrayList<CatACH>) Util.getAttVal(feature, Obj.ACHARE, 0, Att.CATACH);464 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60))); 465 } 466 } 467 ArrayList<CatACH> cats = (ArrayList<CatACH>)getAttVal(feature, Obj.ACHARE, 0, Att.CATACH); 395 468 int dy = (cats.size() - 1) * -30; 396 469 for (CatACH cat : cats) { 397 470 switch (cat) { 398 471 case ACH_DEEP: 399 Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));472 Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 400 473 dy += 60; 401 474 break; 402 475 case ACH_TANK: 403 Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));476 Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 404 477 dy += 60; 405 478 break; 406 479 case ACH_H24P: 407 Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));480 Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 408 481 dy += 60; 409 482 break; 410 483 case ACH_EXPL: 411 Renderer.symbol(feature, Harbours.Explosives, new Scheme( Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));484 Renderer.symbol(feature, Harbours.Explosives, new Scheme(Renderer.Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 412 485 dy += 60; 413 486 break; 414 487 case ACH_QUAR: 415 Renderer.symbol(feature, Harbours.Hospital, new Scheme( Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));488 Renderer.symbol(feature, Harbours.Hospital, new Scheme(Renderer.Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 416 489 dy += 60; 417 490 break; 418 491 case ACH_SEAP: 419 Renderer.symbol(feature, Areas.Seaplane, new Scheme( Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));492 Renderer.symbol(feature, Areas.Seaplane, new Scheme(Renderer.Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 420 493 dy += 60; 421 494 break; … … 425 498 case BERTHS: 426 499 if (zoom >= 14) { 427 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Mline, Color.white, null);500 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Renderer.Mline, Color.white, null); 428 501 } 429 502 break; … … 431 504 if (zoom >= 16) { 432 505 ArrayList<Symbol> symbols = new ArrayList<Symbol>(); 433 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Util.getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN);506 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN); 434 507 for (FncFNC fnc : fncs) { 435 508 symbols.add(Landmarks.Funcs.get(fnc)); 436 509 } 437 510 if (feature.objs.containsKey(Obj.SMCFAC)) { 438 ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) Util.getAttVal(feature, Obj.SMCFAC, 0, Att.CATSCF);511 ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttVal(feature, Obj.SMCFAC, 0, Att.CATSCF); 439 512 for (CatSCF scf : scfs) { 440 513 symbols.add(Facilities.Cats.get(scf)); … … 446 519 case HRBFAC: 447 520 if (zoom >= 12) { 448 switch ((CatHAF) Util.getAttVal(feature, feature.type, 0, Att.CATHAF)) {521 switch ((CatHAF) getAttVal(feature, feature.type, 0, Att.CATHAF)) { 449 522 case HAF_MRNA: 450 523 Renderer.symbol(feature, Harbours.Marina); … … 464 537 465 538 private static void landmarks(Feature feature) { 466 ArrayList<CatLMK> cats = (ArrayList<CatLMK>) Util.getAttVal(feature, feature.type, 0, Att.CATLMK);539 ArrayList<CatLMK> cats = (ArrayList<CatLMK>) getAttVal(feature, feature.type, 0, Att.CATLMK); 467 540 Symbol catSym = Landmarks.Shapes.get(cats.get(0)); 468 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Util.getAttVal(feature, feature.type, 0, Att.FUNCTN);541 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttVal(feature, feature.type, 0, Att.FUNCTN); 469 542 Symbol fncSym = Landmarks.Funcs.get(fncs.get(0)); 470 543 if ((fncs.get(0) == FncFNC.FNC_CHCH) && (cats.get(0) == CatLMK.LMK_TOWR)) … … 501 574 Renderer.symbol(feature, Beacons.LightMinor); 502 575 break; 576 case PILPNT: 577 if (hasObject(feature, Obj.LIGHTS)) 578 Renderer.symbol(feature, Beacons.LightMinor); 579 else 580 Renderer.symbol(feature, Harbours.Post); 581 break; 503 582 } 504 583 Signals.addSignals(feature); 505 584 } 506 585 507 586 private static void locks(Feature feature) { 508 587 } 588 509 589 private static void marinas(Feature feature) { 510 590 if (zoom >= 16) { … … 512 592 } 513 593 } 514 515 594 private static void moorings(Feature feature) { 516 switch ((CatMOR) Util.getAttVal(feature, feature.type, 0, Att.CATMOR)) {595 switch ((CatMOR) getAttVal(feature, feature.type, 0, Att.CATMOR)) { 517 596 case MOR_DLPN: 518 597 Renderer.symbol(feature, Harbours.Dolphin); … … 526 605 break; 527 606 case MOR_BUOY: 528 BoySHP shape = (BoySHP) Util.getAttVal(feature, feature.type, 0, Att.BOYSHP);607 BoySHP shape = (BoySHP) getAttVal(feature, feature.type, 0, Att.BOYSHP); 529 608 if (shape == BoySHP.BOY_UNKN) 530 609 shape = BoySHP.BOY_SPHR; 531 Renderer.symbol(feature, Buoys.Shapes.get(shape), Util.getScheme(feature, feature.type));610 Renderer.symbol(feature, Buoys.Shapes.get(shape), getScheme(feature, feature.type)); 532 611 break; 533 612 } … … 751 830 } 752 831 } 832 753 833 private static void obstructions(Feature feature) { 754 834 if ((zoom >= 14) && (feature.type == Obj.UWTROC)) { 755 WatLEV lvl = (WatLEV) Util.getAttVal(feature, feature.type, 0, Att.WATLEV);835 WatLEV lvl = (WatLEV) getAttVal(feature, feature.type, 0, Att.WATLEV); 756 836 switch (lvl) { 757 837 case LEV_CVRS: … … 768 848 } 769 849 } 850 770 851 private static void pipelines(Feature feature) { 771 852 if (zoom >= 14) { 772 853 if (feature.type == Obj.PIPSOL) { 773 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Mline);854 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Renderer.Mline); 774 855 } else if (feature.type == Obj.PIPOHD) { 775 856 … … 777 858 } 778 859 } 860 779 861 private static void platforms(Feature feature) { 780 ArrayList<CatOFP> cats = (ArrayList<CatOFP>) Util.getAttVal(feature, Obj.OFSPLF, 0, Att.CATOFP);862 ArrayList<CatOFP> cats = (ArrayList<CatOFP>)getAttVal(feature, Obj.OFSPLF, 0, Att.CATOFP); 781 863 if ((CatOFP) cats.get(0) == CatOFP.OFP_FPSO) 782 864 Renderer.symbol(feature, Buoys.Storage); 783 865 else 784 866 Renderer.symbol(feature, Landmarks.Platform); 785 String name = Util.getName(feature);867 String name = getName(feature); 786 868 if ((zoom >= 15) && (name != null)) 787 869 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50))); 788 /*object_rules(platforms) { 789 if (has_object("fog_signal")) object(fogs); 790 if (has_object("radar_transponder")) object(rtbs); 791 if (has_object("light")) object(lights); 792 } 793 */ 794 } 870 Signals.addSignals(feature); 871 } 872 795 873 private static void ports(Feature feature) { 796 874 if (zoom >= 14) { 797 875 if (feature.type == Obj.CRANES) { 798 if ((CatCRN) Util.getAttVal(feature, feature.type, 0, Att.CATCRN) == CatCRN.CRN_CONT)876 if ((CatCRN) getAttVal(feature, feature.type, 0, Att.CATCRN) == CatCRN.CRN_CONT) 799 877 Renderer.symbol(feature, Harbours.ContainerCrane); 800 878 else … … 802 880 } else if (feature.type == Obj.HULKES) { 803 881 Renderer.lineVector(feature, new LineStyle(Color.black, 4, null, new Color(0xffe000))); 804 String name = Util.getName(feature);882 String name = getName(feature); 805 883 if ((zoom >= 15) && (name != null)) 806 884 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, null); … … 808 886 } 809 887 } 888 810 889 private static void separation(Feature feature) { 811 890 switch (feature.type) { … … 817 896 else 818 897 Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, null, null)); 819 String name = Util.getName(feature);898 String name = getName(feature); 820 899 if ((zoom >= 10) && (name != null)) 821 900 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080, true), null, null); … … 835 914 } 836 915 } 916 837 917 private static void shoreline(Feature feature) { 838 918 if (zoom >= 12) { 839 switch ((CatSLC) Util.getAttVal(feature, feature.type, 0, Att.CATSLC)) {919 switch ((CatSLC) getAttVal(feature, feature.type, 0, Att.CATSLC)) { 840 920 case SLC_TWAL: 841 WatLEV lev = (WatLEV) Util.getAttVal(feature, feature.type, 0, Att.WATLEV);921 WatLEV lev = (WatLEV) getAttVal(feature, feature.type, 0, Att.WATLEV); 842 922 if (lev == WatLEV.LEV_CVRS) { 843 923 Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null)); … … 852 932 } 853 933 } 854 934 855 935 private static void stations(Feature feature) { 856 936 if (zoom >= 14) { … … 885 965 Signals.addSignals(feature); 886 966 } 887 967 888 968 private static void transits(Feature feature) { 889 969 if (zoom >= 12) { … … 893 973 if (zoom >= 15) { 894 974 String str = ""; 895 String name = Util.getName(feature);975 String name = getName(feature); 896 976 if (name != null) str += name + " "; 897 Double ort = (Double) Util.getAttVal(feature, feature.type, 0, Att.ORIENT);977 Double ort = (Double) getAttVal(feature, feature.type, 0, Att.ORIENT); 898 978 if (ort != null) str += ort.toString() + "\u0152"; 899 979 if (!str.isEmpty()) Renderer.lineText(feature, str, new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20); 900 980 } 901 981 } 982 902 983 private static void waterways(Feature feature) { 903 984 904 985 } 905 986 906 987 private static void wrecks(Feature feature) { 907 988 if (zoom >= 14) { 908 CatWRK cat = (CatWRK) Util.getAttVal(feature, feature.type, 0, Att.CATWRK);989 CatWRK cat = (CatWRK) getAttVal(feature, feature.type, 0, Att.CATWRK); 909 990 switch (cat) { 910 991 case WRK_DNGR: -
applications/editors/josm/plugins/smed2/src/seamap/Signals.java
r30036 r30046 41 41 public static void radarStations(Feature feature) { 42 42 Renderer.symbol(feature, Beacons.RadarStation); 43 ArrayList<CatROS> cats = (ArrayList<CatROS>) Util.getAttVal(feature, Obj.RDOSTA, 0, Att.CATROS);43 ArrayList<CatROS> cats = (ArrayList<CatROS>)Rules.getAttVal(feature, Obj.RDOSTA, 0, Att.CATROS); 44 44 String str = ""; 45 45 for (CatROS ros : cats) {
Note:
See TracChangeset
for help on using the changeset viewer.