Changeset 31532 in osm for applications/editors/josm/plugins/seachart/src/render
- Timestamp:
- 2015-08-29T16:55:46+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/seachart/src/render
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/render/ChartContext.java
r31343 r31532 16 16 17 17 public interface ChartContext { 18 public enum RuleSet { ALL, BASE, SEAMARK } 19 18 20 Point2D getPoint(Snode coord); 19 21 double mile(Feature feature); 20 22 boolean clip(); 21 23 Color background(); 24 RuleSet ruleset(); 22 25 } -
applications/editors/josm/plugins/seachart/src/render/Renderer.java
r31343 r31532 16 16 import java.util.*; 17 17 18 import render.Rules.*;19 18 import s57.S57val.*; 20 19 import s57.S57map; … … 36 35 static int zoom; 37 36 38 public static void reRender(Graphics2D g, R uleSet set, Rectangle rect, int z, double factor, S57map m, ChartContext c) {37 public static void reRender(Graphics2D g, Rectangle rect, int z, double factor, S57map m, ChartContext c) { 39 38 g2 = g; 40 39 zoom = z; … … 53 52 g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP); 54 53 g2.setStroke(new BasicStroke(0, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)); 55 Rules.rules( set);54 Rules.rules(); 56 55 } 57 56 } -
applications/editors/josm/plugins/seachart/src/render/Rules.java
r31344 r31532 22 22 import s57.S57obj.*; 23 23 import s57.S57map.*; 24 import render.ChartContext.RuleSet; 24 25 import render.Renderer.*; 25 26 import symbols.*; … … 28 29 public class Rules { 29 30 30 public enum RuleSet { ALL, BASE, SEAMARK }31 32 31 static final EnumMap<ColCOL, Color> bodyColours = new EnumMap<ColCOL, Color>(ColCOL.class); 33 32 static { … … 173 172 static Feature feature; 174 173 static ArrayList<Feature> objects; 175 static RuleSet ruleset;176 174 177 175 static boolean testObject(Obj obj) { … … 183 181 } 184 182 185 public static void rules (RuleSet set) { 186 ruleset = set; 187 if ((set == RuleSet.ALL) || (set == RuleSet.BASE)) { 183 public static void rules () { 184 if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.BASE)) { 188 185 if (testObject(Obj.LNDARE)) for (Feature f : objects) if (testFeature(f)) areas(); 189 186 if (testObject(Obj.BUAARE)) for (Feature f : objects) if (testFeature(f)) areas(); … … 202 199 } 203 200 if (testObject(Obj.SLCONS)) for (Feature f : objects) if (testFeature(f)) shoreline(); 204 if (( set == RuleSet.ALL) || (set== RuleSet.SEAMARK)) {201 if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.SEAMARK)) { 205 202 if (testObject(Obj.PIPSOL)) for (Feature f : objects) if (testFeature(f)) pipelines(); 206 203 if (testObject(Obj.CBLSUB)) for (Feature f : objects) if (testFeature(f)) cables(); … … 443 440 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0); 444 441 if (topmap.containsKey(Att.TOPSHP)) { 445 Symbol topmark = Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)); 446 if (topmark != null) 447 Renderer.symbol(feature, topmark, getScheme(feature, Obj.TOPMAR), Topmarks.BeaconDelta); 442 Renderer.symbol(feature, Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(feature, Obj.TOPMAR), Topmarks.BeaconDelta); 448 443 } 449 444 } else if (feature.objs.containsKey(Obj.DAYMAR)) { 450 445 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0); 451 446 if (topmap.containsKey(Att.TOPSHP)) { 452 Symbol topmark = Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)); 453 if (topmark != null) 454 Renderer.symbol(feature, topmark, getScheme(feature, Obj.DAYMAR), Topmarks.BeaconDelta); 447 Renderer.symbol(feature, Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(feature, Obj.DAYMAR), Topmarks.BeaconDelta); 455 448 } 456 449 } … … 468 461 AttMap topmap = feature.objs.get(Obj.TOPMAR).get(0); 469 462 if (topmap.containsKey(Att.TOPSHP)) { 470 Symbol topmark = Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)); 471 if (topmark != null) 472 Renderer.symbol(feature, topmark, getScheme(feature, Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape)); 463 Renderer.symbol(feature, Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(feature, Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape)); 473 464 } 474 465 } else if (feature.objs.containsKey(Obj.DAYMAR)) { 475 466 AttMap topmap = feature.objs.get(Obj.DAYMAR).get(0); 476 467 if (topmap.containsKey(Att.TOPSHP)) { 477 Symbol topmark = Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)); 478 if (topmark != null) 479 Renderer.symbol(feature, topmark, getScheme(feature, Obj.DAYMAR), Topmarks.BuoyDeltas.get(shape)); 468 Renderer.symbol(feature, Topmarks.Shapes.get(((ArrayList<TopSHP>)(topmap.get(Att.TOPSHP).val)).get(0)), getScheme(feature, Obj.DAYMAR), Topmarks.BuoyDeltas.get(shape)); 480 469 } 481 470 } … … 1035 1024 private static void shoreline() { 1036 1025 CatSLC cat = (CatSLC) getAttEnum(feature, feature.type, 0, Att.CATSLC); 1037 if (( ruleset == RuleSet.ALL) || (ruleset== RuleSet.BASE)) {1026 if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.BASE)) { 1038 1027 if ((cat != CatSLC.SLC_SWAY) && (cat != CatSLC.SLC_TWAL)) { 1039 1028 Renderer.lineVector(feature, new LineStyle(Color.black, 10, Symbols.Yland)); 1040 1029 } 1041 1030 } 1042 if (( ruleset == RuleSet.ALL) || (ruleset== RuleSet.SEAMARK)) {1031 if ((Renderer.context.ruleset() == RuleSet.ALL) || (Renderer.context.ruleset() == RuleSet.SEAMARK)) { 1043 1032 if (Renderer.zoom >= 12) { 1044 1033 switch (cat) {
Note:
See TracChangeset
for help on using the changeset viewer.