Ignore:
Timestamp:
2021-01-13T10:42:07+01:00 (5 years ago)
Author:
malcolmh
Message:

null exception fix + misc updates

File:
1 edited

Legend:

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

    r35483 r35685  
    9797    }
    9898
     99    public static void symbol(Symbol symbol, double scale, Delta delta) {
     100        Point2D point = context.getPoint(Rules.feature.geom.centre);
     101        Symbols.drawSymbol(g2, symbol, (sScale * scale), point.getX(), point.getY(), null, delta);
     102    }
     103
    99104    public static void symbol(Symbol symbol, Scheme scheme, Delta delta) {
    100105        Point2D point = context.getPoint(Rules.feature.geom.centre);
    101106        Symbols.drawSymbol(g2, symbol, sScale, point.getX(), point.getY(), scheme, delta);
     107    }
     108
     109    public static void symbol(Symbol symbol, double scale, Scheme scheme) {
     110        Point2D point = context.getPoint(Rules.feature.geom.centre);
     111        Symbols.drawSymbol(g2, symbol, (sScale * scale), point.getX(), point.getY(), scheme, null);
    102112    }
    103113
     
    426436            g2.draw(p);
    427437            Symbol legend = new Symbol();
    428             legend.add(new Instr(Form.BBOX, new Rectangle2D.Double(0, 0, 500, 100)));
    429             Path2D.Double path = new Path2D.Double(); path.moveTo(0, 0); path.lineTo(500, 0); path.lineTo(500, 100); path.lineTo(0, 100); path.closePath();
     438            legend.add(new Instr(Form.BBOX, new Rectangle2D.Double(0, 0, 600, 250)));
     439            Path2D.Double path = new Path2D.Double(); path.moveTo(0, 0); path.lineTo(600, 0); path.lineTo(600, 250); path.lineTo(0, 250); path.closePath();
    430440            legend.add(new Instr(Form.FILL, Color.white));
    431441            legend.add(new Instr(Form.PGON, path));
    432             legend.add(new Instr(Form.TEXT, new Caption("Mercator Projection", new Font("Arial", Font.PLAIN, 50), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(250, 60)))));
     442            legend.add(new Instr(Form.TEXT, new Caption("Mercator Projection", new Font("Arial", Font.PLAIN, 50), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(300, 60)))));
     443            legend.add(new Instr(Form.TEXT, new Caption("© OpenStreetMap contributors", new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 40)))));
     444            legend.add(new Instr(Form.TEXT, new Caption("EMODnet Bathymetry Consortium (2018)", new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 40)))));
     445            legend.add(new Instr(Form.TEXT, new Caption("EMODnet Digital Bathymetry (DTM)", new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 40)))));
     446            legend.add(new Instr(Form.TEXT, new Caption("http://doi.org/10.12770/18ff0d48-b203-4a65-94a9-5fd8b0ec35f6", new Font("Arial", Font.PLAIN, 20), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 35)))));
    433447            point = context.getPoint(new Snode(map.bounds.minlat, map.bounds.minlon));
    434448            Symbols.drawSymbol(g2, legend, sScale, point.getX(), point.getY(), null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, 0)));
    435             legend = new Symbol();
    436             legend.add(new Instr(Form.BBOX, new Rectangle2D.Double(0, 0, 500, 100)));
    437             legend.add(new Instr(Form.TEXT, new Caption("© OpenStreetMap contributors", new Font("Arial", Font.PLAIN, 30), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(250, 100)))));
    438             point = context.getPoint(new Snode(map.bounds.minlat, map.bounds.minlon));
    439             Symbols.drawSymbol(g2, legend, sScale, point.getX(), point.getY(), null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(0, 0)));
    440         }
    441     }
    442 
     449        }
     450    }
     451   
    443452    public static void lineCircle(LineStyle style, double radius, UniHLU units) {
    444453        switch (units) {
Note: See TracChangeset for help on using the changeset viewer.