Ignore:
Timestamp:
2015-02-17T14:05:54+01:00 (10 years ago)
Author:
malcolmh
Message:

coast/land processing

Location:
applications/editors/josm/plugins/seachart/src/render
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/seachart/src/render/Renderer.java

    r30894 r31014  
    251251                while (git.hasComp()) {
    252252                        git.nextComp();
     253                        boolean first = true;
    253254                        while (git.hasEdge()) {
    254255                                git.nextEdge();
    255256                                point = context.getPoint(git.next());
    256                                 p.moveTo(point.getX(), point.getY());
     257                                if (first) {
     258                                        p.moveTo(point.getX(), point.getY());
     259                                        first = false;
     260                                } else {
     261                                        p.lineTo(point.getX(), point.getY());
     262                                }
    257263                                while (git.hasNode()) {
    258264                                        point = context.getPoint(git.next());
  • applications/editors/josm/plugins/seachart/src/render/Rules.java

    r30992 r31014  
    2828public class Rules {
    2929
    30         public static final Color Yland = new Color(0xeca818);
    31         public static final Color Bwater = new Color(0x2ea8d8);
     30        public static final Color Yland = new Color(0xdcb820);
     31        public static final Color Bwater = new Color(0x3ea8c8);
     32        public static final Color Gdries = new Color(0x50b050);
    3233        public static final Color Mline = new Color(0xc480ff);
    3334        public static final Color Msymb = new Color(0xa30075);
     
    176177        public static void rules () {
    177178                ArrayList<Feature> objects;
     179                if ((objects = Renderer.map.features.get(Obj.LNDARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
     180                if ((objects = Renderer.map.features.get(Obj.LAKARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
     181                if ((objects = Renderer.map.features.get(Obj.RIVBNK)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
     182                if ((objects = Renderer.map.features.get(Obj.RIVERS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) waterways(feature);
     183                if ((objects = Renderer.map.features.get(Obj.CANALS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) waterways(feature);
     184                if ((objects = Renderer.map.features.get(Obj.DOCARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
     185                if ((objects = Renderer.map.features.get(Obj.DEPARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    178186                if ((objects = Renderer.map.features.get(Obj.COALNE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    179187                if ((objects = Renderer.map.features.get(Obj.SLCONS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) shoreline(feature);
     
    199207                if ((objects = Renderer.map.features.get(Obj.UWTROC)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) obstructions(feature);
    200208                if ((objects = Renderer.map.features.get(Obj.MARCUL)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    201                 if ((objects = Renderer.map.features.get(Obj.WTWAXS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) waterways(feature);
    202209                if ((objects = Renderer.map.features.get(Obj.RECTRC)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) transits(feature);
    203210                if ((objects = Renderer.map.features.get(Obj.NAVLNE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) transits(feature);
     
    255262                switch (feature.type) {
    256263                case COALNE:
    257                         Renderer.lineVector(feature, new LineStyle(Color.black, 8, Yland));
     264                        Renderer.lineVector(feature, new LineStyle(Color.black, 10));
     265                        break;
     266                case DEPARE:
     267                        Double depmax = 0.0;
     268                        if (((depmax = (Double) getAttVal(feature, feature.type, 0, Att.DRVAL2)) != null) && (depmax <= 0.0)) {
     269                                Renderer.lineVector(feature, new LineStyle(Gdries));
     270                        }
     271                        break;
     272                case DOCARE:
     273                case LAKARE:
     274                case RIVBNK:
     275                        Renderer.lineVector(feature, new LineStyle(Bwater));
    258276                        break;
    259277                case DRGARE:
     
    272290                        } else {
    273291                                if (Renderer.zoom >= 14)
    274                                         Renderer.lineVector(feature, new LineStyle(null, 0, new Color(0x40ffffff, true)));
    275                         }
     292                                        Renderer.lineVector(feature, new LineStyle(new Color(0x40ffffff, true)));
     293                        }
     294                        break;
     295                case LNDARE:
     296                        Renderer.lineVector(feature, new LineStyle(Yland));
    276297                        break;
    277298                case MARCUL:
     
    930951                case TSSRON:
    931952                        if (Renderer.zoom <= 15)
    932                                 Renderer.lineVector(feature, new LineStyle(null, 0, null, new Color(0x80c48080, true)));
     953                                Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true)));
    933954                        else
    934955                                Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, null, null));
     
    11081129
    11091130        private static void waterways(Feature feature) {
    1110                
     1131                Renderer.lineVector(feature, new LineStyle(Bwater, 20));
    11111132        }
    11121133
Note: See TracChangeset for help on using the changeset viewer.