Ignore:
Timestamp:
2013-01-06T16:33:30+01:00 (12 years ago)
Author:
malcolmh
Message:

save

File:
1 edited

Legend:

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

    r29174 r29175  
    1111
    1212import java.util.ArrayList;
    13 import java.util.EnumMap;
    14 import java.util.HashMap;
    1513
    16 import s57.S57att;
    17 import s57.S57val.BcnSHP;
     14import s57.S57val.*;
    1815import s57.S57att.*;
    19 import s57.S57obj;
    2016import s57.S57obj.*;
    21 import s57.S57val;
    22 import s57.S57val.*;
    2317
    2418import seamap.SeaMap.AttItem;
    2519import seamap.SeaMap.Feature;
    2620import symbols.Beacons;
    27 import symbols.Symbols.Instr;
     21import symbols.Buoys;
    2822
    2923public class Rules {
     
    106100       
    107101        private static void shoreline(ArrayList<Feature> features) {
    108                 for (Feature feature : features) {
    109                 }
     102//              for (Feature feature : features) {
     103//              }
    110104        }
    111105        private static void pipelines(ArrayList<Feature> features) {}
     
    131125        private static void gauges(ArrayList<Feature> features) {}
    132126        private static void platforms(ArrayList<Feature> features) {}
    133         private static void buoys(ArrayList<Feature> features) {}
     127        private static void buoys(ArrayList<Feature> features) {
     128                for (Feature feature : features) {
     129                        BoySHP shape = (BoySHP) Renderer.getAttVal(feature, feature.type, 0, Att.BOYSHP);
     130                        Renderer.symbol(feature, Buoys.Shapes.get(shape), feature.type);
     131                }
     132        }
    134133        private static void beacons(ArrayList<Feature> features) {
    135134                for (Feature feature : features) {
    136                         BcnSHP shape;
    137                         HashMap<Integer, EnumMap<Att, AttItem>> objs = feature.objs.get(feature.type);
    138                         if (objs == null) shape = BcnSHP.BCN_UNKN;
    139                         else {
    140                                 EnumMap<Att, AttItem> atts = objs.get(0);
    141                                 if (atts == null) shape = BcnSHP.BCN_UNKN;
    142                                 else {
    143                                         AttItem item = atts.get(Att.BCNSHP);
    144                                         if (item == null) shape = BcnSHP.BCN_UNKN;
    145                                         else shape = (BcnSHP) item.val;
     135                        BcnSHP shape = (BcnSHP) Renderer.getAttVal(feature, feature.type, 0, Att.BCNSHP);
     136                        if (((shape == BcnSHP.BCN_PRCH) || (shape == BcnSHP.BCN_WTHY)) && (feature.type == Obj.BCNLAT)) {
     137                                CatLAM cat = (CatLAM) Renderer.getAttVal(feature, feature.type, 0, Att.CATLAM);
     138                                switch (cat) {
     139                                case LAM_PORT:
     140                                        if (shape == BcnSHP.BCN_PRCH)
     141                                                Renderer.symbol(feature, Beacons.PerchPort, feature.type);
     142                                        else
     143                                                Renderer.symbol(feature, Beacons.WithyPort, feature.type);
     144                                        break;
     145                                case LAM_STBD:
     146                                        if (shape == BcnSHP.BCN_PRCH)
     147                                                Renderer.symbol(feature, Beacons.PerchStarboard, feature.type);
     148                                        else
     149                                                Renderer.symbol(feature, Beacons.WithyStarboard, feature.type);
     150                                        break;
     151                                default:
     152                                        Renderer.symbol(feature, Beacons.Stake, feature.type);
    146153                                }
    147                         }
    148                         if (shape == BcnSHP.BCN_PRCH) {
    149                                
    150                         } else if (shape == BcnSHP.BCN_WTHY) {
    151                                        
    152154                        } else {
    153                                 Renderer.symbol(feature, Beacons.Shapes.get(shape));
     155                                Renderer.symbol(feature, Beacons.Shapes.get(shape), feature.type);
    154156                        }
    155157                }
Note: See TracChangeset for help on using the changeset viewer.