Changeset 29175 in osm for applications/editors/josm/plugins/smed2/src/seamap/Rules.java
- Timestamp:
- 2013-01-06T16:33:30+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r29174 r29175 11 11 12 12 import java.util.ArrayList; 13 import java.util.EnumMap;14 import java.util.HashMap;15 13 16 import s57.S57att; 17 import s57.S57val.BcnSHP; 14 import s57.S57val.*; 18 15 import s57.S57att.*; 19 import s57.S57obj;20 16 import s57.S57obj.*; 21 import s57.S57val;22 import s57.S57val.*;23 17 24 18 import seamap.SeaMap.AttItem; 25 19 import seamap.SeaMap.Feature; 26 20 import symbols.Beacons; 27 import symbols. Symbols.Instr;21 import symbols.Buoys; 28 22 29 23 public class Rules { … … 106 100 107 101 private static void shoreline(ArrayList<Feature> features) { 108 for (Feature feature : features) { 109 } 102 // for (Feature feature : features) { 103 // } 110 104 } 111 105 private static void pipelines(ArrayList<Feature> features) {} … … 131 125 private static void gauges(ArrayList<Feature> features) {} 132 126 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 } 134 133 private static void beacons(ArrayList<Feature> features) { 135 134 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); 146 153 } 147 }148 if (shape == BcnSHP.BCN_PRCH) {149 150 } else if (shape == BcnSHP.BCN_WTHY) {151 152 154 } else { 153 Renderer.symbol(feature, Beacons.Shapes.get(shape)); 155 Renderer.symbol(feature, Beacons.Shapes.get(shape), feature.type); 154 156 } 155 157 }
Note:
See TracChangeset
for help on using the changeset viewer.