Ignore:
Timestamp:
2013-10-28T12:52:49+01:00 (11 years ago)
Author:
malcolmh
Message:

save

Location:
applications/editors/josm/plugins/smed2/src/seamap
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/src/seamap/Renderer.java

    r30029 r30033  
    103103        }
    104104
    105         public static void symbol(Feature feature, Symbol symbol, Obj obj, Delta delta, Scheme scheme) {
     105        public static void symbol(Feature feature, Symbol symbol, Obj obj, Scheme scheme, Delta delta) {
    106106                Point2D point = context.getPoint(feature.centre);
    107107                if (obj == null) {
    108                         Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), delta, scheme);
     108                        Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, delta);
    109109                } else {
    110110                        ArrayList<Color> colours = new ArrayList<Color>();
     
    116116                                patterns.add(pattMap.get(pat));
    117117                        }
    118                         Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), delta, new Scheme(patterns, colours));
    119                 }
    120         }
    121 
    122         private static Rectangle symbolSize(Symbol symbol) {
     118                        Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), new Scheme(patterns, colours), delta);
     119                }
     120        }
     121       
     122        public static void cluster(Feature feature, ArrayList<Symbol> symbols) {
     123                Rectangle2D.Double bbox = null;
     124                if (symbols.size() > 4) {
     125                        for (Instr instr : symbols.get(0)) {
     126                                if (instr.type == Prim.BBOX) {
     127                                        bbox = (Rectangle2D.Double) instr.params;
     128                                        break;
     129                                }
     130                        }
     131                        if (bbox == null) return;
     132                }
     133                switch (symbols.size()) {
     134                case 1:
     135                        symbol(feature, symbols.get(0), null, null, new Delta(Handle.CC, new AffineTransform()));
     136                        break;
     137                case 2:
     138                        symbol(feature, symbols.get(0), null, null, new Delta(Handle.RC, new AffineTransform()));
     139                        symbol(feature, symbols.get(1), null, null, new Delta(Handle.LC, new AffineTransform()));
     140                        break;
     141                case 3:
     142                        symbol(feature, symbols.get(0), null, null, new Delta(Handle.BC, new AffineTransform()));
     143                        symbol(feature, symbols.get(1), null, null, new Delta(Handle.TR, new AffineTransform()));
     144                        symbol(feature, symbols.get(2), null, null, new Delta(Handle.TL, new AffineTransform()));
     145                        break;
     146                case 4:
     147                        symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, new AffineTransform()));
     148                        symbol(feature, symbols.get(1), null, null, new Delta(Handle.BL, new AffineTransform()));
     149                        symbol(feature, symbols.get(2), null, null, new Delta(Handle.TR, new AffineTransform()));
     150                        symbol(feature, symbols.get(3), null, null, new Delta(Handle.TL, new AffineTransform()));
     151                        break;
     152                case 5:
     153                        symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, new AffineTransform()));
     154                        symbol(feature, symbols.get(1), null, null, new Delta(Handle.BL, new AffineTransform()));
     155                        symbol(feature, symbols.get(2), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     156                        symbol(feature, symbols.get(3), null, null, new Delta(Handle.TC, new AffineTransform()));
     157                        symbol(feature, symbols.get(4), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     158                        break;
     159                case 6:
     160                        symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     161                        symbol(feature, symbols.get(1), null, null, new Delta(Handle.BC, new AffineTransform()));
     162                        symbol(feature, symbols.get(2), null, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     163                        symbol(feature, symbols.get(3), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     164                        symbol(feature, symbols.get(4), null, null, new Delta(Handle.TC, new AffineTransform()));
     165                        symbol(feature, symbols.get(5), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     166                        break;
     167                case 7:
     168                        symbol(feature, symbols.get(0), null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
     169                        symbol(feature, symbols.get(1), null, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     170                        symbol(feature, symbols.get(2), null, null, new Delta(Handle.CC, new AffineTransform()));
     171                        symbol(feature, symbols.get(3), null, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     172                        symbol(feature, symbols.get(4), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
     173                        symbol(feature, symbols.get(5), null, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
     174                        symbol(feature, symbols.get(6), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
     175                        break;
     176                case 8:
     177                        symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
     178                        symbol(feature, symbols.get(1), null, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
     179                        symbol(feature, symbols.get(2), null, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     180                        symbol(feature, symbols.get(3), null, null, new Delta(Handle.CC, new AffineTransform()));
     181                        symbol(feature, symbols.get(4), null, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     182                        symbol(feature, symbols.get(5), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
     183                        symbol(feature, symbols.get(6), null, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
     184                        symbol(feature, symbols.get(7), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
     185                        break;
     186                case 9:
     187                        symbol(feature, symbols.get(0), null, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, -bbox.height/2)));
     188                        symbol(feature, symbols.get(1), null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
     189                        symbol(feature, symbols.get(2), null, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, -bbox.height/2)));
     190                        symbol(feature, symbols.get(3), null, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     191                        symbol(feature, symbols.get(4), null, null, new Delta(Handle.CC, new AffineTransform()));
     192                        symbol(feature, symbols.get(5), null, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     193                        symbol(feature, symbols.get(6), null, null, new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
     194                        symbol(feature, symbols.get(7), null, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
     195                        symbol(feature, symbols.get(8), null, null, new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
     196                        break;
     197                }
     198        }
     199
     200        private static Rectangle2D.Double symbolSize(Symbol symbol) {
    123201                Symbol ssymb = symbol;
    124202                while (ssymb != null) {
    125203                        for (Instr item : symbol) {
    126204                                if (item.type == Prim.BBOX) {
    127                                         return (Rectangle) item.params;
     205                                        return (Rectangle2D.Double) item.params;
    128206                                }
    129207                                if (item.type == Prim.SYMB) {
     
    138216        }
    139217
    140         public static void lineSymbols(Feature feature, Symbol prisymb, double space, Symbol secsymb, int ratio, Color col) {
     218        public static void lineSymbols(Feature feature, Symbol prisymb, double space, Symbol secsymb, Symbol tersymb, int ratio, Color col) {
    141219                Area area;
    142220                switch (feature.flag) {
     
    152230                        return;
    153231                }
    154                 Rectangle prect = symbolSize(prisymb);
    155                 Rectangle srect = symbolSize(secsymb);
     232                Rectangle2D.Double prect = symbolSize(prisymb);
     233                Rectangle2D.Double srect = symbolSize(secsymb);
     234                Rectangle2D.Double trect = symbolSize(tersymb);
    156235                if (srect == null)
    157236                        ratio = 0;
     
    159238                        double psize = Math.abs(prect.getY()) * sScale;
    160239                        double ssize = (srect != null) ? Math.abs(srect.getY()) * sScale : 0;
     240                        double tsize = (trect != null) ? Math.abs(srect.getY()) * sScale : 0;
    161241                        Point2D prev = new Point2D.Double();
    162242                        Point2D next = new Point2D.Double();
     
    167247                        double len = 0;
    168248                        double angle = 0;
    169                         int scount = ratio;
     249                        int stcount = ratio;
     250                        boolean stflag = false;
    170251                        Symbol symbol = prisymb;
    171252                        for (Bound bound : area) {
     
    180261                                                curr = succ = next;
    181262                                                gap = (space > 0);
    182                                                 scount = ratio;
     263                                                stcount = ratio - 1;
    183264                                                symbol = prisymb;
    184265                                                len = gap ? psize * space * 0.5 : psize;
     
    202283                                                        }
    203284                                                        if (!gap) {
    204                                                                 Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(),
    205                                                                                 new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())) + Math.toRadians(90))),
    206                                                                                 new Scheme(col));
     285                                                                Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(), new Scheme(col),
     286                                                                                new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())) + Math.toRadians(90))));
    207287                                                        }
    208288                                                        if (space > 0)
    209289                                                                gap = !gap;
    210290                                                        curr = succ;
    211                                                         len = gap ? (psize * space) : (--scount == 0) ? ssize : psize;
    212                                                         if (scount == 0) {
    213                                                                 symbol = secsymb;
    214                                                                 scount = ratio;
     291                                                        len = gap ? (psize * space) : (--stcount == 0) ? (stflag ? tsize : ssize) : psize;
     292                                                        if (stcount == 0) {
     293                                                                symbol = stflag ? tersymb : secsymb;
     294                                                                if (trect != null) stflag = !stflag;
     295                                                                stcount = ratio;
    215296                                                        } else {
    216297                                                                symbol = prisymb;
     
    330411
    331412        public static void labelText(Feature feature, String str, Font font, LabelStyle style, Color fg, Color bg, Delta delta) {
    332                 if (delta == null) delta = new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 0));
     413                if (delta == null) delta = new Delta(Handle.CC);
    333414                if (bg == null) bg = new Color(0x00000000, true);
    334415                if ((str == null) || (str.isEmpty())) str = " ";
     
    339420    double height = bounds.getHeight();
    340421                Symbol label = new Symbol();
    341                 double lx = 0;
    342                 double ly = 0;
    343                 double tx = 0;
    344                 double ty = 0;
     422                double lx, ly, tx, ty;
    345423                switch (style) {
    346424                case RRCT:
     
    378456                        label.add(new Instr(Prim.PLIN, p));
    379457                        break;
     458                default:
     459                        lx = -width / 2;
     460                        ly = -height / 2;
     461                        tx = lx;
     462                        ty = ly;
     463                        label.add(new Instr(Prim.BBOX, new Rectangle2D.Double(lx,ly,width,height)));
     464                        break;
    380465                }
    381466                label.add(new Instr(Prim.TEXT, new Caption(str, font, fg, new Delta(Handle.TL, AffineTransform.getTranslateInstance(tx, ty)))));
    382467                Point2D point = context.getPoint(feature.centre);
    383                 Symbols.drawSymbol(g2, label, sScale, point.getX(), point.getY(), delta, null);
     468                Symbols.drawSymbol(g2, label, sScale, point.getX(), point.getY(), null, delta);
    384469        }
    385470
  • applications/editors/josm/plugins/smed2/src/seamap/Rules.java

    r30029 r30033  
    1818import s57.S57att.*;
    1919import s57.S57obj.*;
    20 
    21 import seamap.SeaMap.AttItem;
    22 import seamap.SeaMap.AttMap;
    23 import seamap.SeaMap.ObjTab;
    2420import seamap.Renderer.*;
    2521import seamap.SeaMap.*;
     
    3329       
    3430        public static final Color Yland = new Color(0x50b0ff);
    35         public static final Color Mline = new Color(0xc480ff);
     31        public static final Color Mline = new Color(0x80c480);
    3632        public static final Color Msymb = new Color(0xa30075);
    3733       
     
    149145                case RESARE:
    150146                        if (zoom >= 12) {
    151                                 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0, new Color(0x80c480));
     147                                Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Mline);
    152148//                              if ((CatREA)Renderer.getAttVal(feature, feature.type, 0, Att.CATREA) == CatREA.REA_NWAK)
    153149//                                      Renderer.symbol(feature, Areas.NoWake, Obj.RESARE, null);
     
    208204                        if (zoom >= 12) {
    209205                                Renderer.symbol(feature, Areas.Plane, Obj.SPLARE, null, null);
    210                                 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, 10, new Color(0x80c480));
     206                                Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Mline);
    211207                        }
    212208                        if ((zoom >= 15) && (name != null))
    213209                                Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
     210                        break;
     211                default:
    214212                        break;
    215213                }
     
    239237                        Renderer.symbol(feature, Beacons.Shapes.get(shape), feature.type, null, null);
    240238                        if (feature.objs.get(Obj.TOPMAR) != null)
    241                                 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Beacons, null);
     239                                Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, null, Topmarks.Beacons);
    242240                }
    243241                Signals.addSignals(feature);
     
    248246                Renderer.symbol(feature, Buoys.Shapes.get(shape), feature.type, null, null);
    249247                if (feature.objs.get(Obj.TOPMAR) != null) {
    250                         Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Buoys.get(shape), null);
     248                        Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, null, Topmarks.Buoys.get(shape));
    251249                }
    252250                Signals.addSignals(feature);
     
    258256                        AttMap atts = feature.objs.get(Obj.BRIDGE).get(0);
    259257                        String str = "";
    260                         if (atts.containsKey(Att.VERCLR)) {
    261                                 verclr = (Double)atts.get(Att.VERCLR).val;
    262                         } else {
    263                                 verclr = atts.containsKey(Att.VERCSA) ? (Double)atts.get(Att.VERCSA).val : 0;
    264                         }
    265                         verccl = atts.containsKey(Att.VERCCL) ? (Double)atts.get(Att.VERCCL).val : 0;
    266                         vercop = atts.containsKey(Att.VERCOP) ? (Double)atts.get(Att.VERCOP).val : 0;
    267                         if (verclr > 0) {
    268                                 str += String.valueOf(verclr);
    269                         } else if (verccl > 0) {
    270                                 if (vercop == 0) {
    271                                         str += String.valueOf(verccl) + "/-";
     258                        if (atts != null) {
     259                                if (atts.containsKey(Att.VERCLR)) {
     260                                        verclr = (Double) atts.get(Att.VERCLR).val;
    272261                                } else {
    273                                         str += String.valueOf(verccl) + "/" + String.valueOf(vercop);
     262                                        verclr = atts.containsKey(Att.VERCSA) ? (Double) atts.get(Att.VERCSA).val : 0;
    274263                                }
    275                         }
    276                         if (!str.isEmpty())
    277                                 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 0)));
     264                                verccl = atts.containsKey(Att.VERCCL) ? (Double) atts.get(Att.VERCCL).val : 0;
     265                                vercop = atts.containsKey(Att.VERCOP) ? (Double) atts.get(Att.VERCOP).val : 0;
     266                                if (verclr > 0) {
     267                                        str += String.valueOf(verclr);
     268                                } else if (verccl > 0) {
     269                                        if (vercop == 0) {
     270                                                str += String.valueOf(verccl) + "/-";
     271                                        } else {
     272                                                str += String.valueOf(verccl) + "/" + String.valueOf(vercop);
     273                                        }
     274                                }
     275                                if (!str.isEmpty())
     276                                        Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC));
     277                        }
    278278                }
    279279        }
     
    282282                if ((zoom >= 16) && (feature.length < 2)) {
    283283                        if (feature.type == Obj.CBLSUB) {
    284                                 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, 0, new Color(0x80c480));
     284                                Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Mline);
    285285                        } else if (feature.type == Obj.CBLOHD) {
    286 
     286                                AttMap atts = feature.objs.get(Obj.CBLOHD).get(0);
     287                                if ((atts != null) && (atts.containsKey(Att.CATCBL)) && (atts.get(Att.CATCBL).val == CatCBL.CBL_POWR)) {
     288                                        Renderer.lineSymbols(feature, Areas.CableDash, 0, Areas.CableDot, Areas.CableFlash, 2, Color.black);
     289                                } else {
     290                                        Renderer.lineSymbols(feature, Areas.CableDash, 0, Areas.CableDot, null, 2, Color.black);
     291                                }
    287292                        }
    288293                }
     
    290295       
    291296        private static void distances(Feature feature) {
    292 /*object_rules(distances) {
    293   if ((zoom>=16) && (has_attribute("category"))) {
    294     attribute_switch("category")
    295     attribute_case("installed") symbol("distance_i");
    296     attribute_default symbol("distance_u");
    297     end_switch
    298   }
    299 }
    300 */
     297                if (zoom >= 14) {
     298                        if (!((CatDIS)Renderer.getAttVal(feature, Obj.DISMAR, 0, Att.CATDIS) == CatDIS.DIS_NONI)) {
     299                                Renderer.symbol(feature, Harbours.DistanceI, null, null, null);
     300                        } else {
     301                                Renderer.symbol(feature, Harbours.DistanceU, null, null, null);
     302                        }
     303                        AttMap atts = feature.objs.get(Obj.DISMAR).get(0);
     304                        if ((atts != null) && (atts.containsKey(Att.WTWDIS)) && (zoom >=15)) {
     305                        Double dist = (Double)atts.get(Att.WTWDIS).val;
     306                        String str = "";
     307                        if (atts.containsKey(Att.HUNITS)) {
     308                                switch ((UniHLU)atts.get(Att.HUNITS).val) {
     309                                case HLU_METR:
     310                                        str += "m ";
     311                                        break;
     312                                case HLU_FEET:
     313                                        str += "ft ";
     314                                        break;
     315                                case HLU_HMTR:
     316                                        str += "hm ";
     317                                        break;
     318                                case HLU_KMTR:
     319                                        str += "km ";
     320                                        break;
     321                                case HLU_SMIL:
     322                                        str += "M ";
     323                                        break;
     324                                case HLU_NMIL:
     325                                        str += "NM ";
     326                                        break;
     327                                }
     328                        }
     329                        str += String.format("%1.0f", dist);
     330                        Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45)));
     331                        }
     332                }
    301333        }
    302334       
     
    314346                }
    315347                if (feature.objs.get(Obj.TOPMAR) != null)
    316                         Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Floats, null);
     348                        Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, null, Topmarks.Floats);
    317349                Signals.addSignals(feature);
    318350        }
     
    331363                case ACHBRT:
    332364                        if (zoom >= 14) {
    333                                 Renderer.symbol(feature, Harbours.Anchorage, null, null, new Scheme(Mline));
    334                         Renderer.labelText(feature, name == null ? "" : (String) name.val, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 0)));
     365                                Renderer.symbol(feature, Harbours.Anchorage, null, new Scheme(Mline), null);
     366                        Renderer.labelText(feature, name == null ? "" : (String) name.val, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC));
    335367                        }
    336368                        double radius = (Double)Renderer.getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS);
     
    343375                        if (zoom >= 12) {
    344376                                if (feature.flag != Fflag.AREA) {
    345                                         Renderer.symbol(feature, Harbours.Anchorage, null, null, new Scheme(Color.black));
     377                                        Renderer.symbol(feature, Harbours.Anchorage, null, new Scheme(Color.black), null);
    346378                                } else {
    347                                         Renderer.symbol(feature, Harbours.Anchorage, null, null, new Scheme(Mline));
    348                                         Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, 10, Mline);
     379                                        Renderer.symbol(feature, Harbours.Anchorage, null, new Scheme(Mline), null);
     380                                        Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Mline);
    349381                                }
    350382                                if ((zoom >= 15) && ((name) != null)) {
     
    373405                                        break;
    374406                                case ACH_EXPL:
    375                                         Renderer.symbol(feature, Harbours.Explosives, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(Mline));
     407                                        Renderer.symbol(feature, Harbours.Explosives, null, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    376408                                        dy += 60;
    377409                                        break;
    378410                                case ACH_QUAR:
    379                                         Renderer.symbol(feature, Harbours.Hospital, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(Mline));
     411                                        Renderer.symbol(feature, Harbours.Hospital, null, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    380412                                        dy += 60;
    381413                                        break;
    382414                                case ACH_SEAP:
    383                                         Renderer.symbol(feature, Areas.Seaplane, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)), new Scheme(Mline));
     415                                        Renderer.symbol(feature, Areas.Seaplane, null, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    384416                                        dy += 60;
    385417                                        break;
     
    394426                case BUISGL:
    395427                  if (zoom >= 16) {
     428                        ArrayList<Symbol> symbols = new ArrayList();
    396429                        ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Renderer.getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN);
    397                         Renderer.symbol(feature, Landmarks.Funcs.get(fncs.get(0)), null, null, null);
     430                        for (FncFNC fnc : fncs) {
     431                                symbols.add(Landmarks.Funcs.get(fnc));
     432                        }
     433                          if (feature.objs.containsKey(Obj.SMCFAC))  {
     434                                ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) Renderer.getAttVal(feature, Obj.SMCFAC, 0, Att.CATSCF);
     435                                for (CatSCF scf : scfs) {
     436                                        symbols.add(Facilities.Cats.get(scf));
     437                                }
     438                          }
     439                          Renderer.cluster(feature, symbols);
    398440                  }
    399441                        break;
     
    401443        }
    402444/*
    403   if ((zoom >= 16) && is_type("anchor_berth")) symbol("anchor_berth");
    404445  if ((zoom >= 12) && is_type("harbour")) {
    405446    if (has_attribute("category")) {
     
    779820                if (zoom >= 14) {
    780821                        if (feature.type == Obj.PIPSOL) {
    781                                 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, 0, new Color(0x80c480));
     822                                Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Mline);
    782823                        } else if (feature.type == Obj.PIPOHD) {
    783824
     
    793834                AttItem name = feature.atts.get(Att.OBJNAM);
    794835                if ((zoom >= 15) && (name != null))
    795                         Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(60, -50)));
     836                        Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
    796837/*object_rules(platforms) {
    797838  if (has_object("fog_signal")) object(fogs);
     
    827868                        AttItem name = feature.atts.get(Att.OBJNAM);
    828869                        if ((zoom >= 10) && (name != null))
    829                                 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080), null, null);
     870                                Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080, true), null, null);
    830871                        break;
    831872                case TSELNE:
     
    833874                        break;
    834875                case TSSLPT:
    835                         Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, 0, new Color(0x80c48080, true));
     876                        Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, null, 0, new Color(0x80c48080, true));
    836877                        break;
    837878                case TSSBND:
     
    839880                        break;
    840881                case ISTZNE:
    841                         Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0, new Color(0x80c48080, true));
     882                        Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, new Color(0x80c48080, true));
    842883                        break;
    843884                }
     
    867908                        case SISTAW:
    868909                                Renderer.symbol(feature, Harbours.SignalStation, null, null, null);
     910                                String str = "SS";
     911                                //  Append (cat) to str
     912                                Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0)));
    869913                                break;
    870914                        case RDOSTA:
     
    881925                        case CGUSTA:
    882926                                Renderer.symbol(feature, Harbours.SignalStation, null, null, null);
     927                                Renderer.labelText(feature, "CG", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0)));
    883928                                break;
    884929                        case RSCSTA:
  • applications/editors/josm/plugins/smed2/src/seamap/Signals.java

    r30026 r30033  
    101101                        case ROS_VANC:
    102102                                Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
    103                                 Renderer.symbol(feature, Topmarks.TopNorth, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);
     103                                Renderer.symbol(feature, Topmarks.TopNorth, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    104104                                break;
    105105                        case ROS_VASC:
    106106                                Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
    107                                 Renderer.symbol(feature, Topmarks.TopSouth, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);
     107                                Renderer.symbol(feature, Topmarks.TopSouth, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    108108                                break;
    109109                        case ROS_VAEC:
    110110                                Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
    111                                 Renderer.symbol(feature, Topmarks.TopEast, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);
     111                                Renderer.symbol(feature, Topmarks.TopEast, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    112112                                break;
    113113                        case ROS_VAWC:
    114114                                Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
    115                                 Renderer.symbol(feature, Topmarks.TopWest, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);
     115                                Renderer.symbol(feature, Topmarks.TopWest, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    116116                                break;
    117117                        case ROS_VAPL:
    118118                                Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
    119                                 Renderer.symbol(feature, Topmarks.TopCan, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);
     119                                Renderer.symbol(feature, Topmarks.TopCan, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    120120                                break;
    121121                        case ROS_VASL:
    122122                                Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
    123                                 Renderer.symbol(feature, Topmarks.TopCone, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);
     123                                Renderer.symbol(feature, Topmarks.TopCone, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    124124                                break;
    125125                        case ROS_VAID:
    126126                                Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
    127                                 Renderer.symbol(feature, Topmarks.TopIsol, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);
     127                                Renderer.symbol(feature, Topmarks.TopIsol, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    128128                                break;
    129129                        case ROS_VASW:
    130130                                Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
    131                                 Renderer.symbol(feature, Topmarks.TopSphere, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);
     131                                Renderer.symbol(feature, Topmarks.TopSphere, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    132132                                break;
    133133                        case ROS_VASP:
    134134                                Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
    135                                 Renderer.symbol(feature, Topmarks.TopX, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);
     135                                Renderer.symbol(feature, Topmarks.TopX, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    136136                                break;
    137137                        case ROS_VAWK:
    138138                                Renderer.labelText(feature, " V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
    139                                 Renderer.symbol(feature, Topmarks.TopCross, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)), null);
     139                                Renderer.symbol(feature, Topmarks.TopCross, null, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     140                                break;
     141                        default:
    140142                                break;
    141143                        }
Note: See TracChangeset for help on using the changeset viewer.