Changeset 30028 in osm for applications/editors
- Timestamp:
- 2013-10-20T16:50:35+02:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/s57/S57obj.java
r29266 r30028 13 13 DMPGRD, DYKCON, EXEZNE, FAIRWY, FNCLNE, FERYRT, FSHZNE, FSHFAC, FSHGRD, FLODOC, FOGSIG, FORSTC, FRPARE, GATCON, GRIDRN, HRBARE, 14 14 HRBFAC, HULKES, ICEARE, ICNARE, ISTZNE, LAKARE, LAKSHR, LNDARE, LNDELV, LNDRGN, LNDMRK, LIGHTS, LITFLT, LITVES, LOCMAG, LOKBSN, 15 LOGPON, MAGVAR, MARCUL, MIPARE, MORFAC, /*MPAARE,*/ NAVLNE, OBSTRN, OFSPLF, OSPARE, OILBAR, PILPNT, PILBOP, PIPARE, PIPOHD, PIPSOL, PONTON,16 P RCARE, PRDARE, PYLONS, RADLNE, RADRNG, RADRFL, RADSTA, RTPBCN, RDOCAL, RDOSTA, RAILWY, RAPIDS, RCRTCL, RECTRC, RCTLPT, RSCSTA,17 R ESARE, RETRFL, RIVERS, RIVBNK, ROADWY, RUNWAY, SNDWAV, SEAARE, SPLARE, SBDARE, SLCONS, SISTAT, SISTAW, SILTNK, SLOTOP, SLOGRD,18 S MCFAC, SOUNDG, SPRING, SQUARE, STSLNE, SUBTLN, SWPARE, TESARE, TS_PRH, TS_PNH, TS_PAD, TS_TIS, T_HMON, T_NHMN, T_TIMS, TIDEWY,19 T OPMAR, TSELNE, TSSBND, TSSCRS, TSSLPT, TSSRON, TSEZNE, TUNNEL, TWRTPT, UWTROC, UNSARE, VEGATN, WATTUR, WATFAL, WEDKLP, WRECKS,20 TS_FEB, NOTMRK, WTWAXS, WTWPRF, BRGARE, BUNSTA, COMARE, HRBBSN, LOKARE, LKBSPT, PRTARE, BCNWTW, BOYWTW, REFDMP, RTPLPT, TERMNL,21 T RNBSN, WTWARE, WTWGAG, TISDGE, VEHTRF, EXCNST, LG_SDM, LG_VSP, LITMIN, LITMAJ15 LOGPON, MAGVAR, MARCUL, MIPARE, MORFAC, MPAARE, NAVLNE, OBSTRN, OFSPLF, OSPARE, OILBAR, PILPNT, PILBOP, PIPARE, PIPOHD, PIPSOL, 16 PONTON, PRCARE, PRDARE, PYLONS, RADLNE, RADRNG, RADRFL, RADSTA, RTPBCN, RDOCAL, RDOSTA, RAILWY, RAPIDS, RCRTCL, RECTRC, RCTLPT, 17 RSCSTA, RESARE, RETRFL, RIVERS, RIVBNK, ROADWY, RUNWAY, SNDWAV, SEAARE, SPLARE, SBDARE, SLCONS, SISTAT, SISTAW, SILTNK, SLOTOP, 18 SLOGRD, SMCFAC, SOUNDG, SPRING, SQUARE, STSLNE, SUBTLN, SWPARE, TESARE, TS_PRH, TS_PNH, TS_PAD, TS_TIS, T_HMON, T_NHMN, T_TIMS, 19 TIDEWY, TOPMAR, TSELNE, TSSBND, TSSCRS, TSSLPT, TSSRON, TSEZNE, TUNNEL, TWRTPT, UWTROC, UNSARE, VEGATN, WATTUR, WATFAL, WEDKLP, 20 WRECKS, TS_FEB, NOTMRK, WTWAXS, WTWPRF, BRGARE, BUNSTA, COMARE, HRBBSN, LOKARE, LKBSPT, PRTARE, BCNWTW, BOYWTW, REFDMP, RTPLPT, 21 TERMNL, TRNBSN, WTWARE, WTWGAG, TISDGE, VEHTRF, EXCNST, LG_SDM, LG_VSP, LITMIN, LITMAJ 22 22 } 23 23 … … 41 41 ObjS57.put(Obj.LIGHTS,75); ObjS57.put(Obj.LITFLT,76); ObjS57.put(Obj.LITVES,77); ObjS57.put(Obj.LOCMAG,78); ObjS57.put(Obj.LOKBSN,79); 42 42 ObjS57.put(Obj.LOGPON,80); ObjS57.put(Obj.MAGVAR,81); ObjS57.put(Obj.MARCUL,82); ObjS57.put(Obj.MIPARE,83); ObjS57.put(Obj.MORFAC,84); 43 // ObjS57.put(Obj.MPAARE,?);44 43 ObjS57.put(Obj.NAVLNE,85); ObjS57.put(Obj.OBSTRN,86); ObjS57.put(Obj.OFSPLF,87); ObjS57.put(Obj.OSPARE,88); ObjS57.put(Obj.OILBAR,89); 45 44 ObjS57.put(Obj.PILPNT,90); ObjS57.put(Obj.PILBOP,91); ObjS57.put(Obj.PIPARE,92); ObjS57.put(Obj.PIPOHD,93); ObjS57.put(Obj.PIPSOL,94); … … 57 56 ObjS57.put(Obj.TSEZNE,150); ObjS57.put(Obj.TUNNEL,151); ObjS57.put(Obj.TWRTPT,152); ObjS57.put(Obj.UWTROC,153); ObjS57.put(Obj.UNSARE,154); 58 57 ObjS57.put(Obj.VEGATN,155); ObjS57.put(Obj.WATTUR,156); ObjS57.put(Obj.WATFAL,157); ObjS57.put(Obj.WEDKLP,158); ObjS57.put(Obj.WRECKS,159); 59 ObjS57.put(Obj.TS_FEB,160); 58 ObjS57.put(Obj.TS_FEB,160); ObjS57.put(Obj.MPAARE,199); 60 59 } 61 60 … … 135 134 ObjStr.put(Obj.TRNBSN, "turning_basin"); ObjStr.put(Obj.WTWARE, "waterway_area"); ObjStr.put(Obj.WTWGAG, "waterway_gauge"); ObjStr.put(Obj.TISDGE, "time_schedule"); 136 135 ObjStr.put(Obj.VEHTRF, "vehicle_transfer"); ObjStr.put(Obj.EXCNST, "exceptional_structure"); ObjStr.put(Obj.LG_SDM, ""); ObjStr.put(Obj.LG_VSP, ""); 137 ObjStr.put(Obj. LITMAJ, "light_major"); ObjStr.put(Obj.LITMIN, "light_minor");136 ObjStr.put(Obj.MPAARE, "protected_area"); ObjStr.put(Obj.LITMAJ, "light_major"); ObjStr.put(Obj.LITMIN, "light_minor"); 138 137 } 139 138 -
applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
r30027 r30028 58 58 pattMap.put(ColPAT.PAT_STRP, Patt.H); 59 59 } 60 60 61 61 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 }; 62 62 63 // public static final double textScale[] = { 256.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.5556, 0.3086, 0.1714, 0.0953, 0.0529, 0.0294, 0.0163, 0.0091, 0.0050, 0.0028, 0.0163 };64 65 63 public enum LabelStyle { NONE, RRCT, RECT, ELPS, CIRC, VCLR, HCLR } 66 64 … … 68 66 static SeaMap map; 69 67 static double sScale; 70 // static double tScale;71 68 static Graphics2D g2; 72 69 static int zoom; … … 78 75 map = m; 79 76 sScale = symbolScale[zoom] * factor; 80 // tScale = textScale[zoom] * factor;81 77 if (map != null) { 82 78 g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 83 79 g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP); 80 g2.setStroke(new BasicStroke(0, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)); 84 81 Rules.rules(map, zoom); 85 82 } -
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r30027 r30028 31 31 static SeaMap map; 32 32 static int zoom; 33 34 public static final Color Yland = new Color(0x50b0ff); 35 public static final Color Mline = new Color(0xc480ff); 36 public static final Color Msymb = new Color(0xa30075); 33 37 34 38 public static void rules (SeaMap m, int z) { … … 121 125 if (feature.area > 2.0) { 122 126 if (zoom < 16) 123 Renderer.lineVector(feature, new LineStyle( new Color(0xc480ff), 8, new float[] { 50, 50 }, new Color(0x40ffffff, true)));127 Renderer.lineVector(feature, new LineStyle(Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true))); 124 128 else 125 Renderer.lineVector(feature, new LineStyle( new Color(0xc480ff), 8, new float[] { 50, 50 }, null));129 Renderer.lineVector(feature, new LineStyle(Mline, 8, new float[] { 50, 50 }, null)); 126 130 } else { 127 131 if (zoom >= 14) … … 276 280 277 281 private static void cables(Feature feature) { 278 if ( zoom >= 14) {282 if ((zoom >= 16) && (feature.length < 2)) { 279 283 if (feature.type == Obj.CBLSUB) { 280 284 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, 0, new Color(0x80c480)); … … 327 331 case ACHBRT: 328 332 if (zoom >= 14) { 329 Renderer.symbol(feature, Harbours.Anchorage, null, null, new Scheme( new Color(0xc480ff)));330 Renderer.labelText(feature, name == null ? " " : (String) name.val, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, new Color(0xc480ff), Color.white, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 0)));333 Renderer.symbol(feature, Harbours.Anchorage, null, null, 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))); 331 335 } 332 336 double radius = (Double)Renderer.getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS); 333 337 if (radius != 0) { 334 338 UniHLU units = (UniHLU)Renderer.getAttVal(feature, Obj.ACHBRT, 0, Att.HUNITS); 335 Renderer.lineCircle (feature, new LineStyle( new Color(0xc480ff), 4, new float[] { 10, 10 }, null), radius, units);339 Renderer.lineCircle (feature, new LineStyle(Mline, 4, new float[] { 10, 10 }, null), radius, units); 336 340 } 337 341 break; … … 341 345 Renderer.symbol(feature, Harbours.Anchorage, null, null, new Scheme(Color.black)); 342 346 } else { 343 Renderer.symbol(feature, Harbours.Anchorage, null, null, new Scheme( new Color(0xc480ff)));344 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, 10, new Color(0xc480ff));347 Renderer.symbol(feature, Harbours.Anchorage, null, null, new Scheme(Mline)); 348 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, 10, Mline); 345 349 } 346 350 if ((zoom >= 15) && ((name) != null)) { 347 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, new Color(0xc480ff), null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));351 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0))); 348 352 } 349 353 ArrayList<StsSTS> sts = (ArrayList<StsSTS>)Renderer.getAttVal(feature, Obj.ACHARE, 0, Att.STATUS); 350 354 if ((zoom >= 15) && (sts != null) && (sts.contains(StsSTS.STS_RESV))) { 351 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, new Color(0xc480ff), null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));355 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60))); 352 356 } 353 357 } … … 357 361 switch (cat) { 358 362 case ACH_DEEP: 359 Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, new Color(0xc480ff), null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));363 Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 360 364 dy += 60; 361 365 break; 362 366 case ACH_TANK: 363 Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, new Color(0xc480ff), null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));367 Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 364 368 dy += 60; 365 369 break; 366 370 case ACH_H24P: 367 Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, new Color(0xc480ff), null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));371 Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 368 372 dy += 60; 369 373 break; 370 374 case ACH_EXPL: 371 Renderer.symbol(feature, Harbours.Explosives, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme( new Color(0xc480ff)));375 Renderer.symbol(feature, Harbours.Explosives, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(Mline)); 372 376 dy += 60; 373 377 break; 374 378 case ACH_QUAR: 375 Renderer.symbol(feature, Harbours.Hospital, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme( new Color(0xc480ff)));379 Renderer.symbol(feature, Harbours.Hospital, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(Mline)); 376 380 dy += 60; 377 381 break; 378 382 case ACH_SEAP: 379 Renderer.symbol(feature, Areas.Seaplane, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme( new Color(0xc480ff)));383 Renderer.symbol(feature, Areas.Seaplane, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(Mline)); 380 384 dy += 60; 381 385 break; … … 385 389 case BERTHS: 386 390 if (zoom >= 14) { 387 Renderer.labelText(feature, name == null ? " " : (String) name.val, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, new Color(0xc480ff), Color.white, null);391 Renderer.labelText(feature, name == null ? " " : (String) name.val, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Mline, Color.white, null); 388 392 } 389 393 break;
Note:
See TracChangeset
for help on using the changeset viewer.