Changeset 30036 in osm


Ignore:
Timestamp:
2013-11-02T17:09:51+01:00 (11 years ago)
Author:
malcolmh
Message:

save

Location:
applications/editors/josm/plugins/smed2/src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/src/panels/ShowFrame.java

    r30033 r30036  
    4949                }
    5050
    51                 @Override
    5251                public Point2D getPoint(Snode coord) {
    5352                        return new Point2D.Double(150, 150);
  • applications/editors/josm/plugins/smed2/src/seamap/Renderer.java

    r30033 r30036  
    2828public class Renderer {
    2929
    30         public static final EnumMap<ColCOL, Color> bodyColours = new EnumMap<ColCOL, Color>(ColCOL.class);
    31         static {
    32                 bodyColours.put(ColCOL.COL_UNK, new Color(0, true));
    33                 bodyColours.put(ColCOL.COL_WHT, new Color(0xffffff));
    34                 bodyColours.put(ColCOL.COL_BLK, new Color(0x000000));
    35                 bodyColours.put(ColCOL.COL_RED, new Color(0xd40000));
    36                 bodyColours.put(ColCOL.COL_GRN, new Color(0x00d400));
    37                 bodyColours.put(ColCOL.COL_BLU, Color.blue);
    38                 bodyColours.put(ColCOL.COL_YEL, new Color(0xffd400));
    39                 bodyColours.put(ColCOL.COL_GRY, Color.gray);
    40                 bodyColours.put(ColCOL.COL_BRN, new Color(0x8b4513));
    41                 bodyColours.put(ColCOL.COL_AMB, new Color(0xfbf00f));
    42                 bodyColours.put(ColCOL.COL_VIO, new Color(0xee82ee));
    43                 bodyColours.put(ColCOL.COL_ORG, Color.orange);
    44                 bodyColours.put(ColCOL.COL_MAG, new Color(0xf000f0));
    45                 bodyColours.put(ColCOL.COL_PNK, Color.pink);
    46         }
    47 
    48         public static final EnumMap<ColPAT, Patt> pattMap = new EnumMap<ColPAT, Patt>(ColPAT.class);
    49         static {
    50                 pattMap.put(ColPAT.PAT_UNKN, Patt.Z);
    51                 pattMap.put(ColPAT.PAT_HORI, Patt.H);
    52                 pattMap.put(ColPAT.PAT_VERT, Patt.V);
    53                 pattMap.put(ColPAT.PAT_DIAG, Patt.D);
    54                 pattMap.put(ColPAT.PAT_BRDR, Patt.B);
    55                 pattMap.put(ColPAT.PAT_SQUR, Patt.S);
    56                 pattMap.put(ColPAT.PAT_CROS, Patt.C);
    57                 pattMap.put(ColPAT.PAT_SALT, Patt.X);
    58                 pattMap.put(ColPAT.PAT_STRP, Patt.H);
    59         }
    60        
    6130        public static final double symbolScale[] = { 256.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.61, 0.372, 0.227, 0.138, 0.0843, 0.0514, 0.0313, 0.0191, 0.0117, 0.007, 0.138 };
    6231
     
    8352        }
    8453
    85         public static AttMap getAtts(Feature feature, Obj obj, int idx) {
    86                 HashMap<Integer, AttMap> objs = feature.objs.get(obj);
    87                 if (objs == null)
    88                         return null;
    89                 else
    90                         return objs.get(idx);
    91         }
    92 
    93         public static Object getAttVal(Feature feature, Obj obj, int idx, Att att) {
    94                 AttMap atts = getAtts(feature, obj, idx);
    95                 if (atts == null)
    96                         return S57val.nullVal(att);
    97                 else {
    98                         AttItem item = atts.get(att);
    99                         if (item == null)
    100                                 return S57val.nullVal(att);
    101                         return item.val;
    102                 }
    103         }
    104 
    105         public static void symbol(Feature feature, Symbol symbol, Obj obj, Scheme scheme, Delta delta) {
    106                 Point2D point = context.getPoint(feature.centre);
    107                 if (obj == null) {
    108                         Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, delta);
    109                 } else {
    110                         ArrayList<Color> colours = new ArrayList<Color>();
    111                         for (ColCOL col : (ArrayList<ColCOL>)getAttVal(feature, obj, 0, Att.COLOUR)) {
    112                                 colours.add(bodyColours.get(col));
    113                         }
    114                         ArrayList<Patt> patterns = new ArrayList<Patt>();
    115                         for(ColPAT pat: (ArrayList<ColPAT>) getAttVal(feature, obj, 0, Att.COLPAT)) {
    116                                 patterns.add(pattMap.get(pat));
    117                         }
    118                         Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), new Scheme(patterns, colours), delta);
    119                 }
     54        public static void symbol(Feature feature, Symbol symbol) {
     55                Point2D point = context.getPoint(feature.centre);
     56                Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), null, null);
     57        }
     58       
     59        public static void symbol(Feature feature, Symbol symbol, Scheme scheme) {
     60                Point2D point = context.getPoint(feature.centre);
     61                Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, null);
     62        }
     63       
     64        public static void symbol(Feature feature, Symbol symbol, Delta delta) {
     65                Point2D point = context.getPoint(feature.centre);
     66                Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), null, delta);
     67        }
     68       
     69        public static void symbol(Feature feature, Symbol symbol, Scheme scheme, Delta delta) {
     70                Point2D point = context.getPoint(feature.centre);
     71                Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, delta);
    12072        }
    12173       
     
    13385                switch (symbols.size()) {
    13486                case 1:
    135                         symbol(feature, symbols.get(0), null, null, new Delta(Handle.CC, new AffineTransform()));
     87                        symbol(feature, symbols.get(0), new Delta(Handle.CC, new AffineTransform()));
    13688                        break;
    13789                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()));
     90                        symbol(feature, symbols.get(0), new Delta(Handle.RC, new AffineTransform()));
     91                        symbol(feature, symbols.get(1), new Delta(Handle.LC, new AffineTransform()));
    14092                        break;
    14193                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()));
     94                        symbol(feature, symbols.get(0), new Delta(Handle.BC, new AffineTransform()));
     95                        symbol(feature, symbols.get(1), new Delta(Handle.TR, new AffineTransform()));
     96                        symbol(feature, symbols.get(2), new Delta(Handle.TL, new AffineTransform()));
    14597                        break;
    14698                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()));
     99                        symbol(feature, symbols.get(0), new Delta(Handle.BR, new AffineTransform()));
     100                        symbol(feature, symbols.get(1), new Delta(Handle.BL, new AffineTransform()));
     101                        symbol(feature, symbols.get(2), new Delta(Handle.TR, new AffineTransform()));
     102                        symbol(feature, symbols.get(3), new Delta(Handle.TL, new AffineTransform()));
    151103                        break;
    152104                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)));
     105                        symbol(feature, symbols.get(0), new Delta(Handle.BR, new AffineTransform()));
     106                        symbol(feature, symbols.get(1), new Delta(Handle.BL, new AffineTransform()));
     107                        symbol(feature, symbols.get(2), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     108                        symbol(feature, symbols.get(3), new Delta(Handle.TC, new AffineTransform()));
     109                        symbol(feature, symbols.get(4), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
    158110                        break;
    159111                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)));
     112                        symbol(feature, symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     113                        symbol(feature, symbols.get(1), new Delta(Handle.BC, new AffineTransform()));
     114                        symbol(feature, symbols.get(2), new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     115                        symbol(feature, symbols.get(3), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     116                        symbol(feature, symbols.get(4), new Delta(Handle.TC, new AffineTransform()));
     117                        symbol(feature, symbols.get(5), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
    166118                        break;
    167119                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)));
     120                        symbol(feature, symbols.get(0), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
     121                        symbol(feature, symbols.get(1), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     122                        symbol(feature, symbols.get(2), new Delta(Handle.CC, new AffineTransform()));
     123                        symbol(feature, symbols.get(3), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     124                        symbol(feature, symbols.get(4), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
     125                        symbol(feature, symbols.get(5), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
     126                        symbol(feature, symbols.get(6), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
    175127                        break;
    176128                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)));
     129                        symbol(feature, symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
     130                        symbol(feature, symbols.get(1), new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
     131                        symbol(feature, symbols.get(2), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     132                        symbol(feature, symbols.get(3), new Delta(Handle.CC, new AffineTransform()));
     133                        symbol(feature, symbols.get(4), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     134                        symbol(feature, symbols.get(5), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
     135                        symbol(feature, symbols.get(6), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
     136                        symbol(feature, symbols.get(7), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
    185137                        break;
    186138                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)));
     139                        symbol(feature, symbols.get(0), new Delta(Handle.BR, AffineTransform.getTranslateInstance(-bbox.width/2, -bbox.height/2)));
     140                        symbol(feature, symbols.get(1), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -bbox.height/2)));
     141                        symbol(feature, symbols.get(2), new Delta(Handle.BL, AffineTransform.getTranslateInstance(bbox.width/2, -bbox.height/2)));
     142                        symbol(feature, symbols.get(3), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-bbox.width/2, 0)));
     143                        symbol(feature, symbols.get(4), new Delta(Handle.CC, new AffineTransform()));
     144                        symbol(feature, symbols.get(5), new Delta(Handle.LC, AffineTransform.getTranslateInstance(bbox.width/2, 0)));
     145                        symbol(feature, symbols.get(6), new Delta(Handle.TR, AffineTransform.getTranslateInstance(-bbox.width/2, bbox.height/2)));
     146                        symbol(feature, symbols.get(7), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, bbox.height/2)));
     147                        symbol(feature, symbols.get(8), new Delta(Handle.TL, AffineTransform.getTranslateInstance(bbox.width/2, bbox.height/2)));
    196148                        break;
    197149                }
  • applications/editors/josm/plugins/smed2/src/seamap/Rules.java

    r30033 r30036  
    108108       
    109109        private static void areas(Feature feature) {
    110                 AttItem name = feature.atts.get(Att.OBJNAM);
     110                String name = Util.getName(feature);
    111111                switch (feature.type) {
    112112                case DRGARE:
     
    116116                                Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, null));
    117117                        if ((zoom >= 12) && (name != null))
    118                                 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE, Color.black, null, null);
     118                                Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE, Color.black, null, null);
    119119                        break;
    120120                case FAIRWY:
     
    131131                case MARCUL:
    132132                        if (zoom >= 14)
    133                                 Renderer.symbol(feature, Areas.MarineFarm, Obj.MARCUL, null, null);
     133                                Renderer.symbol(feature, Areas.MarineFarm);
    134134                        if (zoom >= 16)
    135135                                Renderer.lineVector(feature, new LineStyle( Color.black, 4, new float[] { 10, 10 }, null));
    136136                        break;
    137137                case OSPARE:
    138                         if ((CatPRA)Renderer.getAttVal(feature, feature.type, 0, Att.CATPRA) == CatPRA.PRA_WFRM) {
    139                                 Renderer.symbol(feature, Areas.WindFarm, Obj.OSPARE, null, null);
     138                        if (Util.testAttribute(feature, feature.type, Att.CATPRA, CatPRA.PRA_WFRM)) {
     139                                Renderer.symbol(feature, Areas.WindFarm);
    140140                                Renderer.lineVector(feature, new LineStyle(Color.black, 20, new float[] { 40, 40 }, null));
    141141                                if ((zoom >= 15) && (name != null))
    142                                         Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));
     142                                        Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));
    143143                        }
    144144                        break;
     
    146146                        if (zoom >= 12) {
    147147                                Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Mline);
    148 //                              if ((CatREA)Renderer.getAttVal(feature, feature.type, 0, Att.CATREA) == CatREA.REA_NWAK)
    149 //                                      Renderer.symbol(feature, Areas.NoWake, Obj.RESARE, null);
     148                                if (Util.testAttribute(feature, feature.type, Att.CATPRA, CatREA.REA_NWAK)) {
     149                                        Renderer.symbol(feature, Areas.NoWake);
     150                                }
    150151                        }
    151152                        break;
    152153                case SEAARE:
    153                         switch ((CatSEA) Renderer.getAttVal(feature, feature.type, 0, Att.CATSEA)) {
     154                        switch ((CatSEA) Util.getAttVal(feature, feature.type, 0, Att.CATSEA)) {
    154155                        case SEA_RECH:
    155156                                break;
     
    160161                        case SEA_GAT:
    161162                        case SEA_NRRW:
     163                                break;
     164                        default:
    162165                                break;
    163166                        }
     
    203206                case SPLARE:
    204207                        if (zoom >= 12) {
    205                                 Renderer.symbol(feature, Areas.Plane, Obj.SPLARE, null, null);
     208                                Renderer.symbol(feature, Areas.Plane);
    206209                                Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Mline);
    207210                        }
    208211                        if ((zoom >= 15) && (name != null))
    209                                 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
     212                                Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
    210213                        break;
    211214                default:
     
    215218       
    216219        private static void beacons(Feature feature) {
    217                 BcnSHP shape = (BcnSHP) Renderer.getAttVal(feature, feature.type, 0, Att.BCNSHP);
     220                BcnSHP shape = (BcnSHP) Util.getAttVal(feature, feature.type, 0, Att.BCNSHP);
    218221                if (((shape == BcnSHP.BCN_PRCH) || (shape == BcnSHP.BCN_WTHY)) && (feature.type == Obj.BCNLAT)) {
    219                         CatLAM cat = (CatLAM) Renderer.getAttVal(feature, feature.type, 0, Att.CATLAM);
     222                        CatLAM cat = (CatLAM) Util.getAttVal(feature, feature.type, 0, Att.CATLAM);
    220223                        switch (cat) {
    221224                        case LAM_PORT:
    222225                                if (shape == BcnSHP.BCN_PRCH)
    223                                         Renderer.symbol(feature, Beacons.PerchPort, null, null, null);
     226                                        Renderer.symbol(feature, Beacons.PerchPort);
    224227                                else
    225                                         Renderer.symbol(feature, Beacons.WithyPort, null, null, null);
     228                                        Renderer.symbol(feature, Beacons.WithyPort);
    226229                                break;
    227230                        case LAM_STBD:
    228231                                if (shape == BcnSHP.BCN_PRCH)
    229                                         Renderer.symbol(feature, Beacons.PerchStarboard, null, null, null);
     232                                        Renderer.symbol(feature, Beacons.PerchStarboard);
    230233                                else
    231                                         Renderer.symbol(feature, Beacons.WithyStarboard, null, null, null);
     234                                        Renderer.symbol(feature, Beacons.WithyStarboard);
    232235                                break;
    233236                        default:
    234                                 Renderer.symbol(feature, Beacons.Stake, feature.type, null, null);
     237                                Renderer.symbol(feature, Beacons.Stake, Util.getScheme(feature, feature.type));
    235238                        }
    236239                } else {
    237                         Renderer.symbol(feature, Beacons.Shapes.get(shape), feature.type, null, null);
     240                        Renderer.symbol(feature, Beacons.Shapes.get(shape), Util.getScheme(feature, feature.type));
    238241                        if (feature.objs.get(Obj.TOPMAR) != null)
    239                                 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, null, Topmarks.Beacons);
     242                                Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Util.getScheme(feature, Obj.TOPMAR), Topmarks.BeaconDelta);
    240243                }
    241244                Signals.addSignals(feature);
     
    243246       
    244247        private static void buoys(Feature feature) {
    245                 BoySHP shape = (BoySHP) Renderer.getAttVal(feature, feature.type, 0, Att.BOYSHP);
    246                 Renderer.symbol(feature, Buoys.Shapes.get(shape), feature.type, null, null);
    247                 if (feature.objs.get(Obj.TOPMAR) != 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));
     248                BoySHP shape = (BoySHP) Util.getAttVal(feature, feature.type, 0, Att.BOYSHP);
     249                Renderer.symbol(feature, Buoys.Shapes.get(shape), Util.getScheme(feature, feature.type));
     250                if (Util.hasObject(feature, Obj.TOPMAR)) {
     251                        Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Util.getScheme(feature, Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape));
    249252                }
    250253                Signals.addSignals(feature);
     
    296299        private static void distances(Feature feature) {
    297300                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);
     301                        if (!Util.testAttribute(feature, Obj.DISMAR, Att.CATDIS, CatDIS.DIS_NONI)) {
     302                                Renderer.symbol(feature, Harbours.DistanceI);
    300303                        } 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)));
     304                                Renderer.symbol(feature, Harbours.DistanceU);
     305                        }
     306                        if ((zoom >=15) && Util.hasAttribute(feature, Obj.DISMAR, Att.WTWDIS)) {
     307                                AttMap atts = feature.objs.get(Obj.DISMAR).get(0);
     308                                Double dist = (Double) atts.get(Att.WTWDIS).val;
     309                                String str = "";
     310                                if (atts.containsKey(Att.HUNITS)) {
     311                                        switch ((UniHLU) atts.get(Att.HUNITS).val) {
     312                                        case HLU_METR:
     313                                                str += "m ";
     314                                                break;
     315                                        case HLU_FEET:
     316                                                str += "ft ";
     317                                                break;
     318                                        case HLU_HMTR:
     319                                                str += "hm ";
     320                                                break;
     321                                        case HLU_KMTR:
     322                                                str += "km ";
     323                                                break;
     324                                        case HLU_SMIL:
     325                                                str += "M ";
     326                                                break;
     327                                        case HLU_NMIL:
     328                                                str += "NM ";
     329                                                break;
     330                                        default:
     331                                                break;
     332                                        }
     333                                }
     334                                str += String.format("%1.0f", dist);
     335                                Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45)));
    331336                        }
    332337                }
     
    336341                switch (feature.type) {
    337342                case LITVES:
    338                         Renderer.symbol(feature, Buoys.Super, feature.type, null, null);
     343                        Renderer.symbol(feature, Buoys.Super, Util.getScheme(feature, feature.type));
    339344                        break;
    340345                case LITFLT:
    341                         Renderer.symbol(feature, Buoys.Float, feature.type, null, null);
     346                        Renderer.symbol(feature, Buoys.Float, Util.getScheme(feature, feature.type));
    342347                        break;
    343348                case BOYINB:
    344                         Renderer.symbol(feature, Buoys.Super, feature.type, null, null);
     349                        Renderer.symbol(feature, Buoys.Super, Util.getScheme(feature, feature.type));
     350                        break;
     351                default:
    345352                        break;
    346353                }
    347354                if (feature.objs.get(Obj.TOPMAR) != null)
    348                         Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, null, Topmarks.Floats);
     355                        Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Util.getScheme(feature, Obj.TOPMAR), Topmarks.FloatDelta);
    349356                Signals.addSignals(feature);
    350357        }
     
    359366       
    360367        private static void harbours(Feature feature) {
    361                 AttItem name = feature.atts.get(Att.OBJNAM);
     368                String name = Util.getName(feature);
    362369                switch (feature.type) {
    363370                case ACHBRT:
    364371                        if (zoom >= 14) {
    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));
    367                         }
    368                         double radius = (Double)Renderer.getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS);
     372                                Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Mline));
     373                        Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC));
     374                        }
     375                        double radius = (Double)Util.getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS);
    369376                        if (radius != 0) {
    370                                 UniHLU units = (UniHLU)Renderer.getAttVal(feature, Obj.ACHBRT, 0, Att.HUNITS);
     377                                UniHLU units = (UniHLU)Util.getAttVal(feature, Obj.ACHBRT, 0, Att.HUNITS);
    371378                                Renderer.lineCircle (feature, new LineStyle(Mline, 4, new float[] { 10, 10 }, null), radius, units);
    372379                        }
     
    375382                        if (zoom >= 12) {
    376383                                if (feature.flag != Fflag.AREA) {
    377                                         Renderer.symbol(feature, Harbours.Anchorage, null, new Scheme(Color.black), null);
     384                                        Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Color.black));
    378385                                } else {
    379                                         Renderer.symbol(feature, Harbours.Anchorage, null, new Scheme(Mline), null);
     386                                        Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Mline));
    380387                                        Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Mline);
    381388                                }
    382389                                if ((zoom >= 15) && ((name) != null)) {
    383                                         Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
    384                                 }
    385                                 ArrayList<StsSTS> sts = (ArrayList<StsSTS>)Renderer.getAttVal(feature, Obj.ACHARE, 0, Att.STATUS);
     390                                        Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
     391                                }
     392                                ArrayList<StsSTS> sts = (ArrayList<StsSTS>)Util.getAttVal(feature, Obj.ACHARE, 0, Att.STATUS);
    386393                                if ((zoom >= 15) && (sts != null) && (sts.contains(StsSTS.STS_RESV))) {
    387394                                        Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));
    388395                                }
    389396                        }
    390                         ArrayList<CatACH> cats = (ArrayList<CatACH>)Renderer.getAttVal(feature, Obj.ACHARE, 0, Att.CATACH);
     397                        ArrayList<CatACH> cats = (ArrayList<CatACH>)Util.getAttVal(feature, Obj.ACHARE, 0, Att.CATACH);
    391398                        int dy = (cats.size() - 1) * -30;
    392399                        for (CatACH cat : cats) {
     
    405412                                        break;
    406413                                case ACH_EXPL:
    407                                         Renderer.symbol(feature, Harbours.Explosives, null, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     414                                        Renderer.symbol(feature, Harbours.Explosives, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    408415                                        dy += 60;
    409416                                        break;
    410417                                case ACH_QUAR:
    411                                         Renderer.symbol(feature, Harbours.Hospital, null, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     418                                        Renderer.symbol(feature, Harbours.Hospital, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    412419                                        dy += 60;
    413420                                        break;
    414421                                case ACH_SEAP:
    415                                         Renderer.symbol(feature, Areas.Seaplane, null, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     422                                        Renderer.symbol(feature, Areas.Seaplane, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    416423                                        dy += 60;
    417424                                        break;
     
    421428                case BERTHS:
    422429                        if (zoom >= 14) {
    423                                 Renderer.labelText(feature, name == null ? " " : (String) name.val, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Mline, Color.white, null);
     430                                Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Mline, Color.white, null);
    424431                        }
    425432                        break;
     
    427434                  if (zoom >= 16) {
    428435                        ArrayList<Symbol> symbols = new ArrayList();
    429                         ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Renderer.getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN);
     436                        ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Util.getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN);
    430437                        for (FncFNC fnc : fncs) {
    431438                                symbols.add(Landmarks.Funcs.get(fnc));
    432439                        }
    433440                          if (feature.objs.containsKey(Obj.SMCFAC))  {
    434                                 ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) Renderer.getAttVal(feature, Obj.SMCFAC, 0, Att.CATSCF);
     441                                ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) Util.getAttVal(feature, Obj.SMCFAC, 0, Att.CATSCF);
    435442                                for (CatSCF scf : scfs) {
    436443                                        symbols.add(Facilities.Cats.get(scf));
     
    439446                          Renderer.cluster(feature, symbols);
    440447                  }
     448                        break;
     449                default:
    441450                        break;
    442451                }
     
    457466       
    458467        private static void landmarks(Feature feature) {
    459                 ArrayList<CatLMK> cats = (ArrayList<CatLMK>) Renderer.getAttVal(feature, feature.type, 0, Att.CATLMK);
     468                ArrayList<CatLMK> cats = (ArrayList<CatLMK>) Util.getAttVal(feature, feature.type, 0, Att.CATLMK);
    460469                Symbol catSym = Landmarks.Shapes.get(cats.get(0));
    461                 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Renderer.getAttVal(feature, feature.type, 0, Att.FUNCTN);
     470                ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) Util.getAttVal(feature, feature.type, 0, Att.FUNCTN);
    462471                Symbol fncSym = Landmarks.Funcs.get(fncs.get(0));
    463472                if ((fncs.get(0) == FncFNC.FNC_CHCH) && (cats.get(0) == CatLMK.LMK_TOWR))
     
    467476                if (cats.get(0) == CatLMK.LMK_RADR)
    468477                        fncSym = Landmarks.RadioTV;
    469                 Renderer.symbol(feature, catSym, null, null, null);
    470                 Renderer.symbol(feature, fncSym, null, null, null);
     478                Renderer.symbol(feature, catSym);
     479                Renderer.symbol(feature, fncSym);
    471480/*  if (!has_attribute("function") && !has_attribute("category") && has_object("light")) {
    472481    symbol("lighthouse");
     
    488497                switch (feature.type) {
    489498                case LITMAJ:
    490                         Renderer.symbol(feature, Beacons.LightMajor, null, null, null);
     499                        Renderer.symbol(feature, Beacons.LightMajor);
    491500                        break;
    492501                case LITMIN:
    493502                case LIGHTS:
    494                         Renderer.symbol(feature, Beacons.LightMinor, null, null, null);
     503                        Renderer.symbol(feature, Beacons.LightMinor);
    495504                        break;
    496505                }
     
    499508       
    500509        private static void locks(Feature feature) {
    501 /*object_rules(locks) {
    502   if ((zoom>=13) && is_type("lock_basin|lock_basin_part")) symbol("lock");
    503   if ((zoom>=15) && is_type("gate")) symbol("lock_gate");
    504 }
    505 */
    506510        }
    507511        private static void marinas(Feature feature) {
     
    509513                       
    510514                }
    511 /*      int n = countObjects(item, type);
    512       Atta_t atta = enumAttribute("category", obja);
    513       char **map = cluster_map(obja);
    514       if (map == NULL) return;
    515       switch (n) {
    516         case 0: {
    517           Obj_t *obj = getObj(item, obja, 0);
    518           int n = countValues(getAtt(obj, atta));
    519           switch (n) {
    520             case 1:
    521               renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", CC, 0, 0, 0);
    522               break;
    523             case 2:
    524               renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", RC, 0, 0, 0);
    525               renderSymbol(item, obja, map[getAttEnum(obj, atta, 1)], "", "", LC, 0, 0, 0);
    526               break;
    527             case 3:
    528               renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", BC, 0, 0, 0);
    529               renderSymbol(item, obja, map[getAttEnum(obj, atta, 1)], "", "", TR, 0, 0, 0);
    530               renderSymbol(item, obja, map[getAttEnum(obj, atta, 2)], "", "", TL, 0, 0, 0);
    531               break;
    532             case 4:
    533               renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", BR, 0, 0, 0);
    534               renderSymbol(item, obja, map[getAttEnum(obj, atta, 1)], "", "", BL, 0, 0, 0);
    535               renderSymbol(item, obja, map[getAttEnum(obj, atta, 2)], "", "", TR, 0, 0, 0);
    536               renderSymbol(item, obja, map[getAttEnum(obj, atta, 3)], "", "", TL, 0, 0, 0);
    537               break;
    538           }
    539         }
    540           break;
    541         case 1:
    542           renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", CC, 0, 0, 0);
    543           break;
    544         case 2:
    545           renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", RC, 0, 0, 0);
    546           renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 2), atta, 0)], "", "", LC, 0, 0, 0);
    547           break;
    548         case 3:
    549           renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", BC, 0, 0, 0);
    550           renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 2), atta, 0)], "", "", TR, 0, 0, 0);
    551           renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 3), atta, 0)], "", "", TL, 0, 0, 0);
    552           break;
    553         case 4:
    554           renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", BR, 0, 0, 0);
    555           renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 2), atta, 0)], "", "", BL, 0, 0, 0);
    556           renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 3), atta, 0)], "", "", TR, 0, 0, 0);
    557           renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 4), atta, 0)], "", "", TL, 0, 0, 0);
    558           break;
    559       }
    560 */
    561515        }
    562516       
    563517        private static void moorings(Feature feature) {
    564                 CatMOR cat = (CatMOR) Renderer.getAttVal(feature, feature.type, 0, Att.CATMOR);
     518                CatMOR cat = (CatMOR) Util.getAttVal(feature, feature.type, 0, Att.CATMOR);
    565519                switch (cat) {
    566520                case MOR_DLPN:
    567                         Renderer.symbol(feature, Harbours.Dolphin, null, null, null);
     521                        Renderer.symbol(feature, Harbours.Dolphin);
    568522                        break;
    569523                case MOR_DDPN:
    570                         Renderer.symbol(feature, Harbours.DeviationDolphin, null, null, null);
     524                        Renderer.symbol(feature, Harbours.DeviationDolphin);
    571525                        break;
    572526                case MOR_BLRD:
    573527                case MOR_POST:
    574                         Renderer.symbol(feature, Harbours.Bollard, null, null, null);
     528                        Renderer.symbol(feature, Harbours.Bollard);
    575529                        break;
    576530                case MOR_BUOY:
    577                         BoySHP shape = (BoySHP) Renderer.getAttVal(feature, feature.type, 0, Att.BOYSHP);
     531                        BoySHP shape = (BoySHP) Util.getAttVal(feature, feature.type, 0, Att.BOYSHP);
    578532                        if (shape == BoySHP.BOY_UNKN)
    579533                                shape = BoySHP.BOY_SPHR;
    580                         Renderer.symbol(feature, Buoys.Shapes.get(shape), feature.type, null, null);
     534                        Renderer.symbol(feature, Buoys.Shapes.get(shape), Util.getScheme(feature, feature.type));
    581535                        break;
    582536                }
     
    802756        private static void obstructions(Feature feature) {
    803757                if ((zoom >= 14) && (feature.type == Obj.UWTROC)) {
    804                         WatLEV lvl = (WatLEV) Renderer.getAttVal(feature, feature.type, 0, Att.WATLEV);
     758                        WatLEV lvl = (WatLEV) Util.getAttVal(feature, feature.type, 0, Att.WATLEV);
    805759                        switch (lvl) {
    806760                        case LEV_CVRS:
    807                                 Renderer.symbol(feature, Areas.RockC, null, null, null);
     761                                Renderer.symbol(feature, Areas.RockC);
    808762                                break;
    809763                        case LEV_AWSH:
    810                                 Renderer.symbol(feature, Areas.RockA, null, null, null);
     764                                Renderer.symbol(feature, Areas.RockA);
    811765                                break;
    812766                        default:
    813                                 Renderer.symbol(feature, Areas.Rock, null, null, null);
     767                                Renderer.symbol(feature, Areas.Rock);
    814768                        }
    815769                } else {
    816                         Renderer.symbol(feature, Areas.Rock, null, null, null);
     770                        Renderer.symbol(feature, Areas.Rock);
    817771                }
    818772        }
     
    827781        }
    828782        private static void platforms(Feature feature) {
    829                 ArrayList<CatOFP> cats = (ArrayList<CatOFP>)Renderer.getAttVal(feature, Obj.OFSPLF, 0, Att.CATOFP);
     783                ArrayList<CatOFP> cats = (ArrayList<CatOFP>)Util.getAttVal(feature, Obj.OFSPLF, 0, Att.CATOFP);
    830784                if ((CatOFP) cats.get(0) == CatOFP.OFP_FPSO)
    831                         Renderer.symbol(feature, Buoys.Storage, null, null, null);
     785                        Renderer.symbol(feature, Buoys.Storage);
    832786                else
    833                         Renderer.symbol(feature, Landmarks.Platform, null, null, null);
    834                 AttItem name = feature.atts.get(Att.OBJNAM);
     787                        Renderer.symbol(feature, Landmarks.Platform);
     788                String name = Util.getName(feature);
    835789                if ((zoom >= 15) && (name != null))
    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)));
     790                        Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
    837791/*object_rules(platforms) {
    838792  if (has_object("fog_signal")) object(fogs);
     
    845799                if (zoom >= 14) {
    846800                        if (feature.type == Obj.CRANES) {
    847                                 if ((CatCRN) Renderer.getAttVal(feature, feature.type, 0, Att.CATCRN) == CatCRN.CRN_CONT)
    848                                         Renderer.symbol(feature, Harbours.ContainerCrane, null, null, null);
     801                                if ((CatCRN) Util.getAttVal(feature, feature.type, 0, Att.CATCRN) == CatCRN.CRN_CONT)
     802                                        Renderer.symbol(feature, Harbours.ContainerCrane);
    849803                                else
    850                                         Renderer.symbol(feature, Harbours.PortCrane, null, null, null);
     804                                        Renderer.symbol(feature, Harbours.PortCrane);
    851805                        } else if (feature.type == Obj.HULKES) {
    852806                                Renderer.lineVector(feature, new LineStyle(Color.black, 4, null, new Color(0xffe000)));
    853                                 AttItem name = feature.atts.get(Att.OBJNAM);
     807                                String name = Util.getName(feature);
    854808                                if ((zoom >= 15) && (name != null))
    855                                         Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, null);
     809                                        Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, null);
    856810                        }
    857811                }
     
    866820                        else
    867821                                Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, null, null));
    868                         AttItem name = feature.atts.get(Att.OBJNAM);
     822                        String name = Util.getName(feature);
    869823                        if ((zoom >= 10) && (name != null))
    870                                 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080, true), null, null);
     824                                Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080, true), null, null);
    871825                        break;
    872826                case TSELNE:
     
    886840        private static void shoreline(Feature feature) {
    887841                if (zoom >= 12) {
    888                         switch ((CatSLC) Renderer.getAttVal(feature, feature.type, 0, Att.CATSLC)) {
     842                        switch ((CatSLC) Util.getAttVal(feature, feature.type, 0, Att.CATSLC)) {
    889843                        case SLC_TWAL:
    890                                 WatLEV lev = (WatLEV) Renderer.getAttVal(feature, feature.type, 0, Att.WATLEV);
     844                                WatLEV lev = (WatLEV) Util.getAttVal(feature, feature.type, 0, Att.WATLEV);
    891845                                if (lev == WatLEV.LEV_CVRS) {
    892846                                        Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
     
    907861                        case SISTAT:
    908862                        case SISTAW:
    909                                 Renderer.symbol(feature, Harbours.SignalStation, null, null, null);
     863                                Renderer.symbol(feature, Harbours.SignalStation);
    910864                                String str = "SS";
    911865                                //  Append (cat) to str
     
    913867                                break;
    914868                        case RDOSTA:
    915                                 Renderer.symbol(feature, Harbours.SignalStation, null, null, null);
    916                                 Renderer.symbol(feature, Beacons.RadarStation, null, null, null);
     869                                Renderer.symbol(feature, Harbours.SignalStation);
     870                                Renderer.symbol(feature, Beacons.RadarStation);
    917871                                break;
    918872                        case RADSTA:
    919                                 Renderer.symbol(feature, Harbours.SignalStation, null, null, null);
    920                                 Renderer.symbol(feature, Beacons.RadarStation, null, null, null);
     873                                Renderer.symbol(feature, Harbours.SignalStation);
     874                                Renderer.symbol(feature, Beacons.RadarStation);
    921875                                break;
    922876                        case PILBOP:
    923                                 Renderer.symbol(feature, Harbours.Pilot, null, null, null);
     877                                Renderer.symbol(feature, Harbours.Pilot);
    924878                                break;
    925879                        case CGUSTA:
    926                                 Renderer.symbol(feature, Harbours.SignalStation, null, null, null);
     880                                Renderer.symbol(feature, Harbours.SignalStation);
    927881                                Renderer.labelText(feature, "CG", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0)));
    928882                                break;
    929883                        case RSCSTA:
    930                                 Renderer.symbol(feature, Harbours.Rescue, null, null, null);
     884                                Renderer.symbol(feature, Harbours.Rescue);
    931885                                break;
    932886                        }
     
    942896          if (zoom >= 15) {
    943897                String str = "";
    944                         AttItem name = feature.atts.get(Att.OBJNAM);
    945                         if (name != null) str += (String)name.val + " ";
    946                         Double ort = (Double) Renderer.getAttVal(feature, feature.type, 0, Att.ORIENT);
     898                        String name = Util.getName(feature);
     899                        if (name != null) str += name + " ";
     900                        Double ort = (Double) Util.getAttVal(feature, feature.type, 0, Att.ORIENT);
    947901                        if (ort != null) str += ort.toString() + "\u0152";
    948902                        if (!str.isEmpty()) Renderer.lineText(feature, str, new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20);
     
    950904        }
    951905        private static void waterways(Feature feature) {
     906               
    952907        }
    953908       
    954909        private static void wrecks(Feature feature) {
    955910                if (zoom >= 14) {
    956                         CatWRK cat = (CatWRK) Renderer.getAttVal(feature, feature.type, 0, Att.CATWRK);
     911                        CatWRK cat = (CatWRK) Util.getAttVal(feature, feature.type, 0, Att.CATWRK);
    957912                        switch (cat) {
    958913                        case WRK_DNGR:
    959914                        case WRK_MSTS:
    960                                 Renderer.symbol(feature, Areas.WreckD, null, null, null);
     915                                Renderer.symbol(feature, Areas.WreckD);
    961916                                break;
    962917                        case WRK_HULS:
    963                                 Renderer.symbol(feature, Areas.WreckS, null, null, null);
     918                                Renderer.symbol(feature, Areas.WreckS);
    964919                                break;
    965920                        default:
    966                                 Renderer.symbol(feature, Areas.WreckND, null, null, null);
     921                                Renderer.symbol(feature, Areas.WreckND);
    967922                        }
    968923                }
  • applications/editors/josm/plugins/smed2/src/seamap/Signals.java

    r30033 r30036  
    4040
    4141        public static void radarStations(Feature feature) {
    42                 Renderer.symbol(feature, Beacons.RadarStation, null, null, null);
    43                 ArrayList<CatROS> cats = (ArrayList<CatROS>)Renderer.getAttVal(feature, Obj.RDOSTA, 0, Att.CATROS);
     42                Renderer.symbol(feature, Beacons.RadarStation);
     43                ArrayList<CatROS> cats = (ArrayList<CatROS>)Util.getAttVal(feature, Obj.RDOSTA, 0, Att.CATROS);
    4444                String str = "";
    4545                for (CatROS ros : cats) {
     
    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, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     103                                Renderer.symbol(feature, Topmarks.TopNorth, 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, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     107                                Renderer.symbol(feature, Topmarks.TopSouth, 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, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     111                                Renderer.symbol(feature, Topmarks.TopEast, 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, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     115                                Renderer.symbol(feature, Topmarks.TopWest, 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, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     119                                Renderer.symbol(feature, Topmarks.TopCan, 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, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     123                                Renderer.symbol(feature, Topmarks.TopCone, 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, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     127                                Renderer.symbol(feature, Topmarks.TopIsol, 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, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     131                                Renderer.symbol(feature, Topmarks.TopSphere, 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, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     135                                Renderer.symbol(feature, Topmarks.TopX, 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, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
     139                                Renderer.symbol(feature, Topmarks.TopCross, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -25)));
    140140                                break;
    141141                        default:
  • applications/editors/josm/plugins/smed2/src/symbols/Topmarks.java

    r30029 r30036  
    228228                 Shapes.put(TopSHP.TOP_SALT, TopX);
    229229        }
    230         public static final EnumMap<BoySHP, Delta> Buoys = new EnumMap<BoySHP, Delta>(BoySHP.class);
    231         static {
    232                 Buoys.put(BoySHP.BOY_PILR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 31.5, -95.0)));
    233                 Buoys.put(BoySHP.BOY_SPAR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 31.5, -95.0)));
    234                 Buoys.put(BoySHP.BOY_CAN, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));
    235                 Buoys.put(BoySHP.BOY_CONE, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));
    236                 Buoys.put(BoySHP.BOY_SPHR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));
    237                 Buoys.put(BoySHP.BOY_BARL, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));
    238                 Buoys.put(BoySHP.BOY_SUPR, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -42.0)));
    239                 Buoys.put(BoySHP.BOY_ICE, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -25.0)));
    240         }
    241         public static final Delta Floats = new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -42.0));
    242         public static final Delta Beacons = new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -70.0));
     230        public static final EnumMap<BoySHP, Delta> BuoyDeltas = new EnumMap<BoySHP, Delta>(BoySHP.class);
     231        static {
     232                BuoyDeltas.put(BoySHP.BOY_PILR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 31.5, -95.0)));
     233                BuoyDeltas.put(BoySHP.BOY_SPAR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 31.5, -95.0)));
     234                BuoyDeltas.put(BoySHP.BOY_CAN, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));
     235                BuoyDeltas.put(BoySHP.BOY_CONE, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));
     236                BuoyDeltas.put(BoySHP.BOY_SPHR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));
     237                BuoyDeltas.put(BoySHP.BOY_BARL, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));
     238                BuoyDeltas.put(BoySHP.BOY_SUPR, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -42.0)));
     239                BuoyDeltas.put(BoySHP.BOY_ICE, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -25.0)));
     240        }
     241        public static final Delta FloatDelta = new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -42.0));
     242        public static final Delta BeaconDelta = new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -70.0));
    243243
    244244}
Note: See TracChangeset for help on using the changeset viewer.