Ignore:
Timestamp:
2016-03-03T08:32:31+01:00 (9 years ago)
Author:
malcolmh
Message:

add RADRFLs

Location:
applications/editors/josm/plugins/seachart
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/seachart/jrender/src/jrender/Jrender.java

    r32088 r32090  
    8989                context = new Context();
    9090
     91                int border = 256 / (int)Math.pow(2, (12 - zoom));
    9192                int size = 256;
    9293                for (int i = 0; i < (12 - zoom); i++) size *= 2;
    93                 Rectangle rect = new Rectangle(size, size);
     94                Rectangle rect = new Rectangle((size + (2 * border)), (size + (2 * border)));
    9495                img = new BufferedImage(rect.width, rect.height, BufferedImage.TYPE_INT_ARGB);
    9596                Renderer.reRender(img.createGraphics(), rect, zoom, 1.0, map, context);
     
    106107                                svgGenerator.setSVGCanvasSize(rect.getSize());
    107108                                svgGenerator.setClip(rect.x, rect.y, rect.width, rect.height);
    108                                 svgGenerator.translate(-256, -256);
     109                                svgGenerator.translate(-border, -border);
    109110                                Renderer.reRender(svgGenerator, rect, z, 1.0, map, context);
    110111                                svgGenerator.stream(dstdir + "tst_" + z + "-" + xtile + "-" + ytile + ".svg");
     
    129130                        String dstnam = dstdir + zoom + "/" + xdir + "/" + ynam + ".png";
    130131                        deletes.remove(dstnam);
    131                         send.add("put " + dstnam + " cache/tiles-" + zoom + "-" + xdir + "-" + ynam + ".png");
     132                        send.add("put " + dstnam + " tiles/" + zoom + "/" + xdir + "/" + ynam + ".png");
    132133                        File ofile = new File(dstdir + "/" + zoom + "/" + xdir + "/");
    133134                        ofile.mkdirs();
  • applications/editors/josm/plugins/seachart/src/render/Renderer.java

    r32088 r32090  
    5656        }
    5757
    58         public static void symbol(Feature feature, Symbol symbol) {
    59                 Point2D point = context.getPoint(feature.geom.centre);
     58        public static void symbol(Symbol symbol) {
     59                Point2D point = context.getPoint(Rules.feature.geom.centre);
    6060                Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), null, null);
    6161        }
    62         public static void symbol(Feature feature, Symbol symbol, Scheme scheme) {
    63                 Point2D point = context.getPoint(feature.geom.centre);
     62        public static void symbol(Symbol symbol, Scheme scheme) {
     63                Point2D point = context.getPoint(Rules.feature.geom.centre);
    6464                Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, null);
    6565        }
    66         public static void symbol(Feature feature, Symbol symbol, Delta delta) {
    67                 Point2D point = context.getPoint(feature.geom.centre);
     66        public static void symbol(Symbol symbol, Delta delta) {
     67                Point2D point = context.getPoint(Rules.feature.geom.centre);
    6868                Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), null, delta);
    6969        }
    70         public static void symbol(Feature feature, Symbol symbol, Scheme scheme, Delta delta) {
    71                 Point2D point = context.getPoint(feature.geom.centre);
     70        public static void symbol(Symbol symbol, Scheme scheme, Delta delta) {
     71                Point2D point = context.getPoint(Rules.feature.geom.centre);
    7272                Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, delta);
    7373        }
    7474       
    75         public static void cluster(Feature feature, ArrayList<Symbol> symbols) {
     75        public static void cluster(ArrayList<Symbol> symbols) {
    7676                Rectangle2D.Double bbox = null;
    7777                if (symbols.size() > 4) {
     
    8686                switch (symbols.size()) {
    8787                case 1:
    88                         symbol(feature, symbols.get(0), new Delta(Handle.CC, new AffineTransform()));
     88                        symbol(symbols.get(0), new Delta(Handle.CC, new AffineTransform()));
    8989                        break;
    9090                case 2:
    91                         symbol(feature, symbols.get(0), new Delta(Handle.RC, new AffineTransform()));
    92                         symbol(feature, symbols.get(1), new Delta(Handle.LC, new AffineTransform()));
     91                        symbol(symbols.get(0), new Delta(Handle.RC, new AffineTransform()));
     92                        symbol(symbols.get(1), new Delta(Handle.LC, new AffineTransform()));
    9393                        break;
    9494                case 3:
    95                         symbol(feature, symbols.get(0), new Delta(Handle.BC, new AffineTransform()));
    96                         symbol(feature, symbols.get(1), new Delta(Handle.TR, new AffineTransform()));
    97                         symbol(feature, symbols.get(2), new Delta(Handle.TL, new AffineTransform()));
     95                        symbol(symbols.get(0), new Delta(Handle.BC, new AffineTransform()));
     96                        symbol(symbols.get(1), new Delta(Handle.TR, new AffineTransform()));
     97                        symbol(symbols.get(2), new Delta(Handle.TL, new AffineTransform()));
    9898                        break;
    9999                case 4:
    100                         symbol(feature, symbols.get(0), new Delta(Handle.BR, new AffineTransform()));
    101                         symbol(feature, symbols.get(1), new Delta(Handle.BL, new AffineTransform()));
    102                         symbol(feature, symbols.get(2), new Delta(Handle.TR, new AffineTransform()));
    103                         symbol(feature, symbols.get(3), new Delta(Handle.TL, new AffineTransform()));
     100                        symbol(symbols.get(0), new Delta(Handle.BR, new AffineTransform()));
     101                        symbol(symbols.get(1), new Delta(Handle.BL, new AffineTransform()));
     102                        symbol(symbols.get(2), new Delta(Handle.TR, new AffineTransform()));
     103                        symbol(symbols.get(3), new Delta(Handle.TL, new AffineTransform()));
    104104                        break;
    105105                case 5:
    106                         symbol(feature, symbols.get(0), new Delta(Handle.BR, new AffineTransform()));
    107                         symbol(feature, symbols.get(1), new Delta(Handle.BL, new AffineTransform()));
    108                         symbol(feature, symbols.get(2), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
    109                         symbol(feature, symbols.get(3), new Delta(Handle.TC, new AffineTransform()));
    110                         symbol(feature, symbols.get(4), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     106                        symbol(symbols.get(0), new Delta(Handle.BR, new AffineTransform()));
     107                        symbol(symbols.get(1), new Delta(Handle.BL, new AffineTransform()));
     108                        symbol(symbols.get(2), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     109                        symbol(symbols.get(3), new Delta(Handle.TC, new AffineTransform()));
     110                        symbol(symbols.get(4), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
    111111                        break;
    112112                case 6:
    113                         symbol(feature, symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
    114                         symbol(feature, symbols.get(1), new Delta(Handle.BC, new AffineTransform()));
    115                         symbol(feature, symbols.get(2), new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
    116                         symbol(feature, symbols.get(3), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
    117                         symbol(feature, symbols.get(4), new Delta(Handle.TC, new AffineTransform()));
    118                         symbol(feature, symbols.get(5), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     113                        symbol(symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     114                        symbol(symbols.get(1), new Delta(Handle.BC, new AffineTransform()));
     115                        symbol(symbols.get(2), new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     116                        symbol(symbols.get(3), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     117                        symbol(symbols.get(4), new Delta(Handle.TC, new AffineTransform()));
     118                        symbol(symbols.get(5), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
    119119                        break;
    120120                case 7:
    121                         symbol(feature, symbols.get(0), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
    122                         symbol(feature, symbols.get(1), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
    123                         symbol(feature, symbols.get(2), new Delta(Handle.CC, new AffineTransform()));
    124                         symbol(feature, symbols.get(3), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
    125                         symbol(feature, symbols.get(4), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
    126                         symbol(feature, symbols.get(5), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
    127                         symbol(feature, symbols.get(6), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
     121                        symbol(symbols.get(0), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
     122                        symbol(symbols.get(1), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     123                        symbol(symbols.get(2), new Delta(Handle.CC, new AffineTransform()));
     124                        symbol(symbols.get(3), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     125                        symbol(symbols.get(4), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
     126                        symbol(symbols.get(5), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
     127                        symbol(symbols.get(6), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
    128128                        break;
    129129                case 8:
    130                         symbol(feature, symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
    131                         symbol(feature, symbols.get(1), new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
    132                         symbol(feature, symbols.get(2), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
    133                         symbol(feature, symbols.get(3), new Delta(Handle.CC, new AffineTransform()));
    134                         symbol(feature, symbols.get(4), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
    135                         symbol(feature, symbols.get(5), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
    136                         symbol(feature, symbols.get(6), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
    137                         symbol(feature, symbols.get(7), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
     130                        symbol(symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
     131                        symbol(symbols.get(1), new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
     132                        symbol(symbols.get(2), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     133                        symbol(symbols.get(3), new Delta(Handle.CC, new AffineTransform()));
     134                        symbol(symbols.get(4), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     135                        symbol(symbols.get(5), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
     136                        symbol(symbols.get(6), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
     137                        symbol(symbols.get(7), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
    138138                        break;
    139139                case 9:
    140                         symbol(feature, symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, -bbox.height/2)));
    141                         symbol(feature, symbols.get(1), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
    142                         symbol(feature, symbols.get(2), new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, -bbox.height/2)));
    143                         symbol(feature, symbols.get(3), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
    144                         symbol(feature, symbols.get(4), new Delta(Handle.CC, new AffineTransform()));
    145                         symbol(feature, symbols.get(5), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
    146                         symbol(feature, symbols.get(6), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
    147                         symbol(feature, symbols.get(7), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
    148                         symbol(feature, symbols.get(8), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
     140                        symbol(symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, -bbox.height/2)));
     141                        symbol(symbols.get(1), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
     142                        symbol(symbols.get(2), new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, -bbox.height/2)));
     143                        symbol(symbols.get(3), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     144                        symbol(symbols.get(4), new Delta(Handle.CC, new AffineTransform()));
     145                        symbol(symbols.get(5), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     146                        symbol(symbols.get(6), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
     147                        symbol(symbols.get(7), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
     148                        symbol(symbols.get(8), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
    149149                        break;
    150150                }
     
    169169        }
    170170
    171         public static void lineSymbols(Feature feature, Symbol prisymb, double space, Symbol secsymb, Symbol tersymb, int ratio, Color col) {
    172                 if ((feature.geom.prim == Pflag.NOSP) || (feature.geom.prim == Pflag.POINT))
     171        public static void lineSymbols(Symbol prisymb, double space, Symbol secsymb, Symbol tersymb, int ratio, Color col) {
     172                if ((Rules.feature.geom.prim == Pflag.NOSP) || (Rules.feature.geom.prim == Pflag.POINT))
    173173                        return;
    174174                Rectangle2D.Double prect = symbolSize(prisymb);
     
    192192                        boolean stflag = false;
    193193                        Symbol symbol = prisymb;
    194                         GeomIterator git = map.new GeomIterator(feature.geom);
     194                        GeomIterator git = map.new GeomIterator(Rules.feature.geom);
    195195                        while (git.hasComp()) {
    196196                                git.nextComp();
     
    253253        }
    254254
    255         public static void lineVector(Feature feature, LineStyle style) {
     255        public static void lineVector(LineStyle style) {
    256256                Path2D.Double p = new Path2D.Double();
    257257                p.setWindingRule(GeneralPath.WIND_EVEN_ODD);
    258258                Point2D point;
    259                 GeomIterator git = map.new GeomIterator(feature.geom);
     259                GeomIterator git = map.new GeomIterator(Rules.feature.geom);
    260260                while (git.hasComp()) {
    261261                        git.nextComp();
     
    278278                        }
    279279                }
    280                 if ((style.fill != null) && (feature.geom.prim == Pflag.AREA)) {
     280                if ((style.fill != null) && (Rules.feature.geom.prim == Pflag.AREA)) {
    281281                        g2.setPaint(style.fill);
    282282                        g2.fill(p);
     
    298298        }
    299299       
    300         public static void lineCircle(Feature feature, LineStyle style, double radius, UniHLU units) {
     300        public static void lineCircle(LineStyle style, double radius, UniHLU units) {
    301301                switch (units) {
    302302                case HLU_FEET:
     
    318318                        break;
    319319                }
    320                 radius *= context.mile(feature);
     320                radius *= context.mile(Rules.feature);
    321321                Symbol circle = new Symbol();
    322322                if (style.fill != null) {
     
    327327                circle.add(new Instr(Form.STRK, new BasicStroke(style.width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, style.dash, 0)));
    328328                circle.add(new Instr(Form.ELPS, new Ellipse2D.Double(-radius,-radius,radius*2,radius*2)));
    329                 Point2D point = context.getPoint(feature.geom.centre);
     329                Point2D point = context.getPoint(Rules.feature.geom.centre);
    330330                Symbols.drawSymbol(g2, circle, 1, point.getX(), point.getY(), null, null);
    331331        }
    332332
    333         public static void fillPattern(Feature feature, BufferedImage image) {
     333        public static void fillPattern(BufferedImage image) {
    334334                Path2D.Double p = new Path2D.Double();
    335335                p.setWindingRule(GeneralPath.WIND_EVEN_ODD);
    336336                Point2D point;
    337                 switch (feature.geom.prim) {
     337                switch (Rules.feature.geom.prim) {
    338338                case POINT:
    339                         point = context.getPoint(feature.geom.centre);
     339                        point = context.getPoint(Rules.feature.geom.centre);
    340340                        g2.drawImage(image, new AffineTransformOp(AffineTransform.getScaleInstance(sScale, sScale), AffineTransformOp.TYPE_NEAREST_NEIGHBOR),
    341341                                        (int)(point.getX() - (50 * sScale)), (int)(point.getY() - (50 * sScale)));
    342342                        break;
    343343                case AREA:
    344                         GeomIterator git = map.new GeomIterator(feature.geom);
     344                        GeomIterator git = map.new GeomIterator(Rules.feature.geom);
    345345                        while (git.hasComp()) {
    346346                                git.nextComp();
     
    365365        }
    366366       
    367         public static void labelText(Feature feature, String str, Font font, Color tc) {
    368                 labelText(feature, str, font, tc, LabelStyle.NONE, null, null, null);
    369         }
    370         public static void labelText(Feature feature, String str, Font font, Color tc, Delta delta) {
    371                 labelText(feature, str, font, tc, LabelStyle.NONE, null, null, delta);
    372         }
    373         public static void labelText(Feature feature, String str, Font font, Color tc, LabelStyle style, Color fg) {
    374                 labelText(feature, str, font, tc, style, fg, null, null);
    375         }
    376         public static void labelText(Feature feature, String str, Font font, Color tc, LabelStyle style, Color fg, Color bg) {
    377                 labelText(feature, str, font, tc, style, fg, bg, null);
    378         }
    379         public static void labelText(Feature feature, String str, Font font, Color tc, LabelStyle style, Color fg, Delta delta) {
    380                 labelText(feature, str, font, tc, style, fg, null, delta);
    381         }
    382         public static void labelText(Feature feature, String str, Font font, Color tc, LabelStyle style, Color fg, Color bg, Delta delta) {
     367        public static void labelText(String str, Font font, Color tc) {
     368                labelText(str, font, tc, LabelStyle.NONE, null, null, null);
     369        }
     370        public static void labelText(String str, Font font, Color tc, Delta delta) {
     371                labelText(str, font, tc, LabelStyle.NONE, null, null, delta);
     372        }
     373        public static void labelText(String str, Font font, Color tc, LabelStyle style, Color fg) {
     374                labelText(str, font, tc, style, fg, null, null);
     375        }
     376        public static void labelText(String str, Font font, Color tc, LabelStyle style, Color fg, Color bg) {
     377                labelText(str, font, tc, style, fg, bg, null);
     378        }
     379        public static void labelText(String str, Font font, Color tc, LabelStyle style, Color fg, Delta delta) {
     380                labelText(str, font, tc, style, fg, null, delta);
     381        }
     382        public static void labelText(String str, Font font, Color tc, LabelStyle style, Color fg, Color bg, Delta delta) {
    383383                if (delta == null) delta = new Delta(Handle.CC);
    384384                if (bg == null) bg = new Color(0x00000000, true);
     
    475475                }
    476476                label.add(new Instr(Form.TEXT, new Caption(str, font, tc, new Delta(Handle.TL, AffineTransform.getTranslateInstance(tx, ty)))));
    477                 Point2D point = context.getPoint(feature.geom.centre);
     477                Point2D point = context.getPoint(Rules.feature.geom.centre);
    478478                Symbols.drawSymbol(g2, label, sScale, point.getX(), point.getY(), null, delta);
    479479        }
    480480
    481         public static void lineText(Feature feature, String str, Font font, Color colour, double offset, double dy) {
     481        public static void lineText(String str, Font font, Color colour, double offset, double dy) {
    482482                if (!str.isEmpty()) {
    483483                        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
     
    493493                        double angle = 0;
    494494                        int index = 0;
    495                         double gwidth = offset * (feature.geom.length * context.mile(feature) - gv.getLogicalBounds().getWidth()) + gv.getGlyphMetrics(0).getAdvance();
    496                         GeomIterator git = map.new GeomIterator(feature.geom);
     495                        double gwidth = offset * (Rules.feature.geom.length * context.mile(Rules.feature) - gv.getLogicalBounds().getWidth()) + gv.getGlyphMetrics(0).getAdvance();
     496                        GeomIterator git = map.new GeomIterator(Rules.feature.geom);
    497497                        while (git.hasComp()) {
    498498                                git.nextComp();
     
    548548        }
    549549       
    550         public static void lightSector(Feature feature, Color col1, Color col2, double radius, double s1, double s2, Double dir, String str) {
     550        public static void lightSector(Color col1, Color col2, double radius, double s1, double s2, Double dir, String str) {
    551551                if ((zoom >= 16) && (radius > 0.2)) {
    552552                        radius /= (Math.pow(2, zoom-15));
     
    555555                g2.setStroke(new BasicStroke((float) (3.0 * sScale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 1, new float[] {20 * (float)sScale, 20 * (float)sScale}, 0));
    556556                g2.setPaint(Color.black);
    557                 Point2D.Double centre = (Point2D.Double) context.getPoint(feature.geom.centre);
    558                 double radial = radius * context.mile(feature);
     557                Point2D.Double centre = (Point2D.Double) context.getPoint(Rules.feature.geom.centre);
     558                double radial = radius * context.mile(Rules.feature);
    559559                if (dir != null) {
    560560                        g2.draw(new Line2D.Double(centre.x, centre.y, centre.x - radial * Math.sin(Math.toRadians(dir)), centre.y + radial * Math.cos(Math.toRadians(dir))));
     
    585585                        if (gv.getLogicalBounds().getWidth() < awidth) {
    586586                                at.rotate(Math.toRadians(mid + (hand ? 0 : 180)));
    587                                 Renderer.labelText(feature, str, font, Color.black, new Delta(Handle.CC, at));
     587                                Renderer.labelText(str, font, Color.black, new Delta(Handle.CC, at));
    588588                        } else if (gv.getLogicalBounds().getHeight() < awidth) {
    589589                                hand = (mid < 180);
    590590                                at.rotate(Math.toRadians(mid + (hand ? -90 : 90)));
    591                                 Renderer.labelText(feature, str, font, Color.black, hand ? new Delta(Handle.RC, at) : new Delta(Handle.LC, at));
     591                                Renderer.labelText(str, font, Color.black, hand ? new Delta(Handle.RC, at) : new Delta(Handle.LC, at));
    592592                        }
    593593                        if (dir != null) {
     
    599599                                at = AffineTransform.getTranslateInstance(-radial * Math.sin(phi) / sScale, radial * Math.cos(phi) / sScale);
    600600                                at.rotate(Math.toRadians(dir + (hand ? 90 : -90)));
    601                                 Renderer.labelText(feature, str, font, Color.black, hand ? new Delta(Handle.BR, at) : new Delta(Handle.BL, at));
     601                                Renderer.labelText(str, font, Color.black, hand ? new Delta(Handle.BR, at) : new Delta(Handle.BL, at));
    602602                        }
    603603                }
  • applications/editors/josm/plugins/seachart/src/render/Rules.java

    r32084 r32090  
    1313import java.awt.Font;
    1414import java.awt.geom.AffineTransform;
     15import java.text.DecimalFormat;
    1516import java.util.ArrayList;
    1617import java.util.EnumMap;
     
    2930public class Rules {
    3031       
     32        static final DecimalFormat df = new DecimalFormat("#.#");
     33
    3134        static final EnumMap<ColCOL, Color> bodyColours = new EnumMap<ColCOL, Color>(ColCOL.class);
    3235        static {
     
    7174        }
    7275
    73         public static void addName(Feature feature, int z, Font font) {
    74                 addName(feature, z, font, Color.black, new Delta(Handle.CC, new AffineTransform()));
    75         }
    76         public static void addName(Feature feature, int z, Font font, Color colour) {
    77                 addName(feature, z, font, colour, new Delta(Handle.CC, new AffineTransform()));
    78         }
    79         public static void addName(Feature feature, int z, Font font, Delta delta) {
    80                 addName(feature, z, font, Color.black, delta);
    81         }
    82         public static void addName(Feature feature, int z, Font font, Color colour, Delta delta) {
     76        public static void addName(int z, Font font) {
     77                addName(z, font, Color.black, new Delta(Handle.CC, new AffineTransform()));
     78        }
     79        public static void addName(int z, Font font, Color colour) {
     80                addName(z, font, colour, new Delta(Handle.CC, new AffineTransform()));
     81        }
     82        public static void addName(int z, Font font, Delta delta) {
     83                addName(z, font, Color.black, delta);
     84        }
     85        public static void addName(int z, Font font, Color colour, Delta delta) {
    8386                if (Renderer.zoom >= z) {
    8487                        String name = getName();
    8588                        if (name != null) {
    86                                 Renderer.labelText(feature, name, font,  colour, delta);
    87                         }
    88                 }
    89         }
    90 
    91         static AttMap getAtts(Feature feature, Obj obj, int idx) {
     89                                Renderer.labelText(name, font,  colour, delta);
     90                        }
     91                }
     92        }
     93
     94        static AttMap getAtts(Obj obj, int idx) {
    9295                HashMap<Integer, AttMap> objs = feature.objs.get(obj);
    9396                if (objs == null)
     
    97100        }
    98101
    99         public static Object getAttVal(Feature feature, Obj obj, int idx, Att att) {
     102        public static Object getAttVal(Obj obj, Att att) {
    100103                AttMap atts;
    101104                HashMap<Integer, AttMap> objs;
    102105                AttVal<?> item;
    103106                if ((objs = feature.objs.get(obj)) != null)
    104                         atts = objs.get(idx);
     107                        atts = objs.get(0);
    105108                else
    106109                        return null;
     
    111114        }
    112115       
    113         public static String getAttStr(Feature feature, Obj obj, int idx, Att att) {
    114                 String str = (String)getAttVal(feature, obj, idx, att);
     116        public static String getAttStr(Obj obj, Att att) {
     117                String str = (String)getAttVal(obj, att);
    115118                if (str != null) {
    116119                        return str;
     
    118121                return "";
    119122        }
    120        
     123
    121124        @SuppressWarnings("unchecked")
    122         public static Enum<?> getAttEnum(Feature feature, Obj obj, int idx, Att att) {
    123                 ArrayList<?> list = (ArrayList<?>)getAttVal(feature, obj, idx, att);
     125        public static Enum<?> getAttEnum(Obj obj, Att att) {
     126                ArrayList<?> list = (ArrayList<?>)getAttVal(obj, att);
    124127                if (list != null) {
    125128                        return ((ArrayList<Enum<?>>)list).get(0);
     
    129132       
    130133        @SuppressWarnings("unchecked")
    131         public static ArrayList<?> getAttList(Feature feature, Obj obj, int idx, Att att) {
    132                 ArrayList<Enum<?>> list = (ArrayList<Enum<?>>)getAttVal(feature, obj, idx, att);
     134        public static ArrayList<?> getAttList(Obj obj, Att att) {
     135                ArrayList<Enum<?>> list = (ArrayList<Enum<?>>)getAttVal(obj, att);
    133136                if (list != null) {
    134137                        return list;
     
    140143       
    141144        @SuppressWarnings("unchecked")
    142         static Scheme getScheme(Feature feature, Obj obj) {
     145        static Scheme getScheme(Obj obj) {
    143146                ArrayList<Color> colours = new ArrayList<Color>();
    144                 for (ColCOL col : (ArrayList<ColCOL>) getAttList(feature, obj, 0, Att.COLOUR)) {
     147                for (ColCOL col : (ArrayList<ColCOL>) getAttList(obj, Att.COLOUR)) {
    145148                        colours.add(bodyColours.get(col));
    146149                }
    147150                ArrayList<Patt> patterns = new ArrayList<Patt>();
    148                 for (ColPAT pat : (ArrayList<ColPAT>) getAttList(feature, obj, 0, Att.COLPAT)) {
     151                for (ColPAT pat : (ArrayList<ColPAT>) getAttList(obj, Att.COLPAT)) {
    149152                        patterns.add(pattMap.get(pat));
    150153                }
    151154                return new Scheme(patterns, colours);
    152155        }
    153        
    154         static boolean testAttribute(Feature feature, Obj obj, int idx, Att att, Object val) {
     156
     157        static boolean hasAttribute(Obj obj, int idx, Att att) {
    155158                AttMap atts;
    156                 if ((atts = getAtts(feature, obj, idx)) != null) {
     159                if ((atts = getAtts(obj, idx)) != null) {
     160                        AttVal<?> item = atts.get(att);
     161                        return item != null;
     162                }
     163                return false;
     164        }
     165       
     166        static boolean testAttribute(Obj obj, Att att, Object val) {
     167                AttMap atts;
     168                if ((atts = getAtts(obj, 0)) != null) {
    157169                        AttVal<?> item = atts.get(att);
    158170                        if (item != null) {
     
    161173                                case A:
    162174                                        return ((String)item.val).equals(val);
     175                                case E:
    163176                                case L:
    164177                                        return ((ArrayList<?>)item.val).contains(val);
    165                                 case E:
    166178                                case F:
    167179                                case I:
    168                                         return item.val.equals(val);
     180                                        return item.val == val;
    169181                                }
    170182                        }
     
    173185        }
    174186       
    175         static Feature feature;
     187        public static Feature feature;
    176188        static ArrayList<Feature> objects;
    177189       
     
    248260                        if (testObject(Obj.CGUSTA)) for (Feature f : objects) if (testFeature(f)) stations();
    249261                        if (testObject(Obj.RDOSTA)) for (Feature f : objects) if (testFeature(f)) stations();
     262                        if (testObject(Obj.RADRFL)) for (Feature f : objects) if (testFeature(f)) stations();
    250263                        if (testObject(Obj.RADSTA)) for (Feature f : objects) if (testFeature(f)) stations();
    251264                        if (testObject(Obj.RTPBCN)) for (Feature f : objects) if (testFeature(f)) stations();
     
    275288                switch (feature.type) {
    276289                case BUAARE:
    277                         Renderer.lineVector(feature, new LineStyle(new Color(0x20000000, true)));
     290                        Renderer.lineVector(new LineStyle(new Color(0x20000000, true)));
    278291                        break;
    279292                case COALNE:
    280293                        if (Renderer.zoom >= 12)
    281                                 Renderer.lineVector(feature, new LineStyle(Color.black, 10));
     294                                Renderer.lineVector(new LineStyle(Color.black, 10));
    282295                        break;
    283296                case DEPARE:
    284297                        Double depmax = 0.0;
    285                         if (((depmax = (Double) getAttVal(feature, Obj.DEPARE, 0, Att.DRVAL2)) != null) && (depmax <= 0.0)) {
    286                                 Renderer.lineVector(feature, new LineStyle(Symbols.Gdries));
     298                        if (((depmax = (Double) getAttVal(Obj.DEPARE, Att.DRVAL2)) != null) && (depmax <= 0.0)) {
     299                                Renderer.lineVector(new LineStyle(Symbols.Gdries));
    287300                        }
    288301                        break;
    289302                case LAKARE:
    290303                        if ((Renderer.zoom >= 12) || (feature.geom.area > 10.0))
    291                                 Renderer.lineVector(feature, new LineStyle(Symbols.Bwater));
     304                                Renderer.lineVector(new LineStyle(Symbols.Bwater));
    292305                        break;
    293306                case DRGARE:
    294307                        if (Renderer.zoom < 16)
    295                                 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, new Color(0x40ffffff, true)));
     308                                Renderer.lineVector(new LineStyle(Color.black, 8, new float[] { 25, 25 }, new Color(0x40ffffff, true)));
    296309                        else
    297                                 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }));
    298                         addName(feature, 12, new Font("Arial", Font.PLAIN, 100), new Delta(Handle.CC, new AffineTransform()));
     310                                Renderer.lineVector(new LineStyle(Color.black, 8, new float[] { 25, 25 }));
     311                        addName(12, new Font("Arial", Font.PLAIN, 100), new Delta(Handle.CC, new AffineTransform()));
    299312                        break;
    300313                case FAIRWY:
    301314                        if (feature.geom.area > 2.0) {
    302315                                if (Renderer.zoom < 16)
    303                                         Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true)));
     316                                        Renderer.lineVector(new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true)));
    304317                                else
    305                                         Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 }));
     318                                        Renderer.lineVector(new LineStyle(Symbols.Mline, 8, new float[] { 50, 50 }));
    306319                        } else {
    307320                                if (Renderer.zoom >= 14)
    308                                         Renderer.lineVector(feature, new LineStyle(new Color(0x40ffffff, true)));
     321                                        Renderer.lineVector(new LineStyle(new Color(0x40ffffff, true)));
    309322                        }
    310323                        break;
     
    313326                case HRBBSN:
    314327                        if (Renderer.zoom >= 12) {
    315                                 Renderer.lineVector(feature, new LineStyle(Color.black, 10, Symbols.Bwater));
     328                                Renderer.lineVector(new LineStyle(Color.black, 10, Symbols.Bwater));
    316329                        } else {
    317                                 Renderer.lineVector(feature, new LineStyle(Symbols.Bwater));
     330                                Renderer.lineVector(new LineStyle(Symbols.Bwater));
    318331                        }
    319332                        break;
     
    321334                        if (feature.objs.get(Obj.HRBBSN) != null) {
    322335                                if (Renderer.zoom >= 12) {
    323                                         Renderer.lineVector(feature, new LineStyle(Color.black, 10, Symbols.Bwater));
     336                                        Renderer.lineVector(new LineStyle(Color.black, 10, Symbols.Bwater));
    324337                                } else {
    325                                         Renderer.lineVector(feature, new LineStyle(Symbols.Bwater));
     338                                        Renderer.lineVector(new LineStyle(Symbols.Bwater));
    326339                                }
    327340                        }
    328341                        break;
    329342                case LNDARE:
    330                         Renderer.lineVector(feature, new LineStyle(Symbols.Yland));
     343                        Renderer.lineVector(new LineStyle(Symbols.Yland));
    331344                        break;
    332345                case MARCUL:
    333346                        if (Renderer.zoom >= 12) {
    334347                                if (Renderer.zoom >= 14) {
    335                                         Renderer.symbol(feature, Areas.MarineFarm);
     348                                        Renderer.symbol(Areas.MarineFarm);
    336349                                }
    337350                                if ((feature.geom.area > 0.2) || ((feature.geom.area > 0.05) && (Renderer.zoom >= 14)) || ((feature.geom.area > 0.005) && (Renderer.zoom >= 16))) {
    338                                         Renderer.lineVector(feature, new LineStyle(Color.black, 4, new float[] { 10, 10 }));
     351                                        Renderer.lineVector(new LineStyle(Color.black, 4, new float[] { 10, 10 }));
    339352                                }
    340353                        }
    341354                        break;
    342355                case OSPARE:
    343                         if (testAttribute(feature, feature.type, 0, Att.CATPRA, CatPRA.PRA_WFRM)) {
    344                                 Renderer.symbol(feature, Areas.WindFarm);
    345                                 Renderer.lineVector(feature, new LineStyle(Color.black, 20, new float[] { 40, 40 }));
    346                                 addName(feature, 15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));
     356                        if (testAttribute(feature.type, Att.CATPRA, CatPRA.PRA_WFRM)) {
     357                                Renderer.symbol(Areas.WindFarm);
     358                                Renderer.lineVector(new LineStyle(Color.black, 20, new float[] { 40, 40 }));
     359                                addName(15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));
    347360                        }
    348361                        break;
     
    350363                case MIPARE:
    351364                        if (Renderer.zoom >= 12) {
    352                                 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Symbols.Mline);
    353                                 if (testAttribute(feature, feature.type, 0, Att.CATREA, CatREA.REA_NWAK)) {
    354                                         Renderer.symbol(feature, Areas.NoWake);
     365                                Renderer.lineSymbols(Areas.Restricted, 1.0, null, null, 0, Symbols.Mline);
     366                                if (testAttribute(feature.type, Att.CATREA, CatREA.REA_NWAK)) {
     367                                        Renderer.symbol(Areas.NoWake);
    355368                                }
    356369                        }
     
    358371                case PRCARE:
    359372                        if (Renderer.zoom >= 12) {
    360                                 Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 10, new float[] { 40, 40 }));
     373                                Renderer.lineVector(new LineStyle(Symbols.Mline, 10, new float[] { 40, 40 }));
    361374                        }
    362375                        break;
    363376                case SEAARE:
    364                         switch ((CatSEA) getAttEnum(feature, feature.type, 0, Att.CATSEA)) {
     377                        switch ((CatSEA) getAttEnum(feature.type, Att.CATSEA)) {
    365378                        case SEA_RECH:
    366379                                if ((Renderer.zoom >= 10) && (name != null))
    367380                                        if (feature.geom.prim == Pflag.LINE) {
    368                                                 Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40);
     381                                                Renderer.lineText(name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40);
    369382                                        } else {
    370                                                 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
     383                                                Renderer.labelText(name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
    371384                                        }
    372385                                break;
     
    374387                                if ((Renderer.zoom >= 12) && (name != null))
    375388                                        if (feature.geom.prim == Pflag.LINE) {
    376                                                 Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40);
     389                                                Renderer.lineText(name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40);
    377390                                        } else {
    378                                                 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
     391                                                Renderer.labelText(name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
    379392                                        }
    380393                                break;
     
    382395                                if (Renderer.zoom >= 14) {
    383396                                        if (feature.geom.prim == Pflag.AREA) {
    384                                                 Renderer.lineVector(feature, new LineStyle(new Color(0xc480ff), 4, new float[] { 25, 25 }));
     397                                                Renderer.lineVector(new LineStyle(new Color(0xc480ff), 4, new float[] { 25, 25 }));
    385398                                                if (name != null) {
    386                                                         Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
    387                                                         Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC));
     399                                                        Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
     400                                                        Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC));
    388401                                                }
    389402                                        } else if (feature.geom.prim == Pflag.LINE) {
    390403                                                if (name != null) {
    391                                                         Renderer.lineText(feature, name, new Font("Arial", Font.ITALIC, 75), Color.black, 0.5, -40);
    392                                                         Renderer.lineText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5, 0);
     404                                                        Renderer.lineText(name, new Font("Arial", Font.ITALIC, 75), Color.black, 0.5, -40);
     405                                                        Renderer.lineText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5, 0);
    393406                                                }
    394407                                        } else {
    395408                                                if (name != null) {
    396                                                         Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
    397                                                         Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC));
     409                                                        Renderer.labelText(name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
     410                                                        Renderer.labelText("(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC));
    398411                                                }
    399412                                        }
     
    402415                        case SEA_GAT:
    403416                        case SEA_NRRW:
    404                                 addName(feature, 12, new Font("Arial", Font.PLAIN, 100));
     417                                addName(12, new Font("Arial", Font.PLAIN, 100));
    405418                                break;
    406419                        default:
     
    409422                        break;
    410423                case SNDWAV:
    411                         if (Renderer.zoom >= 12) Renderer.fillPattern(feature, Areas.Sandwaves);
     424                        if (Renderer.zoom >= 12) Renderer.fillPattern(Areas.Sandwaves);
    412425                        break;
    413426                case SPLARE:
    414427                        if (Renderer.zoom >= 12) {
    415                                 Renderer.symbol(feature, Areas.Plane, new Scheme(Symbols.Msymb));
    416                                 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Symbols.Mline);
    417                         }
    418                         addName(feature, 15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
     428                                Renderer.symbol(Areas.Plane, new Scheme(Symbols.Msymb));
     429                                Renderer.lineSymbols(Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Symbols.Mline);
     430                        }
     431                        addName(15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
    419432                        break;
    420433                default:
     
    426439        private static void beacons() {
    427440                if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BCNLAT) || (feature.type == Obj.BCNCAR)))) {
    428                         BcnSHP shape = (BcnSHP)getAttEnum(feature, feature.type, 0, Att.BCNSHP);
     441                        BcnSHP shape = (BcnSHP)getAttEnum(feature.type, Att.BCNSHP);
    429442                        if (shape == BcnSHP.BCN_UNKN)
    430443                                shape = BcnSHP.BCN_PILE;
    431444                        if ((shape == BcnSHP.BCN_WTHY) && (feature.type == Obj.BCNLAT)) {
    432                                 switch ((CatLAM) getAttEnum(feature, feature.type, 0, Att.CATLAM)) {
     445                                switch ((CatLAM) getAttEnum(feature.type, Att.CATLAM)) {
    433446                                case LAM_PORT:
    434                                         Renderer.symbol(feature, Beacons.WithyPort);
     447                                        Renderer.symbol(Beacons.WithyPort);
    435448                                        break;
    436449                                case LAM_STBD:
    437                                         Renderer.symbol(feature, Beacons.WithyStarboard);
     450                                        Renderer.symbol(Beacons.WithyStarboard);
    438451                                        break;
    439452                                default:
    440                                         Renderer.symbol(feature, Beacons.Stake, getScheme(feature, feature.type));
     453                                        Renderer.symbol(Beacons.Stake, getScheme(feature.type));
    441454                                }
    442455                        } else if ((shape == BcnSHP.BCN_PRCH) && (feature.type == Obj.BCNLAT) && !(feature.objs.containsKey(Obj.TOPMAR))) {
    443                                 switch ((CatLAM) getAttEnum(feature, feature.type, 0, Att.CATLAM)) {
     456                                switch ((CatLAM) getAttEnum(feature.type, Att.CATLAM)) {
    444457                                case LAM_PORT:
    445                                         Renderer.symbol(feature, Beacons.PerchPort);
     458                                        Renderer.symbol(Beacons.PerchPort);
    446459                                        break;
    447460                                case LAM_STBD:
    448                                         Renderer.symbol(feature, Beacons.PerchStarboard);
     461                                        Renderer.symbol(Beacons.PerchStarboard);
    449462                                        break;
    450463                                default:
    451                                         Renderer.symbol(feature, Beacons.Stake, getScheme(feature, feature.type));
     464                                        Renderer.symbol(Beacons.Stake, getScheme(feature.type));
    452465                                }
    453466                        } else {
    454                                 Renderer.symbol(feature, Beacons.Shapes.get(shape), getScheme(feature, feature.type));
     467                                Renderer.symbol(Beacons.Shapes.get(shape), getScheme(feature.type));
    455468                                if (feature.objs.containsKey(Obj.TOPMAR)) {
    456469                                        AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
    457470                                        if (topmap.containsKey(Att.TOPSHP)) {
    458                                                 Renderer.symbol(feature, Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(feature, Obj.TOPMAR), Topmarks.BeaconDelta);
     471                                                Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.BeaconDelta);
    459472                                        }
    460473                                } else if (feature.objs.containsKey(Obj.DAYMAR)) {
    461474                                        AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
    462475                                        if (topmap.containsKey(Att.TOPSHP)) {
    463                                                 Renderer.symbol(feature, Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(feature, Obj.DAYMAR), Topmarks.BeaconDelta);
    464                                         }
    465                                 }
    466                         }
    467                         addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
    468                         Signals.addSignals(feature);
     476                                                Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.BeaconDelta);
     477                                        }
     478                                }
     479                        }
     480                        addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
     481                        Signals.addSignals();
    469482                }
    470483        }
     
    473486        private static void buoys() {
    474487                if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BOYLAT) || (feature.type == Obj.BOYCAR)))) {
    475                         BoySHP shape = (BoySHP) getAttEnum(feature, feature.type, 0, Att.BOYSHP);
     488                        BoySHP shape = (BoySHP) getAttEnum(feature.type, Att.BOYSHP);
    476489                        if (shape == BoySHP.BOY_UNKN) shape = BoySHP.BOY_PILR;
    477                         Renderer.symbol(feature, Buoys.Shapes.get(shape), getScheme(feature, feature.type));
     490                        Renderer.symbol(Buoys.Shapes.get(shape), getScheme(feature.type));
    478491                        if (feature.objs.containsKey(Obj.TOPMAR)) {
    479492                                AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
    480493                                if (topmap.containsKey(Att.TOPSHP)) {
    481                                         Renderer.symbol(feature, Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(feature, Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape));
     494                                        Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape));
    482495                                }
    483496                        } else if (feature.objs.containsKey(Obj.DAYMAR)) {
    484497                                AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
    485498                                if (topmap.containsKey(Att.TOPSHP)) {
    486                                         Renderer.symbol(feature, Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(feature, Obj.DAYMAR), Topmarks.BuoyDeltas.get(shape));
    487                                 }
    488                         }
    489                         addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
    490                         Signals.addSignals(feature);
     499                                        Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.BuoyDeltas.get(shape));
     500                                }
     501                        }
     502                        addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
     503                        Signals.addSignals();
    491504                }
    492505        }
     
    520533                                }
    521534                                if (hstr.isEmpty() && !vstr.isEmpty()) {
    522                                         Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC));
     535                                        Renderer.labelText(vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC));
    523536                                } else if (!hstr.isEmpty() && !vstr.isEmpty()) {
    524                                         Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.BC));
    525                                         Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.TC));
     537                                        Renderer.labelText(vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.BC));
     538                                        Renderer.labelText(hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.TC));
    526539                                } else if (!hstr.isEmpty() && vstr.isEmpty()) {
    527                                         Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.CC));
     540                                        Renderer.labelText(hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.CC));
    528541                                }
    529542                        }
     
    534547                if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) {
    535548                        if (feature.type == Obj.CBLSUB) {
    536                                 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Symbols.Mline);
     549                                Renderer.lineSymbols(Areas.Cable, 0.0, null, null, 0, Symbols.Mline);
    537550                        } else if (feature.type == Obj.CBLOHD) {
    538551                                AttMap atts = feature.objs.get(Obj.CBLOHD).get(0);
    539552                                if ((atts != null) && (atts.containsKey(Att.CATCBL)) && (atts.get(Att.CATCBL).val == CatCBL.CBL_POWR)) {
    540                                         Renderer.lineSymbols(feature, Areas.CableDash, 0, Areas.CableDot, Areas.CableFlash, 2, Color.black);
     553                                        Renderer.lineSymbols(Areas.CableDash, 0, Areas.CableDot, Areas.CableFlash, 2, Color.black);
    541554                                } else {
    542                                         Renderer.lineSymbols(feature, Areas.CableDash, 0, Areas.CableDot, null, 2, Color.black);
     555                                        Renderer.lineSymbols(Areas.CableDash, 0, Areas.CableDot, null, 2, Color.black);
    543556                                }
    544557                                if (atts != null) {
    545558                                        if (atts.containsKey(Att.VERCLR)) {
    546                                                 Renderer.labelText(feature, String.valueOf((Double) atts.get(Att.VERCLR).val), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
     559                                                Renderer.labelText(String.valueOf((Double) atts.get(Att.VERCLR).val), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
    547560                                        } else if (atts.containsKey(Att.VERCSA)) {
    548                                                 Renderer.labelText(feature, String.valueOf((Double) atts.get(Att.VERCSA).val), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.PCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
     561                                                Renderer.labelText(String.valueOf((Double) atts.get(Att.VERCSA).val), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.PCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
    549562                                        }
    550563                                }
     
    556569                if (Renderer.zoom >= 14) {
    557570                        Symbol symb = Harbours.CallPoint2;
    558                         TrfTRF trf = (TrfTRF) getAttEnum(feature, feature.type, 0, Att.TRAFIC);
     571                        TrfTRF trf = (TrfTRF) getAttEnum(feature.type, Att.TRAFIC);
    559572                        if (trf != TrfTRF.TRF_TWOW) {
    560573                                symb = Harbours.CallPoint1;
    561574                        }
    562575                        Double orient = 0.0;
    563                         if ((orient = (Double) getAttVal(feature, feature.type, 0, Att.ORIENT)) == null) {
     576                        if ((orient = (Double) getAttVal(feature.type, Att.ORIENT)) == null) {
    564577                                orient = 0.0;
    565578                        }
    566                         Renderer.symbol(feature, symb, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(orient))));
     579                        Renderer.symbol(symb, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(orient))));
    567580                        String chn;
    568                         if (!(chn = getAttStr(feature, feature.type, 0, Att.COMCHA)).isEmpty()) {
    569                                 Renderer.labelText(feature, ("Ch." + chn), new Font("Arial", Font.PLAIN, 50), Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,50)));
     581                        if (!(chn = getAttStr(feature.type, Att.COMCHA)).isEmpty()) {
     582                                Renderer.labelText(("Ch." + chn), new Font("Arial", Font.PLAIN, 50), Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,50)));
    570583                        }
    571584                }
     
    574587        private static void distances() {
    575588                if (Renderer.zoom >= 14) {
    576                         if (!testAttribute(feature, Obj.DISMAR, 0, Att.CATDIS, CatDIS.DIS_NONI)) {
    577                                 Renderer.symbol(feature, Harbours.DistanceI);
     589                        if (!testAttribute(Obj.DISMAR, Att.CATDIS, CatDIS.DIS_NONI)) {
     590                                Renderer.symbol(Harbours.DistanceI);
    578591                        } else {
    579                                 Renderer.symbol(feature, Harbours.DistanceU);
     592                                Renderer.symbol(Harbours.DistanceU);
    580593                        }
    581594                        if (Renderer.zoom >= 15) {
    582                                 AttMap atts = getAtts(feature, Obj.DISMAR, 0);
     595                                AttMap atts = getAtts(Obj.DISMAR, 0);
    583596                                if ((atts != null) && (atts.containsKey(Att.WTWDIS))) {
    584597                                        Double dist = (Double) atts.get(Att.WTWDIS).val;
     
    609622                                        }
    610623                                        str += String.format("%1.0f", dist);
    611                                         Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45)));
     624                                        Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45)));
    612625                                }
    613626                        }
     
    616629       
    617630        private static void floats() {
    618                 switch (feature.type) {
    619                 case LITVES:
    620                         Renderer.symbol(feature, Buoys.Super, getScheme(feature, feature.type));
    621                         break;
    622                 case LITFLT:
    623                         Renderer.symbol(feature, Buoys.Float, getScheme(feature, feature.type));
    624                         break;
    625                 case BOYINB:
    626                         Renderer.symbol(feature, Buoys.Super, getScheme(feature, feature.type));
    627                         break;
    628                 default:
    629                         break;
    630                 }
    631                 if (feature.objs.get(Obj.TOPMAR) != null)
    632                         Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.FloatDelta);
    633                 addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
    634                 Signals.addSignals(feature);
     631                if (Renderer.zoom >= 12) {
     632                        switch (feature.type) {
     633                        case LITVES:
     634                                Renderer.symbol(Buoys.Super, getScheme(feature.type));
     635                                break;
     636                        case LITFLT:
     637                                Renderer.symbol(Buoys.Float, getScheme(feature.type));
     638                                break;
     639                        case BOYINB:
     640                                Renderer.symbol(Buoys.Super, getScheme(feature.type));
     641                                break;
     642                        default:
     643                                break;
     644                        }
     645                        if (feature.objs.get(Obj.TOPMAR) != null)
     646                                Renderer.symbol(Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(Obj.TOPMAR), Topmarks.FloatDelta);
     647                        addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
     648                        Signals.addSignals();
     649                }
    635650        }
    636651       
    637652        private static void gauges() {
    638653                if (Renderer.zoom >= 14) {
    639                         Renderer.symbol(feature, Harbours.TideGauge);
    640                         addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
    641                         Signals.addSignals(feature);
     654                        Renderer.symbol(Harbours.TideGauge);
     655                        addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
     656                        Signals.addSignals();
    642657                }
    643658        }
     
    649664                case ACHBRT:
    650665                        if (Renderer.zoom >= 14) {
    651                                 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Symbols.Mline));
     666                                Renderer.symbol(Harbours.Anchorage, new Scheme(Symbols.Mline));
    652667                                if (Renderer.zoom >= 15) {
    653                                         Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Symbols.Msymb, LabelStyle.RRCT, Symbols.Mline, Color.white, new Delta(Handle.BC));
    654                                 }
    655                         }
    656                         if (getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS) != null) {
     668                                        Renderer.labelText(name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Symbols.Msymb, LabelStyle.RRCT, Symbols.Mline, Color.white, new Delta(Handle.BC));
     669                                }
     670                        }
     671                        if (getAttVal(Obj.ACHBRT, Att.RADIUS) != null) {
    657672                                double radius;
    658                                 if ((radius = (Double) getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS)) != 0) {
    659                                         UniHLU units = (UniHLU) getAttEnum(feature, Obj.ACHBRT, 0, Att.HUNITS);
     673                                if ((radius = (Double) getAttVal(Obj.ACHBRT, Att.RADIUS)) != 0) {
     674                                        UniHLU units = (UniHLU) getAttEnum(Obj.ACHBRT, Att.HUNITS);
    660675                                        if (units == UniHLU.HLU_UNKN) {
    661676                                                units = UniHLU.HLU_METR;
    662677                                        }
    663                                         Renderer.lineCircle(feature, new LineStyle(Symbols.Mline, 4, new float[] { 10, 10 }, null), radius, units);
     678                                        Renderer.lineCircle(new LineStyle(Symbols.Mline, 4, new float[] { 10, 10 }, null), radius, units);
    664679                                }
    665680                        }
     
    668683                        if (Renderer.zoom >= 12) {
    669684                                if (feature.geom.prim != Pflag.AREA) {
    670                                         Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Color.black));
     685                                        Renderer.symbol(Harbours.Anchorage, new Scheme(Color.black));
    671686                                } else {
    672                                         Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Symbols.Mline));
    673                                         Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Symbols.Mline);
    674                                 }
    675                                 addName(feature, 15, new Font("Arial", Font.BOLD, 60), Symbols.Mline, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
    676                                 ArrayList<StsSTS> sts = (ArrayList<StsSTS>)getAttList(feature, Obj.ACHARE, 0, Att.STATUS);
     687                                        Renderer.symbol(Harbours.Anchorage, new Scheme(Symbols.Mline));
     688                                        Renderer.lineSymbols(Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Symbols.Mline);
     689                                }
     690                                addName(15, new Font("Arial", Font.BOLD, 60), Symbols.Mline, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
     691                                ArrayList<StsSTS> sts = (ArrayList<StsSTS>) getAttList(Obj.ACHARE, Att.STATUS);
    677692                                if ((Renderer.zoom >= 15) && (sts.contains(StsSTS.STS_RESV))) {
    678                                         Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), Symbols.Mline, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));
    679                                 }
    680                         }
    681                         ArrayList<CatACH> cats = (ArrayList<CatACH>) getAttList(feature, Obj.ACHARE, 0, Att.CATACH);
    682                         int dy = (cats.size() - 1) * -30;
    683                         for (CatACH cat : cats) {
    684                                 switch (cat) {
    685                                 case ACH_DEEP:
    686                                         Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    687                                         dy += 60;
    688                                         break;
    689                                 case ACH_TANK:
    690                                         Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    691                                         dy += 60;
    692                                         break;
    693                                 case ACH_H24P:
    694                                         Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    695                                         dy += 60;
    696                                         break;
    697                                 case ACH_EXPL:
    698                                         Renderer.symbol(feature, Harbours.Explosives, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    699                                         dy += 60;
    700                                         break;
    701                                 case ACH_QUAR:
    702                                         Renderer.symbol(feature, Harbours.Hospital, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    703                                         dy += 60;
    704                                         break;
    705                                 case ACH_SEAP:
    706                                         Renderer.symbol(feature, Areas.Seaplane, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    707                                         dy += 60;
    708                                         break;
    709                                 default:
     693                                        Renderer.labelText("Reserved", new Font("Arial", Font.PLAIN, 50), Symbols.Mline, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));
     694                                }
     695                                ArrayList<CatACH> cats = (ArrayList<CatACH>) getAttList(Obj.ACHARE, Att.CATACH);
     696                                int dy = (cats.size() - 1) * -30;
     697                                for (CatACH cat : cats) {
     698                                        switch (cat) {
     699                                        case ACH_DEEP:
     700                                                Renderer.labelText("DW", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     701                                                dy += 60;
     702                                                break;
     703                                        case ACH_TANK:
     704                                                Renderer.labelText("Tanker", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     705                                                dy += 60;
     706                                                break;
     707                                        case ACH_H24P:
     708                                                Renderer.labelText("24h", new Font("Arial", Font.BOLD, 50), Symbols.Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     709                                                dy += 60;
     710                                                break;
     711                                        case ACH_EXPL:
     712                                                Renderer.symbol(Harbours.Explosives, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     713                                                dy += 60;
     714                                                break;
     715                                        case ACH_QUAR:
     716                                                Renderer.symbol(Harbours.Hospital, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     717                                                dy += 60;
     718                                                break;
     719                                        case ACH_SEAP:
     720                                                Renderer.symbol(Areas.Seaplane, new Scheme(Symbols.Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     721                                                dy += 60;
     722                                                break;
     723                                        default:
     724                                        }
    710725                                }
    711726                        }
     
    713728                case BERTHS:
    714729                        if (Renderer.zoom >= 14) {
    715                                 Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 6, new float[] { 20, 20 }));
    716                                 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, LabelStyle.RRCT, Symbols.Mline, Color.white);
     730                                Renderer.lineVector(new LineStyle(Symbols.Mline, 6, new float[] { 20, 20 }));
     731                                Renderer.labelText(name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, LabelStyle.RRCT, Symbols.Mline, Color.white);
    717732                        }
    718733                        break;
     
    720735                        if (Renderer.zoom >= 16) {
    721736                                ArrayList<Symbol> symbols = new ArrayList<Symbol>();
    722                                 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttList(feature, Obj.BUISGL, 0, Att.FUNCTN);
     737                                ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttList(Obj.BUISGL, Att.FUNCTN);
    723738                                for (FncFNC fnc : fncs) {
    724739                                        symbols.add(Landmarks.Funcs.get(fnc));
    725740                                }
    726741                                if (feature.objs.containsKey(Obj.SMCFAC)) {
    727                                         ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(feature, Obj.SMCFAC, 0, Att.CATSCF);
     742                                        ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(Obj.SMCFAC, Att.CATSCF);
    728743                                        for (CatSCF scf : scfs) {
    729744                                                symbols.add(Facilities.Cats.get(scf));
    730745                                        }
    731746                                }
    732                                 Renderer.cluster(feature, symbols);
     747                                Renderer.cluster(symbols);
    733748                        }
    734749                        break;
    735750                case HRBFAC:
    736751                        if (Renderer.zoom >= 12) {
    737                                 ArrayList<CatHAF> cathaf = (ArrayList<CatHAF>) getAttList(feature, Obj.HRBFAC, 0, Att.CATHAF);
     752                                ArrayList<CatHAF> cathaf = (ArrayList<CatHAF>) getAttList(Obj.HRBFAC, Att.CATHAF);
    738753                                if (cathaf.size() == 1) {
    739754                                        switch (cathaf.get(0)) {
    740755                                        case HAF_MRNA:
    741                                                 Renderer.symbol(feature, Harbours.Marina);
     756                                                Renderer.symbol(Harbours.Marina);
    742757                                                break;
    743758                                        case HAF_MANF:
    744                                                 Renderer.symbol(feature, Harbours.MarinaNF);
     759                                                Renderer.symbol(Harbours.MarinaNF);
    745760                                                break;
    746761                                        case HAF_FISH:
    747                                                 Renderer.symbol(feature, Harbours.Fishing);
     762                                                Renderer.symbol(Harbours.Fishing);
    748763                                                break;
    749764                                        default:
    750                                                 Renderer.symbol(feature, Harbours.Harbour);
     765                                                Renderer.symbol(Harbours.Harbour);
    751766                                                break;
    752767                                        }
    753768                                } else {
    754                                         Renderer.symbol(feature, Harbours.Harbour);
     769                                        Renderer.symbol(Harbours.Harbour);
    755770                                }
    756771                        }
     
    765780                switch (feature.type) {
    766781                case ROADWY:
    767                         ArrayList<CatROD> cat = (ArrayList<CatROD>) (getAttList(feature, Obj.ROADWY, 0, Att.CATROD));
     782                        ArrayList<CatROD> cat = (ArrayList<CatROD>) (getAttList(Obj.ROADWY, Att.CATROD));
    768783                        if (cat.size() > 0) {
    769784                                switch (cat.get(0)) {
    770785                                case ROD_MWAY:
    771                                         Renderer.lineVector(feature, new LineStyle(Color.black, 20));
     786                                        Renderer.lineVector(new LineStyle(Color.black, 20));
    772787                                        break;
    773788                                case ROD_MAJR:
    774                                         Renderer.lineVector(feature, new LineStyle(Color.black, 15));
     789                                        Renderer.lineVector(new LineStyle(Color.black, 15));
    775790                                        break;
    776791                                case ROD_MINR:
    777                                         Renderer.lineVector(feature, new LineStyle(Color.black, 10));
     792                                        Renderer.lineVector(new LineStyle(Color.black, 10));
    778793                                        break;
    779794                                default:
    780                                         Renderer.lineVector(feature, new LineStyle(Color.black, 5));
     795                                        Renderer.lineVector(new LineStyle(Color.black, 5));
    781796                                }
    782797                        } else {
    783                                 Renderer.lineVector(feature, new LineStyle(Color.black, 5));
     798                                Renderer.lineVector(new LineStyle(Color.black, 5));
    784799                        }
    785800                        break;
    786801                case RAILWY:
    787                         Renderer.lineVector(feature, new LineStyle(Color.gray, 10));
    788                         Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 30, 30 }));
     802                        Renderer.lineVector(new LineStyle(Color.gray, 10));
     803                        Renderer.lineVector(new LineStyle(Color.black, 10, new float[] { 30, 30 }));
    789804                        break;
    790805                default:
     
    794809        @SuppressWarnings("unchecked")
    795810        private static void landmarks() {
    796                 ArrayList<CatLMK> cats = (ArrayList<CatLMK>) getAttList(feature, feature.type, 0, Att.CATLMK);
    797                 Symbol catSym = Landmarks.Shapes.get(cats.get(0));
    798                 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttList(feature, feature.type, 0, Att.FUNCTN);
    799                 Symbol fncSym = Landmarks.Funcs.get(fncs.get(0));
    800                 if ((fncs.get(0) == FncFNC.FNC_CHCH) && (cats.get(0) == CatLMK.LMK_TOWR))
    801                         catSym = Landmarks.ChurchTower;
    802                 if ((cats.get(0) == CatLMK.LMK_UNKN) && (fncs.get(0) == FncFNC.FNC_UNKN) && (feature.objs.get(Obj.LIGHTS) != null))
    803                         catSym = Beacons.LightMajor;
    804                 if (cats.get(0) == CatLMK.LMK_RADR)
    805                         fncSym = Landmarks.RadioTV;
    806                 Renderer.symbol(feature, catSym);
    807                 Renderer.symbol(feature, fncSym);
    808                 addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
    809                 Signals.addSignals(feature);
    810         }
    811        
     811                if (Renderer.zoom >= 12) {
     812                        ArrayList<CatLMK> cats = (ArrayList<CatLMK>) getAttList(feature.type, Att.CATLMK);
     813                        Symbol catSym = Landmarks.Shapes.get(cats.get(0));
     814                        ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttList(feature.type, Att.FUNCTN);
     815                        Symbol fncSym = Landmarks.Funcs.get(fncs.get(0));
     816                        if ((fncs.get(0) == FncFNC.FNC_CHCH) && (cats.get(0) == CatLMK.LMK_TOWR))
     817                                catSym = Landmarks.ChurchTower;
     818                        if ((cats.get(0) == CatLMK.LMK_UNKN) && (fncs.get(0) == FncFNC.FNC_UNKN) && (feature.objs.get(Obj.LIGHTS) != null))
     819                                catSym = Beacons.LightMajor;
     820                        if (cats.get(0) == CatLMK.LMK_RADR)
     821                                fncSym = Landmarks.RadioTV;
     822                        Renderer.symbol(catSym);
     823                        Renderer.symbol(fncSym);
     824                        if (Renderer.zoom >= 15)
     825                                addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
     826                        Signals.addSignals();
     827                }
     828        }
     829       
     830        @SuppressWarnings("unchecked")
    812831        private static void lights() {
    813832                switch (feature.type) {
    814833                case LITMAJ:
    815                         Renderer.symbol(feature, Beacons.LightMajor);
     834                        Renderer.symbol(Beacons.LightMajor);
    816835                        break;
    817836                case LITMIN:
    818837                case LIGHTS:
    819                         Renderer.symbol(feature, Beacons.LightMinor);
     838                        Renderer.symbol(Beacons.LightMinor);
    820839                        break;
    821840                case PILPNT:
    822841                        if (feature.objs.containsKey(Obj.LIGHTS))
    823                                 Renderer.symbol(feature, Beacons.LightMinor);
     842                                Renderer.symbol(Beacons.LightMinor);
    824843                        else
    825                                 Renderer.symbol(feature, Harbours.Post);
     844                                Renderer.symbol(Harbours.Post);
    826845                        break;
    827846                default:
     
    829848                }
    830849                if (feature.objs.containsKey(Obj.TOPMAR)) {
    831                         Symbol topmark = Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val);
    832                         if (topmark != null)
    833                                 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.LightDelta);
     850                        AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0);
     851                        if (topmap.containsKey(Att.TOPSHP)) {
     852                                Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.TOPMAR), Topmarks.LightDelta);
     853                        }
    834854                } else  if (feature.objs.containsKey(Obj.DAYMAR)) {
    835                         Symbol topmark = Topmarks.Shapes.get(feature.objs.get(Obj.DAYMAR).get(0).get(Att.TOPSHP).val);
    836                         if (topmark != null)
    837                                 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.DAYMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.DAYMAR), Topmarks.LightDelta);
    838                 }
    839                 Signals.addSignals(feature);
     855                        AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0);
     856                        if (topmap.containsKey(Att.TOPSHP)) {
     857                                Renderer.symbol(Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(Obj.DAYMAR), Topmarks.LightDelta);
     858                        }
     859                }
     860                Signals.addSignals();
    840861        }
    841862
     
    844865                if (Renderer.zoom >= 16) {
    845866                        ArrayList<Symbol> symbols = new ArrayList<Symbol>();
    846                         ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(feature, Obj.SMCFAC, 0, Att.CATSCF);
     867                        ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(Obj.SMCFAC, Att.CATSCF);
    847868                        for (CatSCF scf : scfs) {
    848869                                symbols.add(Facilities.Cats.get(scf));
    849870                        }
    850                         Renderer.cluster(feature, symbols);
     871                        Renderer.cluster(symbols);
    851872                }
    852873        }
    853874       
    854875        private static void moorings() {
    855                 switch ((CatMOR) getAttEnum(feature, feature.type, 0, Att.CATMOR)) {
    856                 case MOR_DLPN:
    857                         Renderer.symbol(feature, Harbours.Dolphin);
    858                         break;
    859                 case MOR_DDPN:
    860                         Renderer.symbol(feature, Harbours.DeviationDolphin);
    861                         break;
    862                 case MOR_BLRD:
    863                 case MOR_POST:
    864                         Renderer.symbol(feature, Harbours.Bollard);
    865                         break;
    866                 case MOR_BUOY:
    867                         BoySHP shape = (BoySHP) getAttEnum(feature, feature.type, 0, Att.BOYSHP);
    868                         if (shape == BoySHP.BOY_UNKN) {
    869                                 shape = BoySHP.BOY_SPHR;
    870                         }
    871                         Renderer.symbol(feature, Buoys.Shapes.get(shape), getScheme(feature, feature.type));
    872                         Renderer.symbol(feature, Topmarks.TopMooring, Topmarks.BuoyDeltas.get(shape));
    873                         break;
    874                 default:
    875                         break;
    876                 }
    877                 Signals.addSignals(feature);
     876                if (Renderer.zoom >= 14) {
     877                        switch ((CatMOR) getAttEnum(feature.type, Att.CATMOR)) {
     878                        case MOR_DLPN:
     879                                Renderer.symbol(Harbours.Dolphin);
     880                                break;
     881                        case MOR_DDPN:
     882                                Renderer.symbol(Harbours.DeviationDolphin);
     883                                break;
     884                        case MOR_BLRD:
     885                        case MOR_POST:
     886                                Renderer.symbol(Harbours.Bollard);
     887                                break;
     888                        case MOR_BUOY:
     889                                BoySHP shape = (BoySHP) getAttEnum(feature.type, Att.BOYSHP);
     890                                if (shape == BoySHP.BOY_UNKN) {
     891                                        shape = BoySHP.BOY_SPHR;
     892                                }
     893                                Renderer.symbol(Buoys.Shapes.get(shape), getScheme(feature.type));
     894                                Renderer.symbol(Topmarks.TopMooring, Topmarks.BuoyDeltas.get(shape));
     895                                break;
     896                        default:
     897                                break;
     898                        }
     899                        Signals.addSignals();
     900                }
    878901        }
    879902
     
    902925                        int n = objs.size();
    903926                        if (n > 5) {
    904                                 Renderer.symbol(feature, Notices.Notice, new Delta(Handle.CC, AffineTransform.getTranslateInstance(dx, dy)));
     927                                Renderer.symbol(Notices.Notice, new Delta(Handle.CC, AffineTransform.getTranslateInstance(dx, dy)));
    905928                        } else {
    906929                                int i = 0;
     
    937960                                                break;
    938961                                        }
    939                                         if (h != null) Renderer.symbol(feature, sym, new Delta(h, AffineTransform.getTranslateInstance(dx, dy)));
     962                                        if (h != null) Renderer.symbol(sym, new Delta(h, AffineTransform.getTranslateInstance(dx, dy)));
    940963                                        i++;
    941964                                }
     
    946969        private static void obstructions() {
    947970                if ((Renderer.zoom >= 12) && (feature.type == Obj.OBSTRN)) {
    948                         switch ((CatOBS) getAttEnum(feature, feature.type, 0, Att.CATOBS)) {
     971                        switch ((CatOBS) getAttEnum(feature.type, Att.CATOBS)) {
    949972                        case OBS_BOOM:
    950                                 Renderer.lineVector(feature, new LineStyle(Color.black, 5, new float[] { 20, 20 }, null));
     973                                Renderer.lineVector(new LineStyle(Color.black, 5, new float[] { 20, 20 }, null));
    951974                                if (Renderer.zoom >= 15) {
    952                                         Renderer.lineText(feature, "Boom", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20);
     975                                        Renderer.lineText("Boom", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20);
    953976                                }
    954977                        default:
     
    957980                }
    958981                if ((Renderer.zoom >= 14) && (feature.type == Obj.UWTROC)) {
    959                         switch ((WatLEV) getAttEnum(feature, feature.type, 0, Att.WATLEV)) {
     982                        switch ((WatLEV) getAttEnum(feature.type, Att.WATLEV)) {
    960983                        case LEV_CVRS:
    961                                 Renderer.symbol(feature, Areas.RockC);
     984                                Renderer.symbol(Areas.RockC);
    962985                                break;
    963986                        case LEV_AWSH:
    964                                 Renderer.symbol(feature, Areas.RockA);
     987                                Renderer.symbol(Areas.RockA);
    965988                                break;
    966989                        default:
    967                                 Renderer.symbol(feature, Areas.Rock);
     990                                Renderer.symbol(Areas.Rock);
    968991                        }
    969992                } else {
    970                         Renderer.symbol(feature, Areas.Rock);
     993                        Renderer.symbol(Areas.Rock);
    971994                }
    972995        }
     
    975998                if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) {
    976999                        if (feature.type == Obj.PIPSOL) {
    977                                 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Symbols.Mline);
     1000                                Renderer.lineSymbols(Areas.Pipeline, 1.0, null, null, 0, Symbols.Mline);
    9781001                        } else if (feature.type == Obj.PIPOHD) {
    979                                 Renderer.lineVector(feature, new LineStyle(Color.black, 8));
     1002                                Renderer.lineVector(new LineStyle(Color.black, 8));
    9801003                                AttMap atts = feature.atts;
    9811004                                double verclr = 0;
     
    9871010                                        }
    9881011                                        if (verclr > 0) {
    989                                                 Renderer.labelText(feature, String.valueOf(verclr), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
     1012                                                Renderer.labelText(String.valueOf(verclr), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
    9901013                                        }
    9911014                                }
     
    9961019        @SuppressWarnings("unchecked")
    9971020        private static void platforms() {
    998                 ArrayList<CatOFP> cats = (ArrayList<CatOFP>) getAttList(feature, Obj.OFSPLF, 0, Att.CATOFP);
     1021                ArrayList<CatOFP> cats = (ArrayList<CatOFP>) getAttList(Obj.OFSPLF, Att.CATOFP);
    9991022                if ((CatOFP) cats.get(0) == CatOFP.OFP_FPSO)
    1000                         Renderer.symbol(feature, Buoys.Storage);
     1023                        Renderer.symbol(Buoys.Storage);
    10011024                else
    1002                         Renderer.symbol(feature, Landmarks.Platform);
    1003                 addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
    1004                 Signals.addSignals(feature);
     1025                        Renderer.symbol(Landmarks.Platform);
     1026                addName(15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
     1027                Signals.addSignals();
    10051028        }
    10061029
     
    10081031                if (Renderer.zoom >= 14) {
    10091032                        if (feature.type == Obj.CRANES) {
    1010                                 if ((CatCRN) getAttEnum(feature, feature.type, 0, Att.CATCRN) == CatCRN.CRN_CONT)
    1011                                         Renderer.symbol(feature, Harbours.ContainerCrane);
     1033                                if ((CatCRN) getAttEnum(feature.type, Att.CATCRN) == CatCRN.CRN_CONT)
     1034                                        Renderer.symbol(Harbours.ContainerCrane);
    10121035                                else
    1013                                         Renderer.symbol(feature, Harbours.PortCrane);
     1036                                        Renderer.symbol(Harbours.PortCrane);
    10141037                        } else if (feature.type == Obj.HULKES) {
    1015                                 Renderer.lineVector(feature, new LineStyle(Color.black, 4, null, new Color(0xffe000)));
    1016                                 addName(feature, 15, new Font("Arial", Font.BOLD, 40));
     1038                                Renderer.lineVector(new LineStyle(Color.black, 4, null, new Color(0xffe000)));
     1039                                addName(15, new Font("Arial", Font.BOLD, 40));
    10171040                        }
    10181041                }
     
    10251048                case TSSRON:
    10261049                        if (Renderer.zoom <= 15)
    1027                                 Renderer.lineVector(feature, new LineStyle(Symbols.Mline));
     1050                                Renderer.lineVector(new LineStyle(Symbols.Mtss));
    10281051                        else
    1029                                 Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 20, null, null));
    1030                         addName(feature, 10, new Font("Arial", Font.BOLD, 150), Symbols.Mline);
     1052                                Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, null, null));
     1053                        addName(10, new Font("Arial", Font.BOLD, 150), Symbols.Mline);
    10311054                        break;
    10321055                case TSELNE:
    1033                         Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 20, null, null));
     1056                        Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, null, null));
    10341057                        break;
    10351058                case TSSLPT:
    1036                         Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, null, 0, Symbols.Mline);
     1059                        Renderer.lineSymbols(Areas.LaneArrow, 0.5, null, null, 0, Symbols.Mtss);
    10371060                        break;
    10381061                case TSSBND:
    1039                         Renderer.lineVector(feature, new LineStyle(Symbols.Mline, 20, new float[] { 40, 40 }, null));
     1062                        Renderer.lineVector(new LineStyle(Symbols.Mtss, 20, new float[] { 40, 40 }, null));
    10401063                        break;
    10411064                case ISTZNE:
    1042                         Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Symbols.Mline);
     1065                        Renderer.lineSymbols(Areas.Restricted, 1.0, null, null, 0, Symbols.Mtss);
    10431066                        break;
    10441067                default:
     
    10491072        @SuppressWarnings("unchecked")
    10501073        private static void shoreline() {
    1051                 CatSLC cat = (CatSLC) getAttEnum(feature, feature.type, 0, Att.CATSLC);
     1074                CatSLC cat = (CatSLC) getAttEnum(feature.type, Att.CATSLC);
    10521075                if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.BASE)) {
    10531076                        if ((cat != CatSLC.SLC_SWAY) && (cat != CatSLC.SLC_TWAL)) {
    10541077                                if (Renderer.zoom >= 12) {
    1055                                         Renderer.lineVector(feature, new LineStyle(Color.black, 10, Symbols.Yland));
     1078                                        Renderer.lineVector(new LineStyle(Color.black, 10, Symbols.Yland));
    10561079                                } else {
    1057                                         Renderer.lineVector(feature, new LineStyle(Symbols.Yland));
     1080                                        Renderer.lineVector(new LineStyle(Symbols.Yland));
    10581081                                }
    10591082                        }
     
    10631086                                switch (cat) {
    10641087                                case SLC_TWAL:
    1065                                         WatLEV lev = (WatLEV) getAttEnum(feature, feature.type, 0, Att.WATLEV);
     1088                                        WatLEV lev = (WatLEV) getAttEnum(feature.type, Att.WATLEV);
    10661089                                        if (lev == WatLEV.LEV_CVRS) {
    1067                                                 Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
     1090                                                Renderer.lineVector(new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
    10681091                                                if (Renderer.zoom >= 15)
    1069                                                         Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5, 80);
     1092                                                        Renderer.lineText("(covers)", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5, 80);
    10701093                                        } else {
    1071                                                 Renderer.lineVector(feature, new LineStyle(Color.black, 10, null, null));
     1094                                                Renderer.lineVector(new LineStyle(Color.black, 10, null, null));
    10721095                                        }
    10731096                                        if (Renderer.zoom >= 15)
    1074                                                 Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5, -30);
     1097                                                Renderer.lineText("Training Wall", new Font("Arial", Font.PLAIN, 60), Color.black, 0.5, -30);
    10751098                                        break;
    10761099                                case SLC_SWAY:
    1077                                         Renderer.lineVector(feature, new LineStyle(Color.black, 2, null, new Color(0xffe000)));
     1100                                        Renderer.lineVector(new LineStyle(Color.black, 2, null, new Color(0xffe000)));
    10781101                                        if ((Renderer.zoom >= 16) && feature.objs.containsKey(Obj.SMCFAC)) {
    10791102                                                ArrayList<Symbol> symbols = new ArrayList<Symbol>();
    1080                                                 ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(feature, Obj.SMCFAC, 0, Att.CATSCF);
     1103                                                ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(Obj.SMCFAC, Att.CATSCF);
    10811104                                                for (CatSCF scf : scfs) {
    10821105                                                        symbols.add(Facilities.Cats.get(scf));
    10831106                                                }
    1084                                                 Renderer.cluster(feature, symbols);
     1107                                                Renderer.cluster(symbols);
    10851108                                        }
    10861109                                        break;
     
    10981121                        switch (feature.type) {
    10991122                        case SISTAT:
    1100                                 Renderer.symbol(feature, Harbours.SignalStation);
     1123                                Renderer.symbol(Harbours.SignalStation);
    11011124                                str = "SS";
    1102                                 ArrayList<CatSIT> tcats = (ArrayList<CatSIT>) getAttList(feature, Obj.SISTAT, 0, Att.CATSIT);
     1125                                ArrayList<CatSIT> tcats = (ArrayList<CatSIT>) getAttList(Obj.SISTAT, Att.CATSIT);
    11031126                                switch (tcats.get(0)) {
    11041127                                case SIT_IPT:
     
    11221145                                break;
    11231146                        case SISTAW:
    1124                                 Renderer.symbol(feature, Harbours.SignalStation);
     1147                                Renderer.symbol(Harbours.SignalStation);
    11251148                                str = "SS";
    11261149                                str = "SS";
    1127                                 ArrayList<CatSIW> wcats = (ArrayList<CatSIW>) getAttList(feature, Obj.SISTAW, 0, Att.CATSIW);
     1150                                ArrayList<CatSIW> wcats = (ArrayList<CatSIW>) getAttList(Obj.SISTAW, Att.CATSIW);
    11281151                                switch (wcats.get(0)) {
    11291152                                case SIW_STRM:
     
    11631186                        case RDOSTA:
    11641187                        case RTPBCN:
    1165                                 Renderer.symbol(feature, Harbours.SignalStation);
    1166                                 Renderer.symbol(feature, Beacons.RadarStation);
     1188                                Renderer.symbol(Harbours.SignalStation);
     1189                                Renderer.symbol(Beacons.RadarStation);
     1190                                break;
     1191                        case RADRFL:
     1192                                Renderer.symbol(Topmarks.RadarReflector);
    11671193                                break;
    11681194                        case RADSTA:
    1169                                 Renderer.symbol(feature, Harbours.SignalStation);
    1170                                 Renderer.symbol(feature, Beacons.RadarStation);
    1171                                 Renderer.labelText(feature, "Ra", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70)));
     1195                                Renderer.symbol(Harbours.SignalStation);
     1196                                Renderer.symbol(Beacons.RadarStation);
     1197                                Renderer.labelText("Ra", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70)));
    11721198                                break;
    11731199                        case PILBOP:
    1174                                 Renderer.symbol(feature, Harbours.Pilot);
    1175                                 addName(feature, 15, new Font("Arial", Font.BOLD, 40), Symbols.Msymb , new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40)));
    1176                                 CatPIL cat = (CatPIL) getAttEnum(feature, feature.type, 0, Att.CATPIL);
     1200                                Renderer.symbol(Harbours.Pilot);
     1201                                addName(15, new Font("Arial", Font.BOLD, 40), Symbols.Msymb , new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40)));
     1202                                CatPIL cat = (CatPIL) getAttEnum(feature.type, Att.CATPIL);
    11771203                                if (cat == CatPIL.PIL_HELI) {
    1178                                         Renderer.labelText(feature, "H", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
     1204                                        Renderer.labelText("H", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
    11791205                                }
    11801206                                break;
    11811207                        case CGUSTA:
    1182                                 Renderer.symbol(feature, Harbours.SignalStation);
     1208                                Renderer.symbol(Harbours.SignalStation);
    11831209                                str = "CG";
    1184                           if (feature.objs.containsKey(Obj.RSCSTA)) Renderer.symbol(feature, Harbours.Rescue, new Delta(Handle.CC, AffineTransform.getTranslateInstance(130, 0)));
     1210                          if (feature.objs.containsKey(Obj.RSCSTA)) Renderer.symbol(Harbours.Rescue, new Delta(Handle.CC, AffineTransform.getTranslateInstance(130, 0)));
    11851211                                break;
    11861212                        case RSCSTA:
    1187                                 Renderer.symbol(feature, Harbours.Rescue);
     1213                                Renderer.symbol(Harbours.Rescue);
    11881214                                break;
    11891215                        default:
     
    11911217                        }
    11921218                        if ((Renderer.zoom >= 15) && !str.isEmpty()) {
    1193                                 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.LC, AffineTransform.getTranslateInstance(40, 0)));
    1194                         }
    1195                         Signals.addSignals(feature);
     1219                                Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.LC, AffineTransform.getTranslateInstance(40, 0)));
     1220                        }
     1221                        Signals.addSignals();
    11961222                }
    11971223        }
     
    11991225        private static void transits() {
    12001226          if (Renderer.zoom >= 14) {
    1201                 if (feature.type == Obj.RECTRC) Renderer.lineVector (feature, new LineStyle(Color.black, 10, null, null));
    1202                 else if (feature.type == Obj.NAVLNE) Renderer.lineVector (feature, new LineStyle(Color.black, 10, new float[] { 25, 25 }, null));
     1227                if (feature.type == Obj.RECTRC) Renderer.lineVector (new LineStyle(Color.black, 10, null, null));
     1228                else if (feature.type == Obj.NAVLNE) Renderer.lineVector (new LineStyle(Color.black, 10, new float[] { 25, 25 }, null));
    12031229          }
    12041230                if (Renderer.zoom >= 15) {
     
    12081234                                str += name + " ";
    12091235                        Double ort;
    1210                         if ((ort = (Double) getAttVal(feature, feature.type, 0, Att.ORIENT)) != null) {
    1211                                 str += ort.toString() + "\u0152";
     1236                        if ((ort = (Double) getAttVal(feature.type, Att.ORIENT)) != null) {
     1237                                str += df.format(ort) + "º";
    12121238                                if (!str.isEmpty())
    1213                                         Renderer.lineText(feature, str, new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20);
     1239                                        Renderer.lineText(str, new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20);
    12141240                        }
    12151241                }
     
    12171243
    12181244        private static void waterways() {
    1219                 Renderer.lineVector(feature, new LineStyle(Symbols.Bwater, 20, (feature.geom.prim == Pflag.AREA) ? Symbols.Bwater : null));
     1245                Renderer.lineVector(new LineStyle(Symbols.Bwater, 20, (feature.geom.prim == Pflag.AREA) ? Symbols.Bwater : null));
    12201246        }
    12211247
    12221248        private static void wrecks() {
    12231249                if (Renderer.zoom >= 14) {
    1224                         switch ((CatWRK) getAttEnum(feature, feature.type, 0, Att.CATWRK)) {
     1250                        switch ((CatWRK) getAttEnum(feature.type, Att.CATWRK)) {
    12251251                        case WRK_DNGR:
    12261252                        case WRK_MSTS:
    1227                                 Renderer.symbol(feature, Areas.WreckD);
     1253                                Renderer.symbol(Areas.WreckD);
    12281254                                break;
    12291255                        case WRK_HULS:
    1230                                 Renderer.symbol(feature, Areas.WreckS);
     1256                                Renderer.symbol(Areas.WreckS);
    12311257                                break;
    12321258                        default:
    1233                                 Renderer.symbol(feature, Areas.WreckND);
     1259                                Renderer.symbol(Areas.WreckND);
    12341260                        }
    12351261                }
  • applications/editors/josm/plugins/seachart/src/render/Signals.java

    r32088 r32090  
    8484        }
    8585       
    86         public static void addSignals(Feature feature) {
    87           if (feature.objs.containsKey(Obj.FOGSIG)) fogSignals(feature);
    88           if (feature.objs.containsKey(Obj.RTPBCN)) radarStations(feature);
    89           if (feature.objs.containsKey(Obj.RADSTA)) radarStations(feature);
    90           if (feature.objs.containsKey(Obj.RDOSTA)) radioStations(feature);
    91           if (feature.objs.containsKey(Obj.LIGHTS)) lights(feature);
    92         }
    93        
    9486        static final EnumMap<CatFOG, String> fogSignals = new EnumMap<CatFOG, String>(CatFOG.class);
    9587        static {
     
    108100        static final DecimalFormat df = new DecimalFormat("#.#");
    109101       
    110         public static void fogSignals(Feature feature) {
    111                 Renderer.symbol(feature, Beacons.FogSignal);
    112                 AttMap atts = feature.objs.get(Obj.FOGSIG).get(0);
    113                 String str = "";
    114                 if (atts.containsKey(Att.CATFOG)) {
    115                         str += fogSignals.get(((ArrayList<?>)(atts.get(Att.CATFOG).val)).get(0));
    116                 }
    117                 if (atts.containsKey(Att.SIGGRP)) {
    118                         str += "(" + atts.get(Att.SIGGRP).val + ")";
    119                 } else {
    120                         str += " ";
    121                 }
    122                 if (atts.containsKey(Att.SIGPER)) {
    123                         str += df.format(atts.get(Att.SIGPER).val) + "s";
    124                 }
    125                 if (atts.containsKey(Att.VALMXR)) {
    126                         str += df.format(atts.get(Att.VALMXR).val) + "M";
    127                 }
    128                 if ((Renderer.zoom >= 15) && !str.isEmpty()) {
    129                         Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40),Color.black, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-60, -30)));
    130                 }
    131         }
    132 
    133         public static void radarStations(Feature feature) {
    134                 Renderer.symbol(feature, Beacons.RadarStation);
    135                 String bstr = "";
    136                 CatRTB cat = (CatRTB) Rules.getAttEnum(feature, Obj.RTPBCN, 0, Att.CATRTB);
    137                 String wal = Rules.getAttStr(feature, Obj.RTPBCN, 0, Att.RADWAL);
    138                 switch (cat) {
    139                 case RTB_RAMK:
    140                         bstr += " Ramark";
    141                         break;
    142                 case RTB_RACN:
    143                         bstr += " Racon";
    144                         String astr = Rules.getAttStr(feature, Obj.RTPBCN, 0, Att.SIGGRP);
    145                         if (!astr.isEmpty()) {
    146                                 bstr += "(" + astr + ")";
    147                         }
    148                         Double per = (Double) Rules.getAttVal(feature, Obj.RTPBCN, 0, Att.SIGPER);
    149                         Double mxr = (Double) Rules.getAttVal(feature, Obj.RTPBCN, 0, Att.VALMXR);
    150                         if ((per != null) || (mxr != null)) {
    151                                 bstr += (astr.isEmpty() ? " " : "");
    152                                 if (per != null) bstr += (per != 0) ? per.toString() + "s" : "";
    153                                 if (mxr != null) bstr += (mxr != 0) ? mxr.toString() + "M" : "";
    154                         }
    155                         break;
    156                 default:
    157                         break;
    158                 }
    159                 if (!wal.isEmpty()) {
    160                         switch (wal) {
    161                         case "0.03-X":
    162                                 bstr += "(3cm)";
     102        public static void addSignals() {
     103          if (Rules.feature.objs.containsKey(Obj.RADRFL)) reflectors();
     104          if (Rules.feature.objs.containsKey(Obj.FOGSIG)) fogSignals();
     105          if (Rules.feature.objs.containsKey(Obj.RTPBCN)) radarStations();
     106          if (Rules.feature.objs.containsKey(Obj.RADSTA)) radarStations();
     107          if (Rules.feature.objs.containsKey(Obj.RDOSTA)) radioStations();
     108          if (Rules.feature.objs.containsKey(Obj.LIGHTS)) lights();
     109        }
     110
     111        public static void reflectors() {
     112                if (Renderer.zoom >= 14) {
     113                        switch (Rules.feature.type) {
     114                        case BCNLAT:
     115                        case BCNCAR:
     116                        case BCNISD:
     117                        case BCNSAW:
     118                        case BCNSPP:
     119                        case LITFLT:
     120                        case LITVES:
     121                        case BOYINB:
     122                                if ((Rules.feature.objs.containsKey(Obj.TOPMAR)) || (Rules.feature.objs.containsKey(Obj.DAYMAR))) {
     123                                        Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -140)));
     124                                } else {
     125                                        Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -80)));
     126                                }
    163127                                break;
    164                         case "0.10-S":
    165                                 bstr += "(10cm)";
     128                        case LITMAJ:
     129                        case LITMIN:
     130                                if ((Rules.feature.objs.containsKey(Obj.TOPMAR)) || (Rules.feature.objs.containsKey(Obj.DAYMAR))) {
     131                                        Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
     132                                } else {
     133                                        Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -30)));
     134                                }
    166135                                break;
    167                         }
    168                 }
    169                 if ((Renderer.zoom >= 15) && !bstr.isEmpty()) {
    170                         Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70)));
    171                 }
    172         }
    173 
    174         @SuppressWarnings("unchecked")
    175         public static void radioStations(Feature feature) {
    176                 ArrayList<CatROS> cats = (ArrayList<CatROS>)Rules.getAttList(feature, Obj.RDOSTA, 0, Att.CATROS);
    177                 boolean vais = false;
    178                 String bstr = "";
    179                 for (CatROS ros : cats) {
    180                         switch (ros) {
    181                         case ROS_OMNI:
    182                                 bstr += " RC";
    183                                 break;
    184                         case ROS_DIRL:
    185                                 bstr += " RD";
    186                                 break;
    187                         case ROS_ROTP:
    188                                 bstr += " RW";
    189                                 break;
    190                         case ROS_CNSL:
    191                                 bstr += " Consol";
    192                                 break;
    193                         case ROS_RDF:
    194                                 bstr += " RG";
    195                                 break;
    196                         case ROS_QTA:
    197                                 bstr += " R";
    198                                 break;
    199                         case ROS_AERO:
    200                                 bstr += " AeroRC";
    201                                 break;
    202                         case ROS_DECA:
    203                                 bstr += " Decca";
    204                                 break;
    205                         case ROS_LORN:
    206                                 bstr += " Loran";
    207                                 break;
    208                         case ROS_DGPS:
    209                                 bstr += " DGPS";
    210                                 break;
    211                         case ROS_TORN:
    212                                 bstr += " Toran";
    213                                 break;
    214                         case ROS_OMGA:
    215                                 bstr += " Omega";
    216                                 break;
    217                         case ROS_SYLD:
    218                                 bstr += " Syledis";
    219                                 break;
    220                         case ROS_CHKA:
    221                                 bstr += " Chiaka";
    222                                 break;
    223                         case ROS_PCOM:
    224                         case ROS_COMB:
    225                         case ROS_FACS:
    226                         case ROS_TIME:
    227                                 break;
    228                         case ROS_PAIS:
    229                         case ROS_SAIS:
    230                                 bstr += " AIS";
    231                                 break;
    232                         case ROS_VAIS:
    233                                 vais = true;
    234                                 break;
    235                         case ROS_VANC:
    236                                 vais = true;
    237                                 Renderer.symbol(feature, Topmarks.TopNorth, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    238                                 break;
    239                         case ROS_VASC:
    240                                 vais = true;
    241                                 Renderer.symbol(feature, Topmarks.TopSouth, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    242                                 break;
    243                         case ROS_VAEC:
    244                                 vais = true;
    245                                 Renderer.symbol(feature, Topmarks.TopEast, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    246                                 break;
    247                         case ROS_VAWC:
    248                                 vais = true;
    249                                 Renderer.symbol(feature, Topmarks.TopWest, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    250                                 break;
    251                         case ROS_VAPL:
    252                                 vais = true;
    253                                 Renderer.symbol(feature, Topmarks.TopCan, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    254                                 break;
    255                         case ROS_VASL:
    256                                 vais = true;
    257                                 Renderer.symbol(feature, Topmarks.TopCone, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    258                                 break;
    259                         case ROS_VAID:
    260                                 vais = true;
    261                                 Renderer.symbol(feature, Topmarks.TopIsol, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    262                                 break;
    263                         case ROS_VASW:
    264                                 vais = true;
    265                                 Renderer.symbol(feature, Topmarks.TopSphere, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    266                                 break;
    267                         case ROS_VASP:
    268                                 vais = true;
    269                                 Renderer.symbol(feature, Topmarks.TopX, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    270                                 break;
    271                         case ROS_VAWK:
    272                                 vais = true;
    273                                 Renderer.symbol(feature, Topmarks.TopCross, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     136                        case BOYLAT:
     137                        case BOYCAR:
     138                        case BOYISD:
     139                        case BOYSAW:
     140                        case BOYSPP:
     141                                if ((Rules.feature.objs.containsKey(Obj.TOPMAR)) || (Rules.feature.objs.containsKey(Obj.DAYMAR))) {
     142                                        if (Rules.testAttribute(Rules.feature.type, Att.BOYSHP, BoySHP.BOY_PILR) || Rules.testAttribute(Rules.feature.type, Att.BOYSHP, BoySHP.BOY_PILR)) {
     143                                                Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(45, -140)));
     144                                        } else {
     145                                                Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(25, -80)));
     146                                        }
     147                                } else {
     148                                        if (Rules.testAttribute(Rules.feature.type, Att.BOYSHP, BoySHP.BOY_PILR) || Rules.testAttribute(Rules.feature.type, Att.BOYSHP, BoySHP.BOY_PILR)) {
     149                                                Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(30, -100)));
     150                                        } else {
     151                                                Renderer.symbol(Topmarks.RadarReflector, new Delta(Handle.BC, AffineTransform.getTranslateInstance(10, -50)));
     152                                        }
     153                                }
    274154                                break;
    275155                        default:
     
    277157                        }
    278158                }
    279                 if (!vais) {
    280                         Renderer.symbol(feature, Beacons.RadarStation);
     159        }
     160       
     161        public static void fogSignals() {
     162                if (Renderer.zoom >= 11)
     163                        Renderer.symbol(Beacons.FogSignal);
     164                if (Renderer.zoom >= 15) {
     165                        AttMap atts = Rules.feature.objs.get(Obj.FOGSIG).get(0);
     166                        String str = "";
     167                        if (atts.containsKey(Att.CATFOG)) {
     168                                str += fogSignals.get(((ArrayList<?>) (atts.get(Att.CATFOG).val)).get(0));
     169                        }
     170                        if (atts.containsKey(Att.SIGGRP)) {
     171                                str += "(" + atts.get(Att.SIGGRP).val + ")";
     172                        } else {
     173                                str += " ";
     174                        }
     175                        if (atts.containsKey(Att.SIGPER)) {
     176                                str += df.format(atts.get(Att.SIGPER).val) + "s";
     177                        }
     178                        if (atts.containsKey(Att.VALMXR)) {
     179                                str += df.format(atts.get(Att.VALMXR).val) + "M";
     180                        }
     181                        if (!str.isEmpty()) {
     182                                Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-60, -30)));
     183                        }
     184                }
     185        }
     186
     187        public static void radarStations() {
     188                if (Renderer.zoom >= 11)
     189                        Renderer.symbol(Beacons.RadarStation);
     190                if (Renderer.zoom >= 15) {
     191                        String bstr = "";
     192                        CatRTB cat = (CatRTB) Rules.getAttEnum(Obj.RTPBCN, Att.CATRTB);
     193                        String wal = Rules.getAttStr(Obj.RTPBCN, Att.RADWAL);
     194                        switch (cat) {
     195                        case RTB_RAMK:
     196                                bstr += " Ramark";
     197                                break;
     198                        case RTB_RACN:
     199                                bstr += " Racon";
     200                                String astr = Rules.getAttStr(Obj.RTPBCN, Att.SIGGRP);
     201                                if (!astr.isEmpty()) {
     202                                        bstr += "(" + astr + ")";
     203                                }
     204                                Double per = (Double) Rules.getAttVal(Obj.RTPBCN, Att.SIGPER);
     205                                Double mxr = (Double) Rules.getAttVal(Obj.RTPBCN, Att.VALMXR);
     206                                if ((per != null) || (mxr != null)) {
     207                                        bstr += (astr.isEmpty() ? " " : "");
     208                                        if (per != null)
     209                                                bstr += (per != 0) ? per.toString() + "s" : "";
     210                                        if (mxr != null)
     211                                                bstr += (mxr != 0) ? mxr.toString() + "M" : "";
     212                                }
     213                                break;
     214                        default:
     215                                break;
     216                        }
     217                        if (!wal.isEmpty()) {
     218                                switch (wal) {
     219                                case "0.03-X":
     220                                        bstr += "(3cm)";
     221                                        break;
     222                                case "0.10-S":
     223                                        bstr += "(10cm)";
     224                                        break;
     225                                }
     226                        }
     227                        if (!bstr.isEmpty()) {
     228                                Renderer.labelText(bstr, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -70)));
     229                        }
     230                }
     231        }
     232
     233        @SuppressWarnings("unchecked")
     234        public static void radioStations() {
     235                boolean vais = false;
     236                String bstr = "";
     237                if (Renderer.zoom >= 11) {
     238                        ArrayList<CatROS> cats = (ArrayList<CatROS>) Rules.getAttList(Obj.RDOSTA, Att.CATROS);
     239                        for (CatROS ros : cats) {
     240                                switch (ros) {
     241                                case ROS_OMNI:
     242                                        bstr += " RC";
     243                                        break;
     244                                case ROS_DIRL:
     245                                        bstr += " RD";
     246                                        break;
     247                                case ROS_ROTP:
     248                                        bstr += " RW";
     249                                        break;
     250                                case ROS_CNSL:
     251                                        bstr += " Consol";
     252                                        break;
     253                                case ROS_RDF:
     254                                        bstr += " RG";
     255                                        break;
     256                                case ROS_QTA:
     257                                        bstr += " R";
     258                                        break;
     259                                case ROS_AERO:
     260                                        bstr += " AeroRC";
     261                                        break;
     262                                case ROS_DECA:
     263                                        bstr += " Decca";
     264                                        break;
     265                                case ROS_LORN:
     266                                        bstr += " Loran";
     267                                        break;
     268                                case ROS_DGPS:
     269                                        bstr += " DGPS";
     270                                        break;
     271                                case ROS_TORN:
     272                                        bstr += " Toran";
     273                                        break;
     274                                case ROS_OMGA:
     275                                        bstr += " Omega";
     276                                        break;
     277                                case ROS_SYLD:
     278                                        bstr += " Syledis";
     279                                        break;
     280                                case ROS_CHKA:
     281                                        bstr += " Chiaka";
     282                                        break;
     283                                case ROS_PCOM:
     284                                case ROS_COMB:
     285                                case ROS_FACS:
     286                                case ROS_TIME:
     287                                        break;
     288                                case ROS_PAIS:
     289                                case ROS_SAIS:
     290                                        bstr += " AIS";
     291                                        break;
     292                                case ROS_VAIS:
     293                                        vais = true;
     294                                        break;
     295                                case ROS_VANC:
     296                                        vais = true;
     297                                        Renderer.symbol(Topmarks.TopNorth, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     298                                        break;
     299                                case ROS_VASC:
     300                                        vais = true;
     301                                        Renderer.symbol(Topmarks.TopSouth, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     302                                        break;
     303                                case ROS_VAEC:
     304                                        vais = true;
     305                                        Renderer.symbol(Topmarks.TopEast, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     306                                        break;
     307                                case ROS_VAWC:
     308                                        vais = true;
     309                                        Renderer.symbol(Topmarks.TopWest, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     310                                        break;
     311                                case ROS_VAPL:
     312                                        vais = true;
     313                                        Renderer.symbol(Topmarks.TopCan, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     314                                        break;
     315                                case ROS_VASL:
     316                                        vais = true;
     317                                        Renderer.symbol(Topmarks.TopCone, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     318                                        break;
     319                                case ROS_VAID:
     320                                        vais = true;
     321                                        Renderer.symbol(Topmarks.TopIsol, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     322                                        break;
     323                                case ROS_VASW:
     324                                        vais = true;
     325                                        Renderer.symbol(Topmarks.TopSphere, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     326                                        break;
     327                                case ROS_VASP:
     328                                        vais = true;
     329                                        Renderer.symbol(Topmarks.TopX, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     330                                        break;
     331                                case ROS_VAWK:
     332                                        vais = true;
     333                                        Renderer.symbol(Topmarks.TopCross, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     334                                        break;
     335                                default:
     336                                        break;
     337                                }
     338                        }
     339                        if (!vais) {
     340                                Renderer.symbol(Beacons.RadarStation);
     341                        }
    281342                }
    282343                if (Renderer.zoom >= 15) {
    283344                        if (vais) {
    284                                 Renderer.labelText(feature, "V-AIS", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
     345                                Renderer.labelText("V-AIS", new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
    285346                        }
    286347                        if (!bstr.isEmpty()) {
    287                                 Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -110)));
     348                                Renderer.labelText(bstr, new Font("Arial", Font.PLAIN, 40), Symbols.Msymb, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-30, -110)));
    288349                        }
    289350                }
     
    301362       
    302363        @SuppressWarnings("unchecked")
    303         public static void lights(Feature feature) {
     364        public static void lights() {
    304365                Enum<ColCOL> col = null;
    305366                Enum<ColCOL> tcol = null;
    306                 ObjTab lights = feature.objs.get(Obj.LIGHTS);
     367                ObjTab lights = Rules.feature.objs.get(Obj.LIGHTS);
    307368                for (AttMap atts : lights.values()) {
    308369                        if (atts.containsKey(Att.COLOUR)) {
     
    322383                        }
    323384                }
    324                 Renderer.symbol(feature, Beacons.LightFlare, new Scheme(LightColours.get(col)), new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.toRadians(120))));
     385                Renderer.symbol(Beacons.LightFlare, new Scheme(LightColours.get(col)), new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.toRadians(120))));
    325386                        String str = "";
    326387                        if (lights.get(1) != null) {
     
    425486                                        }
    426487                                        if ((s1 <= 360) && (s2 <= 360) && (s1 != s2))
    427                                                 Renderer.lightSector(feature, LightColours.get(col1), LightColours.get(col2), radius, s1, s2, dir, (Renderer.zoom >= 15) ? str : "");
     488                                                Renderer.lightSector(LightColours.get(col1), LightColours.get(col2), radius, s1, s2, dir, (Renderer.zoom >= 15) ? str : "");
    428489                                }
    429490                        if (Renderer.zoom >= 15) {
     
    432493                                        LitCHR chr;
    433494                                        ColCOL col;
    434                                         ColCOL alt;
    435495                                        String grp;
    436496                                        double per;
     
    468528                                        ArrayList<ColCOL> cols = (ArrayList<ColCOL>) (atts.containsKey(Att.COLOUR) ? atts.get(Att.COLOUR).val : new ArrayList<>());
    469529                                        sect.col = cols.size() > 0 ? cols.get(0) : ColCOL.COL_UNK;
    470                                         sect.alt = cols.size() > 1 ? cols.get(1) : ColCOL.COL_UNK;
    471530                                        if ((sect.chr != LitCHR.CHR_UNKN) && (sect.col != null))
    472531                                                litatts.add(sect);
     
    552611                                        if (colrng.get(0).rng > 0)
    553612                                                str += df.format(colrng.get(0).rng) + ((colrng.size() > 1) ? ((colrng.size() > 2) ? ("-" + df.format(colrng.get(colrng.size() - 1).rng)) : ("/" + df.format(colrng.get(1).rng))) : "") + "M";
    554                                         Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.TL, AffineTransform.getTranslateInstance(60, y)));
     613                                        Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.TL, AffineTransform.getTranslateInstance(60, y)));
    555614                                        y += 40;
    556615                                        str = "";
     
    609668                                str += (cats.contains(CatLIT.LIT_UPPR)) ? "(Upper)" : "";
    610669                                str += (cats.contains(CatLIT.LIT_LOWR)) ? "(Lower)" : "";
    611                                 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.TL, AffineTransform.getTranslateInstance(60, -30)));
     670                                Renderer.labelText(str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.TL, AffineTransform.getTranslateInstance(60, -30)));
    612671                        }
    613672                }
  • applications/editors/josm/plugins/seachart/src/s57/S57map.java

    r32082 r32090  
    466466                                        }
    467467                                } else {
    468                                         Att att = S57att.enumAttribute(subkeys[1], Obj.UNKOBJ);
    469                                         if (att != Att.UNKATT) {
    470                                                 AttVal<?> attval = S57val.convertValue(val, att);
    471                                                 if (attval.val != null)
    472                                                         feature.atts.put(att, attval);
     468                                        if (obj != Obj.UNKOBJ) {
     469                                                if (val.equals("yes")) {
     470                                                        ObjTab objs = feature.objs.get(obj);
     471                                                        if (objs == null) {
     472                                                                objs = new ObjTab();
     473                                                                feature.objs.put(obj, objs);
     474                                                        }
     475                                                }
     476                                        } else {
     477                                                Att att = S57att.enumAttribute(subkeys[1], Obj.UNKOBJ);
     478                                                if (att != Att.UNKATT) {
     479                                                        AttVal<?> attval = S57val.convertValue(val, att);
     480                                                        if (attval.val != null)
     481                                                                feature.atts.put(att, attval);
     482                                                }
    473483                                        }
    474484                                }
  • applications/editors/josm/plugins/seachart/src/symbols/Symbols.java

    r31063 r32090  
    2525        public static final Color Mline = new Color(0x9a6078);
    2626        public static final Color Msymb = new Color(0xa30075);
     27        public static final Color Mtss = new Color(0x80c480ff, true);
    2728       
    2829        public enum Form {
  • applications/editors/josm/plugins/seachart/src/symbols/Topmarks.java

    r30894 r32090  
    2020public class Topmarks {
    2121       
     22        public static final Symbol RadarReflector = new Symbol();
     23        static {
     24                RadarReflector.add(new Instr(Form.BBOX, new Rectangle2D.Double(-50,-40,100,40)));
     25                RadarReflector.add(new Instr(Form.STRK, new BasicStroke(6, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
     26                RadarReflector.add(new Instr(Form.FILL, Color.black));
     27                Path2D.Double p = new Path2D.Double(); p.moveTo(-30,-3); p.quadTo(0, -40, 30, -3); p.moveTo(0,-20); p.lineTo(0,-37);
     28                p.moveTo(-30, -3); p.lineTo(-43,-14); p.moveTo(30, -3); p.lineTo(44,-14); p.moveTo(-15, -14); p.lineTo(-25,-30); p.moveTo(15, -14); p.lineTo(25,-30);
     29                RadarReflector.add(new Instr(Form.PLIN, p));
     30        }
    2231        public static final Symbol TopBesom = new Symbol();
    2332        static {
Note: See TracChangeset for help on using the changeset viewer.