Changeset 31044 in osm for applications/editors/josm
- Timestamp:
- 2015-03-03T17:08:26+01:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/seachart
- Files:
-
- 4 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/build.xml
r30894 r31044 2 2 <project name="SeaChart" default="dist" basedir="."> 3 3 <!-- enter the SVN commit message --> 4 <property name="commit.message" value=" New release"/>4 <property name="commit.message" value="[Seachart] Publish new release"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 6 <property name="plugin.main.version" value="7001"/> -
applications/editors/josm/plugins/seachart/jicons/src/jicons/Jicons.java
r30894 r31044 19 19 import java.awt.Dimension; 20 20 import java.awt.Graphics2D; 21 import java.awt.Rectangle; 21 22 import java.awt.geom.Point2D; 22 23 import java.awt.image.BufferedImage; … … 31 32 32 33 import s57.S57map; 33 import s57.S57map.Feature; 34 import s57.S57map.Snode; 34 import s57.S57map.*; 35 35 import render.*; 36 import render.Rules.RuleSet; 36 37 37 38 public class Jicons { … … 78 79 img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); 79 80 g2 = img.createGraphics(); 80 Renderer.reRender(g2, 16, s / Renderer.symbolScale[16], map, context);81 Renderer.reRender(g2, RuleSet.SEAMARK, new Rectangle(x, y, w, h), 16, s / Renderer.symbolScale[16], map, context); 81 82 try { 82 83 ImageIO.write(img, "png", new File(args[1] + file + ".png")); … … 92 93 SVGGraphics2D svgGenerator = new SVGGraphics2D(document); 93 94 svgGenerator.setSVGCanvasSize(new Dimension(w, h)); 94 Renderer.reRender(svgGenerator, 16, s / Renderer.symbolScale[16], map, context);95 Renderer.reRender(svgGenerator, RuleSet.SEAMARK, new Rectangle(x, y, w, h), 16, s / Renderer.symbolScale[16], map, context); 95 96 boolean useCSS = true; 96 97 Writer out = null; -
applications/editors/josm/plugins/seachart/jrender/src/jrender/Jrender.java
r31031 r31044 10 10 package jrender; 11 11 12 import java.awt.Dimension;13 12 import java.awt.Graphics2D; 14 13 import java.awt.Rectangle; … … 32 31 import org.w3c.dom.Document; 33 32 34 import render.ChartContext;35 import render.Renderer;36 import render.Rules;37 33 import s57.S57map; 38 34 import s57.S57map.Feature; 39 35 import s57.S57map.Snode; 36 import symbols.*; 37 import render.*; 38 import render.Rules.RuleSet; 40 39 41 40 public class Jrender { … … 214 213 Rectangle rect = new Rectangle(size, size); 215 214 img = new BufferedImage(rect.width, rect.height, BufferedImage.TYPE_INT_ARGB); 216 Renderer.reRender(img.createGraphics(), rect, zoom, 0.05, map, context);215 Renderer.reRender(img.createGraphics(), RuleSet.BASE, rect, zoom, 0.05, map, context); 217 216 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 218 217 ImageIO.write(img, "png", bos); … … 227 226 Document document = domImpl.createDocument("http://www.w3.org/2000/svg", "svg", null); 228 227 SVGGraphics2D svgGenerator = new SVGGraphics2D(document); 229 svgGenerator.setBackground( Rules.Bwater);228 svgGenerator.setBackground(Symbols.Bwater); 230 229 svgGenerator.clearRect(rect.x, rect.y, rect.width, rect.height); 231 230 svgGenerator.setSVGCanvasSize(rect.getSize()); 232 231 svgGenerator.setClip(rect.x, rect.y, rect.width, rect.height); 233 232 // svgGenerator.translate(-256, -256); 234 Renderer.reRender(svgGenerator, rect, zoom, 0.05, map, context);233 Renderer.reRender(svgGenerator, RuleSet.BASE, rect, zoom, 0.05, map, context); 235 234 svgGenerator.stream(dstdir + "tst_" + zoom + "-" + xtile + "-" + ytile + ".svg"); 236 235 // } … … 245 244 g2.scale(s, s); 246 245 g2.translate(-(256 + (xn * 256 / s)), -(256 + (yn * 256 / s))); 247 Renderer.reRender(g2, new Rectangle(256, 256), zoom, 1, map, context);246 Renderer.reRender(g2, RuleSet.BASE, new Rectangle(256, 256), zoom, 1, map, context); 248 247 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 249 248 ImageIO.write(img, "png", bos); -
applications/editors/josm/plugins/seachart/js57toosm/src/js57toosm/Js57toosm.java
r30894 r31044 146 146 out.format(" </way>%n"); 147 147 } 148 out.format(" <relation id='%d' version='1'>%n", -map. ref++);148 out.format(" <relation id='%d' version='1'>%n", -map.xref++); 149 149 out.format(" <tag k='type' v='multipolygon'/>%n"); 150 150 git = map.new GeomIterator(feature.geom); -
applications/editors/josm/plugins/seachart/src/render/Renderer.java
r31031 r31044 36 36 static int zoom; 37 37 38 public static void reRender(Graphics2D g, R ectangle rect, int z, double factor, S57map m, ChartContext c) {38 public static void reRender(Graphics2D g, RuleSet set, Rectangle rect, int z, double factor, S57map m, ChartContext c) { 39 39 g2 = g; 40 40 zoom = z; … … 43 43 sScale = symbolScale[zoom] * factor; 44 44 if (map != null) { 45 g2.setBackground( Rules.Bwater);45 g2.setBackground(Symbols.Bwater); 46 46 g2.clearRect(rect.x, rect.y, rect.width, rect.height); 47 47 g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 48 48 g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP); 49 49 g2.setStroke(new BasicStroke(0, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)); 50 Rules.rules( RuleSet.BASE);50 Rules.rules(set); 51 51 } 52 52 } … … 327 327 } 328 328 329 330 329 public static void fillPattern(Feature feature, BufferedImage image) { 331 330 Path2D.Double p = new Path2D.Double(); -
applications/editors/josm/plugins/seachart/src/render/Rules.java
r31028 r31044 30 30 public enum RuleSet { ALL, BASE, SEAMARK } 31 31 32 public static final Color Yland = new Color(0xdcb820);33 public static final Color Bwater = new Color(0x3ea8c8);34 public static final Color Gdries = new Color(0x50b050);35 public static final Color Mline = new Color(0xc480ff);36 public static final Color Msymb = new Color(0xa30075);37 38 32 static final EnumMap<ColCOL, Color> bodyColours = new EnumMap<ColCOL, Color>(ColCOL.class); 39 33 static { … … 129 123 ArrayList<?> list = (ArrayList<?>)getAttVal(feature, obj, idx, att); 130 124 if (list != null) { 131 return ((ArrayList<Enum >)list).get(0);125 return ((ArrayList<Enum<?>>)list).get(0); 132 126 } 133 127 return S57val.unknAtt(att); … … 179 173 static Feature feature; 180 174 static ArrayList<Feature> objects; 181 static RuleSet ruleset; 175 static RuleSet ruleset; 176 182 177 static boolean testObject(Obj obj) { 183 178 return ((objects = Renderer.map.features.get(obj)) != null); … … 290 285 Double depmax = 0.0; 291 286 if (((depmax = (Double) getAttVal(feature, Obj.DEPARE, 0, Att.DRVAL2)) != null) && (depmax <= 0.0)) { 292 Renderer.lineVector(feature, new LineStyle( Gdries));287 Renderer.lineVector(feature, new LineStyle(Symbols.Gdries)); 293 288 } 294 289 break; 295 290 case LAKARE: 296 291 case RIVBNK: 297 Renderer.lineVector(feature, new LineStyle( Bwater, 10,Bwater));292 Renderer.lineVector(feature, new LineStyle(Symbols.Bwater, 10, Symbols.Bwater)); 298 293 break; 299 294 case DRGARE: … … 307 302 if (feature.geom.area > 2.0) { 308 303 if (Renderer.zoom < 16) 309 Renderer.lineVector(feature, new LineStyle( Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true)));304 Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true))); 310 305 else 311 Renderer.lineVector(feature, new LineStyle( Mline, 8, new float[] { 50, 50 }));306 Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 })); 312 307 } else { 313 308 if (Renderer.zoom >= 14) … … 318 313 case LOKBSN: 319 314 case HRBBSN: 320 Renderer.lineVector(feature, new LineStyle(Color.black, 10, Bwater));315 Renderer.lineVector(feature, new LineStyle(Color.black, 10, Symbols.Bwater)); 321 316 break; 322 317 case HRBFAC: 323 318 if (feature.objs.get(Obj.HRBBSN) != null) { 324 Renderer.lineVector(feature, new LineStyle(Color.black, 10, Bwater));319 Renderer.lineVector(feature, new LineStyle(Color.black, 10, Symbols.Bwater)); 325 320 } 326 321 break; 327 322 case LNDARE: 328 Renderer.lineVector(feature, new LineStyle( Yland));323 Renderer.lineVector(feature, new LineStyle(Symbols.Yland)); 329 324 break; 330 325 case MARCUL: … … 348 343 case MIPARE: 349 344 if (Renderer.zoom >= 12) { 350 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Mline);345 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Symbols.Mline); 351 346 if (testAttribute(feature, feature.type, 0, Att.CATREA, CatREA.REA_NWAK)) { 352 347 Renderer.symbol(feature, Areas.NoWake); … … 406 401 case SPLARE: 407 402 if (Renderer.zoom >= 12) { 408 Renderer.symbol(feature, Areas.Plane, new Scheme( Msymb));409 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Mline);403 Renderer.symbol(feature, Areas.Plane, new Scheme(Symbols.Msymb)); 404 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Symbols.Mline); 410 405 } 411 406 addName(feature, 15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90))); … … 525 520 if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) { 526 521 if (feature.type == Obj.CBLSUB) { 527 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Mline);522 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Symbols.Mline); 528 523 } else if (feature.type == Obj.CBLOHD) { 529 524 AttMap atts = feature.objs.get(Obj.CBLOHD).get(0); … … 637 632 case ACHBRT: 638 633 if (Renderer.zoom >= 14) { 639 Renderer.symbol(feature, Harbours.Anchorage, new Scheme( Mline));634 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Symbols.Mline)); 640 635 if (Renderer.zoom >= 15) { 641 Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Msymb, LabelStyle.RRCT,Mline, Color.white, new Delta(Handle.BC));636 Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Symbols.Msymb, LabelStyle.RRCT, Symbols.Mline, Color.white, new Delta(Handle.BC)); 642 637 } 643 638 } … … 649 644 units = UniHLU.HLU_METR; 650 645 } 651 Renderer.lineCircle(feature, new LineStyle( Mline, 4, new float[] { 10, 10 }, null), radius, units);646 Renderer.lineCircle(feature, new LineStyle(Symbols.Mline, 4, new float[] { 10, 10 }, null), radius, units); 652 647 } 653 648 } … … 658 653 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Color.black)); 659 654 } else { 660 Renderer.symbol(feature, Harbours.Anchorage, new Scheme( Mline));661 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Mline);662 } 663 addName(feature, 15, new Font("Arial", Font.BOLD, 60), Mline, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));655 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Symbols.Mline)); 656 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Symbols.Mline); 657 } 658 addName(feature, 15, new Font("Arial", Font.BOLD, 60), Symbols.Mline, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0))); 664 659 ArrayList<StsSTS> sts = (ArrayList<StsSTS>)getAttList(feature, Obj.ACHARE, 0, Att.STATUS); 665 660 if ((Renderer.zoom >= 15) && (sts.contains(StsSTS.STS_RESV))) { 666 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), Mline, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));661 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), Symbols.Mline, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60))); 667 662 } 668 663 } … … 672 667 switch (cat) { 673 668 case ACH_DEEP: 674 Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));669 Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 675 670 dy += 60; 676 671 break; 677 672 case ACH_TANK: 678 Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));673 Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 679 674 dy += 60; 680 675 break; 681 676 case ACH_H24P: 682 Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));677 Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 683 678 dy += 60; 684 679 break; 685 680 case ACH_EXPL: 686 Renderer.symbol(feature, Harbours.Explosives, new Scheme( Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));681 Renderer.symbol(feature, Harbours.Explosives, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 687 682 dy += 60; 688 683 break; 689 684 case ACH_QUAR: 690 Renderer.symbol(feature, Harbours.Hospital, new Scheme( Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));685 Renderer.symbol(feature, Harbours.Hospital, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 691 686 dy += 60; 692 687 break; 693 688 case ACH_SEAP: 694 Renderer.symbol(feature, Areas.Seaplane, new Scheme( Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));689 Renderer.symbol(feature, Areas.Seaplane, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 695 690 dy += 60; 696 691 break; … … 701 696 case BERTHS: 702 697 if (Renderer.zoom >= 14) { 703 Renderer.lineVector(feature, new LineStyle( Mline, 6, new float[] { 20, 20 }));704 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), Msymb, LabelStyle.RRCT,Mline, Color.white);698 Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 6, new float[] { 20, 20 })); 699 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, LabelStyle.RRCT, Symbols.Mline, Color.white); 705 700 } 706 701 break; … … 961 956 if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) { 962 957 if (feature.type == Obj.PIPSOL) { 963 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Mline);958 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Symbols.Mline); 964 959 } else if (feature.type == Obj.PIPOHD) { 965 960 Renderer.lineVector(feature, new LineStyle(Color.black, 8)); … … 1010 1005 case TSSRON: 1011 1006 if (Renderer.zoom <= 15) 1012 Renderer.lineVector(feature, new LineStyle( new Color(0x80c48080, true)));1007 Renderer.lineVector(feature, new LineStyle(Symbols.Mline)); 1013 1008 else 1014 Renderer.lineVector(feature, new LineStyle( new Color(0x80c48080, true), 20, null, null));1015 addName(feature, 10, new Font("Arial", Font.BOLD, 150), new Color(0x80c48080, true));1009 Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 20, null, null)); 1010 addName(feature, 10, new Font("Arial", Font.BOLD, 150), Symbols.Mline); 1016 1011 break; 1017 1012 case TSELNE: 1018 Renderer.lineVector(feature, new LineStyle( new Color(0x80c48080, true), 20, null, null));1013 Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 20, null, null)); 1019 1014 break; 1020 1015 case TSSLPT: 1021 Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, null, 0, new Color(0x80c48080, true));1016 Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, null, 0, Symbols.Mline); 1022 1017 break; 1023 1018 case TSSBND: 1024 Renderer.lineVector(feature, new LineStyle( new Color(0x80c48080, true), 20, new float[] { 40, 40 }, null));1019 Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 20, new float[] { 40, 40 }, null)); 1025 1020 break; 1026 1021 case ISTZNE: 1027 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, new Color(0x80c48080, true));1022 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Symbols.Mline); 1028 1023 break; 1029 1024 default: … … 1033 1028 1034 1029 private static void shoreline() { 1030 CatSLC cat = (CatSLC) getAttEnum(feature, feature.type, 0, Att.CATSLC); 1035 1031 if ((ruleset == RuleSet.ALL) || (ruleset == RuleSet.BASE)) { 1036 Renderer.lineVector(feature, new LineStyle(Color.black, 10, Yland)); 1032 if ((cat != CatSLC.SLC_SWAY) && (cat != CatSLC.SLC_TWAL)) { 1033 Renderer.lineVector(feature, new LineStyle(Color.black, 10, Symbols.Yland)); 1034 } 1037 1035 } 1038 1036 if ((ruleset == RuleSet.ALL) || (ruleset == RuleSet.SEAMARK)) { 1039 1037 if (Renderer.zoom >= 12) { 1040 switch ( (CatSLC) getAttEnum(feature, feature.type, 0, Att.CATSLC)) {1038 switch (cat) { 1041 1039 case SLC_TWAL: 1042 1040 WatLEV lev = (WatLEV) getAttEnum(feature, feature.type, 0, Att.WATLEV); … … 1145 1143 Renderer.symbol(feature, Harbours.SignalStation); 1146 1144 Renderer.symbol(feature, Beacons.RadarStation); 1147 Renderer.labelText(feature, "Ra", new Font("Arial", Font.PLAIN, 40), Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70)));1145 Renderer.labelText(feature, "Ra", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70))); 1148 1146 break; 1149 1147 case PILBOP: 1150 1148 Renderer.symbol(feature, Harbours.Pilot); 1151 addName(feature, 15, new Font("Arial", Font.BOLD, 50), Msymb , new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40)));1149 addName(feature, 15, new Font("Arial", Font.BOLD, 50), Symbols.Msymb , new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40))); 1152 1150 CatPIL cat = (CatPIL) getAttEnum(feature, feature.type, 0, Att.CATPIL); 1153 1151 if (cat == CatPIL.PIL_HELI) { 1154 Renderer.labelText(feature, "H", new Font("Arial", Font.PLAIN, 40), Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));1152 Renderer.labelText(feature, "H", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0))); 1155 1153 } 1156 1154 break; … … 1193 1191 1194 1192 private static void waterways() { 1195 Renderer.lineVector(feature, new LineStyle( Bwater, 20));1193 Renderer.lineVector(feature, new LineStyle(Symbols.Bwater, 20)); 1196 1194 } 1197 1195 -
applications/editors/josm/plugins/seachart/src/render/Signals.java
r30992 r31044 21 21 import s57.S57map.*; 22 22 import symbols.Beacons; 23 import symbols.Symbols; 23 24 import symbols.Topmarks; 24 25 import symbols.Symbols.*; … … 162 163 } 163 164 if ((Renderer.zoom >= 15) && !bstr.isEmpty()) { 164 Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40), Rules.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70)));165 Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70))); 165 166 } 166 167 } … … 273 274 if (Renderer.zoom >= 15) { 274 275 if (vais) { 275 Renderer.labelText(feature, "V-AIS", new Font("Arial", Font.PLAIN, 40), Rules.Msymb, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));276 Renderer.labelText(feature, "V-AIS", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70))); 276 277 } 277 278 if (!bstr.isEmpty()) { 278 Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40), Rules.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -110)));279 Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -110))); 279 280 } 280 281 } -
applications/editors/josm/plugins/seachart/src/s57/S57map.java
r31031 r31044 191 191 public int outers; // Number of outers 192 192 public int inners; // Number of inners 193 public ArrayList<Comp> refs; // Ordered list of compounds193 public ArrayList<Comp> comps; // Ordered list of compounds 194 194 public double area; // Area of feature 195 195 public double length; // Length of feature … … 199 199 elems = new ArrayList<Prim>(); 200 200 outers = inners = 0; 201 refs = new ArrayList<Comp>();201 comps = new ArrayList<Comp>(); 202 202 area = 0; 203 203 length = 0; … … 245 245 private Feature feature; 246 246 private Edge edge; 247 private KeyVal<?> osm = S57osm.OSMtag("", ""); 247 248 248 249 public S57map() { … … 388 389 feature.geom.elems.add(new Prim(id)); 389 390 edge = null; 391 osm = S57osm.OSMtag("", ""); 390 392 } 391 393 … … 396 398 feature.geom.elems.add(new Prim(id)); 397 399 edge = new Edge(); 400 osm = S57osm.OSMtag("", ""); 398 401 } 399 402 … … 415 418 feature.geom.prim = Pflag.AREA; 416 419 edge = null; 420 osm = S57osm.OSMtag("", ""); 417 421 } 418 422 … … 474 478 } 475 479 } else { 476 KeyVal kv = S57osm.OSMtag(key, val);480 KeyVal<?> kv = S57osm.OSMtag(key, val); 477 481 if (kv.obj != Obj.UNKOBJ) { 478 if (feature.type == Obj.UNKOBJ) { 479 feature.type = kv.obj; 480 } 481 ObjTab objs = feature.objs.get(kv.obj); 482 if (objs == null) { 483 objs = new ObjTab(); 484 feature.objs.put(kv.obj, objs); 485 } 486 AttMap atts = objs.get(0); 487 if (atts == null) { 488 atts = new AttMap(); 489 objs.put(0, atts); 490 } 482 osm.obj = kv.obj; 491 483 if (kv.att != Att.UNKATT) { 492 atts.put(kv.att, new AttVal(kv.att, kv.conv, kv.val));484 osm = kv; 493 485 } 494 486 } … … 517 509 break; 518 510 } 519 if ((sortGeom(feature)) && (feature.type != Obj.UNKOBJ) && !((edge != null) && (edge.last == 0))) { 520 index.put(id, feature); 521 if (features.get(feature.type) == null) { 522 features.put(feature.type, new ArrayList<Feature>()); 523 } 524 features.get(feature.type).add(feature); 525 feature.geom.centre = findCentroid(feature); 526 } 527 } 528 511 if (sortGeom(feature) && !((edge != null) && (edge.last == 0))) { 512 if (osm.obj != Obj.UNKOBJ) { 513 if (feature.type == Obj.UNKOBJ) { 514 feature.type = osm.obj; 515 ObjTab objs = feature.objs.get(osm.obj); 516 if (objs == null) { 517 objs = new ObjTab(); 518 feature.objs.put(osm.obj, objs); 519 } 520 AttMap atts = objs.get(0); 521 if (atts == null) { 522 atts = new AttMap(); 523 objs.put(0, atts); 524 } 525 if (osm.att != Att.UNKATT) { 526 atts.put(osm.att, new AttVal<>(osm.att, osm.conv, osm.val)); 527 } 528 } else { 529 Feature base = new Feature(); 530 base.reln = Rflag.MASTER; 531 base.geom = feature.geom; 532 base.type = osm.obj; 533 ObjTab objs = new ObjTab(); 534 base.objs.put(osm.obj, objs); 535 AttMap atts = new AttMap(); 536 objs.put(0, atts); 537 if (osm.att != Att.UNKATT) { 538 atts.put(osm.att, new AttVal<>(osm.att, osm.conv, osm.val)); 539 } 540 index.put(++xref, base); 541 if (features.get(osm.obj) == null) { 542 features.put(osm.obj, new ArrayList<Feature>()); 543 } 544 features.get(osm.obj).add(base); 545 } 546 } 547 if (feature.type != Obj.UNKOBJ) { 548 index.put(id, feature); 549 if (features.get(feature.type) == null) { 550 features.put(feature.type, new ArrayList<Feature>()); 551 } 552 features.get(feature.type).add(feature); 553 } 554 } 555 } 556 557 enum Ext {I, N, W, S, E } 529 558 public void mapDone() { 530 ArrayList<Feature> coasts = new ArrayList<Feature>(); 531 ArrayList<Feature> lands = new ArrayList<Feature>(); 532 if (features.get(Obj.LNDARE) == null) { 533 features.put(Obj.LNDARE, new ArrayList<Feature>()); 534 } 535 for (Feature feature : features.get(Obj.COALNE)) { 536 Feature land = new Feature(); 537 land.type = Obj.LNDARE; 538 land.reln = Rflag.MASTER; 539 land.objs.put(Obj.LNDARE, new ObjTab()); 540 if (feature.geom.prim == Pflag.AREA) { 541 land.geom = feature.geom; 542 features.get(Obj.LNDARE).add(land); 543 } else if (feature.geom.prim == Pflag.LINE) { 544 land.geom.prim = Pflag.LINE; 545 for (int i = 0; i < feature.geom.elems.size(); i++) { 546 land.geom.elems.add(feature.geom.elems.get(i)); 547 } 548 coasts.add(land); 549 } 550 } 551 while (coasts.size() > 0) { 552 Feature land = coasts.remove(0); 553 Edge fedge = edges.get(land.geom.elems.get(0).id); 554 long first = fedge.first; 555 long last = edges.get(land.geom.elems.get(land.geom.elems.size() - 1).id).last; 556 if (coasts.size() > 0) { 557 boolean added = true; 558 while (added) { 559 added = false; 560 for (int i = 0; i < coasts.size(); i++) { 561 Feature coast = coasts.get(i); 562 Edge edge = edges.get(coast.geom.elems.get(0).id); 563 if (edge.first == last) { 564 land.geom.elems.add(coast.geom.elems.get(0)); 565 last = edge.last; 566 coasts.remove(i--); 567 added = true; 568 } else if (edge.last == first) { 569 land.geom.elems.add(0, coast.geom.elems.get(0)); 570 first = edge.first; 571 coasts.remove(i--); 572 added = true; 573 } 574 } 575 } 576 } 577 lands.add(land); 578 } 579 for (Feature land : lands) { 580 long first = edges.get(land.geom.elems.get(0).id).first; 581 long last = edges.get(land.geom.elems.get(land.geom.elems.size()-1).id).last; 582 Ext fext = outsideBounds(first); 583 Ext lext = outsideBounds(last); 584 Edge nedge = new Edge(); 585 nedge.first = last; 586 nedge.last = first; 587 switch (lext) { 588 case N: 589 if ((lext == fext) || (fext != Ext.N)) { 590 nedge.nodes.add(1L); 591 if ((fext != Ext.W)) { 592 nedge.nodes.add(2L); 593 if ((fext != Ext.S)) { 594 nedge.nodes.add(3L); 595 if ((fext != Ext.W)) { 596 nedge.nodes.add(4L); 559 class Land { 560 long first; 561 Snode start; 562 Ext sbound; 563 long last; 564 Snode end; 565 Ext ebound; 566 Feature land; 567 Land (Feature l) { 568 land = l; 569 first = last = 0; 570 start = end = null; 571 sbound = ebound = Ext.I; 572 } 573 } 574 if (features.get(Obj.COALNE) != null) { 575 ArrayList<Feature> coasts = new ArrayList<Feature>(); 576 ArrayList<Land> lands = new ArrayList<Land>(); 577 if (features.get(Obj.LNDARE) == null) { 578 features.put(Obj.LNDARE, new ArrayList<Feature>()); 579 } 580 for (Feature feature : features.get(Obj.COALNE)) { 581 Feature land = new Feature(); 582 land.type = Obj.LNDARE; 583 land.reln = Rflag.MASTER; 584 land.objs.put(Obj.LNDARE, new ObjTab()); 585 if (feature.geom.prim == Pflag.AREA) { 586 land.geom = feature.geom; 587 features.get(Obj.LNDARE).add(land); 588 } else if (feature.geom.prim == Pflag.LINE) { 589 land.geom.prim = Pflag.LINE; 590 for (int i = 0; i < feature.geom.elems.size(); i++) { 591 land.geom.elems.add(feature.geom.elems.get(i)); 592 } 593 coasts.add(land); 594 } 595 } 596 while (coasts.size() > 0) { 597 Feature land = coasts.remove(0); 598 Edge fedge = edges.get(land.geom.elems.get(0).id); 599 long first = fedge.first; 600 long last = edges.get(land.geom.elems.get(land.geom.elems.size() - 1).id).last; 601 if (coasts.size() > 0) { 602 boolean added = true; 603 while (added) { 604 added = false; 605 for (int i = 0; i < coasts.size(); i++) { 606 Feature coast = coasts.get(i); 607 Edge edge = edges.get(coast.geom.elems.get(0).id); 608 if (edge.first == last) { 609 land.geom.elems.add(coast.geom.elems.get(0)); 610 last = edge.last; 611 coasts.remove(i--); 612 added = true; 613 } else if (edge.last == first) { 614 land.geom.elems.add(0, coast.geom.elems.get(0)); 615 first = edge.first; 616 coasts.remove(i--); 617 added = true; 597 618 } 598 619 } 599 620 } 600 621 } 601 break; 602 case W: 603 if ((lext == fext) || (fext != Ext.W)) { 604 nedge.nodes.add(2L); 605 if ((fext != Ext.S)) { 606 nedge.nodes.add(3L); 607 if ((fext != Ext.E)) { 608 nedge.nodes.add(4L); 609 if ( (fext != Ext.N)) { 610 nedge.nodes.add(1L); 622 lands.add(new Land(land)); 623 } 624 ArrayList<Land> islands = new ArrayList<Land>(); 625 for (Land land : lands) { 626 sortGeom(land.land); 627 if (land.land.geom.prim == Pflag.AREA) { 628 islands.add(land); 629 features.get(Obj.LNDARE).add(land.land); 630 } 631 } 632 for (Land island : islands) { 633 lands.remove(island); 634 } 635 for (Land land : lands) { 636 GeomIterator git = new GeomIterator(land.land.geom); 637 Snode prev = null; 638 Ext bprev = Ext.I; 639 Ext ext; 640 land.ebound = land.sbound = Ext.I; 641 while (git.hasComp()) { 642 git.nextComp(); 643 while (git.hasEdge()) { 644 git.nextEdge(); 645 while (git.hasNode()) { 646 long ref = git.nextRef(false); 647 Snode node = nodes.get(ref); 648 if (node == null) continue; 649 if (land.first == 0) { 650 land.first = ref; 651 } 652 if (prev == null) { 653 prev = node; 654 } 655 if ((node.lat >= bounds.maxlat) && (node.lon < bounds.maxlon)) { 656 ext = Ext.N; 657 } else if (node.lon <= bounds.minlon) { 658 ext = Ext.W; 659 } else if (node.lat <= bounds.minlat) { 660 ext = Ext.S; 661 } else if (node.lon >= bounds.maxlon) { 662 ext = Ext.E; 663 } else { 664 ext = Ext.I; 665 } 666 if (ext == Ext.I) { 667 if (land.start == null) { 668 land.start = prev; 669 land.sbound = bprev; 670 } 671 land.end = null; 672 land.ebound = Ext.I; 673 } else { 674 if ((land.start != null) && (land.end == null)) { 675 land.end = node; 676 land.ebound = ext; 677 } 678 } 679 prev = node; 680 bprev = ext; 681 land.last = ref; 682 } 683 } 684 } 685 } 686 islands = new ArrayList<Land>(); 687 for (Land land : lands) { 688 if ((land.sbound == Ext.I) || (land.ebound == Ext.I)) { 689 islands.add(land); 690 } 691 } 692 for (Land island : islands) { 693 lands.remove(island); 694 } 695 while (lands.size() > 0) { 696 Land land = lands.get(0); 697 Edge nedge = new Edge(); 698 nedge.first = land.last; 699 Ext bound = land.ebound; 700 Snode last = land.end; 701 double delta = Math.PI; 702 int idx = -1; 703 Land next = null; 704 while (idx < 0) { 705 for (int i = 0; i < lands.size(); i++) { 706 next = lands.get(i); 707 if (next.sbound == bound) { 708 double diff = -Math.PI; 709 switch (bound) { 710 case N: 711 diff = last.lon - next.start.lon; 712 break; 713 case W: 714 diff = last.lat - next.start.lat; 715 break; 716 case S: 717 diff = next.start.lon - last.lon; 718 break; 719 case E: 720 diff = next.start.lat - last.lat; 721 break; 722 default: 723 continue; 724 } 725 if ((diff >= 0.0) && (diff < delta)) { 726 delta = diff; 727 idx = i; 611 728 } 612 729 } 613 730 } 614 } 615 break; 616 case S: 617 if ((lext == fext) || (fext != Ext.S)) { 618 nedge.nodes.add(3L); 619 if ((fext != Ext.E)) { 620 nedge.nodes.add(4L); 621 if ((fext != Ext.N)) { 622 nedge.nodes.add(1L); 623 if ((fext != Ext.W)) { 624 nedge.nodes.add(2L); 731 if (idx < 0) { 732 long ref = (long)bound.ordinal(); 733 last = nodes.get(ref); 734 nedge.nodes.add(ref); 735 ref = ref < 4 ? ++ref : 1; 736 for (Ext e : Ext.values()) { 737 if (ref == e.ordinal()) { 738 bound = e; 739 break; 625 740 } 626 741 } 627 742 } 628 743 } 629 break; 630 case E: 631 if ((lext == fext) || (fext != Ext.E)) { 632 nedge.nodes.add(4L); 633 if ((fext != Ext.N)) { 634 nedge.nodes.add(1L); 635 if ((fext != Ext.W)) { 636 nedge.nodes.add(2L); 637 if ((fext != Ext.S)) { 638 nedge.nodes.add(3L); 639 } 640 } 641 } 642 } 643 break; 644 default: 645 } 646 edges.put(++xref, nedge); 647 land.geom.elems.add(new Prim(xref)); 648 sortGeom(land); 649 features.get(Obj.LNDARE).add(land); 744 next = lands.get(idx); 745 nedge.last = next.first; 746 edges.put(++xref, nedge); 747 land.land.geom.elems.add(new Prim(xref)); 748 if (next != land) { 749 land.land.geom.elems.addAll(next.land.geom.elems); 750 land.ebound = next.ebound; 751 land.end = next.end; 752 land.last = next.last; 753 lands.remove(idx); 754 } 755 sortGeom(land.land); 756 if (land.land.geom.prim == Pflag.AREA) { 757 features.get(Obj.LNDARE).add(land.land); 758 lands.remove(land); 759 } 760 } 650 761 } 651 762 return; … … 653 764 654 765 // Utility methods 655 656 enum Ext {I, N, W, S, E }657 class Xnode {658 double lat;659 double lon;660 Ext ext;661 }662 Ext outsideBounds(long ref) {663 Snode node = nodes.get(ref);664 if (node.lat >= bounds.maxlat) {665 return Ext.N;666 }667 if (node.lat <= bounds.minlat) {668 return Ext.S;669 }670 if (node.lon >= bounds.maxlon) {671 return Ext.E;672 }673 if (node.lon <= bounds.minlon) {674 return Ext.W;675 }676 return Ext.I;677 }678 766 679 767 public boolean sortGeom(Feature feature) { … … 686 774 feature.geom.area = 0; 687 775 if (feature.geom.prim == Pflag.POINT) { 776 feature.geom.centre = findCentroid(feature); 688 777 return true; 689 778 } else { … … 697 786 if (next == true) { 698 787 next = false; 699 if (prim.forward) { 700 first = edge.first; 701 last = edge.last; 702 } else { 703 first = edge.last; 704 last = edge.first; 705 } 788 first = edge.first; 789 last = edge.last; 790 prim.forward = true; 706 791 sort.elems.add(prim); 707 792 if (prim.outer) { … … 711 796 } 712 797 comp = new Comp(cref++, 1); 713 sort. refs.add(comp);798 sort.comps.add(comp); 714 799 } else { 715 if (prim.forward) { 716 if (edge.first == last) { 717 sort.elems.add(prim); 718 last = edge.last; 719 comp.size++; 720 } else if (edge.last == first) { 721 sort.elems.add(0, prim); 722 first = edge.first; 723 comp.size++; 724 } else { 725 feature.geom.elems.add(prim); 726 } 800 if (edge.first == last) { 801 sort.elems.add(prim); 802 last = edge.last; 803 prim.forward = true; 804 comp.size++; 805 } else if (edge.last == first) { 806 sort.elems.add(0, prim); 807 first = edge.first; 808 prim.forward = true; 809 comp.size++; 810 } else if (edge.last == last) { 811 sort.elems.add(prim); 812 last = edge.first; 813 prim.forward = false; 814 comp.size++; 815 } else if (edge.first == first) { 816 sort.elems.add(0, prim); 817 first = edge.last; 818 prim.forward = false; 819 comp.size++; 727 820 } else { 728 if (edge.last == last) { 729 sort.elems.add(prim); 730 last = edge.first; 731 comp.size++; 732 } else if (edge.first == first) { 733 sort.elems.add(0, prim); 734 first = edge.last; 735 comp.size++; 736 } else { 737 feature.geom.elems.add(prim); 738 } 821 feature.geom.elems.add(prim); 739 822 } 740 823 } … … 750 833 } 751 834 if (feature.geom.prim == Pflag.AREA) { 752 ArrayList<Prim> outers = new ArrayList<Prim>(); 753 ArrayList<Prim> inners = new ArrayList<Prim>(); 754 for (Prim prim : feature.geom.elems) { 755 if (prim.outer) { 756 outers.add(prim); 757 } else { 758 inners.add(prim); 759 } 760 } 761 ArrayList<Prim> sorting = outers.size() > 0 ? outers : inners; 762 ArrayList<Prim> closed = null; 763 sort = new Geom(feature.geom.prim); 764 sort.outers = feature.geom.outers; 765 sort.inners = feature.geom.inners; 766 sort.refs = feature.geom.refs; 767 next = true; 768 while (!sorting.isEmpty()) { 769 Prim prim = sorting.remove(0); 770 Edge edge = edges.get(prim.id); 771 if (next == true) { 772 next = false; 773 closed = new ArrayList<Prim>(); 774 closed.add(prim); 775 if (prim.forward) { 776 first = edge.first; 777 last = edge.last; 778 } else { 779 first = edge.last; 780 last = edge.first; 781 } 782 } else { 783 if (prim.forward) { 784 if (edge.first == last) { 785 last = edge.last; 786 closed.add(prim); 787 } else { 788 sorting.add(0, prim); 789 next = true; 790 } 791 } else { 792 if (edge.last == last) { 793 last = edge.first; 794 closed.add(prim); 795 } else { 796 sorting.add(0, prim); 797 next = true; 798 } 799 } 800 } 801 if (first == last) { 802 sort.elems.addAll(closed); 803 next = true; 804 } 805 if (sorting.isEmpty() && sorting == outers) { 806 sorting = inners; 807 next = true; 808 } 809 } 810 feature.geom = sort; 835 if (signedArea(feature.geom) < 0.0) { 836 837 }; 838 feature.geom.area = calcArea(feature.geom); 811 839 } 812 840 feature.geom.length = calcLength(feature.geom); 813 feature.geom. area = calcArea(feature.geom);841 feature.geom.centre = findCentroid(feature); 814 842 return true; 815 843 } … … 883 911 lastref = 0; 884 912 ite = geom.elems.listIterator(); 885 itc = geom. refs.listIterator();913 itc = geom.comps.listIterator(); 886 914 } 887 915 -
applications/editors/josm/plugins/seachart/src/s57/S57osm.java
r31028 r31044 38 38 OSMtags.put("waterway=canal", new KeyVal<>(Obj.CANALS, Att.UNKATT, null, null)); OSMtags.put("waterway=dock", new KeyVal<>(Obj.HRBBSN, Att.UNKATT, null, null)); 39 39 OSMtags.put("waterway=lock", new KeyVal<>(Obj.HRBBSN, Att.UNKATT, null, null)); 40 OSMtags.put("wetland=tidalflat", new KeyVal<Double>(Obj.DEPARE, Att.DRVAL2, Conv.F, ( double)0)); OSMtags.put("tidal=yes", new KeyVal<Double>(Obj.DEPARE, Att.DRVAL2, Conv.F, (Double)0.0));40 OSMtags.put("wetland=tidalflat", new KeyVal<Double>(Obj.DEPARE, Att.DRVAL2, Conv.F, (Double)0.0)); OSMtags.put("tidal=yes", new KeyVal<Double>(Obj.DEPARE, Att.DRVAL2, Conv.F, (Double)0.0)); 41 41 OSMtags.put("natural=mud", new KeyVal<>(Obj.DEPARE, Att.UNKATT, null, null)); OSMtags.put("natural=sand", new KeyVal<>(Obj.DEPARE, Att.UNKATT, null, null)); 42 42 OSMtags.put("highway=motorway", new KeyVal<>(Obj.ROADWY, Att.CATROD, Conv.E, CatROD.ROD_MWAY)); OSMtags.put("highway=trunk", new KeyVal<>(Obj.ROADWY, Att.CATROD, Conv.E, CatROD.ROD_MAJR)); -
applications/editors/josm/plugins/seachart/src/seachart/ChartImage.java
r31028 r31044 30 30 import render.ChartContext; 31 31 import render.Renderer; 32 import render.Rules ;32 import render.Rules.RuleSet; 33 33 import s57.S57map.*; 34 34 … … 66 66 public void paint(Graphics2D g2, MapView mv, Bounds bb) { 67 67 Rectangle rect = Main.map.mapView.getBounds(); 68 Renderer.reRender(g2, rect, zoom, Math.pow(2, (zoom-12)), SeachartAction.map, this);68 Renderer.reRender(g2, RuleSet.ALL, rect, zoom, Math.pow(2, (zoom-12)), SeachartAction.map, this); 69 69 g2.setPaint(Color.black); 70 70 g2.setFont(new Font("Arial", Font.BOLD, 20)); -
applications/editors/josm/plugins/seachart/src/symbols/Areas.java
r30894 r31044 53 53 LaneArrow.add(new Instr(Form.BBOX, new Rectangle2D.Double(-20,-240,40,240))); 54 54 LaneArrow.add(new Instr(Form.STRK, new BasicStroke(10, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER))); 55 LaneArrow.add(new Instr(Form.FILL, new Color(0x80c480ff, true)));55 LaneArrow.add(new Instr(Form.FILL, Symbols.Mline)); 56 56 Path2D.Double p = new Path2D.Double(); p.moveTo(15,0); p.lineTo(15,-195); p.lineTo(40,-195); 57 57 p.lineTo(0,-240); p.lineTo(-40,-195); p.lineTo(-15,-195); p.lineTo(-15,0); p.closePath(); -
applications/editors/josm/plugins/seachart/src/symbols/Harbours.java
r30899 r31044 14 14 import java.awt.geom.*; 15 15 16 import render.Rules;17 16 import symbols.Symbols.*; 18 17 … … 39 38 public static final Symbol Anchorage = new Symbol(); 40 39 static { 41 Anchorage.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 1.0, 0, 0, new Scheme( Rules.Msymb), null)));40 Anchorage.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 1.0, 0, 0, new Scheme(Symbols.Msymb), null))); 42 41 } 43 42 public static final Symbol Bollard = new Symbol(); … … 54 53 CallPoint1.add(new Instr(Form.BBOX, new Rectangle2D.Double(-50,-50,100,100))); 55 54 CallPoint1.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER))); 56 CallPoint1.add(new Instr(Form.FILL, Rules.Msymb));55 CallPoint1.add(new Instr(Form.FILL, Symbols.Msymb)); 57 56 CallPoint1.add(new Instr(Form.ELPS, new Ellipse2D.Double(-25,-25,50,50))); 58 57 Path2D.Double p = new Path2D.Double(); p.moveTo(-16.0,-20.0); p.lineTo(0.0,-50.0); p.lineTo(16.0,-20.0); … … 95 94 static { 96 95 DistanceU.add(new Instr(Form.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 97 DistanceU.add(new Instr(Form.FILL, Rules.Msymb));96 DistanceU.add(new Instr(Form.FILL, Symbols.Msymb)); 98 97 DistanceU.add(new Instr(Form.ELPS, new Ellipse2D.Double(-11,-11,22,22))); 99 98 } … … 121 120 static { 122 121 Fishing.add(new Instr(Form.STRK, new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 123 Fishing.add(new Instr(Form.FILL, Rules.Msymb));122 Fishing.add(new Instr(Form.FILL, Symbols.Msymb)); 124 123 Fishing.add(new Instr(Form.EARC, new Arc2D.Double(-50,-50,100,100,15,140,Arc2D.OPEN))); 125 124 Fishing.add(new Instr(Form.EARC, new Arc2D.Double(-50,-50,100,100,-15,-140,Arc2D.OPEN))); … … 133 132 static { 134 133 Harbour.add(new Instr(Form.STRK, new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 135 Harbour.add(new Instr(Form.FILL, Rules.Msymb));134 Harbour.add(new Instr(Form.FILL, Symbols.Msymb)); 136 135 Harbour.add(new Instr(Form.ELPS, new Ellipse2D.Double(-50,-50,100,100))); 137 Harbour.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.6, 0, 0, new Scheme( Rules.Msymb), null)));136 Harbour.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.6, 0, 0, new Scheme(Symbols.Msymb), null))); 138 137 } 139 138 public static final Symbol HarbourMaster = new Symbol(); … … 155 154 public static final Symbol LandingSteps = new Symbol(); 156 155 static { 157 LandingSteps.add(new Instr(Form.FILL, Rules.Msymb));156 LandingSteps.add(new Instr(Form.FILL, Symbols.Msymb)); 158 157 Path2D.Double p = new Path2D.Double(); p.moveTo(-20,-10); p.lineTo(10,20); p.lineTo(20,20); p.lineTo(20,10); 159 158 p.lineTo(10,10); p.lineTo(10,0); p.lineTo(0,0); p.lineTo(0,-10); p.lineTo(-10,-10); p.lineTo(-10,-20); p.lineTo(-20,-20); p.closePath(); … … 165 164 static { 166 165 Marina.add(new Instr(Form.STRK, new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 167 Marina.add(new Instr(Form.FILL, Rules.Msymb));166 Marina.add(new Instr(Form.FILL, Symbols.Msymb)); 168 167 Marina.add(new Instr(Form.EARC, new Arc2D.Double(-50.0,-50.0,100.0,100.0,215.0,-250.0,Arc2D.OPEN))); 169 Marina.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Yacht, 0.6, 0, 0, new Scheme( Rules.Msymb), null)));168 Marina.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Yacht, 0.6, 0, 0, new Scheme(Symbols.Msymb), null))); 170 169 } 171 170 public static final Symbol MarinaNF = new Symbol(); 172 171 static { 173 MarinaNF.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Yacht, 0.6, 0, 0, new Scheme( Rules.Msymb), null)));172 MarinaNF.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Yacht, 0.6, 0, 0, new Scheme(Symbols.Msymb), null))); 174 173 } 175 174 public static final Symbol Pilot = new Symbol(); -
applications/editors/josm/plugins/seachart/src/symbols/Symbols.java
r31014 r31044 20 20 public class Symbols { 21 21 22 public static final Color Yland = new Color(0xf1c010); 23 public static final Color Bwater = new Color(0x78acd2); 24 public static final Color Gdries = new Color(0x689868); 25 public static final Color Mline = new Color(0x9a6078); 26 public static final Color Msymb = new Color(0xa30075); 27 22 28 public enum Form { 23 29 BBOX, STRK, COLR, FILL, LINE, RECT, RRCT, ELPS, EARC, PLIN, PGON, RSHP, TEXT, SYMB, P1, P2, H2, H3, H4, H5, V2, V3, D2, D3, D4, B1, S2, S3, S4, C2, X2
Note:
See TracChangeset
for help on using the changeset viewer.