Ignore:
Timestamp:
2016-02-27T16:14:25+01:00 (9 years ago)
Author:
malcolmh
Message:

[seachart] update

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

Legend:

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

    r32082 r32084  
    568568                g2.setStroke(new BasicStroke((float)arcWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1));
    569569                g2.setPaint(col1);
    570                 g2.draw(new Arc2D.Double(centre.x - radial, centre.y - radial, 2 * radial, 2 * radial, -(s1 + 90), (s1 - s2), Arc2D.OPEN));
     570                g2.draw(new Arc2D.Double(centre.x - radial, centre.y - radial, 2 * radial, 2 * radial, -(s1 + 90), ((s1 < s2) ? (s1 - s2) : (s1 - s2 - 360)), Arc2D.OPEN));
    571571                if (col2 != null) {
    572572                        g2.setPaint(col2);
    573                         g2.draw(new Arc2D.Double(centre.x - radial + arcWidth, centre.y - radial + arcWidth, 2 * (radial - arcWidth), 2 * (radial - arcWidth), -(s1 + 90), (s1 - s2), Arc2D.OPEN));
     573                        g2.draw(new Arc2D.Double(centre.x - radial + arcWidth, centre.y - radial + arcWidth, 2 * (radial - arcWidth), 2 * (radial - arcWidth), -(s1 + 90), ((s1 < s2) ? (s1 - s2) : (s1 - s2 - 360)), Arc2D.OPEN));
    574574                }
    575575                if ((str != null) && (!str.isEmpty())) {
     
    584584            double offset = 0;
    585585            Point2D origin;
    586                         double arc = (s2 - s1);
    587586                        if (dir) {
    588587                                radial += 10 * sScale;
     
    604603                    }
    605604                        } else {
     605                                double arc = (s2 > s1) ? (s2 - s1) : (s2 - s1 + 360);
    606606                                double awidth = (Math.toRadians(arc) * radial);
    607607                                if (gwidth < awidth) {
  • applications/editors/josm/plugins/seachart/src/render/Rules.java

    r32082 r32084  
    465465                                }
    466466                        }
     467                        addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
    467468                        Signals.addSignals(feature);
    468469                }
     
    486487                                }
    487488                        }
     489                        addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
    488490                        Signals.addSignals(feature);
    489491                }
     
    629631                if (feature.objs.get(Obj.TOPMAR) != null)
    630632                        Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.FloatDelta);
     633                addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
    631634                Signals.addSignals(feature);
    632635        }
     
    635638                if (Renderer.zoom >= 14) {
    636639                        Renderer.symbol(feature, Harbours.TideGauge);
     640                        addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
    637641                        Signals.addSignals(feature);
    638642                }
     
    802806                Renderer.symbol(feature, catSym);
    803807                Renderer.symbol(feature, fncSym);
    804                 addName(feature, 15, new Font("Arial", Font.BOLD, 80), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
     808                addName(feature, 15, new Font("Arial", Font.BOLD, 40), new Delta(Handle.BL, AffineTransform.getTranslateInstance(60, -50)));
    805809                Signals.addSignals(feature);
    806810        }
     
    10101014                        } else if (feature.type == Obj.HULKES) {
    10111015                                Renderer.lineVector(feature, new LineStyle(Color.black, 4, null, new Color(0xffe000)));
    1012                                 addName(feature, 15, new Font("Arial", Font.BOLD, 80));
     1016                                addName(feature, 15, new Font("Arial", Font.BOLD, 40));
    10131017                        }
    10141018                }
     
    11691173                        case PILBOP:
    11701174                                Renderer.symbol(feature, Harbours.Pilot);
    1171                                 addName(feature, 15, new Font("Arial", Font.BOLD, 50), Symbols.Msymb , new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40)));
     1175                                addName(feature, 15, new Font("Arial", Font.BOLD, 40), Symbols.Msymb , new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, -40)));
    11721176                                CatPIL cat = (CatPIL) getAttEnum(feature, feature.type, 0, Att.CATPIL);
    11731177                                if (cat == CatPIL.PIL_HELI) {
  • applications/editors/josm/plugins/seachart/src/render/Signals.java

    r32082 r32084  
    323323                }
    324324                Renderer.symbol(feature, Beacons.LightFlare, new Scheme(LightColours.get(col)), new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.toRadians(120))));
    325                 if (Renderer.zoom >= 15) {
    326325                        String str = "";
    327326                        if (lights.get(1) != null) {
     
    375374                                                        str += LightLetters.get(cols.get(1));
    376375                                        }
     376                                        if (atts.containsKey(Att.SIGPER)) {
     377                                                str += "." + df.format(atts.get(Att.SIGPER).val) + "s";
     378                                        }
    377379                                        if (dir && atts.containsKey(Att.ORIENT)) {
    378380                                                double orient = (Double) atts.get(Att.ORIENT).val;
     
    390392                                        Renderer.lightSector(feature, LightColours.get(col1), LightColours.get(col2), radius, s1, s2, dir, (Renderer.zoom >= 15) ? str : "");
    391393                                }
     394                        if (Renderer.zoom >= 15) {
    392395                                class LitSect {
    393396                                        boolean dir;
     
    404407                                for (AttMap atts : lights.values()) {
    405408                                        LitSect sect = new LitSect();
    406                                         litatts.add(sect);
    407409                                        sect.dir = (atts.containsKey(Att.CATLIT)) && (atts.get(Att.CATLIT).val == CatLIT.LIT_DIR);
    408410                                        sect.chr = atts.containsKey(Att.LITCHR) ? ((ArrayList<LitCHR>) atts.get(Att.LITCHR).val).get(0) : LitCHR.CHR_UNKN;
     
    433435                                        sect.col = cols.size() > 0 ? cols.get(0) : ColCOL.COL_UNK;
    434436                                        sect.alt = cols.size() > 1 ? cols.get(1) : ColCOL.COL_UNK;
     437                                        if ((sect.chr != LitCHR.CHR_UNKN) && (sect.col != null))
     438                                                litatts.add(sect);
    435439                                }
    436440                                ArrayList<ArrayList<LitSect>> groupings = new ArrayList<>();
     
    507511                                                str += LightLetters.get(cr.col);
    508512                                        }
     513                                        if ((tmp.per > 0) || (tmp.hgt > 0) || (colrng.get(0).rng > 0))
     514                                                str += ".";
    509515                                        if (tmp.per > 0)
    510516                                                str += df.format(tmp.per) + "s";
     
    517523                                        str = "";
    518524                                }
    519                         } else {
     525                        }
     526                } else {
     527                        if (Renderer.zoom >= 15) {
    520528                                AttMap atts = lights.get(0);
    521529                                ArrayList<CatLIT> cats = new ArrayList<>();
Note: See TracChangeset for help on using the changeset viewer.