Changeset 29206 in osm for applications/editors/josm/plugins/smed2
- Timestamp:
- 2013-01-20T11:51:05+01:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
r29205 r29206 100 100 ArrayList<Long> way; 101 101 if (map.mpolys.containsKey(feature.refs)) { 102 way = map.ways.get(map.mpolys.get(feature.refs) );102 way = map.ways.get(map.mpolys.get(feature.refs).get(0)); 103 103 } else { 104 104 way = map.ways.get(feature.refs); … … 107 107 case NODE: 108 108 return map.nodes.get(feature.refs); 109 case WAY:109 case LINE: 110 110 coord = map.nodes.get(way.get(1)); 111 111 break; … … 152 152 } 153 153 if (item.type == Prim.SYMB) { 154 ssymb = ( Symbol) item.params;154 ssymb = ((SubSymbol)item.params).instr; 155 155 break; 156 156 } … … 293 293 public static void labelText (Feature feature, String str, Font font, Color colour, Delta delta) { 294 294 Symbol label = new Symbol(); 295 label.add(new Instr(Prim.TEXT, new Caption(str, font, colour 296 , delta))); 295 label.add(new Instr(Prim.TEXT, new Caption(str, font, colour, (delta == null) ? new Delta(Handle.CC, null) : delta))); 297 296 Point2D point = helper.getPoint(findCentroid(feature)); 298 Symbols.drawSymbol(g2, label, tScale, point.getX(), point.getY(), delta, null);297 Symbols.drawSymbol(g2, label, tScale, point.getX(), point.getY(), null, null); 299 298 } 300 299 -
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r29204 r29206 195 195 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, null)); 196 196 if ((zoom >= 12) && (name != null)) 197 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.PLAIN, 100), Color.black, n ew Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 0)));197 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.PLAIN, 100), Color.black, null); 198 198 break; 199 199 case RESARE: … … 291 291 } 292 292 private static void harbours(Feature feature) { 293 } 293 AttItem name = feature.atts.get(Att.OBJNAM); 294 switch (feature.type) { 295 case ACHARE: 296 if (zoom >= 12) { 297 Renderer.symbol(feature, Harbours.Anchorage, null, null); 298 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, 10); 299 if ((zoom >= 15) && ((name) != null)) { 300 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), new Color(0x80c480ff), null); 301 } 302 } 303 break; 304 } 305 } 306 /* 307 * if ((zoom >= 12) && is_type("anchorage")) { 308 symbol("anchorage"); 309 if ((zoom >= 15) && (has_item_attribute("name"))) 310 text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:middle", 0, -90); 311 if ((zoom >= 12) && (is_area)) line_symbols("restricted_line", 0.5, "line_anchor", 10); 312 } 313 if ((zoom >= 16) && is_type("anchor_berth")) symbol("anchor_berth"); 314 if ((zoom >= 12) && is_type("harbour")) { 315 if (has_attribute("category")) { 316 attribute_switch("category") 317 attribute_case("marina|yacht") symbol("marina"); 318 attribute_case("marina_no_facilities") symbol("marina_nf"); 319 attribute_default symbol("harbour"); 320 end_switch 321 } else symbol("harbour"); 322 if ((zoom >= 15) && (has_item_attribute("name"))) 323 text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:middle", 0, -90); 324 } 325 326 */ 294 327 private static void locks(Feature feature) { 295 328 } -
applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java
r29202 r29206 24 24 25 25 public enum Fflag { 26 UNKN, NODE, WAY, AREA26 UNKN, NODE, LINE, AREA 27 27 } 28 28 … … 147 147 feature = new Feature(); 148 148 feature.refs = id; 149 feature.flag = Fflag. WAY;149 feature.flag = Fflag.LINE; 150 150 } 151 151 … … 172 172 173 173 public void tagsDone(long id) { 174 if ((feature.type != Obj.UNKOBJ) && !((feature.flag == Fflag. WAY) && (list.size() < 2))) {174 if ((feature.type != Obj.UNKOBJ) && !((feature.flag == Fflag.LINE) && (list.size() < 2))) { 175 175 index.put(id, feature); 176 if ((feature.flag == Fflag. WAY) && (list.size() > 0) && (list.get(0).equals(list.get(list.size() - 1)))) {176 if ((feature.flag == Fflag.LINE) && (list.size() > 0) && (list.get(0).equals(list.get(list.size() - 1)))) { 177 177 feature.flag = Fflag.AREA; 178 178 } -
applications/editors/josm/plugins/smed2/src/symbols/Areas.java
r29204 r29206 44 44 public static final Symbol LineAnchor = new Symbol(); 45 45 static { 46 LineAnchor.add(new Instr(Prim.BBOX, new Rectangle(-30,-60,60,90))); 46 47 LineAnchor.add(new Instr(Prim.FILL, new Color(0xc480ff))); 47 48 LineAnchor.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.5, 0, 0, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(-90.0))), null))); -
applications/editors/josm/plugins/smed2/src/symbols/Symbols.java
r29204 r29206 122 122 123 123 public static class SubSymbol { 124 Symbol instr;125 double scale;126 double x;127 double y;128 Delta delta;129 Scheme scheme;124 public Symbol instr; 125 public double scale; 126 public double x; 127 public double y; 128 public Delta delta; 129 public Scheme scheme; 130 130 131 131 public SubSymbol(Symbol iinstr, double iscale, double ix, double iy, Delta idelta, Scheme ischeme) { … … 295 295 dy = 0; 296 296 if (c.dd != null) { 297 g2.transform(c.dd.t);297 if (c.dd.t != null) g2.transform(c.dd.t); 298 298 switch (c.dd.h) { 299 299 case CC:
Note:
See TracChangeset
for help on using the changeset viewer.