Changeset 29175 in osm for applications/editors/josm/plugins/smed2/src/seamap/Renderer.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/Renderer.java
r29174 r29175 14 14 import java.awt.geom.Point2D; 15 15 import java.util.ArrayList; 16 import java.util.EnumMap; 17 import java.util.HashMap; 16 18 19 import s57.S57att.Att; 20 import s57.S57obj.Obj; 21 import s57.S57val.ColCOL; 22 import s57.S57val.*; 23 import s57.S57val; 17 24 import seamap.SeaMap.*; 18 25 import symbols.Symbols; … … 40 47 } 41 48 42 public static void symbol(Feature feature, ArrayList<Instr> symbol) { 49 public static EnumMap<Att, AttItem> getAtts(Feature feature, Obj obj, int idx) { 50 HashMap<Integer, EnumMap<Att, AttItem>> objs = feature.objs.get(obj); 51 if (objs == null) return null; 52 else return objs.get(idx); 53 } 54 55 public static Object getAttVal(Feature feature, Obj obj, int idx, Att att) { 56 EnumMap<Att, AttItem> atts = getAtts(feature, obj, idx); 57 if (atts == null) return S57val.nullVal(att); 58 else { 59 AttItem item = atts.get(att); 60 if (item == null) return S57val.nullVal(att); 61 return item.val; 62 } 63 } 64 65 public static void symbol(Feature feature, ArrayList<Instr> symbol, Obj obj) { 43 66 Point2D point = helper.getPoint(map.nodes.get(feature.refs)); 44 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), null, null); 67 ArrayList<ColCOL> colours = (ArrayList<ColCOL>) getAttVal(feature, obj, 0, Att.COLOUR); 68 ArrayList<ColPAT> pattern = (ArrayList<ColPAT>) getAttVal(feature, obj, 0, Att.COLPAT); 69 Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), null, new Scheme(pattern, colours)); 45 70 } 46 71
Note:
See TracChangeset
for help on using the changeset viewer.