Changeset 30036 in osm for applications/editors/josm/plugins
- Timestamp:
- 2013-11-02T17:09:51+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/panels/ShowFrame.java
r30033 r30036 49 49 } 50 50 51 @Override52 51 public Point2D getPoint(Snode coord) { 53 52 return new Point2D.Double(150, 150); -
applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
r30033 r30036 28 28 public class Renderer { 29 29 30 public static final EnumMap<ColCOL, Color> bodyColours = new EnumMap<ColCOL, Color>(ColCOL.class);31 static {32 bodyColours.put(ColCOL.COL_UNK, new Color(0, true));33 bodyColours.put(ColCOL.COL_WHT, new Color(0xffffff));34 bodyColours.put(ColCOL.COL_BLK, new Color(0x000000));35 bodyColours.put(ColCOL.COL_RED, new Color(0xd40000));36 bodyColours.put(ColCOL.COL_GRN, new Color(0x00d400));37 bodyColours.put(ColCOL.COL_BLU, Color.blue);38 bodyColours.put(ColCOL.COL_YEL, new Color(0xffd400));39 bodyColours.put(ColCOL.COL_GRY, Color.gray);40 bodyColours.put(ColCOL.COL_BRN, new Color(0x8b4513));41 bodyColours.put(ColCOL.COL_AMB, new Color(0xfbf00f));42 bodyColours.put(ColCOL.COL_VIO, new Color(0xee82ee));43 bodyColours.put(ColCOL.COL_ORG, Color.orange);44 bodyColours.put(ColCOL.COL_MAG, new Color(0xf000f0));45 bodyColours.put(ColCOL.COL_PNK, Color.pink);46 }47 48 public static final EnumMap<ColPAT, Patt> pattMap = new EnumMap<ColPAT, Patt>(ColPAT.class);49 static {50 pattMap.put(ColPAT.PAT_UNKN, Patt.Z);51 pattMap.put(ColPAT.PAT_HORI, Patt.H);52 pattMap.put(ColPAT.PAT_VERT, Patt.V);53 pattMap.put(ColPAT.PAT_DIAG, Patt.D);54 pattMap.put(ColPAT.PAT_BRDR, Patt.B);55 pattMap.put(ColPAT.PAT_SQUR, Patt.S);56 pattMap.put(ColPAT.PAT_CROS, Patt.C);57 pattMap.put(ColPAT.PAT_SALT, Patt.X);58 pattMap.put(ColPAT.PAT_STRP, Patt.H);59 }60 61 30 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 31 … … 83 52 } 84 53 85 public static AttMap getAtts(Feature feature, Obj obj, int idx) { 86 HashMap<Integer, AttMap> objs = feature.objs.get(obj); 87 if (objs == null) 88 return null; 89 else 90 return objs.get(idx); 91 } 92 93 public static Object getAttVal(Feature feature, Obj obj, int idx, Att att) { 94 AttMap atts = getAtts(feature, obj, idx); 95 if (atts == null) 96 return S57val.nullVal(att); 97 else { 98 AttItem item = atts.get(att); 99 if (item == null) 100 return S57val.nullVal(att); 101 return item.val; 102 } 103 } 104 105 public static void symbol(Feature feature, Symbol symbol, Obj obj, Scheme scheme, Delta delta) { 106 Point2D point = context.getPoint(feature.centre); 107 if (obj == null) { 108 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, delta); 109 } else { 110 ArrayList<Color> colours = new ArrayList<Color>(); 111 for (ColCOL col : (ArrayList<ColCOL>)getAttVal(feature, obj, 0, Att.COLOUR)) { 112 colours.add(bodyColours.get(col)); 113 } 114 ArrayList<Patt> patterns = new ArrayList<Patt>(); 115 for(ColPAT pat: (ArrayList<ColPAT>) getAttVal(feature, obj, 0, Att.COLPAT)) { 116 patterns.add(pattMap.get(pat)); 117 } 118 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), new Scheme(patterns, colours), delta); 119 } 54 public static void symbol(Feature feature, Symbol symbol) { 55 Point2D point = context.getPoint(feature.centre); 56 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), null, null); 57 } 58 59 public static void symbol(Feature feature, Symbol symbol, Scheme scheme) { 60 Point2D point = context.getPoint(feature.centre); 61 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, null); 62 } 63 64 public static void symbol(Feature feature, Symbol symbol, Delta delta) { 65 Point2D point = context.getPoint(feature.centre); 66 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), null, delta); 67 } 68 69 public static void symbol(Feature feature, Symbol symbol, Scheme scheme, Delta delta) { 70 Point2D point = context.getPoint(feature.centre); 71 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, delta); 120 72 } 121 73 … … 133 85 switch (symbols.size()) { 134 86 case 1: 135 symbol(feature, symbols.get(0), n ull, null, new Delta(Handle.CC, new AffineTransform()));87 symbol(feature, symbols.get(0), new Delta(Handle.CC, new AffineTransform())); 136 88 break; 137 89 case 2: 138 symbol(feature, symbols.get(0), n ull, null, new Delta(Handle.RC, new AffineTransform()));139 symbol(feature, symbols.get(1), n ull, null, new Delta(Handle.LC, new AffineTransform()));90 symbol(feature, symbols.get(0), new Delta(Handle.RC, new AffineTransform())); 91 symbol(feature, symbols.get(1), new Delta(Handle.LC, new AffineTransform())); 140 92 break; 141 93 case 3: 142 symbol(feature, symbols.get(0), n ull, null, new Delta(Handle.BC, new AffineTransform()));143 symbol(feature, symbols.get(1), n ull, null, new Delta(Handle.TR, new AffineTransform()));144 symbol(feature, symbols.get(2), n ull, null, new Delta(Handle.TL, new AffineTransform()));94 symbol(feature, symbols.get(0), new Delta(Handle.BC, new AffineTransform())); 95 symbol(feature, symbols.get(1), new Delta(Handle.TR, new AffineTransform())); 96 symbol(feature, symbols.get(2), new Delta(Handle.TL, new AffineTransform())); 145 97 break; 146 98 case 4: 147 symbol(feature, symbols.get(0), n ull, null, new Delta(Handle.BR, new AffineTransform()));148 symbol(feature, symbols.get(1), n ull, null, new Delta(Handle.BL, new AffineTransform()));149 symbol(feature, symbols.get(2), n ull, null, new Delta(Handle.TR, new AffineTransform()));150 symbol(feature, symbols.get(3), n ull, null, new Delta(Handle.TL, new AffineTransform()));99 symbol(feature, symbols.get(0), new Delta(Handle.BR, new AffineTransform())); 100 symbol(feature, symbols.get(1), new Delta(Handle.BL, new AffineTransform())); 101 symbol(feature, symbols.get(2), new Delta(Handle.TR, new AffineTransform())); 102 symbol(feature, symbols.get(3), new Delta(Handle.TL, new AffineTransform())); 151 103 break; 152 104 case 5: 153 symbol(feature, symbols.get(0), n ull, null, new Delta(Handle.BR, new AffineTransform()));154 symbol(feature, symbols.get(1), n ull, null, new Delta(Handle.BL, new AffineTransform()));155 symbol(feature, symbols.get(2), n ull, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));156 symbol(feature, symbols.get(3), n ull, null, new Delta(Handle.TC, new AffineTransform()));157 symbol(feature, symbols.get(4), n ull, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));105 symbol(feature, symbols.get(0), new Delta(Handle.BR, new AffineTransform())); 106 symbol(feature, symbols.get(1), new Delta(Handle.BL, new AffineTransform())); 107 symbol(feature, symbols.get(2), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 108 symbol(feature, symbols.get(3), new Delta(Handle.TC, new AffineTransform())); 109 symbol(feature, symbols.get(4), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 158 110 break; 159 111 case 6: 160 symbol(feature, symbols.get(0), n ull, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));161 symbol(feature, symbols.get(1), n ull, null, new Delta(Handle.BC, new AffineTransform()));162 symbol(feature, symbols.get(2), n ull, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));163 symbol(feature, symbols.get(3), n ull, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));164 symbol(feature, symbols.get(4), n ull, null, new Delta(Handle.TC, new AffineTransform()));165 symbol(feature, symbols.get(5), n ull, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));112 symbol(feature, symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 113 symbol(feature, symbols.get(1), new Delta(Handle.BC, new AffineTransform())); 114 symbol(feature, symbols.get(2), new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 115 symbol(feature, symbols.get(3), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 116 symbol(feature, symbols.get(4), new Delta(Handle.TC, new AffineTransform())); 117 symbol(feature, symbols.get(5), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 166 118 break; 167 119 case 7: 168 symbol(feature, symbols.get(0), n ull, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));169 symbol(feature, symbols.get(1), n ull, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));170 symbol(feature, symbols.get(2), n ull, null, new Delta(Handle.CC, new AffineTransform()));171 symbol(feature, symbols.get(3), n ull, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));172 symbol(feature, symbols.get(4), n ull, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));173 symbol(feature, symbols.get(5), n ull, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));174 symbol(feature, symbols.get(6), n ull, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));120 symbol(feature, symbols.get(0), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2))); 121 symbol(feature, symbols.get(1), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 122 symbol(feature, symbols.get(2), new Delta(Handle.CC, new AffineTransform())); 123 symbol(feature, symbols.get(3), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 124 symbol(feature, symbols.get(4), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2))); 125 symbol(feature, symbols.get(5), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2))); 126 symbol(feature, symbols.get(6), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2))); 175 127 break; 176 128 case 8: 177 symbol(feature, symbols.get(0), n ull, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(0, -bbox.height/2)));178 symbol(feature, symbols.get(1), n ull, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, -bbox.height/2)));179 symbol(feature, symbols.get(2), n ull, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));180 symbol(feature, symbols.get(3), n ull, null, new Delta(Handle.CC, new AffineTransform()));181 symbol(feature, symbols.get(4), n ull, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));182 symbol(feature, symbols.get(5), n ull, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));183 symbol(feature, symbols.get(6), n ull, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));184 symbol(feature, symbols.get(7), n ull, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));129 symbol(feature, symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(0, -bbox.height/2))); 130 symbol(feature, symbols.get(1), new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, -bbox.height/2))); 131 symbol(feature, symbols.get(2), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 132 symbol(feature, symbols.get(3), new Delta(Handle.CC, new AffineTransform())); 133 symbol(feature, symbols.get(4), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 134 symbol(feature, symbols.get(5), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2))); 135 symbol(feature, symbols.get(6), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2))); 136 symbol(feature, symbols.get(7), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2))); 185 137 break; 186 138 case 9: 187 symbol(feature, symbols.get(0), n ull, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, -bbox.height/2)));188 symbol(feature, symbols.get(1), n ull, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));189 symbol(feature, symbols.get(2), n ull, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, -bbox.height/2)));190 symbol(feature, symbols.get(3), n ull, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));191 symbol(feature, symbols.get(4), n ull, null, new Delta(Handle.CC, new AffineTransform()));192 symbol(feature, symbols.get(5), n ull, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));193 symbol(feature, symbols.get(6), n ull, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));194 symbol(feature, symbols.get(7), n ull, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));195 symbol(feature, symbols.get(8), n ull, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));139 symbol(feature, symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, -bbox.height/2))); 140 symbol(feature, symbols.get(1), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2))); 141 symbol(feature, symbols.get(2), new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, -bbox.height/2))); 142 symbol(feature, symbols.get(3), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 143 symbol(feature, symbols.get(4), new Delta(Handle.CC, new AffineTransform())); 144 symbol(feature, symbols.get(5), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 145 symbol(feature, symbols.get(6), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2))); 146 symbol(feature, symbols.get(7), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2))); 147 symbol(feature, symbols.get(8), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2))); 196 148 break; 197 149 } -
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r30033 r30036 108 108 109 109 private static void areas(Feature feature) { 110 AttItem name = feature.atts.get(Att.OBJNAM);110 String name = Util.getName(feature); 111 111 switch (feature.type) { 112 112 case DRGARE: … … 116 116 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, null)); 117 117 if ((zoom >= 12) && (name != null)) 118 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE, Color.black, null, null);118 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE, Color.black, null, null); 119 119 break; 120 120 case FAIRWY: … … 131 131 case MARCUL: 132 132 if (zoom >= 14) 133 Renderer.symbol(feature, Areas.MarineFarm , Obj.MARCUL, null, null);133 Renderer.symbol(feature, Areas.MarineFarm); 134 134 if (zoom >= 16) 135 135 Renderer.lineVector(feature, new LineStyle( Color.black, 4, new float[] { 10, 10 }, null)); 136 136 break; 137 137 case OSPARE: 138 if ( (CatPRA)Renderer.getAttVal(feature, feature.type, 0, Att.CATPRA) == CatPRA.PRA_WFRM) {139 Renderer.symbol(feature, Areas.WindFarm , Obj.OSPARE, null, null);138 if (Util.testAttribute(feature, feature.type, Att.CATPRA, CatPRA.PRA_WFRM)) { 139 Renderer.symbol(feature, Areas.WindFarm); 140 140 Renderer.lineVector(feature, new LineStyle(Color.black, 20, new float[] { 40, 40 }, null)); 141 141 if ((zoom >= 15) && (name != null)) 142 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));142 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10))); 143 143 } 144 144 break; … … 146 146 if (zoom >= 12) { 147 147 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Mline); 148 // if ((CatREA)Renderer.getAttVal(feature, feature.type, 0, Att.CATREA) == CatREA.REA_NWAK) 149 // Renderer.symbol(feature, Areas.NoWake, Obj.RESARE, null); 148 if (Util.testAttribute(feature, feature.type, Att.CATPRA, CatREA.REA_NWAK)) { 149 Renderer.symbol(feature, Areas.NoWake); 150 } 150 151 } 151 152 break; 152 153 case SEAARE: 153 switch ((CatSEA) Renderer.getAttVal(feature, feature.type, 0, Att.CATSEA)) {154 switch ((CatSEA) Util.getAttVal(feature, feature.type, 0, Att.CATSEA)) { 154 155 case SEA_RECH: 155 156 break; … … 160 161 case SEA_GAT: 161 162 case SEA_NRRW: 163 break; 164 default: 162 165 break; 163 166 } … … 203 206 case SPLARE: 204 207 if (zoom >= 12) { 205 Renderer.symbol(feature, Areas.Plane , Obj.SPLARE, null, null);208 Renderer.symbol(feature, Areas.Plane); 206 209 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Mline); 207 210 } 208 211 if ((zoom >= 15) && (name != null)) 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)));212 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90))); 210 213 break; 211 214 default: … … 215 218 216 219 private static void beacons(Feature feature) { 217 BcnSHP shape = (BcnSHP) Renderer.getAttVal(feature, feature.type, 0, Att.BCNSHP);220 BcnSHP shape = (BcnSHP) Util.getAttVal(feature, feature.type, 0, Att.BCNSHP); 218 221 if (((shape == BcnSHP.BCN_PRCH) || (shape == BcnSHP.BCN_WTHY)) && (feature.type == Obj.BCNLAT)) { 219 CatLAM cat = (CatLAM) Renderer.getAttVal(feature, feature.type, 0, Att.CATLAM);222 CatLAM cat = (CatLAM) Util.getAttVal(feature, feature.type, 0, Att.CATLAM); 220 223 switch (cat) { 221 224 case LAM_PORT: 222 225 if (shape == BcnSHP.BCN_PRCH) 223 Renderer.symbol(feature, Beacons.PerchPort , null, null, null);226 Renderer.symbol(feature, Beacons.PerchPort); 224 227 else 225 Renderer.symbol(feature, Beacons.WithyPort , null, null, null);228 Renderer.symbol(feature, Beacons.WithyPort); 226 229 break; 227 230 case LAM_STBD: 228 231 if (shape == BcnSHP.BCN_PRCH) 229 Renderer.symbol(feature, Beacons.PerchStarboard , null, null, null);232 Renderer.symbol(feature, Beacons.PerchStarboard); 230 233 else 231 Renderer.symbol(feature, Beacons.WithyStarboard , null, null, null);234 Renderer.symbol(feature, Beacons.WithyStarboard); 232 235 break; 233 236 default: 234 Renderer.symbol(feature, Beacons.Stake, feature.type, null, null);237 Renderer.symbol(feature, Beacons.Stake, Util.getScheme(feature, feature.type)); 235 238 } 236 239 } else { 237 Renderer.symbol(feature, Beacons.Shapes.get(shape), feature.type, null, null);240 Renderer.symbol(feature, Beacons.Shapes.get(shape), Util.getScheme(feature, feature.type)); 238 241 if (feature.objs.get(Obj.TOPMAR) != 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 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Util.getScheme(feature, Obj.TOPMAR), Topmarks.BeaconDelta); 240 243 } 241 244 Signals.addSignals(feature); … … 243 246 244 247 private static void buoys(Feature feature) { 245 BoySHP shape = (BoySHP) Renderer.getAttVal(feature, feature.type, 0, Att.BOYSHP);246 Renderer.symbol(feature, Buoys.Shapes.get(shape), feature.type, null, null);247 if ( feature.objs.get(Obj.TOPMAR) != 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));248 BoySHP shape = (BoySHP) Util.getAttVal(feature, feature.type, 0, Att.BOYSHP); 249 Renderer.symbol(feature, Buoys.Shapes.get(shape), Util.getScheme(feature, feature.type)); 250 if (Util.hasObject(feature, Obj.TOPMAR)) { 251 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)); 249 252 } 250 253 Signals.addSignals(feature); … … 296 299 private static void distances(Feature feature) { 297 300 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);301 if (!Util.testAttribute(feature, Obj.DISMAR, Att.CATDIS, CatDIS.DIS_NONI)) { 302 Renderer.symbol(feature, Harbours.DistanceI); 300 303 } 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))); 304 Renderer.symbol(feature, Harbours.DistanceU); 305 } 306 if ((zoom >=15) && Util.hasAttribute(feature, Obj.DISMAR, Att.WTWDIS)) { 307 AttMap atts = feature.objs.get(Obj.DISMAR).get(0); 308 Double dist = (Double) atts.get(Att.WTWDIS).val; 309 String str = ""; 310 if (atts.containsKey(Att.HUNITS)) { 311 switch ((UniHLU) atts.get(Att.HUNITS).val) { 312 case HLU_METR: 313 str += "m "; 314 break; 315 case HLU_FEET: 316 str += "ft "; 317 break; 318 case HLU_HMTR: 319 str += "hm "; 320 break; 321 case HLU_KMTR: 322 str += "km "; 323 break; 324 case HLU_SMIL: 325 str += "M "; 326 break; 327 case HLU_NMIL: 328 str += "NM "; 329 break; 330 default: 331 break; 332 } 333 } 334 str += String.format("%1.0f", dist); 335 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45))); 331 336 } 332 337 } … … 336 341 switch (feature.type) { 337 342 case LITVES: 338 Renderer.symbol(feature, Buoys.Super, feature.type, null, null);343 Renderer.symbol(feature, Buoys.Super, Util.getScheme(feature, feature.type)); 339 344 break; 340 345 case LITFLT: 341 Renderer.symbol(feature, Buoys.Float, feature.type, null, null);346 Renderer.symbol(feature, Buoys.Float, Util.getScheme(feature, feature.type)); 342 347 break; 343 348 case BOYINB: 344 Renderer.symbol(feature, Buoys.Super, feature.type, null, null); 349 Renderer.symbol(feature, Buoys.Super, Util.getScheme(feature, feature.type)); 350 break; 351 default: 345 352 break; 346 353 } 347 354 if (feature.objs.get(Obj.TOPMAR) != null) 348 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, null, Topmarks.Floats);355 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Util.getScheme(feature, Obj.TOPMAR), Topmarks.FloatDelta); 349 356 Signals.addSignals(feature); 350 357 } … … 359 366 360 367 private static void harbours(Feature feature) { 361 AttItem name = feature.atts.get(Att.OBJNAM);368 String name = Util.getName(feature); 362 369 switch (feature.type) { 363 370 case ACHBRT: 364 371 if (zoom >= 14) { 365 Renderer.symbol(feature, Harbours.Anchorage, n ull, 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));367 } 368 double radius = (Double) Renderer.getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS);372 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Mline)); 373 Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC)); 374 } 375 double radius = (Double)Util.getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS); 369 376 if (radius != 0) { 370 UniHLU units = (UniHLU) Renderer.getAttVal(feature, Obj.ACHBRT, 0, Att.HUNITS);377 UniHLU units = (UniHLU)Util.getAttVal(feature, Obj.ACHBRT, 0, Att.HUNITS); 371 378 Renderer.lineCircle (feature, new LineStyle(Mline, 4, new float[] { 10, 10 }, null), radius, units); 372 379 } … … 375 382 if (zoom >= 12) { 376 383 if (feature.flag != Fflag.AREA) { 377 Renderer.symbol(feature, Harbours.Anchorage, n ull, new Scheme(Color.black), null);384 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Color.black)); 378 385 } else { 379 Renderer.symbol(feature, Harbours.Anchorage, n ull, new Scheme(Mline), null);386 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Mline)); 380 387 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Mline); 381 388 } 382 389 if ((zoom >= 15) && ((name) != null)) { 383 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));384 } 385 ArrayList<StsSTS> sts = (ArrayList<StsSTS>) Renderer.getAttVal(feature, Obj.ACHARE, 0, Att.STATUS);390 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0))); 391 } 392 ArrayList<StsSTS> sts = (ArrayList<StsSTS>)Util.getAttVal(feature, Obj.ACHARE, 0, Att.STATUS); 386 393 if ((zoom >= 15) && (sts != null) && (sts.contains(StsSTS.STS_RESV))) { 387 394 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60))); 388 395 } 389 396 } 390 ArrayList<CatACH> cats = (ArrayList<CatACH>) Renderer.getAttVal(feature, Obj.ACHARE, 0, Att.CATACH);397 ArrayList<CatACH> cats = (ArrayList<CatACH>)Util.getAttVal(feature, Obj.ACHARE, 0, Att.CATACH); 391 398 int dy = (cats.size() - 1) * -30; 392 399 for (CatACH cat : cats) { … … 405 412 break; 406 413 case ACH_EXPL: 407 Renderer.symbol(feature, Harbours.Explosives, n ull, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));414 Renderer.symbol(feature, Harbours.Explosives, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 408 415 dy += 60; 409 416 break; 410 417 case ACH_QUAR: 411 Renderer.symbol(feature, Harbours.Hospital, n ull, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));418 Renderer.symbol(feature, Harbours.Hospital, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 412 419 dy += 60; 413 420 break; 414 421 case ACH_SEAP: 415 Renderer.symbol(feature, Areas.Seaplane, n ull, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));422 Renderer.symbol(feature, Areas.Seaplane, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 416 423 dy += 60; 417 424 break; … … 421 428 case BERTHS: 422 429 if (zoom >= 14) { 423 Renderer.labelText(feature, name == null ? " " : (String) name.val, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Mline, Color.white, null);430 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Mline, Color.white, null); 424 431 } 425 432 break; … … 427 434 if (zoom >= 16) { 428 435 ArrayList<Symbol> symbols = new ArrayList(); 429 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Renderer.getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN);436 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Util.getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN); 430 437 for (FncFNC fnc : fncs) { 431 438 symbols.add(Landmarks.Funcs.get(fnc)); 432 439 } 433 440 if (feature.objs.containsKey(Obj.SMCFAC)) { 434 ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) Renderer.getAttVal(feature, Obj.SMCFAC, 0, Att.CATSCF);441 ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) Util.getAttVal(feature, Obj.SMCFAC, 0, Att.CATSCF); 435 442 for (CatSCF scf : scfs) { 436 443 symbols.add(Facilities.Cats.get(scf)); … … 439 446 Renderer.cluster(feature, symbols); 440 447 } 448 break; 449 default: 441 450 break; 442 451 } … … 457 466 458 467 private static void landmarks(Feature feature) { 459 ArrayList<CatLMK> cats = (ArrayList<CatLMK>) Renderer.getAttVal(feature, feature.type, 0, Att.CATLMK);468 ArrayList<CatLMK> cats = (ArrayList<CatLMK>) Util.getAttVal(feature, feature.type, 0, Att.CATLMK); 460 469 Symbol catSym = Landmarks.Shapes.get(cats.get(0)); 461 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Renderer.getAttVal(feature, feature.type, 0, Att.FUNCTN);470 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Util.getAttVal(feature, feature.type, 0, Att.FUNCTN); 462 471 Symbol fncSym = Landmarks.Funcs.get(fncs.get(0)); 463 472 if ((fncs.get(0) == FncFNC.FNC_CHCH) && (cats.get(0) == CatLMK.LMK_TOWR)) … … 467 476 if (cats.get(0) == CatLMK.LMK_RADR) 468 477 fncSym = Landmarks.RadioTV; 469 Renderer.symbol(feature, catSym , null, null, null);470 Renderer.symbol(feature, fncSym , null, null, null);478 Renderer.symbol(feature, catSym); 479 Renderer.symbol(feature, fncSym); 471 480 /* if (!has_attribute("function") && !has_attribute("category") && has_object("light")) { 472 481 symbol("lighthouse"); … … 488 497 switch (feature.type) { 489 498 case LITMAJ: 490 Renderer.symbol(feature, Beacons.LightMajor , null, null, null);499 Renderer.symbol(feature, Beacons.LightMajor); 491 500 break; 492 501 case LITMIN: 493 502 case LIGHTS: 494 Renderer.symbol(feature, Beacons.LightMinor , null, null, null);503 Renderer.symbol(feature, Beacons.LightMinor); 495 504 break; 496 505 } … … 499 508 500 509 private static void locks(Feature feature) { 501 /*object_rules(locks) {502 if ((zoom>=13) && is_type("lock_basin|lock_basin_part")) symbol("lock");503 if ((zoom>=15) && is_type("gate")) symbol("lock_gate");504 }505 */506 510 } 507 511 private static void marinas(Feature feature) { … … 509 513 510 514 } 511 /* int n = countObjects(item, type);512 Atta_t atta = enumAttribute("category", obja);513 char **map = cluster_map(obja);514 if (map == NULL) return;515 switch (n) {516 case 0: {517 Obj_t *obj = getObj(item, obja, 0);518 int n = countValues(getAtt(obj, atta));519 switch (n) {520 case 1:521 renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", CC, 0, 0, 0);522 break;523 case 2:524 renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", RC, 0, 0, 0);525 renderSymbol(item, obja, map[getAttEnum(obj, atta, 1)], "", "", LC, 0, 0, 0);526 break;527 case 3:528 renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", BC, 0, 0, 0);529 renderSymbol(item, obja, map[getAttEnum(obj, atta, 1)], "", "", TR, 0, 0, 0);530 renderSymbol(item, obja, map[getAttEnum(obj, atta, 2)], "", "", TL, 0, 0, 0);531 break;532 case 4:533 renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", BR, 0, 0, 0);534 renderSymbol(item, obja, map[getAttEnum(obj, atta, 1)], "", "", BL, 0, 0, 0);535 renderSymbol(item, obja, map[getAttEnum(obj, atta, 2)], "", "", TR, 0, 0, 0);536 renderSymbol(item, obja, map[getAttEnum(obj, atta, 3)], "", "", TL, 0, 0, 0);537 break;538 }539 }540 break;541 case 1:542 renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", CC, 0, 0, 0);543 break;544 case 2:545 renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", RC, 0, 0, 0);546 renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 2), atta, 0)], "", "", LC, 0, 0, 0);547 break;548 case 3:549 renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", BC, 0, 0, 0);550 renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 2), atta, 0)], "", "", TR, 0, 0, 0);551 renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 3), atta, 0)], "", "", TL, 0, 0, 0);552 break;553 case 4:554 renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", BR, 0, 0, 0);555 renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 2), atta, 0)], "", "", BL, 0, 0, 0);556 renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 3), atta, 0)], "", "", TR, 0, 0, 0);557 renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 4), atta, 0)], "", "", TL, 0, 0, 0);558 break;559 }560 */561 515 } 562 516 563 517 private static void moorings(Feature feature) { 564 CatMOR cat = (CatMOR) Renderer.getAttVal(feature, feature.type, 0, Att.CATMOR);518 CatMOR cat = (CatMOR) Util.getAttVal(feature, feature.type, 0, Att.CATMOR); 565 519 switch (cat) { 566 520 case MOR_DLPN: 567 Renderer.symbol(feature, Harbours.Dolphin , null, null, null);521 Renderer.symbol(feature, Harbours.Dolphin); 568 522 break; 569 523 case MOR_DDPN: 570 Renderer.symbol(feature, Harbours.DeviationDolphin , null, null, null);524 Renderer.symbol(feature, Harbours.DeviationDolphin); 571 525 break; 572 526 case MOR_BLRD: 573 527 case MOR_POST: 574 Renderer.symbol(feature, Harbours.Bollard , null, null, null);528 Renderer.symbol(feature, Harbours.Bollard); 575 529 break; 576 530 case MOR_BUOY: 577 BoySHP shape = (BoySHP) Renderer.getAttVal(feature, feature.type, 0, Att.BOYSHP);531 BoySHP shape = (BoySHP) Util.getAttVal(feature, feature.type, 0, Att.BOYSHP); 578 532 if (shape == BoySHP.BOY_UNKN) 579 533 shape = BoySHP.BOY_SPHR; 580 Renderer.symbol(feature, Buoys.Shapes.get(shape), feature.type, null, null);534 Renderer.symbol(feature, Buoys.Shapes.get(shape), Util.getScheme(feature, feature.type)); 581 535 break; 582 536 } … … 802 756 private static void obstructions(Feature feature) { 803 757 if ((zoom >= 14) && (feature.type == Obj.UWTROC)) { 804 WatLEV lvl = (WatLEV) Renderer.getAttVal(feature, feature.type, 0, Att.WATLEV);758 WatLEV lvl = (WatLEV) Util.getAttVal(feature, feature.type, 0, Att.WATLEV); 805 759 switch (lvl) { 806 760 case LEV_CVRS: 807 Renderer.symbol(feature, Areas.RockC , null, null, null);761 Renderer.symbol(feature, Areas.RockC); 808 762 break; 809 763 case LEV_AWSH: 810 Renderer.symbol(feature, Areas.RockA , null, null, null);764 Renderer.symbol(feature, Areas.RockA); 811 765 break; 812 766 default: 813 Renderer.symbol(feature, Areas.Rock , null, null, null);767 Renderer.symbol(feature, Areas.Rock); 814 768 } 815 769 } else { 816 Renderer.symbol(feature, Areas.Rock , null, null, null);770 Renderer.symbol(feature, Areas.Rock); 817 771 } 818 772 } … … 827 781 } 828 782 private static void platforms(Feature feature) { 829 ArrayList<CatOFP> cats = (ArrayList<CatOFP>) Renderer.getAttVal(feature, Obj.OFSPLF, 0, Att.CATOFP);783 ArrayList<CatOFP> cats = (ArrayList<CatOFP>)Util.getAttVal(feature, Obj.OFSPLF, 0, Att.CATOFP); 830 784 if ((CatOFP) cats.get(0) == CatOFP.OFP_FPSO) 831 Renderer.symbol(feature, Buoys.Storage , null, null, null);785 Renderer.symbol(feature, Buoys.Storage); 832 786 else 833 Renderer.symbol(feature, Landmarks.Platform , null, null, null);834 AttItem name = feature.atts.get(Att.OBJNAM);787 Renderer.symbol(feature, Landmarks.Platform); 788 String name = Util.getName(feature); 835 789 if ((zoom >= 15) && (name != null)) 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)));790 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50))); 837 791 /*object_rules(platforms) { 838 792 if (has_object("fog_signal")) object(fogs); … … 845 799 if (zoom >= 14) { 846 800 if (feature.type == Obj.CRANES) { 847 if ((CatCRN) Renderer.getAttVal(feature, feature.type, 0, Att.CATCRN) == CatCRN.CRN_CONT)848 Renderer.symbol(feature, Harbours.ContainerCrane , null, null, null);801 if ((CatCRN) Util.getAttVal(feature, feature.type, 0, Att.CATCRN) == CatCRN.CRN_CONT) 802 Renderer.symbol(feature, Harbours.ContainerCrane); 849 803 else 850 Renderer.symbol(feature, Harbours.PortCrane , null, null, null);804 Renderer.symbol(feature, Harbours.PortCrane); 851 805 } else if (feature.type == Obj.HULKES) { 852 806 Renderer.lineVector(feature, new LineStyle(Color.black, 4, null, new Color(0xffe000))); 853 AttItem name = feature.atts.get(Att.OBJNAM);807 String name = Util.getName(feature); 854 808 if ((zoom >= 15) && (name != null)) 855 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, null);809 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, null); 856 810 } 857 811 } … … 866 820 else 867 821 Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, null, null)); 868 AttItem name = feature.atts.get(Att.OBJNAM);822 String name = Util.getName(feature); 869 823 if ((zoom >= 10) && (name != null)) 870 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080, true), null, null);824 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080, true), null, null); 871 825 break; 872 826 case TSELNE: … … 886 840 private static void shoreline(Feature feature) { 887 841 if (zoom >= 12) { 888 switch ((CatSLC) Renderer.getAttVal(feature, feature.type, 0, Att.CATSLC)) {842 switch ((CatSLC) Util.getAttVal(feature, feature.type, 0, Att.CATSLC)) { 889 843 case SLC_TWAL: 890 WatLEV lev = (WatLEV) Renderer.getAttVal(feature, feature.type, 0, Att.WATLEV);844 WatLEV lev = (WatLEV) Util.getAttVal(feature, feature.type, 0, Att.WATLEV); 891 845 if (lev == WatLEV.LEV_CVRS) { 892 846 Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null)); … … 907 861 case SISTAT: 908 862 case SISTAW: 909 Renderer.symbol(feature, Harbours.SignalStation , null, null, null);863 Renderer.symbol(feature, Harbours.SignalStation); 910 864 String str = "SS"; 911 865 // Append (cat) to str … … 913 867 break; 914 868 case RDOSTA: 915 Renderer.symbol(feature, Harbours.SignalStation , null, null, null);916 Renderer.symbol(feature, Beacons.RadarStation , null, null, null);869 Renderer.symbol(feature, Harbours.SignalStation); 870 Renderer.symbol(feature, Beacons.RadarStation); 917 871 break; 918 872 case RADSTA: 919 Renderer.symbol(feature, Harbours.SignalStation , null, null, null);920 Renderer.symbol(feature, Beacons.RadarStation , null, null, null);873 Renderer.symbol(feature, Harbours.SignalStation); 874 Renderer.symbol(feature, Beacons.RadarStation); 921 875 break; 922 876 case PILBOP: 923 Renderer.symbol(feature, Harbours.Pilot , null, null, null);877 Renderer.symbol(feature, Harbours.Pilot); 924 878 break; 925 879 case CGUSTA: 926 Renderer.symbol(feature, Harbours.SignalStation , null, null, null);880 Renderer.symbol(feature, Harbours.SignalStation); 927 881 Renderer.labelText(feature, "CG", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0))); 928 882 break; 929 883 case RSCSTA: 930 Renderer.symbol(feature, Harbours.Rescue , null, null, null);884 Renderer.symbol(feature, Harbours.Rescue); 931 885 break; 932 886 } … … 942 896 if (zoom >= 15) { 943 897 String str = ""; 944 AttItem name = feature.atts.get(Att.OBJNAM);945 if (name != null) str += (String)name.val+ " ";946 Double ort = (Double) Renderer.getAttVal(feature, feature.type, 0, Att.ORIENT);898 String name = Util.getName(feature); 899 if (name != null) str += name + " "; 900 Double ort = (Double) Util.getAttVal(feature, feature.type, 0, Att.ORIENT); 947 901 if (ort != null) str += ort.toString() + "\u0152"; 948 902 if (!str.isEmpty()) Renderer.lineText(feature, str, new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20); … … 950 904 } 951 905 private static void waterways(Feature feature) { 906 952 907 } 953 908 954 909 private static void wrecks(Feature feature) { 955 910 if (zoom >= 14) { 956 CatWRK cat = (CatWRK) Renderer.getAttVal(feature, feature.type, 0, Att.CATWRK);911 CatWRK cat = (CatWRK) Util.getAttVal(feature, feature.type, 0, Att.CATWRK); 957 912 switch (cat) { 958 913 case WRK_DNGR: 959 914 case WRK_MSTS: 960 Renderer.symbol(feature, Areas.WreckD , null, null, null);915 Renderer.symbol(feature, Areas.WreckD); 961 916 break; 962 917 case WRK_HULS: 963 Renderer.symbol(feature, Areas.WreckS , null, null, null);918 Renderer.symbol(feature, Areas.WreckS); 964 919 break; 965 920 default: 966 Renderer.symbol(feature, Areas.WreckND , null, null, null);921 Renderer.symbol(feature, Areas.WreckND); 967 922 } 968 923 } -
applications/editors/josm/plugins/smed2/src/seamap/Signals.java
r30033 r30036 40 40 41 41 public static void radarStations(Feature feature) { 42 Renderer.symbol(feature, Beacons.RadarStation , null, null, null);43 ArrayList<CatROS> cats = (ArrayList<CatROS>) Renderer.getAttVal(feature, Obj.RDOSTA, 0, Att.CATROS);42 Renderer.symbol(feature, Beacons.RadarStation); 43 ArrayList<CatROS> cats = (ArrayList<CatROS>)Util.getAttVal(feature, Obj.RDOSTA, 0, Att.CATROS); 44 44 String str = ""; 45 45 for (CatROS ros : cats) { … … 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, n ull, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));103 Renderer.symbol(feature, Topmarks.TopNorth, 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, n ull, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));107 Renderer.symbol(feature, Topmarks.TopSouth, 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, n ull, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));111 Renderer.symbol(feature, Topmarks.TopEast, 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, n ull, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));115 Renderer.symbol(feature, Topmarks.TopWest, 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, n ull, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));119 Renderer.symbol(feature, Topmarks.TopCan, 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, n ull, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));123 Renderer.symbol(feature, Topmarks.TopCone, 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, n ull, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));127 Renderer.symbol(feature, Topmarks.TopIsol, 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, n ull, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));131 Renderer.symbol(feature, Topmarks.TopSphere, 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, n ull, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));135 Renderer.symbol(feature, Topmarks.TopX, 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, n ull, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));139 Renderer.symbol(feature, Topmarks.TopCross, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 140 140 break; 141 141 default: -
applications/editors/josm/plugins/smed2/src/symbols/Topmarks.java
r30029 r30036 228 228 Shapes.put(TopSHP.TOP_SALT, TopX); 229 229 } 230 public static final EnumMap<BoySHP, Delta> Buoy s = new EnumMap<BoySHP, Delta>(BoySHP.class);231 static { 232 Buoy s.put(BoySHP.BOY_PILR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 31.5, -95.0)));233 Buoy s.put(BoySHP.BOY_SPAR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 31.5, -95.0)));234 Buoy s.put(BoySHP.BOY_CAN, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));235 Buoy s.put(BoySHP.BOY_CONE, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));236 Buoy s.put(BoySHP.BOY_SPHR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));237 Buoy s.put(BoySHP.BOY_BARL, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));238 Buoy s.put(BoySHP.BOY_SUPR, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -42.0)));239 Buoy s.put(BoySHP.BOY_ICE, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -25.0)));240 } 241 public static final Delta Float s= new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -42.0));242 public static final Delta Beacon s= new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -70.0));230 public static final EnumMap<BoySHP, Delta> BuoyDeltas = new EnumMap<BoySHP, Delta>(BoySHP.class); 231 static { 232 BuoyDeltas.put(BoySHP.BOY_PILR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 31.5, -95.0))); 233 BuoyDeltas.put(BoySHP.BOY_SPAR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 31.5, -95.0))); 234 BuoyDeltas.put(BoySHP.BOY_CAN, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9))); 235 BuoyDeltas.put(BoySHP.BOY_CONE, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9))); 236 BuoyDeltas.put(BoySHP.BOY_SPHR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9))); 237 BuoyDeltas.put(BoySHP.BOY_BARL, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9))); 238 BuoyDeltas.put(BoySHP.BOY_SUPR, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -42.0))); 239 BuoyDeltas.put(BoySHP.BOY_ICE, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -25.0))); 240 } 241 public static final Delta FloatDelta = new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -42.0)); 242 public static final Delta BeaconDelta = new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -70.0)); 243 243 244 244 }
Note:
See TracChangeset
for help on using the changeset viewer.