Changeset 30033 in osm
- Timestamp:
- 2013-10-28T12:52:49+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/panels/PanelMain.java
r30022 r30033 19 19 20 20 import org.openstreetmap.josm.Main; 21 import org.openstreetmap.josm.actions.search.SearchCompiler.Parent;22 21 23 22 import s57.S57att.Att; … … 28 27 29 28 public class PanelMain extends JPanel { 30 private static final long serialVersionUID = 1L; 31 29 32 30 Smed2Action dlg; 33 31 BufferedImage img; -
applications/editors/josm/plugins/smed2/src/panels/ShowFrame.java
r30025 r30033 23 23 24 24 class Picture extends JPanel implements MapContext { 25 25 26 26 public void drawPicture(OsmPrimitive osm, SeaMap map) { 27 27 long id; -
applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
r30029 r30033 103 103 } 104 104 105 public static void symbol(Feature feature, Symbol symbol, Obj obj, Delta delta, Scheme scheme) {105 public static void symbol(Feature feature, Symbol symbol, Obj obj, Scheme scheme, Delta delta) { 106 106 Point2D point = context.getPoint(feature.centre); 107 107 if (obj == null) { 108 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), delta, scheme);108 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, delta); 109 109 } else { 110 110 ArrayList<Color> colours = new ArrayList<Color>(); … … 116 116 patterns.add(pattMap.get(pat)); 117 117 } 118 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), delta, new Scheme(patterns, colours)); 119 } 120 } 121 122 private static Rectangle symbolSize(Symbol symbol) { 118 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), new Scheme(patterns, colours), delta); 119 } 120 } 121 122 public static void cluster(Feature feature, ArrayList<Symbol> symbols) { 123 Rectangle2D.Double bbox = null; 124 if (symbols.size() > 4) { 125 for (Instr instr : symbols.get(0)) { 126 if (instr.type == Prim.BBOX) { 127 bbox = (Rectangle2D.Double) instr.params; 128 break; 129 } 130 } 131 if (bbox == null) return; 132 } 133 switch (symbols.size()) { 134 case 1: 135 symbol(feature, symbols.get(0), null, null, new Delta(Handle.CC, new AffineTransform())); 136 break; 137 case 2: 138 symbol(feature, symbols.get(0), null, null, new Delta(Handle.RC, new AffineTransform())); 139 symbol(feature, symbols.get(1), null, null, new Delta(Handle.LC, new AffineTransform())); 140 break; 141 case 3: 142 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BC, new AffineTransform())); 143 symbol(feature, symbols.get(1), null, null, new Delta(Handle.TR, new AffineTransform())); 144 symbol(feature, symbols.get(2), null, null, new Delta(Handle.TL, new AffineTransform())); 145 break; 146 case 4: 147 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, new AffineTransform())); 148 symbol(feature, symbols.get(1), null, null, new Delta(Handle.BL, new AffineTransform())); 149 symbol(feature, symbols.get(2), null, null, new Delta(Handle.TR, new AffineTransform())); 150 symbol(feature, symbols.get(3), null, null, new Delta(Handle.TL, new AffineTransform())); 151 break; 152 case 5: 153 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, new AffineTransform())); 154 symbol(feature, symbols.get(1), null, null, new Delta(Handle.BL, new AffineTransform())); 155 symbol(feature, symbols.get(2), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 156 symbol(feature, symbols.get(3), null, null, new Delta(Handle.TC, new AffineTransform())); 157 symbol(feature, symbols.get(4), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 158 break; 159 case 6: 160 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 161 symbol(feature, symbols.get(1), null, null, new Delta(Handle.BC, new AffineTransform())); 162 symbol(feature, symbols.get(2), null, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 163 symbol(feature, symbols.get(3), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 164 symbol(feature, symbols.get(4), null, null, new Delta(Handle.TC, new AffineTransform())); 165 symbol(feature, symbols.get(5), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 166 break; 167 case 7: 168 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2))); 169 symbol(feature, symbols.get(1), null, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 170 symbol(feature, symbols.get(2), null, null, new Delta(Handle.CC, new AffineTransform())); 171 symbol(feature, symbols.get(3), null, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 172 symbol(feature, symbols.get(4), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2))); 173 symbol(feature, symbols.get(5), null, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2))); 174 symbol(feature, symbols.get(6), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2))); 175 break; 176 case 8: 177 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(0, -bbox.height/2))); 178 symbol(feature, symbols.get(1), null, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, -bbox.height/2))); 179 symbol(feature, symbols.get(2), null, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 180 symbol(feature, symbols.get(3), null, null, new Delta(Handle.CC, new AffineTransform())); 181 symbol(feature, symbols.get(4), null, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 182 symbol(feature, symbols.get(5), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2))); 183 symbol(feature, symbols.get(6), null, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2))); 184 symbol(feature, symbols.get(7), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2))); 185 break; 186 case 9: 187 symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, -bbox.height/2))); 188 symbol(feature, symbols.get(1), null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2))); 189 symbol(feature, symbols.get(2), null, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, -bbox.height/2))); 190 symbol(feature, symbols.get(3), null, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0))); 191 symbol(feature, symbols.get(4), null, null, new Delta(Handle.CC, new AffineTransform())); 192 symbol(feature, symbols.get(5), null, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0))); 193 symbol(feature, symbols.get(6), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2))); 194 symbol(feature, symbols.get(7), null, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2))); 195 symbol(feature, symbols.get(8), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2))); 196 break; 197 } 198 } 199 200 private static Rectangle2D.Double symbolSize(Symbol symbol) { 123 201 Symbol ssymb = symbol; 124 202 while (ssymb != null) { 125 203 for (Instr item : symbol) { 126 204 if (item.type == Prim.BBOX) { 127 return (Rectangle ) item.params;205 return (Rectangle2D.Double) item.params; 128 206 } 129 207 if (item.type == Prim.SYMB) { … … 138 216 } 139 217 140 public static void lineSymbols(Feature feature, Symbol prisymb, double space, Symbol secsymb, int ratio, Color col) {218 public static void lineSymbols(Feature feature, Symbol prisymb, double space, Symbol secsymb, Symbol tersymb, int ratio, Color col) { 141 219 Area area; 142 220 switch (feature.flag) { … … 152 230 return; 153 231 } 154 Rectangle prect = symbolSize(prisymb); 155 Rectangle srect = symbolSize(secsymb); 232 Rectangle2D.Double prect = symbolSize(prisymb); 233 Rectangle2D.Double srect = symbolSize(secsymb); 234 Rectangle2D.Double trect = symbolSize(tersymb); 156 235 if (srect == null) 157 236 ratio = 0; … … 159 238 double psize = Math.abs(prect.getY()) * sScale; 160 239 double ssize = (srect != null) ? Math.abs(srect.getY()) * sScale : 0; 240 double tsize = (trect != null) ? Math.abs(srect.getY()) * sScale : 0; 161 241 Point2D prev = new Point2D.Double(); 162 242 Point2D next = new Point2D.Double(); … … 167 247 double len = 0; 168 248 double angle = 0; 169 int scount = ratio; 249 int stcount = ratio; 250 boolean stflag = false; 170 251 Symbol symbol = prisymb; 171 252 for (Bound bound : area) { … … 180 261 curr = succ = next; 181 262 gap = (space > 0); 182 s count = ratio;263 stcount = ratio - 1; 183 264 symbol = prisymb; 184 265 len = gap ? psize * space * 0.5 : psize; … … 202 283 } 203 284 if (!gap) { 204 Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(), 205 new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())) + Math.toRadians(90))), 206 new Scheme(col)); 285 Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(), new Scheme(col), 286 new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())) + Math.toRadians(90)))); 207 287 } 208 288 if (space > 0) 209 289 gap = !gap; 210 290 curr = succ; 211 len = gap ? (psize * space) : (--scount == 0) ? ssize : psize; 212 if (scount == 0) { 213 symbol = secsymb; 214 scount = ratio; 291 len = gap ? (psize * space) : (--stcount == 0) ? (stflag ? tsize : ssize) : psize; 292 if (stcount == 0) { 293 symbol = stflag ? tersymb : secsymb; 294 if (trect != null) stflag = !stflag; 295 stcount = ratio; 215 296 } else { 216 297 symbol = prisymb; … … 330 411 331 412 public static void labelText(Feature feature, String str, Font font, LabelStyle style, Color fg, Color bg, Delta delta) { 332 if (delta == null) delta = new Delta(Handle.CC , AffineTransform.getTranslateInstance(0, 0));413 if (delta == null) delta = new Delta(Handle.CC); 333 414 if (bg == null) bg = new Color(0x00000000, true); 334 415 if ((str == null) || (str.isEmpty())) str = " "; … … 339 420 double height = bounds.getHeight(); 340 421 Symbol label = new Symbol(); 341 double lx = 0; 342 double ly = 0; 343 double tx = 0; 344 double ty = 0; 422 double lx, ly, tx, ty; 345 423 switch (style) { 346 424 case RRCT: … … 378 456 label.add(new Instr(Prim.PLIN, p)); 379 457 break; 458 default: 459 lx = -width / 2; 460 ly = -height / 2; 461 tx = lx; 462 ty = ly; 463 label.add(new Instr(Prim.BBOX, new Rectangle2D.Double(lx,ly,width,height))); 464 break; 380 465 } 381 466 label.add(new Instr(Prim.TEXT, new Caption(str, font, fg, new Delta(Handle.TL, AffineTransform.getTranslateInstance(tx, ty))))); 382 467 Point2D point = context.getPoint(feature.centre); 383 Symbols.drawSymbol(g2, label, sScale, point.getX(), point.getY(), delta, null);468 Symbols.drawSymbol(g2, label, sScale, point.getX(), point.getY(), null, delta); 384 469 } 385 470 -
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r30029 r30033 18 18 import s57.S57att.*; 19 19 import s57.S57obj.*; 20 21 import seamap.SeaMap.AttItem;22 import seamap.SeaMap.AttMap;23 import seamap.SeaMap.ObjTab;24 20 import seamap.Renderer.*; 25 21 import seamap.SeaMap.*; … … 33 29 34 30 public static final Color Yland = new Color(0x50b0ff); 35 public static final Color Mline = new Color(0x c480ff);31 public static final Color Mline = new Color(0x80c480); 36 32 public static final Color Msymb = new Color(0xa30075); 37 33 … … 149 145 case RESARE: 150 146 if (zoom >= 12) { 151 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0, new Color(0x80c480));147 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Mline); 152 148 // if ((CatREA)Renderer.getAttVal(feature, feature.type, 0, Att.CATREA) == CatREA.REA_NWAK) 153 149 // Renderer.symbol(feature, Areas.NoWake, Obj.RESARE, null); … … 208 204 if (zoom >= 12) { 209 205 Renderer.symbol(feature, Areas.Plane, Obj.SPLARE, null, null); 210 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, 10, new Color(0x80c480));206 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Mline); 211 207 } 212 208 if ((zoom >= 15) && (name != null)) 213 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))); 210 break; 211 default: 214 212 break; 215 213 } … … 239 237 Renderer.symbol(feature, Beacons.Shapes.get(shape), feature.type, null, null); 240 238 if (feature.objs.get(Obj.TOPMAR) != null) 241 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Beacons, 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 240 } 243 241 Signals.addSignals(feature); … … 248 246 Renderer.symbol(feature, Buoys.Shapes.get(shape), feature.type, null, null); 249 247 if (feature.objs.get(Obj.TOPMAR) != null) { 250 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Buoys.get(shape), 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)); 251 249 } 252 250 Signals.addSignals(feature); … … 258 256 AttMap atts = feature.objs.get(Obj.BRIDGE).get(0); 259 257 String str = ""; 260 if (atts.containsKey(Att.VERCLR)) { 261 verclr = (Double)atts.get(Att.VERCLR).val; 262 } else { 263 verclr = atts.containsKey(Att.VERCSA) ? (Double)atts.get(Att.VERCSA).val : 0; 264 } 265 verccl = atts.containsKey(Att.VERCCL) ? (Double)atts.get(Att.VERCCL).val : 0; 266 vercop = atts.containsKey(Att.VERCOP) ? (Double)atts.get(Att.VERCOP).val : 0; 267 if (verclr > 0) { 268 str += String.valueOf(verclr); 269 } else if (verccl > 0) { 270 if (vercop == 0) { 271 str += String.valueOf(verccl) + "/-"; 258 if (atts != null) { 259 if (atts.containsKey(Att.VERCLR)) { 260 verclr = (Double) atts.get(Att.VERCLR).val; 272 261 } else { 273 str += String.valueOf(verccl) + "/" + String.valueOf(vercop);262 verclr = atts.containsKey(Att.VERCSA) ? (Double) atts.get(Att.VERCSA).val : 0; 274 263 } 275 } 276 if (!str.isEmpty()) 277 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 0))); 264 verccl = atts.containsKey(Att.VERCCL) ? (Double) atts.get(Att.VERCCL).val : 0; 265 vercop = atts.containsKey(Att.VERCOP) ? (Double) atts.get(Att.VERCOP).val : 0; 266 if (verclr > 0) { 267 str += String.valueOf(verclr); 268 } else if (verccl > 0) { 269 if (vercop == 0) { 270 str += String.valueOf(verccl) + "/-"; 271 } else { 272 str += String.valueOf(verccl) + "/" + String.valueOf(vercop); 273 } 274 } 275 if (!str.isEmpty()) 276 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC)); 277 } 278 278 } 279 279 } … … 282 282 if ((zoom >= 16) && (feature.length < 2)) { 283 283 if (feature.type == Obj.CBLSUB) { 284 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, 0, new Color(0x80c480));284 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Mline); 285 285 } else if (feature.type == Obj.CBLOHD) { 286 286 AttMap atts = feature.objs.get(Obj.CBLOHD).get(0); 287 if ((atts != null) && (atts.containsKey(Att.CATCBL)) && (atts.get(Att.CATCBL).val == CatCBL.CBL_POWR)) { 288 Renderer.lineSymbols(feature, Areas.CableDash, 0, Areas.CableDot, Areas.CableFlash, 2, Color.black); 289 } else { 290 Renderer.lineSymbols(feature, Areas.CableDash, 0, Areas.CableDot, null, 2, Color.black); 291 } 287 292 } 288 293 } … … 290 295 291 296 private static void distances(Feature feature) { 292 /*object_rules(distances) { 293 if ((zoom>=16) && (has_attribute("category"))) { 294 attribute_switch("category") 295 attribute_case("installed") symbol("distance_i"); 296 attribute_default symbol("distance_u"); 297 end_switch 298 } 299 } 300 */ 297 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); 300 } 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))); 331 } 332 } 301 333 } 302 334 … … 314 346 } 315 347 if (feature.objs.get(Obj.TOPMAR) != null) 316 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Floats, null);348 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, null, Topmarks.Floats); 317 349 Signals.addSignals(feature); 318 350 } … … 331 363 case ACHBRT: 332 364 if (zoom >= 14) { 333 Renderer.symbol(feature, Harbours.Anchorage, null, n ull, 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)));365 Renderer.symbol(feature, Harbours.Anchorage, null, 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)); 335 367 } 336 368 double radius = (Double)Renderer.getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS); … … 343 375 if (zoom >= 12) { 344 376 if (feature.flag != Fflag.AREA) { 345 Renderer.symbol(feature, Harbours.Anchorage, null, n ull, new Scheme(Color.black));377 Renderer.symbol(feature, Harbours.Anchorage, null, new Scheme(Color.black), null); 346 378 } else { 347 Renderer.symbol(feature, Harbours.Anchorage, null, n ull, new Scheme(Mline));348 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, 10, Mline);379 Renderer.symbol(feature, Harbours.Anchorage, null, new Scheme(Mline), null); 380 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Mline); 349 381 } 350 382 if ((zoom >= 15) && ((name) != null)) { … … 373 405 break; 374 406 case ACH_EXPL: 375 Renderer.symbol(feature, Harbours.Explosives, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(Mline));407 Renderer.symbol(feature, Harbours.Explosives, null, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 376 408 dy += 60; 377 409 break; 378 410 case ACH_QUAR: 379 Renderer.symbol(feature, Harbours.Hospital, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(Mline));411 Renderer.symbol(feature, Harbours.Hospital, null, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 380 412 dy += 60; 381 413 break; 382 414 case ACH_SEAP: 383 Renderer.symbol(feature, Areas.Seaplane, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(Mline));415 Renderer.symbol(feature, Areas.Seaplane, null, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 384 416 dy += 60; 385 417 break; … … 394 426 case BUISGL: 395 427 if (zoom >= 16) { 428 ArrayList<Symbol> symbols = new ArrayList(); 396 429 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Renderer.getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN); 397 Renderer.symbol(feature, Landmarks.Funcs.get(fncs.get(0)), null, null, null); 430 for (FncFNC fnc : fncs) { 431 symbols.add(Landmarks.Funcs.get(fnc)); 432 } 433 if (feature.objs.containsKey(Obj.SMCFAC)) { 434 ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) Renderer.getAttVal(feature, Obj.SMCFAC, 0, Att.CATSCF); 435 for (CatSCF scf : scfs) { 436 symbols.add(Facilities.Cats.get(scf)); 437 } 438 } 439 Renderer.cluster(feature, symbols); 398 440 } 399 441 break; … … 401 443 } 402 444 /* 403 if ((zoom >= 16) && is_type("anchor_berth")) symbol("anchor_berth");404 445 if ((zoom >= 12) && is_type("harbour")) { 405 446 if (has_attribute("category")) { … … 779 820 if (zoom >= 14) { 780 821 if (feature.type == Obj.PIPSOL) { 781 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, 0, new Color(0x80c480));822 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Mline); 782 823 } else if (feature.type == Obj.PIPOHD) { 783 824 … … 793 834 AttItem name = feature.atts.get(Att.OBJNAM); 794 835 if ((zoom >= 15) && (name != null)) 795 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(60, -50)));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))); 796 837 /*object_rules(platforms) { 797 838 if (has_object("fog_signal")) object(fogs); … … 827 868 AttItem name = feature.atts.get(Att.OBJNAM); 828 869 if ((zoom >= 10) && (name != null)) 829 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080 ), null, null);870 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080, true), null, null); 830 871 break; 831 872 case TSELNE: … … 833 874 break; 834 875 case TSSLPT: 835 Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, 0, new Color(0x80c48080, true));876 Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, null, 0, new Color(0x80c48080, true)); 836 877 break; 837 878 case TSSBND: … … 839 880 break; 840 881 case ISTZNE: 841 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0, new Color(0x80c48080, true));882 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, new Color(0x80c48080, true)); 842 883 break; 843 884 } … … 867 908 case SISTAW: 868 909 Renderer.symbol(feature, Harbours.SignalStation, null, null, null); 910 String str = "SS"; 911 // Append (cat) to str 912 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0))); 869 913 break; 870 914 case RDOSTA: … … 881 925 case CGUSTA: 882 926 Renderer.symbol(feature, Harbours.SignalStation, null, null, null); 927 Renderer.labelText(feature, "CG", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0))); 883 928 break; 884 929 case RSCSTA: -
applications/editors/josm/plugins/smed2/src/seamap/Signals.java
r30026 r30033 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, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);103 Renderer.symbol(feature, Topmarks.TopNorth, null, null, 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, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);107 Renderer.symbol(feature, Topmarks.TopSouth, null, null, 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, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);111 Renderer.symbol(feature, Topmarks.TopEast, null, null, 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, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);115 Renderer.symbol(feature, Topmarks.TopWest, null, null, 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, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);119 Renderer.symbol(feature, Topmarks.TopCan, null, null, 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, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);123 Renderer.symbol(feature, Topmarks.TopCone, null, null, 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, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);127 Renderer.symbol(feature, Topmarks.TopIsol, null, null, 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, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);131 Renderer.symbol(feature, Topmarks.TopSphere, null, null, 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, null, n ew Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);135 Renderer.symbol(feature, Topmarks.TopX, null, null, 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, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null); 139 Renderer.symbol(feature, Topmarks.TopCross, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25))); 140 break; 141 default: 140 142 break; 141 143 } -
applications/editors/josm/plugins/smed2/src/smed2/MapImage.java
r30025 r30033 10 10 package smed2; 11 11 12 import java.awt.BasicStroke;13 12 import java.awt.Color; 14 13 import java.awt.Font; -
applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
r30025 r30033 30 30 31 31 import s57.S57dat; 32 import seamap.Renderer;33 32 import seamap.SeaMap; 34 33 import seamap.SeaMap.*; … … 38 37 39 38 public class Smed2Action extends JosmAction implements EditLayerChangeListener, SelectionChangedListener { 40 private static final long serialVersionUID = 1L;41 42 39 private static String editor = tr("SeaMap Editor"); 43 40 public static JFrame editFrame = null; -
applications/editors/josm/plugins/smed2/src/symbols/Areas.java
r30029 r30033 32 32 Cable.add(new Instr(Prim.PLIN, p)); 33 33 } 34 public static final Symbol CableDot = new Symbol(); 35 static { 36 CableDot.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-60,60,60))); 37 CableDot.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-10,-40,20,20))); 38 } 39 public static final Symbol CableDash = new Symbol(); 40 static { 41 CableDash.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-60,60,60))); 42 CableDash.add(new Instr(Prim.STRK, new BasicStroke(8, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND))); 43 CableDash.add(new Instr(Prim.LINE, new Line2D.Double(0,-15,0,-45))); 44 } 45 public static final Symbol CableFlash = new Symbol(); 46 static { 47 CableFlash.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-60,60,60))); 48 Path2D.Double p = new Path2D.Double(); p.moveTo(-30,-25); p.lineTo(-10,-40); p.lineTo(10,-26); p.lineTo(30,-35); p.lineTo(10,-20); p.lineTo(-10,-34); p.closePath(); 49 CableFlash.add(new Instr(Prim.PGON, p)); 50 } 34 51 public static final Symbol LaneArrow = new Symbol(); 35 52 static { … … 44 61 static { 45 62 LineAnchor.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-60,60,90))); 46 LineAnchor.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.5, 0, 0, n ew Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(-90.0))), null)));63 LineAnchor.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.5, 0, 0, null, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(-90.0)))))); 47 64 } 48 65 public static final Symbol LinePlane = new Symbol(); 49 66 static { 50 67 LinePlane.add(new Instr(Prim.FILL, new Color(0xc480ff))); 51 LinePlane.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Areas.Plane, 0.5, 0, 0, n ew Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(-90.0))), null)));68 LinePlane.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Areas.Plane, 0.5, 0, 0, null, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(-90.0)))))); 52 69 } 53 70 public static final Symbol MarineFarm = new Symbol(); -
applications/editors/josm/plugins/smed2/src/symbols/Beacons.java
r29198 r30033 12 12 import java.awt.BasicStroke; 13 13 import java.awt.Color; 14 import java.awt.geom.Arc2D; 15 import java.awt.geom.Ellipse2D; 16 import java.awt.geom.GeneralPath; 17 import java.awt.geom.Line2D; 18 import java.awt.geom.Path2D; 14 import java.awt.geom.*; 19 15 import java.util.EnumMap; 20 16 -
applications/editors/josm/plugins/smed2/src/symbols/Facilities.java
r29198 r30033 13 13 import java.awt.Color; 14 14 import java.awt.geom.*; 15 15 import java.util.EnumMap; 16 17 import s57.S57val.CatLMK; 18 import s57.S57val.CatSCF; 16 19 import symbols.Symbols.*; 17 20 … … 28 31 public static final Symbol Boatlift = new Symbol();//was Crane 29 32 static { 33 Boatlift.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60))); 30 34 Boatlift.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null))); 31 35 Boatlift.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND))); … … 36 40 public static final Symbol Boatyard = new Symbol(); 37 41 static { 42 Boatyard.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60))); 38 43 Boatyard.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null))); 39 44 Boatyard.add(new Instr(Prim.STRK, new BasicStroke(8, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER))); … … 45 50 public static final Symbol Chandler = new Symbol(); 46 51 static { 52 Chandler.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60))); 47 53 Chandler.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null))); 48 54 Chandler.add(new Instr(Prim.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND))); … … 55 61 public static final Symbol Fuel = new Symbol(); 56 62 static { 63 Fuel.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60))); 57 64 Fuel.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null))); 58 65 Fuel.add(new Instr(Prim.STRK, new BasicStroke(2.5f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND))); … … 69 76 public static final Symbol Laundrette = new Symbol(); 70 77 static { 78 Laundrette.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60))); 71 79 Laundrette.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null))); 72 80 Laundrette.add(new Instr(Prim.STRK, new BasicStroke(1.5f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND))); … … 80 88 public static final Symbol PumpOut = new Symbol(); 81 89 static { 90 PumpOut.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60))); 82 91 PumpOut.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null))); 83 92 PumpOut.add(new Instr(Prim.STRK, new BasicStroke(2.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER))); … … 96 105 public static final Symbol SailingClub = new Symbol(); 97 106 static { 107 SailingClub.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60))); 98 108 SailingClub.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null))); 99 109 SailingClub.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND))); … … 105 115 public static final Symbol Shower = new Symbol(); 106 116 static { 117 Shower.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60))); 107 118 Shower.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null))); 108 119 Shower.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND))); … … 119 130 public static final Symbol Slipway = new Symbol(); 120 131 static { 132 Slipway.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60))); 121 133 Slipway.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null))); 122 134 Slipway.add(new Instr(Prim.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND))); … … 136 148 public static final Symbol Toilet = new Symbol(); 137 149 static { 150 Toilet.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60))); 138 151 Toilet.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null))); 139 152 Toilet.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND))); … … 153 166 public static final Symbol VisitorBerth = new Symbol(); 154 167 static { 168 VisitorBerth.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60))); 155 169 VisitorBerth.add(new Instr(Prim.FILL, new Color(0xa30075))); 156 170 VisitorBerth.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-25,-25,50,50))); … … 177 191 VisitorMooring.add(new Instr(Prim.PGON, p)); 178 192 } 193 194 public static final EnumMap<CatSCF, Symbol> Cats = new EnumMap<CatSCF, Symbol>(CatSCF.class); 195 static { 196 Cats.put(CatSCF.SCF_BHST, Boatlift); Cats.put(CatSCF.SCF_BTYD, Boatyard); Cats.put(CatSCF.SCF_CHDR, Chandler); Cats.put(CatSCF.SCF_FUEL, Fuel); Cats.put(CatSCF.SCF_LAUN, Laundrette); 197 Cats.put(CatSCF.SCF_PMPO, PumpOut); Cats.put(CatSCF.SCF_CLUB, SailingClub); Cats.put(CatSCF.SCF_SHWR, Shower); Cats.put(CatSCF.SCF_SLPW, Slipway); Cats.put(CatSCF.SCF_WC, Toilet); 198 Cats.put(CatSCF.SCF_VBTH, VisitorBerth); Cats.put(CatSCF.SCF_VMOR, VisitorMooring); 199 } 179 200 } -
applications/editors/josm/plugins/smed2/src/symbols/Harbours.java
r30029 r30033 40 40 Bollard.add(new Instr(Prim.FILL, Color.black)); 41 41 Bollard.add(new Instr(Prim.ELPS, s)); 42 }43 public static final Symbol ClearV = new Symbol();44 static {45 ClearV.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));46 ClearV.add(new Instr(Prim.FILL, Color.white));47 ClearV.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-30,-30,60,60)));48 ClearV.add(new Instr(Prim.FILL, Color.black));49 ClearV.add(new Instr(Prim.LINE, new Line2D.Double(-10,-25,10,-25)));50 ClearV.add(new Instr(Prim.LINE, new Line2D.Double(0,-25,0,-15)));51 ClearV.add(new Instr(Prim.LINE, new Line2D.Double(-10,25,10,25)));52 ClearV.add(new Instr(Prim.LINE, new Line2D.Double(0,25,0,15)));53 42 } 54 43 public static final Symbol ContainerCrane = new Symbol(); … … 113 102 public static final Symbol HarbourMaster = new Symbol(); 114 103 static { 104 HarbourMaster.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60))); 115 105 HarbourMaster.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 116 HarbourMaster.add(new Instr(Prim.ELPS, new Ellipse2D.Double(- 35,-50,70,100)));117 HarbourMaster.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0. 6, 0, 0, null, null)));106 HarbourMaster.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-24,-28,48,56))); 107 HarbourMaster.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.4, 0, 0, null, null))); 118 108 } 119 109 public static final Symbol Hospital = new Symbol(); -
applications/editors/josm/plugins/smed2/src/symbols/Landmarks.java
r30027 r30033 11 11 12 12 import java.awt.BasicStroke; 13 import java.awt.Color; 14 import java.awt.geom.Arc2D; 15 import java.awt.geom.Ellipse2D; 16 import java.awt.geom.Line2D; 17 import java.awt.geom.Path2D; 18 import java.awt.geom.Rectangle2D; 13 import java.awt.geom.*; 19 14 import java.util.EnumMap; 20 15 -
applications/editors/josm/plugins/smed2/src/symbols/Notices.java
r30029 r30033 240 240 static { 241 241 NoticeA6.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Notices.NoticeA, 1.0, 0, 0, null, null))); 242 NoticeA6.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.4, 0, 0, n ew Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(180.0))), null)));242 NoticeA6.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.4, 0, 0, null, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(180.0)))))); 243 243 } 244 244 public static final Symbol NoticeA7 = new Symbol(); … … 277 277 public static final Symbol NoticeA10b = new Symbol(); 278 278 static { 279 NoticeA10b.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Notices.NoticeA10a, 1.0, 0, 0, n ew Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(180.0))), null)));279 NoticeA10b.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Notices.NoticeA10a, 1.0, 0, 0, null, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(180.0)))))); 280 280 } 281 281 public static final Symbol NoticeA12 = new Symbol(); … … 512 512 public static final Symbol NoticeD2b = new Symbol(); 513 513 static { 514 NoticeD2b.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Notices.NoticeD2a, 1.0, 0, 0, n ew Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(180.0))), null)));514 NoticeD2b.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Notices.NoticeD2a, 1.0, 0, 0, null, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(180.0)))))); 515 515 } 516 516 public static final Symbol NoticeD3a = new Symbol(); … … 1039 1039 } 1040 1040 break; 1041 default: 1042 break; 1041 1043 } 1042 1044 return scheme; … … 1055 1057 symbol = NmkPpwbc.get(cat); 1056 1058 break; 1059 default: 1060 break; 1057 1061 } 1058 1062 return symbol; -
applications/editors/josm/plugins/smed2/src/symbols/Symbols.java
r30029 r30033 50 50 t = it; 51 51 } 52 public Delta(Handle ih) { 53 h = ih; 54 t = new AffineTransform(); 55 } 52 56 } 53 57 … … 110 114 public Scheme scheme; 111 115 112 public SubSymbol(Symbol iinstr, double iscale, double ix, double iy, Delta idelta, Scheme ischeme) {116 public SubSymbol(Symbol iinstr, double iscale, double ix, double iy, Scheme ischeme, Delta idelta) { 113 117 instr = iinstr; 114 118 scale = iscale; … … 120 124 } 121 125 122 public static void drawSymbol(Graphics2D g2, Symbol symbol, double scale, double x, double y, Delta dd, Scheme cs) {126 public static void drawSymbol(Graphics2D g2, Symbol symbol, double scale, double x, double y, Scheme cs, Delta dd) { 123 127 int pn = 0; 124 128 int cn = 0; … … 234 238 } 235 239 break; 240 default: 241 break; 236 242 } 237 243 } … … 270 276 case SYMB: 271 277 SubSymbol s = (SubSymbol) item.params; 272 drawSymbol(g2, s.instr, s.scale, s.x, s.y, s.delta, (s.scheme != null ? s.scheme : cs));278 drawSymbol(g2, s.instr, s.scale, s.x, s.y, (s.scheme != null ? s.scheme : cs), s.delta); 273 279 break; 274 280 case TEXT: … … 322 328 layout.draw(g2, (float)dx, (float)dy); 323 329 break; 330 default: 331 break; 324 332 } 325 333 }
Note:
See TracChangeset
for help on using the changeset viewer.